From 1b2e2d893d45ba394a2aff419d8212d9f59eba87 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Thu, 28 Jun 2012 19:27:48 +0900 Subject: [PATCH] Add a more synthetic variable (A33) The goal here is to disambiguate TypedWordValid and HasAutoCorrectionCandidate. Ultimately, HasAutoCorrectionCandidate will disappear. Bug: 6705473 Change-Id: I1acbd0a5efc7f4bf7b0bdb12839fe3d84e9d1dda --- java/src/com/android/inputmethod/latin/SuggestedWords.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/latin/SuggestedWords.java b/java/src/com/android/inputmethod/latin/SuggestedWords.java index 0d64ad321..b84820cb8 100644 --- a/java/src/com/android/inputmethod/latin/SuggestedWords.java +++ b/java/src/com/android/inputmethod/latin/SuggestedWords.java @@ -29,6 +29,7 @@ public class SuggestedWords { public final boolean mTypedWordValid; public final boolean mHasAutoCorrectionCandidate; + public final boolean mWillAutoCorrect; public final boolean mIsPunctuationSuggestions; public final boolean mIsObsoleteSuggestions; public final boolean mIsPrediction; @@ -43,6 +44,7 @@ public class SuggestedWords { mSuggestedWordInfoList = suggestedWordInfoList; mTypedWordValid = typedWordValid; mHasAutoCorrectionCandidate = hasAutoCorrectionCandidate; + mWillAutoCorrect = !mTypedWordValid && mHasAutoCorrectionCandidate; mIsPunctuationSuggestions = isPunctuationSuggestions; mIsObsoleteSuggestions = isObsoleteSuggestions; mIsPrediction = isPrediction; @@ -69,7 +71,7 @@ public class SuggestedWords { } public boolean willAutoCorrect() { - return !mTypedWordValid && mHasAutoCorrectionCandidate; + return mWillAutoCorrect; } @Override