Skip to content

Commit d5ef546

Browse files
author
John Spurlock
committed
NavBar: Slippery on the unsecured lock screen.
The NavBar is always non-slippery, except when: - the notification shade is showing - the 3 buttons (back,home,recents) are disabled Also fix unrelated bug that ignored the "show panel delay" before the first config change. Bug: 6614842 Change-Id: Ib40adaef122b563809398fdebbd8a88d8f0c7ffd
1 parent c07dc74 commit d5ef546

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,28 @@ public void setDisabledFlags(int disabledFlags, boolean force) {
225225
final boolean disableRecent = ((disabledFlags & View.STATUS_BAR_DISABLE_RECENT) != 0);
226226
final boolean disableBack = ((disabledFlags & View.STATUS_BAR_DISABLE_BACK) != 0);
227227

228+
setSlippery(disableHome && disableRecent && disableBack);
229+
228230
getBackButton() .setVisibility(disableBack ? View.INVISIBLE : View.VISIBLE);
229231
getHomeButton() .setVisibility(disableHome ? View.INVISIBLE : View.VISIBLE);
230232
getRecentsButton().setVisibility(disableRecent ? View.INVISIBLE : View.VISIBLE);
231233
}
232234

235+
public void setSlippery(boolean newSlippery) {
236+
WindowManager.LayoutParams lp = (WindowManager.LayoutParams) getLayoutParams();
237+
if (lp != null) {
238+
boolean oldSlippery = (lp.flags & WindowManager.LayoutParams.FLAG_SLIPPERY) != 0;
239+
if (!oldSlippery && newSlippery) {
240+
lp.flags |= WindowManager.LayoutParams.FLAG_SLIPPERY;
241+
} else if (oldSlippery && !newSlippery) {
242+
lp.flags &= ~WindowManager.LayoutParams.FLAG_SLIPPERY;
243+
} else {
244+
return;
245+
}
246+
WindowManagerImpl.getDefault().updateViewLayout(this, lp);
247+
}
248+
}
249+
233250
public void setMenuVisibility(final boolean show) {
234251
setMenuVisibility(show, false);
235252
}

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

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,8 @@ public boolean onTouch(View v, MotionEvent event) {
376376
mIntruderAlertView.setBar(this);
377377
}
378378

379+
updateShowSearchHoldoff();
380+
379381
mStatusBarView.mService = this;
380382

381383
mChoreographer = Choreographer.getInstance();
@@ -663,7 +665,6 @@ private WindowManager.LayoutParams getNavigationBarLayoutParams() {
663665

664666
lp.setTitle("NavigationBar");
665667
lp.windowAnimations = 0;
666-
667668
return lp;
668669
}
669670

@@ -808,8 +809,12 @@ public void removeNotification(IBinder key) {
808809
@Override
809810
protected void onConfigurationChanged(Configuration newConfig) {
810811
updateRecentsPanel();
811-
mShowSearchHoldoff = mContext.getResources().getInteger(
812-
R.integer.config_show_search_delay);
812+
updateShowSearchHoldoff();
813+
}
814+
815+
private void updateShowSearchHoldoff() {
816+
mShowSearchHoldoff = mContext.getResources().getInteger(
817+
R.integer.config_show_search_delay);
813818
}
814819

815820
private void loadNotificationShade() {
@@ -1174,7 +1179,8 @@ private void makeExpandedVisible(boolean revealAfterDraw) {
11741179

11751180
mExpandedVisible = true;
11761181
mPile.setLayoutTransitionsEnabled(true);
1177-
makeSlippery(mNavigationBarView, true);
1182+
if (mNavigationBarView != null)
1183+
mNavigationBarView.setSlippery(true);
11781184

11791185
updateCarrierLabelVisibility(true);
11801186

@@ -1198,19 +1204,6 @@ private void makeExpandedVisible(boolean revealAfterDraw) {
11981204
visibilityChanged(true);
11991205
}
12001206

1201-
private static void makeSlippery(View view, boolean slippery) {
1202-
if (view == null) {
1203-
return;
1204-
}
1205-
WindowManager.LayoutParams lp = (WindowManager.LayoutParams) view.getLayoutParams();
1206-
if (slippery) {
1207-
lp.flags |= WindowManager.LayoutParams.FLAG_SLIPPERY;
1208-
} else {
1209-
lp.flags &= ~WindowManager.LayoutParams.FLAG_SLIPPERY;
1210-
}
1211-
WindowManagerImpl.getDefault().updateViewLayout(view, lp);
1212-
}
1213-
12141207
public void animateExpand() {
12151208
if (SPEW) Slog.d(TAG, "Animate expand: expanded=" + mExpanded);
12161209
if ((mDisabled & StatusBarManager.DISABLE_EXPAND) != 0) {
@@ -1295,8 +1288,9 @@ void performCollapse() {
12951288
}
12961289
mExpandedVisible = false;
12971290
mPile.setLayoutTransitionsEnabled(false);
1291+
if (mNavigationBarView != null)
1292+
mNavigationBarView.setSlippery(false);
12981293
visibilityChanged(false);
1299-
makeSlippery(mNavigationBarView, false);
13001294

13011295
// Shrink the window to the size of the status bar only
13021296
WindowManager.LayoutParams lp = (WindowManager.LayoutParams) mStatusBarWindow.getLayoutParams();

0 commit comments

Comments
 (0)