From f52709c42e81537db1471ffeb552b4340324c795 Mon Sep 17 00:00:00 2001 From: Benjamin Franz Date: Fri, 1 Apr 2016 15:49:13 +0100 Subject: [PATCH] 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 --- .../core/java/com/android/server/LockSettingsService.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/services/core/java/com/android/server/LockSettingsService.java b/services/core/java/com/android/server/LockSettingsService.java index ed16af51c7eb0..098c940a36c2b 100644 --- a/services/core/java/com/android/server/LockSettingsService.java +++ b/services/core/java/com/android/server/LockSettingsService.java @@ -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); } }