Fix trackpad check

Bug: 282884621
Test: edge click on a trackpad doesn't trigger back; edge click with a mouse does
Change-Id: Id988517e115611161e8eb25f695a37631112338c
This commit is contained in:
Tracy Zhou
2023-06-08 19:09:46 -07:00
parent e1467ef54d
commit 2939d1dedf

View File

@@ -1136,7 +1136,8 @@ public class EdgeBackGestureHandler implements PluginListener<NavigationEdgeBack
private boolean isButtonPressFromTrackpad(MotionEvent ev) {
// We don't allow back for button press from the trackpad, and yet we do with a mouse.
int sources = InputManager.getInstance().getInputDevice(ev.getDeviceId()).getSources();
return (sources & (SOURCE_MOUSE | SOURCE_TOUCHPAD)) == sources && ev.getButtonState() != 0;
int sourceTrackpad = (SOURCE_MOUSE | SOURCE_TOUCHPAD);
return (sources & sourceTrackpad) == sourceTrackpad && ev.getButtonState() != 0;
}
private void dispatchToBackAnimation(MotionEvent event) {