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

Commit a8bcd97f authored by Joey's avatar Joey Committed by Danny Baumann
Browse files

LatinIME: support for incognito mode



Don't learn suggestions when input specifies the
IME_FLAG_NO_PERSONALIZED_LEARNING flag

Change-Id: I224c36deda560657996cffa2922392a64e45b53f
Signed-off-by: default avatarJoey <joey@lineageos.org>
parent 7e776212
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ public final class InputAttributes {
    final public boolean mApplicationSpecifiedCompletionOn;
    final public boolean mShouldInsertSpacesAutomatically;
    final public boolean mShouldShowVoiceInputKey;
    final public boolean mNoLearning;
    /**
     * Whether the floating gesture preview should be disabled. If true, this should override the
     * corresponding keyboard settings preference, always suppressing the floating preview text.
@@ -86,6 +87,7 @@ public final class InputAttributes {
            mShouldShowVoiceInputKey = false;
            mDisableGestureFloatingPreviewText = false;
            mIsGeneralTextInput = false;
            mNoLearning = false;
            return;
        }
        // inputClass == InputType.TYPE_CLASS_TEXT
@@ -139,6 +141,8 @@ public final class InputAttributes {
                && InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD != variation
                && 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;
    }

    public boolean isTypeNull() {
+2 −1
Original line number Diff line number Diff line
@@ -184,7 +184,8 @@ public class SettingsValues {
                && prefs.getBoolean(Settings.PREF_GESTURE_FLOATING_PREVIEW_TEXT, true);
        mAutoCorrectionEnabledPerUserSettings = mAutoCorrectEnabled
                && !mInputAttributes.mInputTypeNoAutoCorrect;
        mSuggestionsEnabledPerUserSettings = readSuggestionsEnabled(prefs);
        mSuggestionsEnabledPerUserSettings = !mInputAttributes.mNoLearning &&
                readSuggestionsEnabled(prefs);
        mIsInternal = Settings.isInternal(prefs);
        mHasCustomKeyPreviewAnimationParams = prefs.getBoolean(
                DebugSettings.PREF_HAS_CUSTOM_KEY_PREVIEW_ANIMATION_PARAMS, false);