aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-03-08 23:15:49 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-03-08 23:15:49 -0800
commitaf8092e09335e9986741cac50ed2bfa3a0bc8a56 (patch)
tree83df1963a56bafa213007d33e2cac9a0df61f3ef /java/src
parent4e67085a155aba253db2798d2937ec615e64a032 (diff)
parent838629aea00ce90231df97f1dae3d8273ba80cbd (diff)
downloadlatinime-af8092e09335e9986741cac50ed2bfa3a0bc8a56.tar.gz
latinime-af8092e09335e9986741cac50ed2bfa3a0bc8a56.tar.xz
latinime-af8092e09335e9986741cac50ed2bfa3a0bc8a56.zip
Merge "Remove useless test"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java24
1 files changed, 11 insertions, 13 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 13ba44be0..a3f422c9c 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -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
// need to clear the previous state when the user starts typing a word (i.e. typed word's
// length == 1).
- if (typedWord != null) {
- if (builder.size() > 1 || typedWord.length() == 1 || (!allowsToBeAutoCorrected)
- || mSuggestionsView.isShowingAddToDictionaryHint()) {
- builder.setTypedWordValid(!allowsToBeAutoCorrected).setHasMinimalSuggestion(
- autoCorrectionAvailable);
- } else {
- SuggestedWords previousSuggestions = mSuggestionsView.getSuggestions();
- if (previousSuggestions == mSettingsValues.mSuggestPuncList) {
- if (builder.size() == 0) {
- return;
- }
- previousSuggestions = SuggestedWords.EMPTY;
+ if (builder.size() > 1 || typedWord.length() == 1 || (!allowsToBeAutoCorrected)
+ || mSuggestionsView.isShowingAddToDictionaryHint()) {
+ builder.setTypedWordValid(!allowsToBeAutoCorrected).setHasMinimalSuggestion(
+ autoCorrectionAvailable);
+ } else {
+ SuggestedWords previousSuggestions = mSuggestionsView.getSuggestions();
+ if (previousSuggestions == mSettingsValues.mSuggestPuncList) {
+ if (builder.size() == 0) {
+ return;
}
- builder.addTypedWordAndPreviousSuggestions(typedWord, previousSuggestions);
+ previousSuggestions = SuggestedWords.EMPTY;
}
+ builder.addTypedWordAndPreviousSuggestions(typedWord, previousSuggestions);
}
if (Suggest.shouldBlockAutoCorrectionBySafetyNet(builder, mSuggest,
mSettingsValues.mAutoCorrectionThreshold)) {