OSDN Git Service

Prevent 2nd action down motionevent on nav bar press
authorMatthew Ng <ngmatthew@google.com>
Thu, 25 Jan 2018 01:01:08 +0000 (17:01 -0800)
committerMatthew Ng <ngmatthew@google.com>
Fri, 26 Jan 2018 22:08:53 +0000 (14:08 -0800)
Since motions events are proxied to launcher on intercept and on touch,
when user touches it used to send both. Prevent the action down proxy
event onTouchEvent will only send one touch event if nothing else
handles it.

Bug: 67957962
Test: manual
Change-Id: Ia2a6bfe6cd963f9383a1468f5ba64dc28005a394

packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarGestureHelper.java

index 0954fd0..0d36efd 100644 (file)
@@ -308,8 +308,13 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture
     }
 
     public boolean onTouchEvent(MotionEvent event) {
+        // The same down event was just sent on intercept and therefore can be ignored here
+        boolean ignoreProxyDownEvent = event.getAction() == MotionEvent.ACTION_DOWN
+                && mOverviewEventSender.getProxy() != null;
         boolean result = mStatusBar.isPresenterFullyCollapsed()
-                && (mQuickScrubController.onTouchEvent(event) || proxyMotionEvents(event));
+                && (mQuickScrubController.onTouchEvent(event)
+                || ignoreProxyDownEvent
+                || proxyMotionEvents(event));
         if (mDockWindowEnabled) {
             result |= handleDockWindowEvent(event);
         }