From b4238e0c59d8e1890f7752934bdf4d52fa89bf1b Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Mon, 14 May 2012 15:26:20 -0700 Subject: [PATCH] Fix 6483412: Disable search from navbar while SUW is running This fixes a problem where navbar gestures were enabled during SetupWizard. There's no clear signal for handling this in StatusBar since there are a number of flags that we might use to determine the availability of the search gesture. However, the UI design generally calls for the gesture to be available when the home button is visible, so I think it makes sense to start with that and enable others as we encounter issues. Change-Id: I7b37964ae5b51bf803d5808605f1afe694a88464 --- .../SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java | 2 +- .../src/com/android/systemui/statusbar/DelegateViewHelper.java | 2 +- .../src/com/android/systemui/statusbar/phone/PhoneStatusBar.java | 4 ++-- .../src/com/android/systemui/statusbar/tablet/TabletStatusBar.java | 5 +++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index a44279a33153..02e9bd7dd76f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -751,7 +751,7 @@ public abstract class BaseStatusBar extends SystemUI implements protected abstract void tick(IBinder key, StatusBarNotification n, boolean firstTime); protected abstract void updateExpandedViewPos(int expandedPosition); protected abstract int getExpandedViewMaxHeight(); - protected abstract boolean isStatusBarExpanded(); + protected abstract boolean shouldDisableNavbarGestures(); protected boolean isTopNotification(ViewGroup parent, NotificationData.Entry entry) { return parent.indexOfChild(entry.row) == 0; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java b/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java index 912a1659b181..0e6dfd502475 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/DelegateViewHelper.java @@ -53,7 +53,7 @@ public class DelegateViewHelper { } public boolean onInterceptTouchEvent(MotionEvent event) { - if (mBar.isStatusBarExpanded()) { + if (mBar.shouldDisableNavbarGestures()) { return false; } switch (event.getAction()) { 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 612239026576..097906fad7bf 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -2111,8 +2111,8 @@ public class PhoneStatusBar extends BaseStatusBar { } @Override - protected boolean isStatusBarExpanded() { - return mExpanded; + protected boolean shouldDisableNavbarGestures() { + return mExpanded || (mDisabled & StatusBarManager.DISABLE_HOME) != 0; } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java index a2c763728905..c8d332739ed5 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -1620,8 +1620,9 @@ public class TabletStatusBar extends BaseStatusBar implements } @Override - protected boolean isStatusBarExpanded() { - return mNotificationPanel.getVisibility() == View.VISIBLE; + protected boolean shouldDisableNavbarGestures() { + return mNotificationPanel.getVisibility() == View.VISIBLE + || (mDisabled & StatusBarManager.DISABLE_HOME) != 0; } } -- 2.11.0