Loading java/src/com/android/inputmethod/latin/InputAttributes.java +4 −3 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ public final class InputAttributes { final public boolean mApplicationSpecifiedCompletionOn; final public boolean mShouldInsertSpacesAutomatically; final public boolean mShouldShowVoiceInputKey; final public boolean mNoLearning; final public boolean mNoPersonalizedLearning; /** * Whether the floating gesture preview should be disabled. If true, this should override the * corresponding keyboard settings preference, always suppressing the floating preview text. Loading Loading @@ -87,7 +87,7 @@ public final class InputAttributes { mShouldShowVoiceInputKey = false; mDisableGestureFloatingPreviewText = false; mIsGeneralTextInput = false; mNoLearning = false; mNoPersonalizedLearning = false; return; } // inputClass == InputType.TYPE_CLASS_TEXT Loading Loading @@ -142,7 +142,8 @@ public final class InputAttributes { && InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS != variation && InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD != variation; mNoLearning = (editorInfo.imeOptions & EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING) != 0; mNoPersonalizedLearning = (editorInfo.imeOptions & EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING) != 0; } public boolean isTypeNull() { Loading java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +2 −1 Original line number Diff line number Diff line Loading @@ -1438,7 +1438,8 @@ 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.mAutoCorrectionEnabledPerUserSettings) return; if (!settingsValues.mAutoCorrectionEnabledPerUserSettings || !settingsValues.isPersonalizedLearningEnabled()) return; if (mConnection.hasSlowInputConnection()) { // Since we don't unlearn when the user backspaces on a slow InputConnection, // turn off learning to guard against adding typos that the user later deletes. Loading java/src/com/android/inputmethod/latin/settings/SettingsValues.java +5 −2 Original line number Diff line number Diff line Loading @@ -190,8 +190,7 @@ public class SettingsValues { && prefs.getBoolean(Settings.PREF_GESTURE_FLOATING_PREVIEW_TEXT, true); mAutoCorrectionEnabledPerUserSettings = mAutoCorrectEnabled && !mInputAttributes.mInputTypeNoAutoCorrect; mSuggestionsEnabledPerUserSettings = !mInputAttributes.mNoLearning && readSuggestionsEnabled(prefs); mSuggestionsEnabledPerUserSettings = readSuggestionsEnabled(prefs); mIsInternal = Settings.isInternal(prefs); mHasCustomKeyPreviewAnimationParams = prefs.getBoolean( DebugSettings.PREF_HAS_CUSTOM_KEY_PREVIEW_ANIMATION_PARAMS, false); Loading Loading @@ -308,6 +307,10 @@ public class SettingsValues { return null == appWorkaroundUtils ? false : appWorkaroundUtils.isBrokenByRecorrection(); } public boolean isPersonalizedLearningEnabled() { return !mInputAttributes.mNoPersonalizedLearning; } private static final String SUGGESTIONS_VISIBILITY_HIDE_VALUE_OBSOLETE = "2"; private static boolean readSuggestionsEnabled(final SharedPreferences prefs) { Loading Loading
java/src/com/android/inputmethod/latin/InputAttributes.java +4 −3 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ public final class InputAttributes { final public boolean mApplicationSpecifiedCompletionOn; final public boolean mShouldInsertSpacesAutomatically; final public boolean mShouldShowVoiceInputKey; final public boolean mNoLearning; final public boolean mNoPersonalizedLearning; /** * Whether the floating gesture preview should be disabled. If true, this should override the * corresponding keyboard settings preference, always suppressing the floating preview text. Loading Loading @@ -87,7 +87,7 @@ public final class InputAttributes { mShouldShowVoiceInputKey = false; mDisableGestureFloatingPreviewText = false; mIsGeneralTextInput = false; mNoLearning = false; mNoPersonalizedLearning = false; return; } // inputClass == InputType.TYPE_CLASS_TEXT Loading Loading @@ -142,7 +142,8 @@ public final class InputAttributes { && InputType.TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS != variation && InputType.TYPE_TEXT_VARIATION_WEB_PASSWORD != variation; mNoLearning = (editorInfo.imeOptions & EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING) != 0; mNoPersonalizedLearning = (editorInfo.imeOptions & EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING) != 0; } public boolean isTypeNull() { Loading
java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java +2 −1 Original line number Diff line number Diff line Loading @@ -1438,7 +1438,8 @@ 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.mAutoCorrectionEnabledPerUserSettings) return; if (!settingsValues.mAutoCorrectionEnabledPerUserSettings || !settingsValues.isPersonalizedLearningEnabled()) return; if (mConnection.hasSlowInputConnection()) { // Since we don't unlearn when the user backspaces on a slow InputConnection, // turn off learning to guard against adding typos that the user later deletes. Loading
java/src/com/android/inputmethod/latin/settings/SettingsValues.java +5 −2 Original line number Diff line number Diff line Loading @@ -190,8 +190,7 @@ public class SettingsValues { && prefs.getBoolean(Settings.PREF_GESTURE_FLOATING_PREVIEW_TEXT, true); mAutoCorrectionEnabledPerUserSettings = mAutoCorrectEnabled && !mInputAttributes.mInputTypeNoAutoCorrect; mSuggestionsEnabledPerUserSettings = !mInputAttributes.mNoLearning && readSuggestionsEnabled(prefs); mSuggestionsEnabledPerUserSettings = readSuggestionsEnabled(prefs); mIsInternal = Settings.isInternal(prefs); mHasCustomKeyPreviewAnimationParams = prefs.getBoolean( DebugSettings.PREF_HAS_CUSTOM_KEY_PREVIEW_ANIMATION_PARAMS, false); Loading Loading @@ -308,6 +307,10 @@ public class SettingsValues { return null == appWorkaroundUtils ? false : appWorkaroundUtils.isBrokenByRecorrection(); } public boolean isPersonalizedLearningEnabled() { return !mInputAttributes.mNoPersonalizedLearning; } private static final String SUGGESTIONS_VISIBILITY_HIDE_VALUE_OBSOLETE = "2"; private static boolean readSuggestionsEnabled(final SharedPreferences prefs) { Loading