Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cee74782 authored by András Kurucz's avatar András Kurucz
Browse files

[flexiglass] Refresh NSSL sensitivity, when the Lockscreen public mode changes

NSSL decides whether it should treat sensitive content differently based
on the AmbientState#isHideSensitive() flag. This flag depends on whether
we have any user profiles in public mode. We don't have a fix callback
to the user profiles for such a change. Instead we query their public
states after various events, when the user profiles might have been
locked/unlocked. These triggers are StatusBarState changes, and the end
of certain animations eg. ScreenLifecycle#onScreenTurnedOff().
With Flexiglass the timing for some of these callbacks have changed, and
we've started triggering a code path, which updates the user profile
public modes without checking whether the NSSL sensitiveness needs
to be refreshed. This caused us to show the private layout of
Notifications until the first user interaction on the Lockscreen.

Bug: 379825109
Test:  lock the device -> notificatins are showing their sensitive content
Flag: com.android.systemui.scene_container

Change-Id: Id6f3daf0f6cf9435f48eb5e5cf73b8a843c3e3b2
parent dee733bc
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -429,9 +429,10 @@ public class NotificationStackScrollLayoutController implements Dumpable {
    };

    /**
     * Recalculate sensitiveness without animation; called when waking up while keyguard occluded.
     * Recalculate sensitiveness without animation; called when waking up while keyguard occluded,
     * or whenever we update the Lockscreen public mode.
     */
    public void updateSensitivenessForOccludedWakeup() {
    public void updateSensitivenessWithoutAnimation() {
        updateSensitivenessWithAnimation(false);
    }

+4 −1
Original line number Diff line number Diff line
@@ -2234,6 +2234,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {

            // If the state didn't change, we may still need to update public mode
            mLockscreenUserManager.updatePublicMode();
            if (SceneContainerFlag.isEnabled()) {
                mStackScrollerController.updateSensitivenessWithoutAnimation();
            }
        }
        if (mStatusBarStateController.leaveOpenOnKeyguardHide()) {
            if (!mStatusBarStateController.isKeyguardRequested()) {
@@ -2681,7 +2684,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces {
                // So if AOD is off or unsupported we need to trigger these updates at screen on
                // when the keyguard is occluded.
                mLockscreenUserManager.updatePublicMode();
                mStackScrollerController.updateSensitivenessForOccludedWakeup();
                mStackScrollerController.updateSensitivenessWithoutAnimation();
            }
            if (mLaunchCameraWhenFinishedWaking) {
                startLaunchTransitionTimeout();