summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src
diff options
context:
space:
mode:
author Rubin Xu <rubinxu@google.com> 2023-04-13 15:40:26 +0100
committer Rubin Xu <rubinxu@google.com> 2023-04-19 11:07:39 +0000
commitc5f429f0b67c9057dfa641a5e709fce68a7822dd (patch)
treebeca69b1833c841f67969494562528bcc5108386 /packages/SystemUI/src
parent11562e978937ef374e780993e3724be8bc1100c4 (diff)
Headless: fix locking work profile with separate challenge on power button
SystemUI is querying the profile of its own running user, but in headless system user mode this should really be the current foreground user. Also fix a bug in DevicePolicyManager where device lock timeout is pushed to the wrong user. Bug: 265021591 Test: manual run of the CtsVerifier test Change-Id: I714cda9040b8712df6753a9d37e8c293fe527ad9
Diffstat (limited to 'packages/SystemUI/src')
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index 7a2013e2c612..93ddfba5b6fc 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -1610,8 +1610,9 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
}
private void doKeyguardLaterForChildProfilesLocked() {
- UserManager um = UserManager.get(mContext);
- for (int profileId : um.getEnabledProfileIds(UserHandle.myUserId())) {
+ for (UserInfo profile : mUserTracker.getUserProfiles()) {
+ if (!profile.isEnabled()) continue;
+ final int profileId = profile.id;
if (mLockPatternUtils.isSeparateProfileChallengeEnabled(profileId)) {
long userTimeout = getLockTimeout(profileId);
if (userTimeout == 0) {
@@ -1634,8 +1635,9 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
}
private void doKeyguardForChildProfilesLocked() {
- UserManager um = UserManager.get(mContext);
- for (int profileId : um.getEnabledProfileIds(UserHandle.myUserId())) {
+ for (UserInfo profile : mUserTracker.getUserProfiles()) {
+ if (!profile.isEnabled()) continue;
+ final int profileId = profile.id;
if (mLockPatternUtils.isSeparateProfileChallengeEnabled(profileId)) {
lockProfile(profileId);
}