From 5ac67f9a18348720512d96c2df308b58159301df Mon Sep 17 00:00:00 2001 From: Josh Tsuji Date: Tue, 1 Mar 2022 14:10:10 -0500 Subject: [PATCH] Don't collapse the panel post launch if we went back to sleep. This manages to call through to PowerManager#wakeUp. If you press the power button to sleep the device during an app launch, this will then wake up the device and show the bouncer, but in a weird state with no scrim. Bug: 220907477 Test: manual Change-Id: I7470cfd69cc27458dfed3c5b68fc0c4ef69ae55d --- .../android/systemui/statusbar/phone/CentralSurfaces.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java index 5642744d3390a..de2346aab2047 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java @@ -1870,7 +1870,13 @@ public class CentralSurfaces extends CoreStartable implements if (!mPresenter.isCollapsing()) { onClosingFinished(); } - if (launchIsFullScreen) { + + // Collapse the panel if we're launching in fullscreen, over the lockscreen. Do not do this + // if the device has gone back to sleep - through a horrific chain of 15 or so function + // calls, instantCollapseNotificationPanel will eventually call through to + // StatusBar#wakeUpIfDozing, which will wake the device up even if it was put to sleep + // during the launch animation. + if (launchIsFullScreen && mPowerManager.isInteractive()) { instantCollapseNotificationPanel(); } }