From e2cf85a2f3e22bc84ba1f4d4450b9c0471c38f12 Mon Sep 17 00:00:00 2001 From: Pavel Grafov Date: Fri, 17 May 2019 13:11:01 +0100 Subject: [PATCH] Update notification redacted state for profile. Put back two missing bits of logic relevant for managed profiles: 1. Update user's public mode when work challenge is unlocked. 2. Update notifications when public mode changes. This ensures that redacted notifications become readable again when work profile challenge is unlocked. Test: manual, using Hangouts in a profile with separate lock Bug: 128896361 Change-Id: I0aad2df233c8e3f2820dbe69230ba0897ab45ab1 --- .../statusbar/NotificationLockscreenUserManagerImpl.java | 1 + .../src/com/android/systemui/statusbar/phone/StatusBar.java | 1 - .../systemui/statusbar/phone/StatusBarRemoteInputCallback.java | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java index d8070cdf53d58..5d4172dcc68af 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java @@ -525,6 +525,7 @@ public class NotificationLockscreenUserManagerImpl implements setLockscreenPublicMode(isProfilePublic, userId); mUsersWithSeperateWorkChallenge.put(userId, needsSeparateChallenge); } + getEntryManager().updateNotifications(); } @Override 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 3146595f35927..28b673fc85cc9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java @@ -3133,7 +3133,6 @@ public class StatusBar extends SystemUI implements DemoMode, // If the state didn't change, we may still need to update public mode mLockscreenUserManager.updatePublicMode(); - mEntryManager.updateNotifications(); } if (mStatusBarStateController.leaveOpenOnKeyguardHide()) { if (!mStatusBarStateController.isKeyguardRequested()) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java index 0865eb6ae7d29..6691f7a759f3c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarRemoteInputCallback.java @@ -111,6 +111,7 @@ public class StatusBarRemoteInputCallback implements Callback, Callbacks, } protected void onWorkChallengeChanged() { + mLockscreenUserManager.updatePublicMode(); if (mPendingWorkRemoteInputView != null && !mLockscreenUserManager.isAnyProfilePublicMode()) { // Expand notification panel and the notification row, then click on remote input view