From 9d20909eaed9a8eae2ee73827bc15b1353e2dd8b Mon Sep 17 00:00:00 2001 From: Jeff DeCew Date: Thu, 21 Jul 2022 16:15:11 +0000 Subject: Fix Notification redaction when power cycling a non-dozing device while occluded. This issue was originally raised in the S timeline, but had already been fixed by the refactor to use UnlockedScreenOffAnimationController, which called updateIsKeyguard(/*force*/ true) from onFinishedWakingUp(). This solved the problem of re-triggering the redaction, but it also intriduced a new bug where the keyguard could end up briefly showing on top of the occluding activity when AOD was supported but off. As a result, they limited the call to when the AOD was on (and animations were controlling, etc). This CL uses the opposite check to make sure we recalcualte redaction (and only redaction, not the whole keyguard) when waking up while occluded. We also needed to make sure that we rerun the notification pipeline when updating public information so that any necessary public views are sure to inflate. That rerun has been limited in scope to conditions where the public mode information has detectably changed. Bug: 189575031 Bug: 239828798 Test: CTS Verifier NotificationPrivacyTest on emulator, AOD off, AOD on Merged-In: I95443ee6b77377aceb54b983d34131628027da9b Change-Id: I95443ee6b77377aceb54b983d34131628027da9b --- .../stack/NotificationStackScrollLayoutController.java | 7 +++++++ .../src/com/android/systemui/statusbar/phone/StatusBar.java | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java index 3ceb655b1c0c..b1bea769cd14 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayoutController.java @@ -328,6 +328,13 @@ public class NotificationStackScrollLayoutController { } }; + /** + * Recalculate sensitiveness without animation; called when waking up while keyguard occluded. + */ + public void updateSensitivenessForOccludedWakeup() { + mView.updateSensitiveness(false, mLockscreenUserManager.isAnyProfilePublicMode()); + } + /** * Set the overexpansion of the panel to be applied to the view. */ diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java index 871fb019521f..6aee09ca1755 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -4159,6 +4159,17 @@ public class StatusBar extends SystemUI implements DemoMode, mWakeUpCoordinator.setFullyAwake(true); mBypassHeadsUpNotifier.setFullyAwake(true); mWakeUpCoordinator.setWakingUp(false); + if (isOccluded() && !mDozeParameters.canControlUnlockedScreenOff()) { + // When the keyguard is occluded we don't use the KEYGUARD state which would + // normally cause these redaction updates. If AOD is on, the KEYGUARD state is used + // to show the doze, AND UnlockedScreenOffAnimationController.onFinishedWakingUp() + // would force a KEYGUARD state that would take care of recalculating redaction. + // So if AOD is off or unsupported we need to trigger these updates at screen on + // when the keyguard is occluded. + mLockscreenUserManager.updatePublicMode(); + mNotificationPanelViewController.getNotificationStackScrollLayoutController() + .updateSensitivenessForOccludedWakeup(); + } if (mLaunchCameraWhenFinishedWaking) { mNotificationPanelViewController.launchCamera( false /* animate */, mLastCameraLaunchSource); -- cgit v1.2.3-59-g8ed1b