Loading core/java/android/os/UserManager.java +1 −0 Original line number Diff line number Diff line Loading @@ -1685,6 +1685,7 @@ public class UserManager { /** * Returns whether the given profile is in quiet mode or not. * Notes: Quiet mode is only supported for managed profiles. * * @param userHandle The user handle of the profile to be queried. * @return true if the profile is in quiet mode, false otherwise. Loading services/core/java/com/android/server/LockSettingsService.java +4 −3 Original line number Diff line number Diff line Loading @@ -705,9 +705,9 @@ public class LockSettingsService extends ILockSettings.Stub { } }; // Check if the user is currently in quiet mode and start it otherwise if (mUserManager.isQuietModeEnabled(new UserHandle(userId)) && mLockPatternUtils.isSeparateProfileChallengeEnabled(userId)) { // 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); } Loading @@ -729,6 +729,7 @@ 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); } Loading services/core/java/com/android/server/pm/UserManagerService.java +5 −2 Original line number Diff line number Diff line Loading @@ -691,9 +691,9 @@ public class UserManagerService extends IUserManager.Stub { @Override public boolean trySetQuietModeDisabled(int userHandle, IntentSender target) { final int credentialOwnerUserId = getCredentialOwnerProfile(userHandle); if (mContext.getSystemService(StorageManager.class).isUserKeyUnlocked(userHandle) || !mLockPatternUtils.isSecure(userHandle) || !mLockPatternUtils.isSeparateProfileChallengeEnabled(userHandle)) { || !mLockPatternUtils.isSecure(credentialOwnerUserId)) { // if the user is already unlocked, no need to show a profile challenge setQuietModeEnabled(userHandle, false); return true; Loading @@ -704,6 +704,9 @@ public class UserManagerService extends IUserManager.Stub { // otherwise, we show a profile challenge to trigger decryption of the user final KeyguardManager km = (KeyguardManager) mContext.getSystemService( Context.KEYGUARD_SERVICE); // We should use userHandle not credentialOwnerUserId here, as even if it is unified // lock, confirm screenlock page will know and show personal challenge, and unlock // work profile when personal challenge is correct final Intent unlockIntent = km.createConfirmDeviceCredentialIntent(null, null, userHandle); if (unlockIntent == null) { Loading Loading
core/java/android/os/UserManager.java +1 −0 Original line number Diff line number Diff line Loading @@ -1685,6 +1685,7 @@ public class UserManager { /** * Returns whether the given profile is in quiet mode or not. * Notes: Quiet mode is only supported for managed profiles. * * @param userHandle The user handle of the profile to be queried. * @return true if the profile is in quiet mode, false otherwise. Loading
services/core/java/com/android/server/LockSettingsService.java +4 −3 Original line number Diff line number Diff line Loading @@ -705,9 +705,9 @@ public class LockSettingsService extends ILockSettings.Stub { } }; // Check if the user is currently in quiet mode and start it otherwise if (mUserManager.isQuietModeEnabled(new UserHandle(userId)) && mLockPatternUtils.isSeparateProfileChallengeEnabled(userId)) { // 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); } Loading @@ -729,6 +729,7 @@ 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); } Loading
services/core/java/com/android/server/pm/UserManagerService.java +5 −2 Original line number Diff line number Diff line Loading @@ -691,9 +691,9 @@ public class UserManagerService extends IUserManager.Stub { @Override public boolean trySetQuietModeDisabled(int userHandle, IntentSender target) { final int credentialOwnerUserId = getCredentialOwnerProfile(userHandle); if (mContext.getSystemService(StorageManager.class).isUserKeyUnlocked(userHandle) || !mLockPatternUtils.isSecure(userHandle) || !mLockPatternUtils.isSeparateProfileChallengeEnabled(userHandle)) { || !mLockPatternUtils.isSecure(credentialOwnerUserId)) { // if the user is already unlocked, no need to show a profile challenge setQuietModeEnabled(userHandle, false); return true; Loading @@ -704,6 +704,9 @@ public class UserManagerService extends IUserManager.Stub { // otherwise, we show a profile challenge to trigger decryption of the user final KeyguardManager km = (KeyguardManager) mContext.getSystemService( Context.KEYGUARD_SERVICE); // We should use userHandle not credentialOwnerUserId here, as even if it is unified // lock, confirm screenlock page will know and show personal challenge, and unlock // work profile when personal challenge is correct final Intent unlockIntent = km.createConfirmDeviceCredentialIntent(null, null, userHandle); if (unlockIntent == null) { Loading