From b0d3ab2ce9af11ce94672dc24dc56fe29b108c35 Mon Sep 17 00:00:00 2001 From: Kenny Guy Date: Tue, 10 Feb 2015 16:13:11 +0000 Subject: [PATCH] Fix issue with ignoring dpm policy for first call. Fix the fact that the first call to userAllowsPrivateNotificationsInPublic ignores flags set by the dpm. Change-Id: Ib6f33edc00f822eb45d13ba2366ddb2c68179e73 --- .../src/com/android/systemui/statusbar/BaseStatusBar.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 3b99af10bb7aa..ca5434978d04a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -1181,14 +1181,15 @@ public abstract class BaseStatusBar extends SystemUI implements } if (mUsersAllowingPrivateNotifications.indexOfKey(userHandle) < 0) { - final boolean allowed = 0 != Settings.Secure.getIntForUser( + final boolean allowedByUser = 0 != Settings.Secure.getIntForUser( mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 0, userHandle); final int dpmFlags = mDevicePolicyManager.getKeyguardDisabledFeatures(null /* admin */, userHandle); final boolean allowedByDpm = (dpmFlags & DevicePolicyManager.KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS) == 0; - mUsersAllowingPrivateNotifications.append(userHandle, allowed && allowedByDpm); + final boolean allowed = allowedByUser && allowedByDpm; + mUsersAllowingPrivateNotifications.append(userHandle, allowed); return allowed; }