Avoid tons of redundant calls to InputEvent.getSource()

This commit is contained in:
Cameron Gutman committed 2021-07-17 14:01:12 -05:00
1 parent 5350651d6f
commit 04545ecbb0
2 files changed
+20 -16

No files matched your search

@@ -41,8 +41,9 @@ public class AndroidNativePointerCaptureProvider extends AndroidPointerIconCaptu
// SOURCE_MOUSE_RELATIVE is how SOURCE_MOUSE appears when our view has pointer capture.
// SOURCE_TOUCHPAD will have relative axes populated iff our view has pointer capture.
// See https://developer.android.com/reference/android/view/View#requestPointerCapture()
return event.getSource() == InputDevice.SOURCE_MOUSE_RELATIVE ||
(event.getSource() == InputDevice.SOURCE_TOUCHPAD && targetView.hasPointerCapture());
int eventSource = event.getSource();
return eventSource == InputDevice.SOURCE_MOUSE_RELATIVE ||
(eventSource == InputDevice.SOURCE_TOUCHPAD && targetView.hasPointerCapture());
}
@Override