From ee7dd0568890548323a6f656df6576a423691ebd Mon Sep 17 00:00:00 2001 From: Xiyuan Xia Date: Fri, 15 May 2015 09:46:27 -0700 Subject: [PATCH] Abort swipe up gesture when long press is detected When home button long press is detected, swipe up gesture on nav bar should be aborted as well since both are targeted to start assist. Bug:20500672 Change-Id: Ifbc9a8f0692334c9764205e5ecfac47577ae03f6 --- .../com/android/systemui/statusbar/DelegateViewHelper.java | 7 +++++++ .../systemui/statusbar/phone/NavigationBarView.java | 5 +++++ .../android/systemui/statusbar/phone/PhoneStatusBar.java | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java index 9e2207e7da503..2dc521e68323e 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java @@ -105,6 +105,13 @@ public class DelegateViewHelper { return mPanelShowing; } + public void abortCurrentGesture() { + if (mStarted) { + mStarted = false; + mBar.setInteracting(StatusBarManager.WINDOW_NAVIGATION_BAR, false); + } + } + public void setSourceView(View view) { mSourceView = view; if (mSourceView != null) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java index 7077a17f00df5..1dec2273f4393 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -245,6 +245,11 @@ public class NavigationBarView extends LinearLayout { return intercept; } + public void abortCurrentGesture() { + mDelegateHelper.abortCurrentGesture(); + getHomeButton().abortCurrentGesture(); + } + private H mHandler = new H(); public View getCurrentView() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index f983f58061c7a..68ae057388a56 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1012,7 +1012,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, invokeAssistGesture(true /* vibrate */); awakenDreams(); if (mNavigationBarView != null) { - mNavigationBarView.getHomeButton().abortCurrentGesture(); + mNavigationBarView.abortCurrentGesture(); } } };