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

Commit b85aa779 authored by Vania Januar's avatar Vania Januar
Browse files

Invert STYLUS_BUTTONS_DISABLED to avoid double negatives.

The settings is not backed up as it shouldn't be transferred to
another device. Interaction with a stylus should be as if with
a 'fresh' stylus.

Test: SettingsBackupTest
Bug: 267595764
Change-Id: I220b25cddf53a5946c6525d9e620cce3bb7c7199
parent 96c2a6b2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7422,7 +7422,7 @@ public final class Settings {
         * @hide
         */
        @SuppressLint("NoSettingsProvider")
        public static final String STYLUS_BUTTONS_DISABLED = "stylus_buttons_disabled";
        public static final String STYLUS_BUTTONS_ENABLED = "stylus_buttons_enabled";
        /**
         * Host name and port for global http proxy. Uses ':' seperator for
+1 −1
Original line number Diff line number Diff line
@@ -776,7 +776,7 @@ public class SettingsBackupTest {
                 Settings.Secure.SLEEP_TIMEOUT,
                 Settings.Secure.SMS_DEFAULT_APPLICATION,
                 Settings.Secure.SPELL_CHECKER_ENABLED,  // Intentionally removed in Q
                 Settings.Secure.STYLUS_BUTTONS_DISABLED,
                 Settings.Secure.STYLUS_BUTTONS_ENABLED,
                 Settings.Secure.TRUST_AGENTS_INITIALIZED,
                 Settings.Secure.KNOWN_TRUST_AGENTS_INITIALIZED,
                 Settings.Secure.TV_APP_USES_NON_SYSTEM_INPUTS,
+6 −6
Original line number Diff line number Diff line
@@ -522,7 +522,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    int mDoublePressOnStemPrimaryBehavior;
    int mTriplePressOnStemPrimaryBehavior;
    int mLongPressOnStemPrimaryBehavior;
    boolean mStylusButtonsDisabled = false;
    boolean mStylusButtonsEnabled = true;
    boolean mHasSoftInput = false;
    boolean mHapticTextHandleEnabled;
    boolean mUseTvRouting;
@@ -781,7 +781,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    Settings.Global.POWER_BUTTON_SUPPRESSION_DELAY_AFTER_GESTURE_WAKE), false, this,
                    UserHandle.USER_ALL);
            resolver.registerContentObserver(Settings.Secure.getUriFor(
                    Settings.Secure.STYLUS_BUTTONS_DISABLED), false, this,
                    Settings.Secure.STYLUS_BUTTONS_ENABLED), false, this,
                    UserHandle.USER_ALL);
            updateSettings();
        }
@@ -2601,9 +2601,9 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    mContext.getResources().getInteger(
                            com.android.internal.R.integer.config_keyChordPowerVolumeUp));

            mStylusButtonsDisabled = Settings.Secure.getIntForUser(resolver,
                    Secure.STYLUS_BUTTONS_DISABLED, 0, UserHandle.USER_CURRENT) == 1;
            mInputManagerInternal.setStylusButtonMotionEventsEnabled(!mStylusButtonsDisabled);
            mStylusButtonsEnabled = Settings.Secure.getIntForUser(resolver,
                    Secure.STYLUS_BUTTONS_ENABLED, 1, UserHandle.USER_CURRENT) == 1;
            mInputManagerInternal.setStylusButtonMotionEventsEnabled(mStylusButtonsEnabled);
        }
        if (updateRotation) {
            updateRotation(true);
@@ -4315,7 +4315,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            case KeyEvent.KEYCODE_STYLUS_BUTTON_SECONDARY:
            case KeyEvent.KEYCODE_STYLUS_BUTTON_TERTIARY:
            case KeyEvent.KEYCODE_STYLUS_BUTTON_TAIL: {
                if (down && !mStylusButtonsDisabled) {
                if (down && mStylusButtonsEnabled) {
                    sendSystemKeyToStatusBarAsync(keyCode);
                }
                result &= ~ACTION_PASS_TO_USER;