NPE in isTrackpadDevice

Bug: 285628328
Test: atest inputflinger_tests
Change-Id: I136ee119fdd85cbdcd37f48c42f421f67f5f9e9d
This commit is contained in:
Tracy Zhou
2023-06-03 13:04:30 -07:00
parent 407c2828c3
commit 1cd7bd3db6

View File

@@ -885,6 +885,9 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
private boolean isTrackpadDevice(int deviceId) {
InputDevice inputDevice = mInputManager.getInputDevice(deviceId);
if (inputDevice == null) {
return false;
}
return inputDevice.getSources() == (InputDevice.SOURCE_MOUSE
| InputDevice.SOURCE_TOUCHPAD);
}