Loading core/java/android/hardware/input/InputSettings.java +16 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static com.android.hardware.input.Flags.mouseSwapPrimaryButton; import static com.android.hardware.input.Flags.pointerAcceleration; import static com.android.hardware.input.Flags.touchpadSystemGestureDisable; import static com.android.hardware.input.Flags.touchpadThreeFingerTapShortcut; import static com.android.hardware.input.Flags.touchpadVisualizer; import static com.android.input.flags.Flags.FLAG_KEYBOARD_REPEAT_KEYS; import static com.android.input.flags.Flags.keyboardRepeatKeys; Loading Loading @@ -433,6 +434,15 @@ public class InputSettings { return touchpadSystemGestureDisable(); } /** * Returns true if the feature flag for touchpad visualizer is enabled. * * @hide */ public static boolean isTouchpadVisualizerFeatureFlagEnabled() { return touchpadVisualizer(); } /** * Returns true if the feature flag for the touchpad three-finger tap shortcut is enabled. * Loading Loading @@ -485,6 +495,9 @@ public class InputSettings { * @hide */ public static boolean useTouchpadVisualizer(@NonNull Context context) { if (!isTouchpadVisualizerFeatureFlagEnabled()) { return false; } return Settings.System.getIntForUser(context.getContentResolver(), Settings.System.TOUCHPAD_VISUALIZER, 0, UserHandle.USER_CURRENT) == 1; } Loading @@ -499,6 +512,9 @@ public class InputSettings { */ @RequiresPermission(Manifest.permission.WRITE_SETTINGS) public static void setTouchpadVisualizer(@NonNull Context context, boolean enabled) { if (!isTouchpadVisualizerFeatureFlagEnabled()) { return; } Settings.System.putIntForUser(context.getContentResolver(), Settings.System.TOUCHPAD_VISUALIZER, enabled ? 1 : 0, UserHandle.USER_CURRENT); } Loading core/java/android/hardware/input/input_framework.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,13 @@ flag { bug: "341799888" } flag { namespace: "input_native" name: "touchpad_visualizer" description: "Enables a developer overlay that displays raw touchpad input data and gesture recognition status in real-time." bug: "286551975" } flag { namespace: "input_native" name: "manage_key_gestures" Loading services/core/java/com/android/server/input/InputManagerService.java +14 −6 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_M import static com.android.hardware.input.Flags.enableCustomizableInputGestures; import static com.android.hardware.input.Flags.fixKeyboardInterceptorPolicyCall; import static com.android.hardware.input.Flags.keyEventActivityDetection; import static com.android.hardware.input.Flags.touchpadVisualizer; import static com.android.server.policy.WindowManagerPolicy.ACTION_PASS_TO_USER; import android.Manifest; Loading Loading @@ -347,7 +348,7 @@ public class InputManagerService extends IInputManager.Stub // Monitors any changes to the sysfs nodes when an input device is connected. private final SysfsNodeMonitor mSysfsNodeMonitor; @NonNull @Nullable private final TouchpadDebugViewController mTouchpadDebugViewController; // Manages Keyboard backlight Loading Loading @@ -544,8 +545,9 @@ public class InputManagerService extends IInputManager.Stub mSettingsObserver = new InputSettingsObserver(mContext, mHandler, this, mNative); mKeyboardLayoutManager = new KeyboardLayoutManager(mContext, mNative, mDataStore, injector.getLooper()); mTouchpadDebugViewController = new TouchpadDebugViewController(mContext, injector.getLooper(), this); mTouchpadDebugViewController = touchpadVisualizer() ? new TouchpadDebugViewController(mContext, injector.getLooper(), this) : null; mBatteryController = new BatteryController(mContext, mNative, injector.getLooper(), injector.getUEventManager()); mSysfsNodeMonitor = new SysfsNodeMonitor(mContext, mNative, injector.getLooper(), Loading Loading @@ -2392,14 +2394,18 @@ public class InputManagerService extends IInputManager.Stub // Native callback. @SuppressWarnings("unused") private void notifyTouchpadHardwareState(TouchpadHardwareState hardwareStates, int deviceId) { if (mTouchpadDebugViewController != null) { mTouchpadDebugViewController.updateTouchpadHardwareState(hardwareStates, deviceId); } } // Native callback. @SuppressWarnings("unused") private void notifyTouchpadGestureInfo(int type, int deviceId) { if (mTouchpadDebugViewController != null) { mTouchpadDebugViewController.updateTouchpadGestureInfo(type, deviceId); } } // Native callback. @SuppressWarnings("unused") Loading Loading @@ -3978,8 +3984,10 @@ public class InputManagerService extends IInputManager.Stub void updateTouchpadVisualizerEnabled(boolean enabled) { mNative.setShouldNotifyTouchpadHardwareState(enabled); if (mTouchpadDebugViewController != null) { mTouchpadDebugViewController.updateTouchpadVisualizerEnabled(enabled); } } void updatePointerLocationEnabled(boolean enabled) { mWindowManagerCallbacks.notifyPointerLocationChanged(enabled); Loading Loading
core/java/android/hardware/input/InputSettings.java +16 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ import static com.android.hardware.input.Flags.mouseSwapPrimaryButton; import static com.android.hardware.input.Flags.pointerAcceleration; import static com.android.hardware.input.Flags.touchpadSystemGestureDisable; import static com.android.hardware.input.Flags.touchpadThreeFingerTapShortcut; import static com.android.hardware.input.Flags.touchpadVisualizer; import static com.android.input.flags.Flags.FLAG_KEYBOARD_REPEAT_KEYS; import static com.android.input.flags.Flags.keyboardRepeatKeys; Loading Loading @@ -433,6 +434,15 @@ public class InputSettings { return touchpadSystemGestureDisable(); } /** * Returns true if the feature flag for touchpad visualizer is enabled. * * @hide */ public static boolean isTouchpadVisualizerFeatureFlagEnabled() { return touchpadVisualizer(); } /** * Returns true if the feature flag for the touchpad three-finger tap shortcut is enabled. * Loading Loading @@ -485,6 +495,9 @@ public class InputSettings { * @hide */ public static boolean useTouchpadVisualizer(@NonNull Context context) { if (!isTouchpadVisualizerFeatureFlagEnabled()) { return false; } return Settings.System.getIntForUser(context.getContentResolver(), Settings.System.TOUCHPAD_VISUALIZER, 0, UserHandle.USER_CURRENT) == 1; } Loading @@ -499,6 +512,9 @@ public class InputSettings { */ @RequiresPermission(Manifest.permission.WRITE_SETTINGS) public static void setTouchpadVisualizer(@NonNull Context context, boolean enabled) { if (!isTouchpadVisualizerFeatureFlagEnabled()) { return; } Settings.System.putIntForUser(context.getContentResolver(), Settings.System.TOUCHPAD_VISUALIZER, enabled ? 1 : 0, UserHandle.USER_CURRENT); } Loading
core/java/android/hardware/input/input_framework.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,13 @@ flag { bug: "341799888" } flag { namespace: "input_native" name: "touchpad_visualizer" description: "Enables a developer overlay that displays raw touchpad input data and gesture recognition status in real-time." bug: "286551975" } flag { namespace: "input_native" name: "manage_key_gestures" Loading
services/core/java/com/android/server/input/InputManagerService.java +14 −6 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_M import static com.android.hardware.input.Flags.enableCustomizableInputGestures; import static com.android.hardware.input.Flags.fixKeyboardInterceptorPolicyCall; import static com.android.hardware.input.Flags.keyEventActivityDetection; import static com.android.hardware.input.Flags.touchpadVisualizer; import static com.android.server.policy.WindowManagerPolicy.ACTION_PASS_TO_USER; import android.Manifest; Loading Loading @@ -347,7 +348,7 @@ public class InputManagerService extends IInputManager.Stub // Monitors any changes to the sysfs nodes when an input device is connected. private final SysfsNodeMonitor mSysfsNodeMonitor; @NonNull @Nullable private final TouchpadDebugViewController mTouchpadDebugViewController; // Manages Keyboard backlight Loading Loading @@ -544,8 +545,9 @@ public class InputManagerService extends IInputManager.Stub mSettingsObserver = new InputSettingsObserver(mContext, mHandler, this, mNative); mKeyboardLayoutManager = new KeyboardLayoutManager(mContext, mNative, mDataStore, injector.getLooper()); mTouchpadDebugViewController = new TouchpadDebugViewController(mContext, injector.getLooper(), this); mTouchpadDebugViewController = touchpadVisualizer() ? new TouchpadDebugViewController(mContext, injector.getLooper(), this) : null; mBatteryController = new BatteryController(mContext, mNative, injector.getLooper(), injector.getUEventManager()); mSysfsNodeMonitor = new SysfsNodeMonitor(mContext, mNative, injector.getLooper(), Loading Loading @@ -2392,14 +2394,18 @@ public class InputManagerService extends IInputManager.Stub // Native callback. @SuppressWarnings("unused") private void notifyTouchpadHardwareState(TouchpadHardwareState hardwareStates, int deviceId) { if (mTouchpadDebugViewController != null) { mTouchpadDebugViewController.updateTouchpadHardwareState(hardwareStates, deviceId); } } // Native callback. @SuppressWarnings("unused") private void notifyTouchpadGestureInfo(int type, int deviceId) { if (mTouchpadDebugViewController != null) { mTouchpadDebugViewController.updateTouchpadGestureInfo(type, deviceId); } } // Native callback. @SuppressWarnings("unused") Loading Loading @@ -3978,8 +3984,10 @@ public class InputManagerService extends IInputManager.Stub void updateTouchpadVisualizerEnabled(boolean enabled) { mNative.setShouldNotifyTouchpadHardwareState(enabled); if (mTouchpadDebugViewController != null) { mTouchpadDebugViewController.updateTouchpadVisualizerEnabled(enabled); } } void updatePointerLocationEnabled(boolean enabled) { mWindowManagerCallbacks.notifyPointerLocationChanged(enabled); Loading