From 4c6029e530d121f044c0c7804a4e5641f44b4e09 Mon Sep 17 00:00:00 2001
From: Jean Chalard <jchalard@google.com>
Date: Fri, 24 Jan 2014 21:01:05 +0900
Subject: [PATCH] [IL92] Straighten out showSuggestionStripWithTypedWord

Bug: 8636060
Change-Id: I066ff29c76349f0ab61441ea5f7bc9085d24bdbc
---
 java/src/com/android/inputmethod/latin/LatinIME.java | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index da16d2fe38..58f4eb9546 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1426,7 +1426,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
 
     private void showSuggestionStripWithTypedWord(final SuggestedWords sourceSuggestedWords,
             final String typedWord) {
-        // TODO: refactor this
         final SuggestedWords suggestedWords =
                 sourceSuggestedWords.isEmpty() ? SuggestedWords.EMPTY : sourceSuggestedWords;
         final String autoCorrection;
@@ -1437,13 +1436,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
             // because it may differ from mWordComposer.mTypedWord.
             autoCorrection = typedWord;
         }
-        if (suggestedWords.isEmpty()) {
-            AccessibilityUtils.getInstance().setAutoCorrection(suggestedWords, typedWord);
-            setSuggestedWords(suggestedWords);
-            setAutoCorrectionIndicator(false);
-            return;
+        if (SuggestedWords.EMPTY != suggestedWords) {
+            mInputLogic.mWordComposer.setAutoCorrection(autoCorrection);
         }
-        mInputLogic.mWordComposer.setAutoCorrection(autoCorrection);
         setSuggestedWords(suggestedWords);
         setAutoCorrectionIndicator(suggestedWords.mWillAutoCorrect);
         setSuggestionStripShown(isSuggestionsStripVisible());
-- 
GitLab