Loading core/java/android/hardware/input/InputSettings.java +48 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.hardware.input; 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.touchpadTapDragging; import static com.android.input.flags.Flags.enableInputFilterRustImpl; import android.Manifest; Loading Loading @@ -302,6 +303,53 @@ public class InputSettings { UserHandle.USER_CURRENT); } /** * Returns true if the feature flag for touchpad tap dragging is enabled. * * @hide */ public static boolean isTouchpadTapDraggingFeatureFlagEnabled() { return touchpadTapDragging(); } /** * Returns true if the touchpad should allow tap dragging. * * The returned value only applies to gesture-compatible touchpads. * * @param context The application context. * @return Whether the touchpad should allow tap dragging. * * @hide */ public static boolean useTouchpadTapDragging(@NonNull Context context) { if (!isTouchpadTapDraggingFeatureFlagEnabled()) { return false; } return Settings.System.getIntForUser(context.getContentResolver(), Settings.System.TOUCHPAD_TAP_DRAGGING, 0, UserHandle.USER_CURRENT) == 1; } /** * Sets the tap dragging behavior for the touchpad. * * The new behavior is only applied to gesture-compatible touchpads. * * @param context The application context. * @param enabled Will enable tap dragging if true, disable it if false * * @hide */ @RequiresPermission(Manifest.permission.WRITE_SETTINGS) public static void setTouchpadTapDragging(@NonNull Context context, boolean enabled) { if (!isTouchpadTapDraggingFeatureFlagEnabled()) { return; } Settings.System.putIntForUser(context.getContentResolver(), Settings.System.TOUCHPAD_TAP_DRAGGING, enabled ? 1 : 0, UserHandle.USER_CURRENT); } /** * Returns true if the touchpad should use the right click zone. * Loading core/java/android/hardware/input/input_framework.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -37,3 +37,10 @@ flag { description: "Controls if the slow keys accessibility feature for physical keyboard is available to the user" bug: "294546335" } flag { namespace: "input_native" name: "touchpad_tap_dragging" description: "Offers a setting to enable touchpad tap dragging" bug: "321978150" } No newline at end of file core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -6048,6 +6048,13 @@ public final class Settings { */ public static final String TOUCHPAD_TAP_TO_CLICK = "touchpad_tap_to_click"; /** * Whether to enable tap dragging on touchpads. * * @hide */ public static final String TOUCHPAD_TAP_DRAGGING = "touchpad_tap_dragging"; /** * Whether to enable a right-click zone on touchpads. * Loading Loading @@ -6270,6 +6277,7 @@ public final class Settings { PRIVATE_SETTINGS.add(TOUCHPAD_POINTER_SPEED); PRIVATE_SETTINGS.add(TOUCHPAD_NATURAL_SCROLLING); PRIVATE_SETTINGS.add(TOUCHPAD_TAP_TO_CLICK); PRIVATE_SETTINGS.add(TOUCHPAD_TAP_DRAGGING); PRIVATE_SETTINGS.add(TOUCHPAD_RIGHT_CLICK_ZONE); PRIVATE_SETTINGS.add(CAMERA_FLASH_NOTIFICATION); PRIVATE_SETTINGS.add(SCREEN_FLASH_NOTIFICATION); Loading core/proto/android/providers/settings/system.proto +1 −0 Original line number Diff line number Diff line Loading @@ -207,6 +207,7 @@ message SystemSettingsProto { optional SettingProto pointer_speed = 2 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto right_click_zone = 3 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto tap_to_click = 4 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto tap_dragging = 5 [ (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 @@ -107,6 +107,7 @@ public class SystemSettings { Settings.System.TOUCHPAD_POINTER_SPEED, Settings.System.TOUCHPAD_NATURAL_SCROLLING, Settings.System.TOUCHPAD_TAP_TO_CLICK, Settings.System.TOUCHPAD_TAP_DRAGGING, Settings.System.TOUCHPAD_RIGHT_CLICK_ZONE, Settings.System.CAMERA_FLASH_NOTIFICATION, Settings.System.SCREEN_FLASH_NOTIFICATION, Loading Loading
core/java/android/hardware/input/InputSettings.java +48 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package android.hardware.input; 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.touchpadTapDragging; import static com.android.input.flags.Flags.enableInputFilterRustImpl; import android.Manifest; Loading Loading @@ -302,6 +303,53 @@ public class InputSettings { UserHandle.USER_CURRENT); } /** * Returns true if the feature flag for touchpad tap dragging is enabled. * * @hide */ public static boolean isTouchpadTapDraggingFeatureFlagEnabled() { return touchpadTapDragging(); } /** * Returns true if the touchpad should allow tap dragging. * * The returned value only applies to gesture-compatible touchpads. * * @param context The application context. * @return Whether the touchpad should allow tap dragging. * * @hide */ public static boolean useTouchpadTapDragging(@NonNull Context context) { if (!isTouchpadTapDraggingFeatureFlagEnabled()) { return false; } return Settings.System.getIntForUser(context.getContentResolver(), Settings.System.TOUCHPAD_TAP_DRAGGING, 0, UserHandle.USER_CURRENT) == 1; } /** * Sets the tap dragging behavior for the touchpad. * * The new behavior is only applied to gesture-compatible touchpads. * * @param context The application context. * @param enabled Will enable tap dragging if true, disable it if false * * @hide */ @RequiresPermission(Manifest.permission.WRITE_SETTINGS) public static void setTouchpadTapDragging(@NonNull Context context, boolean enabled) { if (!isTouchpadTapDraggingFeatureFlagEnabled()) { return; } Settings.System.putIntForUser(context.getContentResolver(), Settings.System.TOUCHPAD_TAP_DRAGGING, enabled ? 1 : 0, UserHandle.USER_CURRENT); } /** * Returns true if the touchpad should use the right click zone. * Loading
core/java/android/hardware/input/input_framework.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -37,3 +37,10 @@ flag { description: "Controls if the slow keys accessibility feature for physical keyboard is available to the user" bug: "294546335" } flag { namespace: "input_native" name: "touchpad_tap_dragging" description: "Offers a setting to enable touchpad tap dragging" bug: "321978150" } No newline at end of file
core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -6048,6 +6048,13 @@ public final class Settings { */ public static final String TOUCHPAD_TAP_TO_CLICK = "touchpad_tap_to_click"; /** * Whether to enable tap dragging on touchpads. * * @hide */ public static final String TOUCHPAD_TAP_DRAGGING = "touchpad_tap_dragging"; /** * Whether to enable a right-click zone on touchpads. * Loading Loading @@ -6270,6 +6277,7 @@ public final class Settings { PRIVATE_SETTINGS.add(TOUCHPAD_POINTER_SPEED); PRIVATE_SETTINGS.add(TOUCHPAD_NATURAL_SCROLLING); PRIVATE_SETTINGS.add(TOUCHPAD_TAP_TO_CLICK); PRIVATE_SETTINGS.add(TOUCHPAD_TAP_DRAGGING); PRIVATE_SETTINGS.add(TOUCHPAD_RIGHT_CLICK_ZONE); PRIVATE_SETTINGS.add(CAMERA_FLASH_NOTIFICATION); PRIVATE_SETTINGS.add(SCREEN_FLASH_NOTIFICATION); Loading
core/proto/android/providers/settings/system.proto +1 −0 Original line number Diff line number Diff line Loading @@ -207,6 +207,7 @@ message SystemSettingsProto { optional SettingProto pointer_speed = 2 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto right_click_zone = 3 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto tap_to_click = 4 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto tap_dragging = 5 [ (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 @@ -107,6 +107,7 @@ public class SystemSettings { Settings.System.TOUCHPAD_POINTER_SPEED, Settings.System.TOUCHPAD_NATURAL_SCROLLING, Settings.System.TOUCHPAD_TAP_TO_CLICK, Settings.System.TOUCHPAD_TAP_DRAGGING, Settings.System.TOUCHPAD_RIGHT_CLICK_ZONE, Settings.System.CAMERA_FLASH_NOTIFICATION, Settings.System.SCREEN_FLASH_NOTIFICATION, Loading