Make isSettingsSuggestionStripOn final.

Change-Id: Iabb99a7f8f3f1777f9a87ae2bddff9795a50fa92
This commit is contained in:
Jean Chalard 2011-12-16 13:57:10 +09:00
parent d3bf7ac12f
commit 13db05f930

View file

@ -800,7 +800,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
final boolean insertSpaceOnPickSuggestionManually; final boolean insertSpaceOnPickSuggestionManually;
boolean inputTypeNoAutoCorrect = false; boolean inputTypeNoAutoCorrect = false;
boolean isSettingsSuggestionStripOn = false; final boolean isSettingsSuggestionStripOn;
boolean applicationSpecifiedCompletionOn = false; boolean applicationSpecifiedCompletionOn = false;
if (editorInfo == null || editorInfo.inputType != InputType.TYPE_CLASS_TEXT) { if (editorInfo == null || editorInfo.inputType != InputType.TYPE_CLASS_TEXT) {
@ -810,6 +810,7 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
} }
mApplicationSpecifiedCompletions = null; mApplicationSpecifiedCompletions = null;
insertSpaceOnPickSuggestionManually = false; insertSpaceOnPickSuggestionManually = false;
isSettingsSuggestionStripOn = false;
} else { } else {
final int inputType = editorInfo.inputType; final int inputType = editorInfo.inputType;
final int inputClass = inputType & InputType.TYPE_MASK_CLASS; final int inputClass = inputType & InputType.TYPE_MASK_CLASS;
@ -830,12 +831,19 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
mApplicationSpecifiedCompletions = null; mApplicationSpecifiedCompletions = null;
isSettingsSuggestionStripOn = true;
// Make sure that passwords are not displayed in {@link SuggestionsView}. // Make sure that passwords are not displayed in {@link SuggestionsView}.
if (InputTypeCompatUtils.isPasswordInputType(inputType) 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; isSettingsSuggestionStripOn = false;
} else {
isSettingsSuggestionStripOn = true;
} }
if (InputTypeCompatUtils.isEmailVariation(variation) if (InputTypeCompatUtils.isEmailVariation(variation)
|| variation == InputType.TYPE_TEXT_VARIATION_PERSON_NAME) { || variation == InputType.TYPE_TEXT_VARIATION_PERSON_NAME) {
// The point in turning this off is that we don't want to insert a space after // 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 { } else {
insertSpaceOnPickSuggestionManually = true; insertSpaceOnPickSuggestionManually = true;
} }
if (InputTypeCompatUtils.isEmailVariation(variation)) { if (variation == InputType.TYPE_TEXT_VARIATION_WEB_EDIT_TEXT) {
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 it's a browser edit field and auto correct is not ON explicitly, then // If it's a browser edit field and auto correct is not ON explicitly, then
// disable auto correction, but keep suggestions on. // disable auto correction, but keep suggestions on.
if (!flagAutoCorrect) { if (!flagAutoCorrect) {
@ -860,7 +862,6 @@ public class LatinIME extends InputMethodServiceCompatWrapper implements Keyboar
// If NO_SUGGESTIONS is set, don't do prediction. // If NO_SUGGESTIONS is set, don't do prediction.
if (flagNoSuggestions) { if (flagNoSuggestions) {
isSettingsSuggestionStripOn = false;
inputTypeNoAutoCorrect = true; inputTypeNoAutoCorrect = true;
} }
// If it's not multiline and the autoCorrect flag is not set, then don't correct // 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; inputTypeNoAutoCorrect = true;
} }
if (flagAutoComplete) { if (flagAutoComplete) {
isSettingsSuggestionStripOn = false;
applicationSpecifiedCompletionOn = isFullscreenMode(); applicationSpecifiedCompletionOn = isFullscreenMode();
} }
} }