Loading core/java/android/hardware/input/InputSettings.java +48 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static com.android.hardware.input.Flags.keyboardA11yBounceKeysFlag; import static com.android.hardware.input.Flags.keyboardA11ySlowKeysFlag; import static com.android.hardware.input.Flags.keyboardA11yStickyKeysFlag; import static com.android.hardware.input.Flags.keyboardA11yMouseKeys; import static com.android.hardware.input.Flags.mouseReverseVerticalScrolling; import static com.android.hardware.input.Flags.touchpadTapDragging; import static com.android.hardware.input.Flags.touchpadVisualizer; import static com.android.input.flags.Flags.enableInputFilterRustImpl; Loading Loading @@ -362,6 +363,14 @@ public class InputSettings { return touchpadVisualizer(); } /** * Returns true if the feature flag for mouse reverse vertical scrolling is enabled. * @hide */ public static boolean isMouseReverseVerticalScrollingFeatureFlagEnabled() { return mouseReverseVerticalScrolling(); } /** * Returns true if the touchpad visualizer is allowed to appear. * Loading Loading @@ -500,6 +509,45 @@ public class InputSettings { return isStylusPointerIconEnabled(context, false /* forceReloadSetting */); } /** * Whether mouse vertical scrolling is enabled, this applies only to connected mice. * * @param context The application context. * @return Whether the mouse will have its vertical scrolling reversed * (scroll down to move up). * * @hide */ public static boolean isMouseReverseVerticalScrollingEnabled(@NonNull Context context) { if (!isMouseReverseVerticalScrollingFeatureFlagEnabled()) { return false; } return Settings.System.getIntForUser(context.getContentResolver(), Settings.System.MOUSE_REVERSE_VERTICAL_SCROLLING, 0, UserHandle.USER_CURRENT) != 0; } /** * Sets whether the connected mouse will have its vertical scrolling reversed. * * @param context The application context. * @param reverseScrolling Whether reverse scrolling is enabled. * * @hide */ @RequiresPermission(Manifest.permission.WRITE_SETTINGS) public static void setMouseReverseVerticalScrolling(@NonNull Context context, boolean reverseScrolling) { if (!isMouseReverseVerticalScrollingFeatureFlagEnabled()) { return; } Settings.System.putIntForUser(context.getContentResolver(), Settings.System.MOUSE_REVERSE_VERTICAL_SCROLLING, reverseScrolling ? 1 : 0, UserHandle.USER_CURRENT); } /** * Whether Accessibility bounce keys feature is enabled. * Loading core/java/android/provider/Settings.java +10 −0 Original line number Diff line number Diff line Loading @@ -6209,6 +6209,15 @@ public final class Settings { */ public static final String TOUCHPAD_RIGHT_CLICK_ZONE = "touchpad_right_click_zone"; /** * Whether to enable reversed vertical scrolling for connected mice. * * When enabled, scrolling down on the mouse wheel will move the screen up and vice versa. * @hide */ public static final String MOUSE_REVERSE_VERTICAL_SCROLLING = "mouse_reverse_vertical_scrolling"; /** * Pointer fill style, specified by * {@link android.view.PointerIcon.PointerIconVectorStyleFill} constants. Loading Loading @@ -6447,6 +6456,7 @@ public final class Settings { PRIVATE_SETTINGS.add(SCREEN_FLASH_NOTIFICATION); PRIVATE_SETTINGS.add(SCREEN_FLASH_NOTIFICATION_COLOR); PRIVATE_SETTINGS.add(DEFAULT_DEVICE_FONT_SCALE); PRIVATE_SETTINGS.add(MOUSE_REVERSE_VERTICAL_SCROLLING); } /** Loading core/proto/android/providers/settings/system.proto +9 −1 Original line number Diff line number Diff line Loading @@ -220,6 +220,14 @@ message SystemSettingsProto { } optional Touchpad touchpad = 36; message Mouse { option (android.msg_privacy).dest = DEST_EXPLICIT; optional SettingProto reverse_vertical_scrolling = 1 [ (android.privacy).dest = DEST_AUTOMATIC ]; } optional Mouse mouse = 38; optional SettingProto tty_mode = 31 [ (android.privacy).dest = DEST_AUTOMATIC ]; message Vibrate { Loading Loading @@ -277,5 +285,5 @@ message SystemSettingsProto { // Please insert fields in alphabetical order and group them into messages // if possible (to avoid reaching the method limit). // Next tag = 38; // Next tag = 39; } packages/SettingsProvider/src/android/provider/settings/backup/SystemSettings.java +1 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ public class SystemSettings { Settings.System.UNREAD_NOTIFICATION_DOT_INDICATOR, Settings.System.AUTO_LAUNCH_MEDIA_CONTROLS, Settings.System.LOCALE_PREFERENCES, Settings.System.MOUSE_REVERSE_VERTICAL_SCROLLING, Settings.System.TOUCHPAD_POINTER_SPEED, Settings.System.TOUCHPAD_NATURAL_SCROLLING, Settings.System.TOUCHPAD_TAP_TO_CLICK, Loading packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java +1 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,7 @@ public class SystemSettingsValidators { POINTER_ICON_VECTOR_STYLE_STROKE_END)); VALIDATORS.put(System.POINTER_SCALE, new InclusiveFloatRangeValidator(DEFAULT_POINTER_SCALE, LARGE_POINTER_SCALE)); VALIDATORS.put(System.MOUSE_REVERSE_VERTICAL_SCROLLING, BOOLEAN_VALIDATOR); VALIDATORS.put(System.TOUCHPAD_POINTER_SPEED, new InclusiveIntegerRangeValidator(-7, 7)); VALIDATORS.put(System.TOUCHPAD_NATURAL_SCROLLING, BOOLEAN_VALIDATOR); VALIDATORS.put(System.TOUCHPAD_TAP_TO_CLICK, BOOLEAN_VALIDATOR); Loading Loading
core/java/android/hardware/input/InputSettings.java +48 −0 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static com.android.hardware.input.Flags.keyboardA11yBounceKeysFlag; import static com.android.hardware.input.Flags.keyboardA11ySlowKeysFlag; import static com.android.hardware.input.Flags.keyboardA11yStickyKeysFlag; import static com.android.hardware.input.Flags.keyboardA11yMouseKeys; import static com.android.hardware.input.Flags.mouseReverseVerticalScrolling; import static com.android.hardware.input.Flags.touchpadTapDragging; import static com.android.hardware.input.Flags.touchpadVisualizer; import static com.android.input.flags.Flags.enableInputFilterRustImpl; Loading Loading @@ -362,6 +363,14 @@ public class InputSettings { return touchpadVisualizer(); } /** * Returns true if the feature flag for mouse reverse vertical scrolling is enabled. * @hide */ public static boolean isMouseReverseVerticalScrollingFeatureFlagEnabled() { return mouseReverseVerticalScrolling(); } /** * Returns true if the touchpad visualizer is allowed to appear. * Loading Loading @@ -500,6 +509,45 @@ public class InputSettings { return isStylusPointerIconEnabled(context, false /* forceReloadSetting */); } /** * Whether mouse vertical scrolling is enabled, this applies only to connected mice. * * @param context The application context. * @return Whether the mouse will have its vertical scrolling reversed * (scroll down to move up). * * @hide */ public static boolean isMouseReverseVerticalScrollingEnabled(@NonNull Context context) { if (!isMouseReverseVerticalScrollingFeatureFlagEnabled()) { return false; } return Settings.System.getIntForUser(context.getContentResolver(), Settings.System.MOUSE_REVERSE_VERTICAL_SCROLLING, 0, UserHandle.USER_CURRENT) != 0; } /** * Sets whether the connected mouse will have its vertical scrolling reversed. * * @param context The application context. * @param reverseScrolling Whether reverse scrolling is enabled. * * @hide */ @RequiresPermission(Manifest.permission.WRITE_SETTINGS) public static void setMouseReverseVerticalScrolling(@NonNull Context context, boolean reverseScrolling) { if (!isMouseReverseVerticalScrollingFeatureFlagEnabled()) { return; } Settings.System.putIntForUser(context.getContentResolver(), Settings.System.MOUSE_REVERSE_VERTICAL_SCROLLING, reverseScrolling ? 1 : 0, UserHandle.USER_CURRENT); } /** * Whether Accessibility bounce keys feature is enabled. * Loading
core/java/android/provider/Settings.java +10 −0 Original line number Diff line number Diff line Loading @@ -6209,6 +6209,15 @@ public final class Settings { */ public static final String TOUCHPAD_RIGHT_CLICK_ZONE = "touchpad_right_click_zone"; /** * Whether to enable reversed vertical scrolling for connected mice. * * When enabled, scrolling down on the mouse wheel will move the screen up and vice versa. * @hide */ public static final String MOUSE_REVERSE_VERTICAL_SCROLLING = "mouse_reverse_vertical_scrolling"; /** * Pointer fill style, specified by * {@link android.view.PointerIcon.PointerIconVectorStyleFill} constants. Loading Loading @@ -6447,6 +6456,7 @@ public final class Settings { PRIVATE_SETTINGS.add(SCREEN_FLASH_NOTIFICATION); PRIVATE_SETTINGS.add(SCREEN_FLASH_NOTIFICATION_COLOR); PRIVATE_SETTINGS.add(DEFAULT_DEVICE_FONT_SCALE); PRIVATE_SETTINGS.add(MOUSE_REVERSE_VERTICAL_SCROLLING); } /** Loading
core/proto/android/providers/settings/system.proto +9 −1 Original line number Diff line number Diff line Loading @@ -220,6 +220,14 @@ message SystemSettingsProto { } optional Touchpad touchpad = 36; message Mouse { option (android.msg_privacy).dest = DEST_EXPLICIT; optional SettingProto reverse_vertical_scrolling = 1 [ (android.privacy).dest = DEST_AUTOMATIC ]; } optional Mouse mouse = 38; optional SettingProto tty_mode = 31 [ (android.privacy).dest = DEST_AUTOMATIC ]; message Vibrate { Loading Loading @@ -277,5 +285,5 @@ message SystemSettingsProto { // Please insert fields in alphabetical order and group them into messages // if possible (to avoid reaching the method limit). // Next tag = 38; // Next tag = 39; }
packages/SettingsProvider/src/android/provider/settings/backup/SystemSettings.java +1 −0 Original line number Diff line number Diff line Loading @@ -106,6 +106,7 @@ public class SystemSettings { Settings.System.UNREAD_NOTIFICATION_DOT_INDICATOR, Settings.System.AUTO_LAUNCH_MEDIA_CONTROLS, Settings.System.LOCALE_PREFERENCES, Settings.System.MOUSE_REVERSE_VERTICAL_SCROLLING, Settings.System.TOUCHPAD_POINTER_SPEED, Settings.System.TOUCHPAD_NATURAL_SCROLLING, Settings.System.TOUCHPAD_TAP_TO_CLICK, Loading
packages/SettingsProvider/src/android/provider/settings/validators/SystemSettingsValidators.java +1 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,7 @@ public class SystemSettingsValidators { POINTER_ICON_VECTOR_STYLE_STROKE_END)); VALIDATORS.put(System.POINTER_SCALE, new InclusiveFloatRangeValidator(DEFAULT_POINTER_SCALE, LARGE_POINTER_SCALE)); VALIDATORS.put(System.MOUSE_REVERSE_VERTICAL_SCROLLING, BOOLEAN_VALIDATOR); VALIDATORS.put(System.TOUCHPAD_POINTER_SPEED, new InclusiveIntegerRangeValidator(-7, 7)); VALIDATORS.put(System.TOUCHPAD_NATURAL_SCROLLING, BOOLEAN_VALIDATOR); VALIDATORS.put(System.TOUCHPAD_TAP_TO_CLICK, BOOLEAN_VALIDATOR); Loading