Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManager.java +11 −9 Original line number Diff line number Diff line Loading @@ -47,7 +47,6 @@ import com.android.systemui.statusbar.policy.DeviceProvisionedController; import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.List; /** * Handles keeping track of the current user, profiles, and various things related to hiding Loading Loading @@ -352,7 +351,8 @@ public class NotificationLockscreenUserManager implements Dumpable { final boolean allowedByUser = 0 != Settings.Secure.getIntForUser( mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 0, userHandle); final boolean allowedByDpm = adminAllowsUnredactedNotifications(userHandle); final boolean allowedByDpm = adminAllowsKeyguardFeature(userHandle, DevicePolicyManager.KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS); final boolean allowed = allowedByUser && allowedByDpm; mUsersAllowingPrivateNotifications.append(userHandle, allowed); return allowed; Loading @@ -361,13 +361,13 @@ public class NotificationLockscreenUserManager implements Dumpable { return mUsersAllowingPrivateNotifications.get(userHandle); } private boolean adminAllowsUnredactedNotifications(int userHandle) { private boolean adminAllowsKeyguardFeature(int userHandle, int feature) { if (userHandle == UserHandle.USER_ALL) { return true; } final int dpmFlags = mDevicePolicyManager.getKeyguardDisabledFeatures(null /* admin */, userHandle); return (dpmFlags & DevicePolicyManager.KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS) == 0; final int dpmFlags = mDevicePolicyManager.getKeyguardDisabledFeatures(null /* admin */, userHandle); return (dpmFlags & feature) == 0; } /** Loading @@ -389,14 +389,17 @@ public class NotificationLockscreenUserManager implements Dumpable { * "public" (secure & locked) mode? */ private boolean userAllowsNotificationsInPublic(int userHandle) { if (isCurrentProfile(userHandle)) { if (isCurrentProfile(userHandle) && userHandle != mCurrentUserId) { return true; } if (mUsersAllowingNotifications.indexOfKey(userHandle) < 0) { final boolean allowed = 0 != Settings.Secure.getIntForUser( final boolean allowedByUser = 0 != Settings.Secure.getIntForUser( mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 0, userHandle); final boolean allowedByDpm = adminAllowsKeyguardFeature(userHandle, DevicePolicyManager.KEYGUARD_DISABLE_SECURE_NOTIFICATIONS); final boolean allowed = allowedByUser && allowedByDpm; mUsersAllowingNotifications.append(userHandle, allowed); return allowed; } Loading Loading @@ -428,7 +431,6 @@ public class NotificationLockscreenUserManager implements Dumpable { Notification.VISIBILITY_PRIVATE; } private void updateCurrentProfilesCache() { synchronized (mCurrentProfiles) { mCurrentProfiles.clear(); Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java +1 −2 Original line number Diff line number Diff line Loading @@ -323,8 +323,7 @@ public class NotificationViewHierarchyManager { boolean showOnKeyguard = mLockscreenUserManager.shouldShowOnKeyguard(entry .notification); if (suppressedSummary || (mLockscreenUserManager.isLockscreenPublicMode(userId) && !mLockscreenUserManager.shouldShowLockscreenNotifications()) || mLockscreenUserManager.shouldHideNotifications(userId) || (isLocked && !showOnKeyguard)) { entry.row.setVisibility(View.GONE); } else { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManager.java +11 −9 Original line number Diff line number Diff line Loading @@ -47,7 +47,6 @@ import com.android.systemui.statusbar.policy.DeviceProvisionedController; import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.List; /** * Handles keeping track of the current user, profiles, and various things related to hiding Loading Loading @@ -352,7 +351,8 @@ public class NotificationLockscreenUserManager implements Dumpable { final boolean allowedByUser = 0 != Settings.Secure.getIntForUser( mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 0, userHandle); final boolean allowedByDpm = adminAllowsUnredactedNotifications(userHandle); final boolean allowedByDpm = adminAllowsKeyguardFeature(userHandle, DevicePolicyManager.KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS); final boolean allowed = allowedByUser && allowedByDpm; mUsersAllowingPrivateNotifications.append(userHandle, allowed); return allowed; Loading @@ -361,13 +361,13 @@ public class NotificationLockscreenUserManager implements Dumpable { return mUsersAllowingPrivateNotifications.get(userHandle); } private boolean adminAllowsUnredactedNotifications(int userHandle) { private boolean adminAllowsKeyguardFeature(int userHandle, int feature) { if (userHandle == UserHandle.USER_ALL) { return true; } final int dpmFlags = mDevicePolicyManager.getKeyguardDisabledFeatures(null /* admin */, userHandle); return (dpmFlags & DevicePolicyManager.KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS) == 0; final int dpmFlags = mDevicePolicyManager.getKeyguardDisabledFeatures(null /* admin */, userHandle); return (dpmFlags & feature) == 0; } /** Loading @@ -389,14 +389,17 @@ public class NotificationLockscreenUserManager implements Dumpable { * "public" (secure & locked) mode? */ private boolean userAllowsNotificationsInPublic(int userHandle) { if (isCurrentProfile(userHandle)) { if (isCurrentProfile(userHandle) && userHandle != mCurrentUserId) { return true; } if (mUsersAllowingNotifications.indexOfKey(userHandle) < 0) { final boolean allowed = 0 != Settings.Secure.getIntForUser( final boolean allowedByUser = 0 != Settings.Secure.getIntForUser( mContext.getContentResolver(), Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 0, userHandle); final boolean allowedByDpm = adminAllowsKeyguardFeature(userHandle, DevicePolicyManager.KEYGUARD_DISABLE_SECURE_NOTIFICATIONS); final boolean allowed = allowedByUser && allowedByDpm; mUsersAllowingNotifications.append(userHandle, allowed); return allowed; } Loading Loading @@ -428,7 +431,6 @@ public class NotificationLockscreenUserManager implements Dumpable { Notification.VISIBILITY_PRIVATE; } private void updateCurrentProfilesCache() { synchronized (mCurrentProfiles) { mCurrentProfiles.clear(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationViewHierarchyManager.java +1 −2 Original line number Diff line number Diff line Loading @@ -323,8 +323,7 @@ public class NotificationViewHierarchyManager { boolean showOnKeyguard = mLockscreenUserManager.shouldShowOnKeyguard(entry .notification); if (suppressedSummary || (mLockscreenUserManager.isLockscreenPublicMode(userId) && !mLockscreenUserManager.shouldShowLockscreenNotifications()) || mLockscreenUserManager.shouldHideNotifications(userId) || (isLocked && !showOnKeyguard)) { entry.row.setVisibility(View.GONE); } else { Loading