diff options
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 66f0ec03f..edc4efd1a 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1827,8 +1827,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar builder.addTypedWordAndPreviousSuggestions(typedWord, previousSuggestions); } } - if (Utils.shouldBlockAutoCorrectionBySafetyNet(builder, mSuggest)) { - builder.setShouldBlockAutoCorrectionBySafetyNet(); + final SuggestedWords suggestedWords = builder.build(); + if (Utils.shouldBlockAutoCorrectionBySafetyNet(suggestedWords, mSuggest)) { + suggestedWords.setShouldBlockAutoCorrectionBySatefyNet(); } showSuggestions(builder.build(), typedWord); } @@ -1836,7 +1837,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar public void showSuggestions(final SuggestedWords suggestedWords, final CharSequence typedWord) { final CharSequence autoCorrection; if (suggestedWords.size() > 0) { - if (!suggestedWords.mShouldBlockAutoCorrectionBySafetyNet + if (!suggestedWords.shouldBlockAutoCorrectionBySafetyNet() && suggestedWords.hasAutoCorrectionWord()) { autoCorrection = suggestedWords.getWord(1); } else { @@ -1909,7 +1910,8 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar if (suggestion.length() == 1 && isShowingPunctuationList()) { // Word separators are suggested before the user inputs something. // So, LatinImeLogger logs "" as a user's input. - LatinImeLogger.logOnManualSuggestion("", suggestion.toString(), index, suggestions); + LatinImeLogger.logOnManualSuggestion( + "", suggestion.toString(), index, suggestions.mWords); // Rely on onCodeInput to do the complicated swapping/stripping logic consistently. final int primaryCode = suggestion.charAt(0); onCodeInput(primaryCode, new int[] { primaryCode }, @@ -1920,7 +1922,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // We need to log before we commit, because the word composer will store away the user // typed word. LatinImeLogger.logOnManualSuggestion(mWordComposer.getTypedWord().toString(), - suggestion.toString(), index, suggestions); + suggestion.toString(), index, suggestions.mWords); mExpectingUpdateSelection = true; commitChosenWord(suggestion, LastComposedWord.COMMIT_TYPE_MANUAL_PICK, LastComposedWord.NOT_A_SEPARATOR); |