summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java
index 5d4172dcc68a..905a8e68f3d1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java
@@ -513,14 +513,11 @@ public class NotificationLockscreenUserManagerImpl implements
boolean isProfilePublic = devicePublic;
boolean needsSeparateChallenge = mLockPatternUtils.isSeparateProfileChallengeEnabled(
userId);
- if (!devicePublic && userId != getCurrentUserId()) {
- // We can't rely on KeyguardManager#isDeviceLocked() for unified profile challenge
- // due to a race condition where this code could be called before
- // TrustManagerService updates its internal records, resulting in an incorrect
- // state being cached in mLockscreenPublicMode. (b/35951989)
- if (needsSeparateChallenge && isSecure(userId)) {
- isProfilePublic = mKeyguardManager.isDeviceLocked(userId);
- }
+ if (!devicePublic && userId != getCurrentUserId()
+ && needsSeparateChallenge && isSecure(userId)) {
+ // Keyguard.isDeviceLocked is updated asynchronously, assume that all profiles
+ // with separate challenge are locked when keyguard is visible to avoid race.
+ isProfilePublic = showingKeyguard || mKeyguardManager.isDeviceLocked(userId);
}
setLockscreenPublicMode(isProfilePublic, userId);
mUsersWithSeperateWorkChallenge.put(userId, needsSeparateChallenge);