From 8a66e69242653f020d3e92701c89ad040a3754e4 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Mon, 29 Jul 2019 18:38:12 -0700 Subject: [PATCH] Unset the notification expansion state when fully hidden If the bouncer is showing after dragging down with locked notifications and the screen locked, the visibleForExpansion state wasn't properly reset. Even though we don't ask for the bouncer when bypassing anymore, we're adding a safeguard in case we change out minds. Whenever the notifications are fully hidden, we unset the visibleForExpansion state. Fixes: 138261144 Test: drag down with bypass on, redaction and enforcing bouncer, turn off, then reach. No shelf should be visible Change-Id: I2d237ce67da0e8fd3bf9e8d40e146f3a478ac5ce --- .../notification/NotificationWakeUpCoordinator.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt index 6a3816c50330f..cd82483690a6b 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationWakeUpCoordinator.kt @@ -122,6 +122,17 @@ class NotificationWakeUpCoordinator @Inject constructor( mHeadsUpManagerPhone.addListener(this) statusBarStateController.addCallback(this) mDozeParameters = DozeParameters.getInstance(mContext) + addListener(object : WakeUpListener { + override fun onFullyHiddenChanged(isFullyHidden: Boolean) { + if (isFullyHidden && mNotificationsVisibleForExpansion) { + // When the notification becomes fully invisible, let's make sure our expansion + // flag also changes. This can happen if the bouncer shows when dragging down + // and then the screen turning off, where we don't reset this state. + setNotificationsVisibleForExpansion(visible = false, animate = false, + increaseSpeed = false) + } + } + }); } fun setStackScroller(stackScroller: NotificationStackScrollLayout) {