Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -680,7 +680,7 @@ public class NotificationLockscreenUserManagerImpl implements } NotificationEntry entry = mCommonNotifCollectionLazy.get().getEntry(key); if (mFeatureFlags.isEnabled(Flags.NOTIF_LS_BACKGROUND_THREAD)) { return entry != null return entry != null && entry.getRanking().getChannel() != null && entry.getRanking().getChannel().getLockscreenVisibility() == Notification.VISIBILITY_PRIVATE; } else { Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java +14 −0 Original line number Diff line number Diff line Loading @@ -322,6 +322,20 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { assertTrue(mLockscreenUserManager.needsRedaction(mCurrentUserNotif)); } @Test public void testCurrentUserPrivateNotificationsNullChannel() { // GIVEN current user allows private notifications to show mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, mCurrentUser.id); changeSetting(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS); mCurrentUserNotif.setRanking(new RankingBuilder(mCurrentUserNotif.getRanking()) .setChannel(null) .setVisibilityOverride(VISIBILITY_NO_OVERRIDE).build()); // THEN the notification is not redacted assertFalse(mLockscreenUserManager.needsRedaction(mCurrentUserNotif)); } @Test public void testWorkPrivateNotificationsRedacted() { // GIVEN work profile doesn't private notifications to show Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -680,7 +680,7 @@ public class NotificationLockscreenUserManagerImpl implements } NotificationEntry entry = mCommonNotifCollectionLazy.get().getEntry(key); if (mFeatureFlags.isEnabled(Flags.NOTIF_LS_BACKGROUND_THREAD)) { return entry != null return entry != null && entry.getRanking().getChannel() != null && entry.getRanking().getChannel().getLockscreenVisibility() == Notification.VISIBILITY_PRIVATE; } else { Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationLockscreenUserManagerTest.java +14 −0 Original line number Diff line number Diff line Loading @@ -322,6 +322,20 @@ public class NotificationLockscreenUserManagerTest extends SysuiTestCase { assertTrue(mLockscreenUserManager.needsRedaction(mCurrentUserNotif)); } @Test public void testCurrentUserPrivateNotificationsNullChannel() { // GIVEN current user allows private notifications to show mSettings.putIntForUser(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 1, mCurrentUser.id); changeSetting(LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS); mCurrentUserNotif.setRanking(new RankingBuilder(mCurrentUserNotif.getRanking()) .setChannel(null) .setVisibilityOverride(VISIBILITY_NO_OVERRIDE).build()); // THEN the notification is not redacted assertFalse(mLockscreenUserManager.needsRedaction(mCurrentUserNotif)); } @Test public void testWorkPrivateNotificationsRedacted() { // GIVEN work profile doesn't private notifications to show Loading