From c59a23fb1b1ff7c533c220a2464d46ed43f61a1b Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Tue, 24 May 2016 14:53:36 -0700 Subject: [PATCH] Make navigation bar always slippery Bug: 28939265 Change-Id: I47270e4e3a30d39580e700bc40ca172f62ab511d --- .../statusbar/phone/NavigationBarView.java | 20 ------------------- .../statusbar/phone/PhoneStatusBar.java | 8 +++----- 2 files changed, 3 insertions(+), 25 deletions(-) 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 5fab796921353..53fe6ce3efa97 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java @@ -380,10 +380,6 @@ public class NavigationBarView extends LinearLayout { && ((mNavigationIconHints & StatusBarManager.NAVIGATION_HINT_BACK_ALT) == 0); final boolean disableSearch = ((disabledFlags & View.STATUS_BAR_DISABLE_SEARCH) != 0); - if (SLIPPERY_WHEN_DISABLED) { - setSlippery(disableHome && disableRecent && disableBack && disableSearch); - } - ViewGroup navButtons = (ViewGroup) getCurrentView().findViewById(R.id.nav_buttons); if (navButtons != null) { LayoutTransition lt = navButtons.getLayoutTransition(); @@ -458,22 +454,6 @@ public class NavigationBarView extends LinearLayout { } } - public void setSlippery(boolean newSlippery) { - WindowManager.LayoutParams lp = (WindowManager.LayoutParams) getLayoutParams(); - if (lp != null) { - boolean oldSlippery = (lp.flags & WindowManager.LayoutParams.FLAG_SLIPPERY) != 0; - if (!oldSlippery && newSlippery) { - lp.flags |= WindowManager.LayoutParams.FLAG_SLIPPERY; - } else if (oldSlippery && !newSlippery) { - lp.flags &= ~WindowManager.LayoutParams.FLAG_SLIPPERY; - } else { - return; - } - WindowManager wm = (WindowManager)getContext().getSystemService(Context.WINDOW_SERVICE); - wm.updateViewLayout(this, lp); - } - } - public void setMenuVisibility(final boolean show) { setMenuVisibility(show, false); } 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 073994f8a5cec..530e6f57d6732 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1356,7 +1356,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE | WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH - | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH, + | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH + | WindowManager.LayoutParams.FLAG_SLIPPERY, PixelFormat.TRANSLUCENT); // this will allow the navbar to run in an overlay on devices that support this if (ActivityManager.isHighEndGfx()) { @@ -2526,8 +2527,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, } mExpandedVisible = true; - if (mNavigationBarView != null) - mNavigationBarView.setSlippery(true); // Expand the window to encompass the full screen in anticipation of the drag. // This is only possible to do atomically because the status bar is at the top of the screen! @@ -2661,8 +2660,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode, mNotificationPanel.closeQs(); mExpandedVisible = false; - if (mNavigationBarView != null) - mNavigationBarView.setSlippery(false); + visibilityChanged(false); // Shrink the window to the size of the status bar only