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

Commit 897c4c51 authored by Vaibhav Devmurari's avatar Vaibhav Devmurari Committed by Android (Google) Code Review
Browse files

Merge "Fix NPE in TouchpadDebugViewController" into main

parents ef03d144 3556310b
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -55,15 +55,17 @@ public class TouchpadDebugViewController implements InputManager.InputDeviceList

    @Override
    public void onInputDeviceAdded(int deviceId) {
        if (!mTouchpadVisualizerEnabled) {
            return;
        }
        final InputManager inputManager = Objects.requireNonNull(
                mContext.getSystemService(InputManager.class));
        InputDevice inputDevice = inputManager.getInputDevice(deviceId);

        if (Objects.requireNonNull(inputDevice).supportsSource(
                InputDevice.SOURCE_TOUCHPAD | InputDevice.SOURCE_MOUSE)
                && mTouchpadVisualizerEnabled) {
            showDebugView(deviceId);
        if (inputDevice == null || !inputDevice.supportsSource(
                InputDevice.SOURCE_TOUCHPAD | InputDevice.SOURCE_MOUSE)) {
            return;
        }
        showDebugView(deviceId);
    }

    @Override