summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/LockSettingsService.java7
-rw-r--r--services/core/java/com/android/server/am/UserController.java22
2 files changed, 10 insertions, 19 deletions
diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java
index b6df0ba60ea4..8d413799cd49 100644
--- a/services/core/java/com/android/server/LockSettingsService.java
+++ b/services/core/java/com/android/server/LockSettingsService.java
@@ -747,12 +747,6 @@ public class LockSettingsService extends ILockSettings.Stub {
}
};
- // Turn off quite mode if it's enabled, only managed profile can return true for now, it
- // will return false if it is not a managed profile.
- if (mUserManager.isQuietModeEnabled(new UserHandle(userId))) {
- mUserManager.setQuietModeEnabled(userId, false);
- }
-
try {
ActivityManagerNative.getDefault().unlockUser(userId, token, secret, listener);
} catch (RemoteException e) {
@@ -771,7 +765,6 @@ public class LockSettingsService extends ILockSettings.Stub {
// Unlock managed profile with unified lock
if (pi.isManagedProfile()
&& !mLockPatternUtils.isSeparateProfileChallengeEnabled(pi.id)
- && !pi.isQuietModeEnabled()
&& mStorage.hasChildProfileLock(pi.id)) {
unlockChildProfile(pi.id);
}
diff --git a/services/core/java/com/android/server/am/UserController.java b/services/core/java/com/android/server/am/UserController.java
index 595d086abf35..67f96d888e3b 100644
--- a/services/core/java/com/android/server/am/UserController.java
+++ b/services/core/java/com/android/server/am/UserController.java
@@ -938,28 +938,26 @@ final class UserController {
boolean unlockUserCleared(final int userId, byte[] token, byte[] secret,
IProgressListener listener) {
synchronized (mService) {
- // Bail if user isn't actually running, otherwise register the given
- // listener to watch for unlock progress
- final UserState uss = mStartedUsers.get(userId);
- if (uss == null) {
- notifyFinished(userId, listener);
- return false;
- } else {
- uss.mUnlockProgress.addListener(listener);
- }
-
// TODO Move this block outside of synchronized if it causes lock contention
if (!StorageManager.isUserKeyUnlocked(userId)) {
final UserInfo userInfo = getUserInfo(userId);
final IMountService mountService = getMountService();
try {
+ // We always want to unlock user storage, even user is not started yet
mountService.unlockUserKey(userId, userInfo.serialNumber, token, secret);
} catch (RemoteException | RuntimeException e) {
Slog.w(TAG, "Failed to unlock: " + e.getMessage());
- notifyFinished(userId, listener);
- return false;
}
}
+ // Bail if user isn't actually running, otherwise register the given
+ // listener to watch for unlock progress
+ final UserState uss = mStartedUsers.get(userId);
+ if (uss == null) {
+ notifyFinished(userId, listener);
+ return false;
+ } else {
+ uss.mUnlockProgress.addListener(listener);
+ }
finishUserUnlocking(uss);