Don't show the unlock notification when Work mode is off

Currently we show the unlock work profile notification when work mode
is off. This CL stops this from happening.

Bug: 27764124
Change-Id: I63e4e09ab8c35a69d10118cf06d8ef33b1e1eb05
This commit is contained in:
Benjamin Franz
2016-04-01 15:49:13 +01:00
parent 002f7121b7
commit f52709c42e

View File

@@ -194,7 +194,9 @@ public class LockSettingsService extends ILockSettings.Stub {
showEncryptionNotification(userHandle);
} else {
UserInfo parent = mUserManager.getProfileParent(user.id);
if (parent != null && mUserManager.isUserUnlocked(parent.getUserHandle())) {
if (parent != null &&
mUserManager.isUserUnlocked(parent.getUserHandle()) &&
!mUserManager.isQuietModeEnabled(userHandle)) {
// Only show notifications for managed profiles once their parent
// user is unlocked.
showEncryptionNotificationForProfile(userHandle);
@@ -280,7 +282,8 @@ public class LockSettingsService extends ILockSettings.Stub {
UserInfo profile = profiles.get(i);
if (profile.isManagedProfile()) {
UserHandle userHandle = profile.getUserHandle();
if (!mUserManager.isUserUnlocked(userHandle)) {
if (!mUserManager.isUserUnlocked(userHandle) &&
!mUserManager.isQuietModeEnabled(userHandle)) {
showEncryptionNotificationForProfile(userHandle);
}
}