Loading core/java/android/hardware/input/InputSettings.java +36 −1 Original line number Diff line number Diff line Loading @@ -384,6 +384,42 @@ public class InputSettings { UserHandle.USER_CURRENT); } /** * Whether touchpad acceleration is enabled or not. * * @param context The application context. * * @hide */ public static boolean isTouchpadAccelerationEnabled(@NonNull Context context) { if (!isPointerAccelerationFeatureFlagEnabled()) { return false; } return Settings.System.getIntForUser(context.getContentResolver(), Settings.System.TOUCHPAD_ACCELERATION_ENABLED, 1, UserHandle.USER_CURRENT) == 1; } /** * Enables or disables touchpad acceleration. * * @param context The application context. * @param enabled Will enable touchpad acceleration if true, disable it if * false. * @hide */ @RequiresPermission(Manifest.permission.WRITE_SETTINGS) public static void setTouchpadAccelerationEnabled(@NonNull Context context, boolean enabled) { if (!isPointerAccelerationFeatureFlagEnabled()) { return; } Settings.System.putIntForUser(context.getContentResolver(), Settings.System.TOUCHPAD_ACCELERATION_ENABLED, enabled ? 1 : 0, UserHandle.USER_CURRENT); } /** * Returns true if the feature flag for disabling system gestures on touchpads is enabled. * Loading Loading @@ -835,7 +871,6 @@ public class InputSettings { UserHandle.USER_CURRENT); } /** * Whether Accessibility bounce keys feature is enabled. * Loading core/java/android/provider/Settings.java +12 −0 Original line number Diff line number Diff line Loading @@ -6329,6 +6329,17 @@ public final class Settings { */ public static final String TOUCHPAD_SYSTEM_GESTURES = "touchpad_system_gestures"; /** * Whether touchpad acceleration is enabled. * * When enabled, the speed of the pointer will increase as the user moves their * finger faster on the touchpad. * * @hide */ public static final String TOUCHPAD_ACCELERATION_ENABLED = "touchpad_acceleration_enabled"; /** * Whether to enable reversed vertical scrolling for connected mice. * Loading Loading @@ -6624,6 +6635,7 @@ public final class Settings { PRIVATE_SETTINGS.add(TOUCHPAD_TAP_DRAGGING); PRIVATE_SETTINGS.add(TOUCHPAD_RIGHT_CLICK_ZONE); PRIVATE_SETTINGS.add(TOUCHPAD_SYSTEM_GESTURES); PRIVATE_SETTINGS.add(TOUCHPAD_ACCELERATION_ENABLED); PRIVATE_SETTINGS.add(CAMERA_FLASH_NOTIFICATION); PRIVATE_SETTINGS.add(SCREEN_FLASH_NOTIFICATION); PRIVATE_SETTINGS.add(SCREEN_FLASH_NOTIFICATION_COLOR); Loading core/proto/android/providers/settings/system.proto +2 −1 Original line number Diff line number Diff line Loading @@ -218,7 +218,8 @@ message SystemSettingsProto { optional SettingProto tap_to_click = 4 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto tap_dragging = 5 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto three_finger_tap_customization = 6 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto system_gestures = 7 [ (android.privacy).dest = DEST_AUTOMATIC ];; optional SettingProto system_gestures = 7 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto acceleration_enabled = 8 [ (android.privacy).dest = DEST_AUTOMATIC ];; } optional Touchpad touchpad = 36; Loading packages/SettingsProvider/src/android/provider/settings/backup/SystemSettings.java +1 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,7 @@ public class SystemSettings { Settings.System.TOUCHPAD_TAP_TO_CLICK, Settings.System.TOUCHPAD_TAP_DRAGGING, Settings.System.TOUCHPAD_RIGHT_CLICK_ZONE, Settings.System.TOUCHPAD_ACCELERATION_ENABLED, Settings.System.CAMERA_FLASH_NOTIFICATION, Settings.System.SCREEN_FLASH_NOTIFICATION, Settings.System.SCREEN_FLASH_NOTIFICATION_COLOR, Loading packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java +1 −0 Original line number Diff line number Diff line Loading @@ -234,6 +234,7 @@ public class SystemSettingsValidators { VALIDATORS.put(System.TOUCHPAD_TAP_DRAGGING, BOOLEAN_VALIDATOR); VALIDATORS.put(System.TOUCHPAD_RIGHT_CLICK_ZONE, BOOLEAN_VALIDATOR); VALIDATORS.put(System.TOUCHPAD_SYSTEM_GESTURES, BOOLEAN_VALIDATOR); VALIDATORS.put(System.TOUCHPAD_ACCELERATION_ENABLED, BOOLEAN_VALIDATOR); VALIDATORS.put(System.LOCK_TO_APP_ENABLED, BOOLEAN_VALIDATOR); VALIDATORS.put( System.EGG_MODE, Loading Loading
core/java/android/hardware/input/InputSettings.java +36 −1 Original line number Diff line number Diff line Loading @@ -384,6 +384,42 @@ public class InputSettings { UserHandle.USER_CURRENT); } /** * Whether touchpad acceleration is enabled or not. * * @param context The application context. * * @hide */ public static boolean isTouchpadAccelerationEnabled(@NonNull Context context) { if (!isPointerAccelerationFeatureFlagEnabled()) { return false; } return Settings.System.getIntForUser(context.getContentResolver(), Settings.System.TOUCHPAD_ACCELERATION_ENABLED, 1, UserHandle.USER_CURRENT) == 1; } /** * Enables or disables touchpad acceleration. * * @param context The application context. * @param enabled Will enable touchpad acceleration if true, disable it if * false. * @hide */ @RequiresPermission(Manifest.permission.WRITE_SETTINGS) public static void setTouchpadAccelerationEnabled(@NonNull Context context, boolean enabled) { if (!isPointerAccelerationFeatureFlagEnabled()) { return; } Settings.System.putIntForUser(context.getContentResolver(), Settings.System.TOUCHPAD_ACCELERATION_ENABLED, enabled ? 1 : 0, UserHandle.USER_CURRENT); } /** * Returns true if the feature flag for disabling system gestures on touchpads is enabled. * Loading Loading @@ -835,7 +871,6 @@ public class InputSettings { UserHandle.USER_CURRENT); } /** * Whether Accessibility bounce keys feature is enabled. * Loading
core/java/android/provider/Settings.java +12 −0 Original line number Diff line number Diff line Loading @@ -6329,6 +6329,17 @@ public final class Settings { */ public static final String TOUCHPAD_SYSTEM_GESTURES = "touchpad_system_gestures"; /** * Whether touchpad acceleration is enabled. * * When enabled, the speed of the pointer will increase as the user moves their * finger faster on the touchpad. * * @hide */ public static final String TOUCHPAD_ACCELERATION_ENABLED = "touchpad_acceleration_enabled"; /** * Whether to enable reversed vertical scrolling for connected mice. * Loading Loading @@ -6624,6 +6635,7 @@ public final class Settings { PRIVATE_SETTINGS.add(TOUCHPAD_TAP_DRAGGING); PRIVATE_SETTINGS.add(TOUCHPAD_RIGHT_CLICK_ZONE); PRIVATE_SETTINGS.add(TOUCHPAD_SYSTEM_GESTURES); PRIVATE_SETTINGS.add(TOUCHPAD_ACCELERATION_ENABLED); PRIVATE_SETTINGS.add(CAMERA_FLASH_NOTIFICATION); PRIVATE_SETTINGS.add(SCREEN_FLASH_NOTIFICATION); PRIVATE_SETTINGS.add(SCREEN_FLASH_NOTIFICATION_COLOR); Loading
core/proto/android/providers/settings/system.proto +2 −1 Original line number Diff line number Diff line Loading @@ -218,7 +218,8 @@ message SystemSettingsProto { optional SettingProto tap_to_click = 4 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto tap_dragging = 5 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto three_finger_tap_customization = 6 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto system_gestures = 7 [ (android.privacy).dest = DEST_AUTOMATIC ];; optional SettingProto system_gestures = 7 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto acceleration_enabled = 8 [ (android.privacy).dest = DEST_AUTOMATIC ];; } optional Touchpad touchpad = 36; Loading
packages/SettingsProvider/src/android/provider/settings/backup/SystemSettings.java +1 −0 Original line number Diff line number Diff line Loading @@ -117,6 +117,7 @@ public class SystemSettings { Settings.System.TOUCHPAD_TAP_TO_CLICK, Settings.System.TOUCHPAD_TAP_DRAGGING, Settings.System.TOUCHPAD_RIGHT_CLICK_ZONE, Settings.System.TOUCHPAD_ACCELERATION_ENABLED, Settings.System.CAMERA_FLASH_NOTIFICATION, Settings.System.SCREEN_FLASH_NOTIFICATION, Settings.System.SCREEN_FLASH_NOTIFICATION_COLOR, Loading
packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java +1 −0 Original line number Diff line number Diff line Loading @@ -234,6 +234,7 @@ public class SystemSettingsValidators { VALIDATORS.put(System.TOUCHPAD_TAP_DRAGGING, BOOLEAN_VALIDATOR); VALIDATORS.put(System.TOUCHPAD_RIGHT_CLICK_ZONE, BOOLEAN_VALIDATOR); VALIDATORS.put(System.TOUCHPAD_SYSTEM_GESTURES, BOOLEAN_VALIDATOR); VALIDATORS.put(System.TOUCHPAD_ACCELERATION_ENABLED, BOOLEAN_VALIDATOR); VALIDATORS.put(System.LOCK_TO_APP_ENABLED, BOOLEAN_VALIDATOR); VALIDATORS.put( System.EGG_MODE, Loading