Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5e860a34 authored by /e/ robot's avatar /e/ robot
Browse files

Merge remote-tracking branch 'origin/lineage-22.2' into a15

parents 4b917f74 05f7fefa
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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.
@@ -87,7 +87,7 @@ public final class InputAttributes {
            mShouldShowVoiceInputKey = false;
            mDisableGestureFloatingPreviewText = false;
            mIsGeneralTextInput = false;
            mNoLearning = false;
            mNoPersonalizedLearning = false;
            return;
        }
        // inputClass == InputType.TYPE_CLASS_TEXT
@@ -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() {
+2 −1
Original line number Diff line number Diff line
@@ -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.
+5 −2
Original line number Diff line number Diff line
@@ -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);
@@ -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) {