Loading core/java/android/hardware/input/InputSettings.java +46 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.hardware.input; import static com.android.hardware.input.Flags.keyboardA11yBounceKeysFlag; import static com.android.hardware.input.Flags.keyboardA11yStickyKeysFlag; import android.Manifest; import android.annotation.FloatRange; Loading Loading @@ -401,4 +402,49 @@ public class InputSettings { UserHandle.USER_CURRENT); } /** * Whether Accessibility sticky keys is enabled. * * <p> * 'Sticky keys' is an accessibility feature that assists users who have physical * disabilities or help users reduce repetitive strain injury. It serializes keystrokes * instead of pressing multiple keys at a time, allowing the user to press and release a * modifier key, such as Shift, Ctrl, Alt, or any other modifier key, and have it remain * active until any other key is pressed. * </p> * * @hide */ public static boolean isAccessibilityStickyKeysEnabled(@NonNull Context context) { if (!keyboardA11yStickyKeysFlag()) { return false; } return Settings.System.getIntForUser(context.getContentResolver(), Settings.Secure.ACCESSIBILITY_STICKY_KEYS, 0, UserHandle.USER_CURRENT) != 0; } /** * Set Accessibility sticky keys feature enabled/disabled. * * <p> * 'Sticky keys' is an accessibility feature that assists users who have physical * disabilities or help users reduce repetitive strain injury. It serializes keystrokes * instead of pressing multiple keys at a time, allowing the user to press and release a * modifier key, such as Shift, Ctrl, Alt, or any other modifier key, and have it remain * active until any other key is pressed. * </p> * * @hide */ @RequiresPermission(Manifest.permission.WRITE_SETTINGS) public static void setAccessibilityStickyKeysEnabled(@NonNull Context context, boolean enabled) { if (!keyboardA11yStickyKeysFlag()) { return; } Settings.System.putIntForUser(context.getContentResolver(), Settings.Secure.ACCESSIBILITY_STICKY_KEYS, enabled ? 1 : 0, UserHandle.USER_CURRENT); } } core/java/android/provider/Settings.java +9 −0 Original line number Diff line number Diff line Loading @@ -7800,6 +7800,15 @@ public final class Settings { */ public static final String ACCESSIBILITY_BOUNCE_KEYS = "accessibility_bounce_keys"; /** * Whether to enable sticky keys for Physical Keyboard accessibility. * * This is a boolean value that determines if Sticky keys feature is enabled. * * @hide */ public static final String ACCESSIBILITY_STICKY_KEYS = "accessibility_sticky_keys"; /** * Whether stylus button presses are disabled. This is a boolean that * determines if stylus buttons are ignored. Loading packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java +1 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ public class SecureSettings { Settings.Secure.TTS_DEFAULT_LOCALE, Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD, Settings.Secure.ACCESSIBILITY_BOUNCE_KEYS, Settings.Secure.ACCESSIBILITY_STICKY_KEYS, Settings.Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global Settings.Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global Settings.Secure.WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global Loading packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java +1 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,7 @@ public class SecureSettingsValidators { VALIDATORS.put(Secure.TTS_DEFAULT_LOCALE, TTS_LIST_VALIDATOR); VALIDATORS.put(Secure.SHOW_IME_WITH_HARD_KEYBOARD, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.ACCESSIBILITY_BOUNCE_KEYS, ANY_INTEGER_VALIDATOR); VALIDATORS.put(Secure.ACCESSIBILITY_STICKY_KEYS, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, NON_NEGATIVE_INTEGER_VALIDATOR); VALIDATORS.put(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT, NON_NEGATIVE_INTEGER_VALIDATOR); Loading services/core/java/com/android/server/input/InputManagerService.java +7 −0 Original line number Diff line number Diff line Loading @@ -3511,6 +3511,13 @@ public class InputManagerService extends IInputManager.Stub mNative.setAccessibilityBounceKeysThreshold(thresholdTimeMs); } /** * Sets whether Accessibility sticky keys is enabled. */ public void setAccessibilityStickyKeysEnabled(boolean enabled) { mNative.setAccessibilityStickyKeysEnabled(enabled); } interface KeyboardBacklightControllerInterface { default void incrementKeyboardBacklight(int deviceId) {} default void decrementKeyboardBacklight(int deviceId) {} Loading Loading
core/java/android/hardware/input/InputSettings.java +46 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.hardware.input; import static com.android.hardware.input.Flags.keyboardA11yBounceKeysFlag; import static com.android.hardware.input.Flags.keyboardA11yStickyKeysFlag; import android.Manifest; import android.annotation.FloatRange; Loading Loading @@ -401,4 +402,49 @@ public class InputSettings { UserHandle.USER_CURRENT); } /** * Whether Accessibility sticky keys is enabled. * * <p> * 'Sticky keys' is an accessibility feature that assists users who have physical * disabilities or help users reduce repetitive strain injury. It serializes keystrokes * instead of pressing multiple keys at a time, allowing the user to press and release a * modifier key, such as Shift, Ctrl, Alt, or any other modifier key, and have it remain * active until any other key is pressed. * </p> * * @hide */ public static boolean isAccessibilityStickyKeysEnabled(@NonNull Context context) { if (!keyboardA11yStickyKeysFlag()) { return false; } return Settings.System.getIntForUser(context.getContentResolver(), Settings.Secure.ACCESSIBILITY_STICKY_KEYS, 0, UserHandle.USER_CURRENT) != 0; } /** * Set Accessibility sticky keys feature enabled/disabled. * * <p> * 'Sticky keys' is an accessibility feature that assists users who have physical * disabilities or help users reduce repetitive strain injury. It serializes keystrokes * instead of pressing multiple keys at a time, allowing the user to press and release a * modifier key, such as Shift, Ctrl, Alt, or any other modifier key, and have it remain * active until any other key is pressed. * </p> * * @hide */ @RequiresPermission(Manifest.permission.WRITE_SETTINGS) public static void setAccessibilityStickyKeysEnabled(@NonNull Context context, boolean enabled) { if (!keyboardA11yStickyKeysFlag()) { return; } Settings.System.putIntForUser(context.getContentResolver(), Settings.Secure.ACCESSIBILITY_STICKY_KEYS, enabled ? 1 : 0, UserHandle.USER_CURRENT); } }
core/java/android/provider/Settings.java +9 −0 Original line number Diff line number Diff line Loading @@ -7800,6 +7800,15 @@ public final class Settings { */ public static final String ACCESSIBILITY_BOUNCE_KEYS = "accessibility_bounce_keys"; /** * Whether to enable sticky keys for Physical Keyboard accessibility. * * This is a boolean value that determines if Sticky keys feature is enabled. * * @hide */ public static final String ACCESSIBILITY_STICKY_KEYS = "accessibility_sticky_keys"; /** * Whether stylus button presses are disabled. This is a boolean that * determines if stylus buttons are ignored. Loading
packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java +1 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ public class SecureSettings { Settings.Secure.TTS_DEFAULT_LOCALE, Settings.Secure.SHOW_IME_WITH_HARD_KEYBOARD, Settings.Secure.ACCESSIBILITY_BOUNCE_KEYS, Settings.Secure.ACCESSIBILITY_STICKY_KEYS, Settings.Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, // moved to global Settings.Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, // moved to global Settings.Secure.WIFI_NUM_OPEN_NETWORKS_KEPT, // moved to global Loading
packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java +1 −0 Original line number Diff line number Diff line Loading @@ -120,6 +120,7 @@ public class SecureSettingsValidators { VALIDATORS.put(Secure.TTS_DEFAULT_LOCALE, TTS_LIST_VALIDATOR); VALIDATORS.put(Secure.SHOW_IME_WITH_HARD_KEYBOARD, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.ACCESSIBILITY_BOUNCE_KEYS, ANY_INTEGER_VALIDATOR); VALIDATORS.put(Secure.ACCESSIBILITY_STICKY_KEYS, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY, NON_NEGATIVE_INTEGER_VALIDATOR); VALIDATORS.put(Secure.WIFI_NUM_OPEN_NETWORKS_KEPT, NON_NEGATIVE_INTEGER_VALIDATOR); Loading
services/core/java/com/android/server/input/InputManagerService.java +7 −0 Original line number Diff line number Diff line Loading @@ -3511,6 +3511,13 @@ public class InputManagerService extends IInputManager.Stub mNative.setAccessibilityBounceKeysThreshold(thresholdTimeMs); } /** * Sets whether Accessibility sticky keys is enabled. */ public void setAccessibilityStickyKeysEnabled(boolean enabled) { mNative.setAccessibilityStickyKeysEnabled(enabled); } interface KeyboardBacklightControllerInterface { default void incrementKeyboardBacklight(int deviceId) {} default void decrementKeyboardBacklight(int deviceId) {} Loading