From baa47b62270bea903634c81d4ab70fe1f3365763 Mon Sep 17 00:00:00 2001 From: Fabian Kozynski Date: Fri, 26 Apr 2019 15:40:43 -0400 Subject: [PATCH] Fix pressing back on bouncer If the user goes back when on Bouncer, do not animate the panel up. In particular, DO NOT just animate the header out. Additionally, only reset the bouncer if it's scrimmed and not needFullScreen. Test: manual, use flow of b/130525889 Test: swipe up in Keyguard and press back goes back to keyguard Test: Expand shade and press Reply on notification, going back on bouncer shows expanded shade Test: Open camera, open gallery, going back on bouncer goes back to camera Test: SIM card bouncer, going back does not break Fixes: 130525889 Change-Id: I122cf0858acbfdaa514efb32190369d95df6e001 --- .../systemui/statusbar/phone/NotificationPanelView.java | 6 +++++- .../statusbar/phone/StatusBarKeyguardViewManager.java | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index 1194a1d7b3f29..d52180993b336 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -1316,7 +1316,11 @@ public class NotificationPanelView extends PanelView implements } else if (oldState == StatusBarState.SHADE_LOCKED && statusBarState == StatusBarState.KEYGUARD) { animateKeyguardStatusBarIn(StackStateAnimator.ANIMATION_DURATION_STANDARD); - mQs.animateHeaderSlidingOut(); + // Only animate header if the header is visible. If not, it will partially animate out + // the top of QS + if (!mQsExpanded) { + mQs.animateHeaderSlidingOut(); + } } else { mKeyguardStatusBar.setAlpha(1f); mKeyguardStatusBar.setVisibility(keyguardShowing ? View.VISIBLE : View.INVISIBLE); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index ce432534c1bc5..d6a571b11d9ba 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -662,7 +662,13 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb public boolean onBackPressed(boolean hideImmediately) { if (mBouncer.isShowing()) { mStatusBar.endAffordanceLaunch(); - reset(hideImmediately); + // The second condition is for SIM card locked bouncer + if (mBouncer.isScrimmed() && !mBouncer.needsFullscreenBouncer()) { + hideBouncer(false); + updateStates(); + } else { + reset(hideImmediately); + } return true; } return false;