Merge "Rename some boolean variables for readability"
This commit is contained in:
commit
0dbf15f152
4 changed files with 16 additions and 16 deletions
|
@ -35,7 +35,7 @@ public final class InputAttributes {
|
||||||
final public String mTargetApplicationPackageName;
|
final public String mTargetApplicationPackageName;
|
||||||
final public boolean mInputTypeNoAutoCorrect;
|
final public boolean mInputTypeNoAutoCorrect;
|
||||||
final public boolean mIsPasswordField;
|
final public boolean mIsPasswordField;
|
||||||
final public boolean mIsSettingsSuggestionStripOn;
|
final public boolean mShouldShowSuggestions;
|
||||||
final public boolean mApplicationSpecifiedCompletionOn;
|
final public boolean mApplicationSpecifiedCompletionOn;
|
||||||
final public boolean mShouldInsertSpacesAutomatically;
|
final public boolean mShouldInsertSpacesAutomatically;
|
||||||
final private int mInputType;
|
final private int mInputType;
|
||||||
|
@ -62,7 +62,7 @@ public final class InputAttributes {
|
||||||
Log.w(TAG, String.format("Unexpected input class: inputType=0x%08x"
|
Log.w(TAG, String.format("Unexpected input class: inputType=0x%08x"
|
||||||
+ " imeOptions=0x%08x", inputType, editorInfo.imeOptions));
|
+ " imeOptions=0x%08x", inputType, editorInfo.imeOptions));
|
||||||
}
|
}
|
||||||
mIsSettingsSuggestionStripOn = false;
|
mShouldShowSuggestions = false;
|
||||||
mInputTypeNoAutoCorrect = false;
|
mInputTypeNoAutoCorrect = false;
|
||||||
mApplicationSpecifiedCompletionOn = false;
|
mApplicationSpecifiedCompletionOn = false;
|
||||||
mShouldInsertSpacesAutomatically = false;
|
mShouldInsertSpacesAutomatically = false;
|
||||||
|
@ -81,13 +81,13 @@ public final class InputAttributes {
|
||||||
|
|
||||||
// TODO: Have a helper method in InputTypeUtils
|
// TODO: Have a helper method in InputTypeUtils
|
||||||
// Make sure that passwords are not displayed in {@link SuggestionStripView}.
|
// Make sure that passwords are not displayed in {@link SuggestionStripView}.
|
||||||
final boolean noSuggestionStrip = mIsPasswordField
|
final boolean shouldSuppressSuggestions = mIsPasswordField
|
||||||
|| InputTypeUtils.isEmailVariation(variation)
|
|| InputTypeUtils.isEmailVariation(variation)
|
||||||
|| InputType.TYPE_TEXT_VARIATION_URI == variation
|
|| InputType.TYPE_TEXT_VARIATION_URI == variation
|
||||||
|| InputType.TYPE_TEXT_VARIATION_FILTER == variation
|
|| InputType.TYPE_TEXT_VARIATION_FILTER == variation
|
||||||
|| flagNoSuggestions
|
|| flagNoSuggestions
|
||||||
|| flagAutoComplete;
|
|| flagAutoComplete;
|
||||||
mIsSettingsSuggestionStripOn = !noSuggestionStrip;
|
mShouldShowSuggestions = !shouldSuppressSuggestions;
|
||||||
|
|
||||||
mShouldInsertSpacesAutomatically = InputTypeUtils.isAutoSpaceFriendlyType(inputType);
|
mShouldInsertSpacesAutomatically = InputTypeUtils.isAutoSpaceFriendlyType(inputType);
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ public final class InputAttributes {
|
||||||
mInputType,
|
mInputType,
|
||||||
(mInputTypeNoAutoCorrect ? " noAutoCorrect" : ""),
|
(mInputTypeNoAutoCorrect ? " noAutoCorrect" : ""),
|
||||||
(mIsPasswordField ? " password" : ""),
|
(mIsPasswordField ? " password" : ""),
|
||||||
(mIsSettingsSuggestionStripOn ? " suggestionStrip" : ""),
|
(mShouldShowSuggestions ? " shouldShowSuggestions" : ""),
|
||||||
(mApplicationSpecifiedCompletionOn ? " appSpecified" : ""),
|
(mApplicationSpecifiedCompletionOn ? " appSpecified" : ""),
|
||||||
(mShouldInsertSpacesAutomatically ? " insertSpaces" : ""),
|
(mShouldInsertSpacesAutomatically ? " insertSpaces" : ""),
|
||||||
mTargetApplicationPackageName);
|
mTargetApplicationPackageName);
|
||||||
|
|
|
@ -602,7 +602,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
mDictionaryFacilitator.resetDictionaries(this /* context */, locale,
|
mDictionaryFacilitator.resetDictionaries(this /* context */, locale,
|
||||||
settingsValues.mUseContactsDict, settingsValues.mUsePersonalizedDicts,
|
settingsValues.mUseContactsDict, settingsValues.mUsePersonalizedDicts,
|
||||||
false /* forceReloadMainDictionary */, this);
|
false /* forceReloadMainDictionary */, this);
|
||||||
if (settingsValues.mCorrectionEnabled) {
|
if (settingsValues.mAutoCorrectionEnabled) {
|
||||||
mInputLogic.mSuggest.setAutoCorrectionThreshold(
|
mInputLogic.mSuggest.setAutoCorrectionThreshold(
|
||||||
settingsValues.mAutoCorrectionThreshold);
|
settingsValues.mAutoCorrectionThreshold);
|
||||||
}
|
}
|
||||||
|
@ -814,7 +814,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
mainKeyboardView.closing();
|
mainKeyboardView.closing();
|
||||||
currentSettingsValues = mSettings.getCurrent();
|
currentSettingsValues = mSettings.getCurrent();
|
||||||
|
|
||||||
if (currentSettingsValues.mCorrectionEnabled) {
|
if (currentSettingsValues.mAutoCorrectionEnabled) {
|
||||||
suggest.setAutoCorrectionThreshold(
|
suggest.setAutoCorrectionThreshold(
|
||||||
currentSettingsValues.mAutoCorrectionThreshold);
|
currentSettingsValues.mAutoCorrectionThreshold);
|
||||||
}
|
}
|
||||||
|
@ -1410,7 +1410,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
|
||||||
mInputLogic.mSuggest.getSuggestedWords(mInputLogic.mWordComposer,
|
mInputLogic.mSuggest.getSuggestedWords(mInputLogic.mWordComposer,
|
||||||
mInputLogic.mWordComposer.getPrevWordsInfoForSuggestion(),
|
mInputLogic.mWordComposer.getPrevWordsInfoForSuggestion(),
|
||||||
keyboard.getProximityInfo(), currentSettings.mBlockPotentiallyOffensive,
|
keyboard.getProximityInfo(), currentSettings.mBlockPotentiallyOffensive,
|
||||||
currentSettings.mCorrectionEnabled, additionalFeaturesOptions, sessionId,
|
currentSettings.mAutoCorrectionEnabled, additionalFeaturesOptions, sessionId,
|
||||||
sequenceNumber, callback);
|
sequenceNumber, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -770,7 +770,7 @@ public final class InputLogic {
|
||||||
}
|
}
|
||||||
// isComposingWord() may have changed since we stored wasComposing
|
// isComposingWord() may have changed since we stored wasComposing
|
||||||
if (mWordComposer.isComposingWord()) {
|
if (mWordComposer.isComposingWord()) {
|
||||||
if (settingsValues.mCorrectionEnabled) {
|
if (settingsValues.mAutoCorrectionEnabled) {
|
||||||
final String separator = shouldAvoidSendingCode ? LastComposedWord.NOT_A_SEPARATOR
|
final String separator = shouldAvoidSendingCode ? LastComposedWord.NOT_A_SEPARATOR
|
||||||
: StringUtils.newSingleCodePointString(codePoint);
|
: StringUtils.newSingleCodePointString(codePoint);
|
||||||
commitCurrentAutoCorrection(settingsValues, separator, handler);
|
commitCurrentAutoCorrection(settingsValues, separator, handler);
|
||||||
|
@ -1173,7 +1173,7 @@ public final class InputLogic {
|
||||||
// If correction is not enabled, we don't add words to the user history dictionary.
|
// If correction is not enabled, we don't add words to the user history dictionary.
|
||||||
// That's to avoid unintended additions in some sensitive fields, or fields that
|
// That's to avoid unintended additions in some sensitive fields, or fields that
|
||||||
// expect to receive non-words.
|
// expect to receive non-words.
|
||||||
if (!settingsValues.mCorrectionEnabled) return;
|
if (!settingsValues.mAutoCorrectionEnabled) return;
|
||||||
|
|
||||||
if (TextUtils.isEmpty(suggestion)) return;
|
if (TextUtils.isEmpty(suggestion)) return;
|
||||||
final boolean wasAutoCapitalized =
|
final boolean wasAutoCapitalized =
|
||||||
|
|
|
@ -84,7 +84,7 @@ public final class SettingsValues {
|
||||||
public final int mKeyPreviewPopupDismissDelay;
|
public final int mKeyPreviewPopupDismissDelay;
|
||||||
private final boolean mAutoCorrectEnabled;
|
private final boolean mAutoCorrectEnabled;
|
||||||
public final float mAutoCorrectionThreshold;
|
public final float mAutoCorrectionThreshold;
|
||||||
public final boolean mCorrectionEnabled;
|
public final boolean mAutoCorrectionEnabled;
|
||||||
public final int mSuggestionVisibility;
|
public final int mSuggestionVisibility;
|
||||||
public final int mDisplayOrientation;
|
public final int mDisplayOrientation;
|
||||||
private final AsyncResultHolder<AppWorkaroundsUtils> mAppWorkarounds;
|
private final AsyncResultHolder<AppWorkaroundsUtils> mAppWorkarounds;
|
||||||
|
@ -150,7 +150,7 @@ public final class SettingsValues {
|
||||||
mGestureFloatingPreviewTextEnabled = prefs.getBoolean(
|
mGestureFloatingPreviewTextEnabled = prefs.getBoolean(
|
||||||
Settings.PREF_GESTURE_FLOATING_PREVIEW_TEXT, true);
|
Settings.PREF_GESTURE_FLOATING_PREVIEW_TEXT, true);
|
||||||
mPhraseGestureEnabled = Settings.readPhraseGestureEnabled(prefs, res);
|
mPhraseGestureEnabled = Settings.readPhraseGestureEnabled(prefs, res);
|
||||||
mCorrectionEnabled = mAutoCorrectEnabled && !mInputAttributes.mInputTypeNoAutoCorrect;
|
mAutoCorrectionEnabled = mAutoCorrectEnabled && !mInputAttributes.mInputTypeNoAutoCorrect;
|
||||||
final String showSuggestionsSetting = prefs.getString(
|
final String showSuggestionsSetting = prefs.getString(
|
||||||
Settings.PREF_SHOW_SUGGESTIONS_SETTING,
|
Settings.PREF_SHOW_SUGGESTIONS_SETTING,
|
||||||
res.getString(R.string.prefs_suggestion_visibility_default_value));
|
res.getString(R.string.prefs_suggestion_visibility_default_value));
|
||||||
|
@ -189,8 +189,8 @@ public final class SettingsValues {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSuggestionsRequested() {
|
public boolean isSuggestionsRequested() {
|
||||||
return mInputAttributes.mIsSettingsSuggestionStripOn
|
return mInputAttributes.mShouldShowSuggestions
|
||||||
&& (mCorrectionEnabled
|
&& (mAutoCorrectionEnabled
|
||||||
|| isCurrentOrientationAllowingSuggestionsPerUserSettings());
|
|| isCurrentOrientationAllowingSuggestionsPerUserSettings());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -390,8 +390,8 @@ public final class SettingsValues {
|
||||||
sb.append("" + mAutoCorrectEnabled);
|
sb.append("" + mAutoCorrectEnabled);
|
||||||
sb.append("\n mAutoCorrectionThreshold = ");
|
sb.append("\n mAutoCorrectionThreshold = ");
|
||||||
sb.append("" + mAutoCorrectionThreshold);
|
sb.append("" + mAutoCorrectionThreshold);
|
||||||
sb.append("\n mCorrectionEnabled = ");
|
sb.append("\n mAutoCorrectionEnabled = ");
|
||||||
sb.append("" + mCorrectionEnabled);
|
sb.append("" + mAutoCorrectionEnabled);
|
||||||
sb.append("\n mSuggestionVisibility = ");
|
sb.append("\n mSuggestionVisibility = ");
|
||||||
sb.append("" + mSuggestionVisibility);
|
sb.append("" + mSuggestionVisibility);
|
||||||
sb.append("\n mDisplayOrientation = ");
|
sb.append("\n mDisplayOrientation = ");
|
||||||
|
|
Loading…
Reference in a new issue