From e7056216f85c4db4b2245e7c449f4ed6e6599865 Mon Sep 17 00:00:00 2001 From: Robin Lee Date: Mon, 23 Jan 2017 15:22:35 +0000 Subject: [PATCH] Lock all profile tasks if keyguard is locked too Bug: 29244275 Test: //tests/PoApi/src/com/google/android/afwtest/poapi/WorkChallengeTest Change-Id: I1df84aa1af675af68180a84440ef36adb003b42d --- .../com/android/server/am/ActivityManagerService.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 7fd91cb91d482..de89bb0ee2334 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -11929,14 +11929,12 @@ public class ActivityManagerService extends IActivityManager.Stub final long ident = Binder.clearCallingIdentity(); try { if (mUserController.shouldConfirmCredentials(userId)) { - final int currentUserId = mUserController.getCurrentUserIdLocked(); - if (!mKeyguardController.isKeyguardLocked()) { - // If the device is not locked, we will prompt for credentials immediately. - mStackSupervisor.lockAllProfileTasks(userId); - } else { + if (mKeyguardController.isKeyguardLocked()) { // Showing launcher to avoid user entering credential twice. + final int currentUserId = mUserController.getCurrentUserIdLocked(); startHomeActivityLocked(currentUserId, "notifyLockedProfile"); } + mStackSupervisor.lockAllProfileTasks(userId); } } finally { Binder.restoreCallingIdentity(ident);