Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd9f92d3 authored by Harry Cutts's avatar Harry Cutts
Browse files

input: clean up touchpad visualizer flag

This launched in Android 16, so we can safely clean it up now.

Bug: 388224751
Test: connect a touchpad, turn the "Show touchpad input" dev. option
      on, check the visualization works, and turn it off again.
Flag: EXEMPT removing com.android.hardware.input.touchpad_visualizer
Change-Id: Ib2112b7aa4c0f95ba56c30cc7e033d01ac8098f3
parent 9e5db705
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ 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;

@@ -434,15 +433,6 @@ 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.
     *
@@ -495,9 +485,6 @@ 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;
    }
@@ -512,9 +499,6 @@ 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);
    }
+0 −7
Original line number Diff line number Diff line
@@ -20,13 +20,6 @@ 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"
+6 −14
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ 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;
@@ -348,7 +347,7 @@ public class InputManagerService extends IInputManager.Stub
    // Monitors any changes to the sysfs nodes when an input device is connected.
    private final SysfsNodeMonitor mSysfsNodeMonitor;

    @Nullable
    @NonNull
    private final TouchpadDebugViewController mTouchpadDebugViewController;

    // Manages Keyboard backlight
@@ -545,9 +544,8 @@ public class InputManagerService extends IInputManager.Stub
        mSettingsObserver = new InputSettingsObserver(mContext, mHandler, this, mNative);
        mKeyboardLayoutManager = new KeyboardLayoutManager(mContext, mNative, mDataStore,
                injector.getLooper());
        mTouchpadDebugViewController =
                touchpadVisualizer() ? new TouchpadDebugViewController(mContext,
                        injector.getLooper(), this) : null;
        mTouchpadDebugViewController = new TouchpadDebugViewController(mContext,
                injector.getLooper(), this);
        mBatteryController = new BatteryController(mContext, mNative, injector.getLooper(),
                injector.getUEventManager());
        mSysfsNodeMonitor = new SysfsNodeMonitor(mContext, mNative, injector.getLooper(),
@@ -2394,18 +2392,14 @@ 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")
@@ -3984,10 +3978,8 @@ 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);