Merge "Remove useless test"

This commit is contained in:
Jean Chalard 2012-03-08 23:15:49 -08:00 committed by Android (Google) Code Review
commit af8092e093

View file

@ -1853,21 +1853,19 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// in most cases, suggestion count is 1 when typed word's length is 1, but we do always // in most cases, suggestion count is 1 when typed word's length is 1, but we do always
// need to clear the previous state when the user starts typing a word (i.e. typed word's // need to clear the previous state when the user starts typing a word (i.e. typed word's
// length == 1). // length == 1).
if (typedWord != null) { if (builder.size() > 1 || typedWord.length() == 1 || (!allowsToBeAutoCorrected)
if (builder.size() > 1 || typedWord.length() == 1 || (!allowsToBeAutoCorrected) || mSuggestionsView.isShowingAddToDictionaryHint()) {
|| mSuggestionsView.isShowingAddToDictionaryHint()) { builder.setTypedWordValid(!allowsToBeAutoCorrected).setHasMinimalSuggestion(
builder.setTypedWordValid(!allowsToBeAutoCorrected).setHasMinimalSuggestion( autoCorrectionAvailable);
autoCorrectionAvailable); } else {
} else { SuggestedWords previousSuggestions = mSuggestionsView.getSuggestions();
SuggestedWords previousSuggestions = mSuggestionsView.getSuggestions(); if (previousSuggestions == mSettingsValues.mSuggestPuncList) {
if (previousSuggestions == mSettingsValues.mSuggestPuncList) { if (builder.size() == 0) {
if (builder.size() == 0) { return;
return;
}
previousSuggestions = SuggestedWords.EMPTY;
} }
builder.addTypedWordAndPreviousSuggestions(typedWord, previousSuggestions); previousSuggestions = SuggestedWords.EMPTY;
} }
builder.addTypedWordAndPreviousSuggestions(typedWord, previousSuggestions);
} }
if (Suggest.shouldBlockAutoCorrectionBySafetyNet(builder, mSuggest, if (Suggest.shouldBlockAutoCorrectionBySafetyNet(builder, mSuggest,
mSettingsValues.mAutoCorrectionThreshold)) { mSettingsValues.mAutoCorrectionThreshold)) {