From 6e556092f5d005938596196fefd0aa1fcc006a90 Mon Sep 17 00:00:00 2001 From: Daniel U Date: Fri, 1 Apr 2016 18:44:13 +0100 Subject: [PATCH] Allow user to hide sensitive notifications with no work challenge When a user upgrades to N, her work profile is automatically unified even though no work challenge setting is shown to the user if the user has not upgraded her DPC. Allow the user to hide sensitive notifications based on whethere there's a profile, but not on whether there is a work challenge. Bug:27673591 Change-Id: Iec41dda2d9e479597b3e593e7f9b7f1c0fcd2a49 --- .../notification/ConfigureNotificationSettings.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/notification/ConfigureNotificationSettings.java b/src/com/android/settings/notification/ConfigureNotificationSettings.java index f8ac7ddc36e..4d50461118c 100644 --- a/src/com/android/settings/notification/ConfigureNotificationSettings.java +++ b/src/com/android/settings/notification/ConfigureNotificationSettings.java @@ -75,9 +75,14 @@ public class ConfigureNotificationSettings extends SettingsPreferenceFragment { mContext = getActivity(); mProfileChallengeUserId = Utils.getManagedProfileId( UserManager.get(mContext), UserHandle.myUserId()); - mSecure = new LockPatternUtils(getActivity()).isSecure(UserHandle.myUserId()); + + final LockPatternUtils utils = new LockPatternUtils(getActivity()); + final boolean isUnified = + !utils.isSeparateProfileChallengeEnabled(mProfileChallengeUserId); + + mSecure = utils.isSecure(UserHandle.myUserId()); mSecureProfile = (mProfileChallengeUserId != UserHandle.USER_NULL) - && new LockPatternUtils(getActivity()).isSecure(mProfileChallengeUserId); + && (utils.isSecure(mProfileChallengeUserId) || (isUnified && mSecure)); addPreferencesFromResource(R.xml.configure_notification_settings);