From bd09f730bac4e47cd14585966d536ab0a89231f5 Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Tue, 17 May 2022 09:47:51 -0400 Subject: [PATCH] Fix screen off after panel expansion While unlocked, when the panel was expanded the DozeParameters#shouldControlScreenOff was not properly getting reset after the panel was collapsed. This was leading to overlapping animations as the panel state changed. The panel change event that DozeParameters cares about originates in NotificationPanelViewController so make sure the check in UnlockedScreenOffAnimation uses this same field, and not the one in PanelViewController, which may have a different value. Fixes: 203644049 Test: manual (unlock/lock over and over and over ...) Change-Id: Iaa357eed4afae53f8f96995c570b5df1a83c8123 --- .../statusbar/phone/NotificationPanelViewController.java | 7 ++++++- .../phone/UnlockedScreenOffAnimationController.kt | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index 075df1a28b11c..3194f5ace2bf4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -3037,10 +3037,11 @@ public class NotificationPanelViewController extends PanelViewController { private void updatePanelExpanded() { boolean isExpanded = !isFullyCollapsed() || mExpectingSynthesizedDown; if (mPanelExpanded != isExpanded) { + mPanelExpanded = isExpanded; + mHeadsUpManager.setIsPanelExpanded(isExpanded); mStatusBarTouchableRegionManager.setPanelExpanded(isExpanded); mCentralSurfaces.setPanelExpanded(isExpanded); - mPanelExpanded = isExpanded; if (!isExpanded && mQs != null && mQs.isCustomizing()) { mQs.closeCustomizer(); @@ -3048,6 +3049,10 @@ public class NotificationPanelViewController extends PanelViewController { } } + boolean isPanelExpanded() { + return mPanelExpanded; + } + private int calculatePanelHeightShade() { final int maxHeight = mNotificationStackScrollLayoutController.getHeight(); if (mBarState == KEYGUARD) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt index b11751554db37..d058b75fd1b11 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt @@ -313,7 +313,7 @@ class UnlockedScreenOffAnimationController @Inject constructor( // already expanded and showing notifications/QS, the animation looks really messy. For now, // disable it if the notification panel is expanded. if ((!this::mCentralSurfaces.isInitialized || - mCentralSurfaces.notificationPanelViewController.isExpanded) && + mCentralSurfaces.notificationPanelViewController.isPanelExpanded) && // Status bar might be expanded because we have started // playing the animation already !isAnimationPlaying()