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