From ebbb7e9665b2f9bce46ddc2daa82b9ef73f6c712 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 9 Mar 2012 22:00:23 +0900 Subject: [PATCH] Recompute safety net in debug cases instead of memorizing Change-Id: I67f3a31db081afa4871ec441dd461c56e098c668 --- .../inputmethod/latin/suggestions/SuggestionsView.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java b/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java index 075fb68ee..462733f96 100644 --- a/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java +++ b/java/src/com/android/inputmethod/latin/suggestions/SuggestionsView.java @@ -60,6 +60,7 @@ import com.android.inputmethod.keyboard.PointerTracker; import com.android.inputmethod.latin.LatinImeLogger; import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.StaticInnerHandlerWrapper; +import com.android.inputmethod.latin.Suggest; import com.android.inputmethod.latin.SuggestedWords; import com.android.inputmethod.latin.SuggestedWords.SuggestedWordInfo; @@ -329,8 +330,11 @@ public class SuggestionsView extends RelativeLayout implements OnClickListener, color = mColorTypedWord; } if (LatinImeLogger.sDBG) { + // If we auto-correct, then the autocorrection is in slot 0 and the typed word + // is in slot 1. if (index == mCenterSuggestionIndex && suggestedWords.mHasAutoCorrectionCandidate - && suggestedWords.mShouldBlockAutoCorrectionBySafetyNet) { + && Suggest.shouldBlockAutoCorrectionBySafetyNet( + suggestedWords.getWord(1).toString(), suggestedWords.getWord(0))) { return 0xFFFF0000; } }