From e5c06a6431f8d87b5fd33f15d8078c42712376a9 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Tue, 9 Sep 2014 18:02:06 +0200 Subject: [PATCH] Fixing issue with touch events not being forwarded to task switch fling detector. (Bug 16656169) Change-Id: Id8f96455f6e11a13a8ac12d341464bca4419d7c5 --- .../phone/NavigationBarViewTaskSwitchHelper.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarViewTaskSwitchHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarViewTaskSwitchHelper.java index b633453e7e591..79bb1cd2a5710 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarViewTaskSwitchHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarViewTaskSwitchHelper.java @@ -31,7 +31,6 @@ public class NavigationBarViewTaskSwitchHelper extends GestureDetector.SimpleOnG private final GestureDetector mTaskSwitcherDetector; private final int mScrollTouchSlop; private final int mMinFlingVelocity; - private boolean mInterceptTouches; private int mTouchDownX; private int mTouchDownY; @@ -56,11 +55,11 @@ public class NavigationBarViewTaskSwitchHelper extends GestureDetector.SimpleOnG // task switcher detector mTaskSwitcherDetector.onTouchEvent(event); int action = event.getAction(); + boolean interceptTouches = false; switch (action & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: { mTouchDownX = (int) event.getX(); mTouchDownY = (int) event.getY(); - mInterceptTouches = false; break; } case MotionEvent.ACTION_MOVE: { @@ -72,21 +71,19 @@ public class NavigationBarViewTaskSwitchHelper extends GestureDetector.SimpleOnG ? xDiff > mScrollTouchSlop && xDiff > yDiff : yDiff > mScrollTouchSlop && yDiff > xDiff; if (exceededTouchSlop) { - mInterceptTouches = true; + interceptTouches = true; return true; } break; } case MotionEvent.ACTION_CANCEL: case MotionEvent.ACTION_UP: - mInterceptTouches = false; break; } - return mInterceptTouches; + return interceptTouches; } public boolean onTouchEvent(MotionEvent event) { - if (!mInterceptTouches) return false; return mTaskSwitcherDetector.onTouchEvent(event); }