Loading core/java/android/hardware/input/InputSettings.java +47 −0 Original line number Diff line number Diff line Loading @@ -1192,6 +1192,53 @@ public class InputSettings { maxSpeed, UserHandle.USER_CURRENT); } /** * Returns true if the primary keys are selected to control the mouse key. Returns false if * numpad keys are the only way to control the mouse key. * * <p> * ‘Mouse keys’ is an accessibility feature to aid users who have physical disabilities, * that allows the user to use the keys on the keyboard to control the mouse pointer and * other perform other mouse functionality. * </p> * @param context The application context. * @return Whether user can use primary keys to control the Mouse Key. * @hide */ @FlaggedApi(FLAG_KEYBOARD_A11Y_MOUSE_KEYS) public static boolean isPrimaryKeysForMouseKeysEnabled(@NonNull Context context) { if (!isAccessibilityMouseKeysFeatureFlagEnabled()) { return false; } return Settings.Secure.getIntForUser(context.getContentResolver(), Settings.Secure.ACCESSIBILITY_MOUSE_KEYS_USE_PRIMARY_KEYS, 1, UserHandle.USER_CURRENT) != 0; } /** * Whether primary keys are selected to control the Mouse Key. * * <p> * ‘Mouse keys’ is an accessibility feature to aid users who have physical disabilities, * that allows the user to use the keys on the keyboard to control the mouse pointer and * other perform other mouse functionality. * </p> * * @hide */ @FlaggedApi(FLAG_KEYBOARD_A11Y_MOUSE_KEYS) public static void setPrimaryKeysForMouseKeysEnabled( @NonNull Context context, boolean enabled) { if (!isAccessibilityMouseKeysFeatureFlagEnabled()) { return; } Settings.Secure.putIntForUser(context.getContentResolver(), Settings.Secure.ACCESSIBILITY_MOUSE_KEYS_USE_PRIMARY_KEYS, enabled ? 1 : 0, UserHandle.USER_CURRENT); } /** * Whether "Repeat keys" feature flag is enabled. * Loading core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -13136,6 +13136,14 @@ public final class Settings { public static final String ACCESSIBILITY_MOUSE_KEYS_MAX_SPEED = "accessibility_mouse_keys_max_speed"; /** * Whether the primary keys are selected to control the mouse keys. * * @hide */ public static final String ACCESSIBILITY_MOUSE_KEYS_USE_PRIMARY_KEYS = "accessibility_mouse_keys_use_primary_keys"; /** * Whether the Adaptive connectivity option is enabled. * Loading packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java +1 −0 Original line number Diff line number Diff line Loading @@ -245,6 +245,7 @@ public class SecureSettings { Settings.Secure.ACCESSIBILITY_MOUSE_KEYS_ENABLED, Settings.Secure.ACCESSIBILITY_MOUSE_KEYS_ACCELERATION, Settings.Secure.ACCESSIBILITY_MOUSE_KEYS_MAX_SPEED, Settings.Secure.ACCESSIBILITY_MOUSE_KEYS_USE_PRIMARY_KEYS, Settings.Secure.ACCESSIBILITY_PINCH_TO_ZOOM_ANYWHERE_ENABLED, Settings.Secure.ACCESSIBILITY_SINGLE_FINGER_PANNING_ENABLED, Settings.Secure.ACTION_CORNER_TOP_LEFT_ACTION, Loading packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java +1 −0 Original line number Diff line number Diff line Loading @@ -494,6 +494,7 @@ public class SecureSettingsValidators { new InclusiveFloatRangeValidator(0, 1.0f)); VALIDATORS.put(Secure.ACCESSIBILITY_MOUSE_KEYS_MAX_SPEED, new InclusiveIntegerRangeValidator(1, 10)); VALIDATORS.put(Secure.ACCESSIBILITY_MOUSE_KEYS_USE_PRIMARY_KEYS, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.MANDATORY_BIOMETRICS, new InclusiveIntegerRangeValidator(0, 1)); VALIDATORS.put(Secure.MANDATORY_BIOMETRICS_REQUIREMENTS_SATISFIED, new InclusiveIntegerRangeValidator(0, 1)); Loading Loading
core/java/android/hardware/input/InputSettings.java +47 −0 Original line number Diff line number Diff line Loading @@ -1192,6 +1192,53 @@ public class InputSettings { maxSpeed, UserHandle.USER_CURRENT); } /** * Returns true if the primary keys are selected to control the mouse key. Returns false if * numpad keys are the only way to control the mouse key. * * <p> * ‘Mouse keys’ is an accessibility feature to aid users who have physical disabilities, * that allows the user to use the keys on the keyboard to control the mouse pointer and * other perform other mouse functionality. * </p> * @param context The application context. * @return Whether user can use primary keys to control the Mouse Key. * @hide */ @FlaggedApi(FLAG_KEYBOARD_A11Y_MOUSE_KEYS) public static boolean isPrimaryKeysForMouseKeysEnabled(@NonNull Context context) { if (!isAccessibilityMouseKeysFeatureFlagEnabled()) { return false; } return Settings.Secure.getIntForUser(context.getContentResolver(), Settings.Secure.ACCESSIBILITY_MOUSE_KEYS_USE_PRIMARY_KEYS, 1, UserHandle.USER_CURRENT) != 0; } /** * Whether primary keys are selected to control the Mouse Key. * * <p> * ‘Mouse keys’ is an accessibility feature to aid users who have physical disabilities, * that allows the user to use the keys on the keyboard to control the mouse pointer and * other perform other mouse functionality. * </p> * * @hide */ @FlaggedApi(FLAG_KEYBOARD_A11Y_MOUSE_KEYS) public static void setPrimaryKeysForMouseKeysEnabled( @NonNull Context context, boolean enabled) { if (!isAccessibilityMouseKeysFeatureFlagEnabled()) { return; } Settings.Secure.putIntForUser(context.getContentResolver(), Settings.Secure.ACCESSIBILITY_MOUSE_KEYS_USE_PRIMARY_KEYS, enabled ? 1 : 0, UserHandle.USER_CURRENT); } /** * Whether "Repeat keys" feature flag is enabled. * Loading
core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -13136,6 +13136,14 @@ public final class Settings { public static final String ACCESSIBILITY_MOUSE_KEYS_MAX_SPEED = "accessibility_mouse_keys_max_speed"; /** * Whether the primary keys are selected to control the mouse keys. * * @hide */ public static final String ACCESSIBILITY_MOUSE_KEYS_USE_PRIMARY_KEYS = "accessibility_mouse_keys_use_primary_keys"; /** * Whether the Adaptive connectivity option is enabled. * Loading
packages/SettingsProvider/src/android/provider/settings/backup/SecureSettings.java +1 −0 Original line number Diff line number Diff line Loading @@ -245,6 +245,7 @@ public class SecureSettings { Settings.Secure.ACCESSIBILITY_MOUSE_KEYS_ENABLED, Settings.Secure.ACCESSIBILITY_MOUSE_KEYS_ACCELERATION, Settings.Secure.ACCESSIBILITY_MOUSE_KEYS_MAX_SPEED, Settings.Secure.ACCESSIBILITY_MOUSE_KEYS_USE_PRIMARY_KEYS, Settings.Secure.ACCESSIBILITY_PINCH_TO_ZOOM_ANYWHERE_ENABLED, Settings.Secure.ACCESSIBILITY_SINGLE_FINGER_PANNING_ENABLED, Settings.Secure.ACTION_CORNER_TOP_LEFT_ACTION, Loading
packages/SettingsProvider/src/android/provider/settings/validators/SecureSettingsValidators.java +1 −0 Original line number Diff line number Diff line Loading @@ -494,6 +494,7 @@ public class SecureSettingsValidators { new InclusiveFloatRangeValidator(0, 1.0f)); VALIDATORS.put(Secure.ACCESSIBILITY_MOUSE_KEYS_MAX_SPEED, new InclusiveIntegerRangeValidator(1, 10)); VALIDATORS.put(Secure.ACCESSIBILITY_MOUSE_KEYS_USE_PRIMARY_KEYS, BOOLEAN_VALIDATOR); VALIDATORS.put(Secure.MANDATORY_BIOMETRICS, new InclusiveIntegerRangeValidator(0, 1)); VALIDATORS.put(Secure.MANDATORY_BIOMETRICS_REQUIREMENTS_SATISFIED, new InclusiveIntegerRangeValidator(0, 1)); Loading