From d38b0468b083f2af3329fb81c04b1cf61a18064d Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 24 Jan 2014 20:56:16 +0900 Subject: [PATCH] [IL90] Small refactoring Bug: 8636060 Change-Id: I37844ab1c5c61ea940897e7d72bb79c7b329f743 --- java/src/com/android/inputmethod/latin/LatinIME.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 967e72bda..ba7503dae 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1424,13 +1424,15 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } } - private void showSuggestionStripWithTypedWord(final SuggestedWords suggestedWords, + private void showSuggestionStripWithTypedWord(final SuggestedWords sourceSuggestedWords, final String typedWord) { // TODO: refactor this + final SuggestedWords suggestedWords = + sourceSuggestedWords.isEmpty() ? SuggestedWords.EMPTY : sourceSuggestedWords; if (suggestedWords.isEmpty()) { // No auto-correction is available, clear the cached values. - AccessibilityUtils.getInstance().setAutoCorrection(SuggestedWords.EMPTY, typedWord); - setSuggestedWords(SuggestedWords.EMPTY); + AccessibilityUtils.getInstance().setAutoCorrection(suggestedWords, typedWord); + setSuggestedWords(suggestedWords); setAutoCorrectionIndicator(false); return; }