Loading core/java/android/provider/Settings.java +9 −0 Original line number Diff line number Diff line Loading @@ -7223,6 +7223,15 @@ public final class Settings { @SuppressLint("NoSettingsProvider") public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard"; /** * Whether stylus button presses are disabled. This is a boolean that * determines if stylus buttons are ignored. * * @hide */ @SuppressLint("NoSettingsProvider") public static final String STYLUS_BUTTONS_DISABLED = "stylus_buttons_disabled"; /** * Host name and port for global http proxy. Uses ':' seperator for * between host and port. Loading packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -772,6 +772,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.TRUST_AGENTS_INITIALIZED, Settings.Secure.KNOWN_TRUST_AGENTS_INITIALIZED, Settings.Secure.TV_APP_USES_NON_SYSTEM_INPUTS, Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +11 −1 Original line number Diff line number Diff line Loading @@ -151,6 +151,7 @@ import android.os.Vibrator; import android.provider.DeviceConfig; import android.provider.MediaStore; import android.provider.Settings; import android.provider.Settings.Secure; import android.service.dreams.DreamManagerInternal; import android.service.dreams.DreamService; import android.service.dreams.IDreamManager; Loading Loading @@ -516,6 +517,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { int mDoublePressOnStemPrimaryBehavior; int mTriplePressOnStemPrimaryBehavior; int mLongPressOnStemPrimaryBehavior; boolean mStylusButtonsDisabled = false; boolean mHasSoftInput = false; boolean mHapticTextHandleEnabled; boolean mUseTvRouting; Loading Loading @@ -771,6 +773,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { resolver.registerContentObserver(Settings.Global.getUriFor( 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, UserHandle.USER_ALL); updateSettings(); } Loading Loading @@ -2560,6 +2565,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { Settings.Global.KEY_CHORD_POWER_VOLUME_UP, mContext.getResources().getInteger( com.android.internal.R.integer.config_keyChordPowerVolumeUp)); mStylusButtonsDisabled = Settings.Secure.getIntForUser(resolver, Secure.STYLUS_BUTTONS_DISABLED, 0, UserHandle.USER_CURRENT) == 1; } if (updateRotation) { updateRotation(true); Loading Loading @@ -4183,7 +4191,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { case KeyEvent.KEYCODE_DEMO_APP_3: case KeyEvent.KEYCODE_DEMO_APP_4: { // TODO(b/254604589): Dispatch KeyEvent to System UI. if (!mStylusButtonsDisabled) { sendSystemKeyToStatusBarAsync(keyCode); } // Just drop if keys are not intercepted for direct key. result &= ~ACTION_PASS_TO_USER; Loading Loading
core/java/android/provider/Settings.java +9 −0 Original line number Diff line number Diff line Loading @@ -7223,6 +7223,15 @@ public final class Settings { @SuppressLint("NoSettingsProvider") public static final String SHOW_IME_WITH_HARD_KEYBOARD = "show_ime_with_hard_keyboard"; /** * Whether stylus button presses are disabled. This is a boolean that * determines if stylus buttons are ignored. * * @hide */ @SuppressLint("NoSettingsProvider") public static final String STYLUS_BUTTONS_DISABLED = "stylus_buttons_disabled"; /** * Host name and port for global http proxy. Uses ':' seperator for * between host and port. Loading
packages/SettingsProvider/test/src/android/provider/SettingsBackupTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -772,6 +772,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.TRUST_AGENTS_INITIALIZED, Settings.Secure.KNOWN_TRUST_AGENTS_INITIALIZED, Settings.Secure.TV_APP_USES_NON_SYSTEM_INPUTS, Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +11 −1 Original line number Diff line number Diff line Loading @@ -151,6 +151,7 @@ import android.os.Vibrator; import android.provider.DeviceConfig; import android.provider.MediaStore; import android.provider.Settings; import android.provider.Settings.Secure; import android.service.dreams.DreamManagerInternal; import android.service.dreams.DreamService; import android.service.dreams.IDreamManager; Loading Loading @@ -516,6 +517,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { int mDoublePressOnStemPrimaryBehavior; int mTriplePressOnStemPrimaryBehavior; int mLongPressOnStemPrimaryBehavior; boolean mStylusButtonsDisabled = false; boolean mHasSoftInput = false; boolean mHapticTextHandleEnabled; boolean mUseTvRouting; Loading Loading @@ -771,6 +773,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { resolver.registerContentObserver(Settings.Global.getUriFor( 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, UserHandle.USER_ALL); updateSettings(); } Loading Loading @@ -2560,6 +2565,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { Settings.Global.KEY_CHORD_POWER_VOLUME_UP, mContext.getResources().getInteger( com.android.internal.R.integer.config_keyChordPowerVolumeUp)); mStylusButtonsDisabled = Settings.Secure.getIntForUser(resolver, Secure.STYLUS_BUTTONS_DISABLED, 0, UserHandle.USER_CURRENT) == 1; } if (updateRotation) { updateRotation(true); Loading Loading @@ -4183,7 +4191,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { case KeyEvent.KEYCODE_DEMO_APP_3: case KeyEvent.KEYCODE_DEMO_APP_4: { // TODO(b/254604589): Dispatch KeyEvent to System UI. if (!mStylusButtonsDisabled) { sendSystemKeyToStatusBarAsync(keyCode); } // Just drop if keys are not intercepted for direct key. result &= ~ACTION_PASS_TO_USER; Loading