Merge "Small reorganization"

This commit is contained in:
Jean Chalard 2012-03-09 00:40:10 -08:00 committed by Android (Google) Code Review
commit d17ff7225a

View file

@ -1857,6 +1857,11 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
|| mSuggestionsView.isShowingAddToDictionaryHint()) { || mSuggestionsView.isShowingAddToDictionaryHint()) {
builder.setTypedWordValid(!allowsToBeAutoCorrected).setHasMinimalSuggestion( builder.setTypedWordValid(!allowsToBeAutoCorrected).setHasMinimalSuggestion(
autoCorrectionAvailable); autoCorrectionAvailable);
if (Suggest.shouldBlockAutoCorrectionBySafetyNet(builder, mSuggest,
mSettingsValues.mAutoCorrectionThreshold)) {
builder.setShouldBlockAutoCorrectionBySafetyNet();
}
showSuggestions(builder.build(), typedWord);
} else { } else {
SuggestedWords previousSuggestions = mSuggestionsView.getSuggestions(); SuggestedWords previousSuggestions = mSuggestionsView.getSuggestions();
if (previousSuggestions == mSettingsValues.mSuggestPuncList) { if (previousSuggestions == mSettingsValues.mSuggestPuncList) {
@ -1866,13 +1871,9 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
previousSuggestions = SuggestedWords.EMPTY; previousSuggestions = SuggestedWords.EMPTY;
} }
builder.addTypedWordAndPreviousSuggestions(typedWord, previousSuggestions); builder.addTypedWordAndPreviousSuggestions(typedWord, previousSuggestions);
}
if (Suggest.shouldBlockAutoCorrectionBySafetyNet(builder, mSuggest,
mSettingsValues.mAutoCorrectionThreshold)) {
builder.setShouldBlockAutoCorrectionBySafetyNet();
}
showSuggestions(builder.build(), typedWord); showSuggestions(builder.build(), typedWord);
} }
}
public void showSuggestions(final SuggestedWords suggestedWords, final CharSequence typedWord) { public void showSuggestions(final SuggestedWords suggestedWords, final CharSequence typedWord) {
final CharSequence autoCorrection; final CharSequence autoCorrection;