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

Commit 1cd7bd3d authored by Tracy Zhou's avatar Tracy Zhou
Browse files

NPE in isTrackpadDevice

Bug: 285628328
Test: atest inputflinger_tests
Change-Id: I136ee119fdd85cbdcd37f48c42f421f67f5f9e9d
parent 407c2828
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -885,6 +885,9 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack


    private boolean isTrackpadDevice(int deviceId) {
    private boolean isTrackpadDevice(int deviceId) {
        InputDevice inputDevice = mInputManager.getInputDevice(deviceId);
        InputDevice inputDevice = mInputManager.getInputDevice(deviceId);
        if (inputDevice == null) {
            return false;
        }
        return inputDevice.getSources() == (InputDevice.SOURCE_MOUSE
        return inputDevice.getSources() == (InputDevice.SOURCE_MOUSE
                | InputDevice.SOURCE_TOUCHPAD);
                | InputDevice.SOURCE_TOUCHPAD);
    }
    }