From 13db05f93018f14b3695140bbed63a21b2d41bfe Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 16 Dec 2011 13:57:10 +0900 Subject: [PATCH] Make isSettingsSuggestionStripOn final. Change-Id: Iabb99a7f8f3f1777f9a87ae2bddff9795a50fa92 --- .../android/inputmethod/latin/LatinIME.java | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 71db4550c..e5fb4adff 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -800,7 +800,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar final boolean insertSpaceOnPickSuggestionManually; boolean inputTypeNoAutoCorrect = false; - boolean isSettingsSuggestionStripOn = false; + final boolean isSettingsSuggestionStripOn; boolean applicationSpecifiedCompletionOn = false; if (editorInfo == null || editorInfo.inputType != InputType.TYPE_CLASS_TEXT) { @@ -810,6 +810,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } mApplicationSpecifiedCompletions = null; insertSpaceOnPickSuggestionManually = false; + isSettingsSuggestionStripOn = false; } else { final int inputType = editorInfo.inputType; final int inputClass = inputType & InputType.TYPE_MASK_CLASS; @@ -830,12 +831,19 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar mApplicationSpecifiedCompletions = null; - isSettingsSuggestionStripOn = true; // Make sure that passwords are not displayed in {@link SuggestionsView}. if (InputTypeCompatUtils.isPasswordInputType(inputType) - || InputTypeCompatUtils.isVisiblePasswordInputType(inputType)) { + || InputTypeCompatUtils.isVisiblePasswordInputType(inputType) + || InputTypeCompatUtils.isEmailVariation(variation) + || InputType.TYPE_TEXT_VARIATION_URI == variation + || InputType.TYPE_TEXT_VARIATION_FILTER == variation + || flagNoSuggestions + || flagAutoComplete) { isSettingsSuggestionStripOn = false; + } else { + isSettingsSuggestionStripOn = true; } + if (InputTypeCompatUtils.isEmailVariation(variation) || variation == InputType.TYPE_TEXT_VARIATION_PERSON_NAME) { // The point in turning this off is that we don't want to insert a space after @@ -844,13 +852,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar } else { insertSpaceOnPickSuggestionManually = true; } - if (InputTypeCompatUtils.isEmailVariation(variation)) { - isSettingsSuggestionStripOn = false; - } else if (variation == InputType.TYPE_TEXT_VARIATION_URI) { - isSettingsSuggestionStripOn = false; - } else if (variation == InputType.TYPE_TEXT_VARIATION_FILTER) { - isSettingsSuggestionStripOn = false; - } else if (variation == InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT) { + if (variation == InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT) { // If it's a browser edit field and auto correct is not ON explicitly, then // disable auto correction, but keep suggestions on. if (!flagAutoCorrect) { @@ -860,7 +862,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar // If NO_SUGGESTIONS is set, don't do prediction. if (flagNoSuggestions) { - isSettingsSuggestionStripOn = false; inputTypeNoAutoCorrect = true; } // If it's not multiline and the autoCorrect flag is not set, then don't correct @@ -868,7 +869,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar inputTypeNoAutoCorrect = true; } if (flagAutoComplete) { - isSettingsSuggestionStripOn = false; applicationSpecifiedCompletionOn = isFullscreenMode(); } }