diff options
author | 2012-03-09 00:40:19 -0800 | |
---|---|---|
committer | 2012-03-09 00:40:19 -0800 | |
commit | 0cb7b007047b9e7fadcb6024ecc547cf475ceca9 (patch) | |
tree | 02a38801d4ce7ce73b0136d1db7c0b80809c8fed /java/src/com/android/inputmethod/latin/LatinIME.java | |
parent | d17ff7225a788edd12d52f38108f4ee22389df4b (diff) | |
parent | 91e55ac0008c1c094fd2093a06867efafb22c6ce (diff) | |
download | latinime-0cb7b007047b9e7fadcb6024ecc547cf475ceca9.tar.gz latinime-0cb7b007047b9e7fadcb6024ecc547cf475ceca9.tar.xz latinime-0cb7b007047b9e7fadcb6024ecc547cf475ceca9.zip |
Merge "Small optimization"
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinIME.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 650909414..4400c7e1d 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -1823,7 +1823,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar final SuggestedWords.Builder builder = mSuggest.getSuggestedWordBuilder(mWordComposer, prevWord, mKeyboardSwitcher.getKeyboard().getProximityInfo(), mCorrectionMode); - boolean autoCorrectionAvailable = mSuggest.hasAutoCorrection(); // Here, we want to promote a whitelisted word if exists. // TODO: Change this scheme - a boolean is not enough. A whitelisted word may be "valid" // but still autocorrected from - in the case the whitelist only capitalizes the word. @@ -1840,12 +1839,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar quotesCount > 0 ? typedWord.subSequence(0, typedWord.length() - quotesCount) : typedWord, preferCapitalization()); - if (mCorrectionMode == Suggest.CORRECTION_FULL - || mCorrectionMode == Suggest.CORRECTION_FULL_BIGRAM) { - autoCorrectionAvailable |= (!allowsToBeAutoCorrected); - } - // Don't auto-correct words with multiple capital letter - autoCorrectionAvailable &= !mWordComposer.isMostlyCaps(); // Basically, we update the suggestion strip only when suggestion count > 1. However, // there is an exception: We update the suggestion strip whenever typed word's length @@ -1855,6 +1848,13 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // length == 1). if (builder.size() > 1 || typedWord.length() == 1 || (!allowsToBeAutoCorrected) || mSuggestionsView.isShowingAddToDictionaryHint()) { + boolean autoCorrectionAvailable = mSuggest.hasAutoCorrection(); + if (mCorrectionMode == Suggest.CORRECTION_FULL + || mCorrectionMode == Suggest.CORRECTION_FULL_BIGRAM) { + autoCorrectionAvailable |= (!allowsToBeAutoCorrected); + } + // Don't auto-correct words with multiple capital letter + autoCorrectionAvailable &= !mWordComposer.isMostlyCaps(); builder.setTypedWordValid(!allowsToBeAutoCorrected).setHasMinimalSuggestion( autoCorrectionAvailable); if (Suggest.shouldBlockAutoCorrectionBySafetyNet(builder, mSuggest, |