[IL100] Pull up a check

Bug: 8636060
Change-Id: I344ed59f5f55b412880fc6dc70205eecb1e79961
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 18c22b9..28d4360 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1428,8 +1428,7 @@
 
     // TODO[IL]: Define a clean interface for this
     public void showSuggestionStrip(final SuggestedWords suggestedWords) {
-        showSuggestionStripWithTypedWord(suggestedWords, suggestedWords.isEmpty() ? null
-                : suggestedWords.getWord(SuggestedWords.INDEX_OF_TYPED_WORD));
+        showSuggestionStripWithTypedWord(suggestedWords, suggestedWords.mTypedWord);
     }
 
     // Called from {@link SuggestionStripView} through the {@link SuggestionStripView#Listener}
diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java
index bb34b7b..982a97a 100644
--- a/java/src/com/android/inputmethod/latin/SuggestedWords.java
+++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java
@@ -39,6 +39,7 @@
     public static final SuggestedWords EMPTY = new SuggestedWords(
             EMPTY_WORD_INFO_LIST, false, false, false, false, false);
 
+    public final String mTypedWord;
     public final boolean mTypedWordValid;
     // Note: this INCLUDES cases where the word will auto-correct to itself. A good definition
     // of what this flag means would be "the top suggestion is strong enough to auto-correct",
@@ -74,6 +75,7 @@
         mIsObsoleteSuggestions = isObsoleteSuggestions;
         mIsPrediction = isPrediction;
         mSequenceNumber = sequenceNumber;
+        mTypedWord = suggestedWordInfoList.isEmpty() ? null : getWord(INDEX_OF_TYPED_WORD);
     }
 
     public boolean isEmpty() {