Check if pref is disabled by admin

Test: robotests
Fixes: 137638270
Change-Id: I39953d5b7466281cff7a9a7ffaeb5ba99ab12934
This commit is contained in:
Julia Reynolds
2021-11-05 14:06:10 -04:00
parent 9ae7fa254e
commit 42896d7fe1
2 changed files with 14 additions and 1 deletions

View File

@@ -178,7 +178,8 @@ public class RedactNotificationPreferenceController extends TogglePreferenceCont
private boolean getAllowPrivateNotifications(int userId) {
return Settings.Secure.getIntForUser(mContext.getContentResolver(),
LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, userId) != 0;
LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, userId) != 0
&& getEnforcedAdmin(userId) == null;
}
private boolean getLockscreenNotificationsEnabled(int userId) {