Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/KeyguardNotificationVisibilityProvider.kt +2 −1 Original line number Diff line number Diff line Loading @@ -223,7 +223,8 @@ class KeyguardNotificationVisibilityProviderImpl @Inject constructor( // ranking.lockscreenVisibilityOverride contains possibly out of date DPC and Setting // info, and NotificationLockscreenUserManagerImpl is already listening for updates // to those entry.ranking.channel.lockscreenVisibility == VISIBILITY_SECRET entry.ranking.channel != null && entry.ranking.channel.lockscreenVisibility == VISIBILITY_SECRET } else { entry.ranking.lockscreenVisibilityOverride == VISIBILITY_SECRET } Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/KeyguardNotificationVisibilityProviderTest.java +17 −0 Original line number Diff line number Diff line Loading @@ -471,6 +471,23 @@ public class KeyguardNotificationVisibilityProviderTest extends SysuiTestCase { assertTrue(mKeyguardNotificationVisibilityProvider.shouldHideNotification(mEntry)); } @Test public void publicMode_nullChannel_allowed() { mFeatureFlags.set(Flags.NOTIF_LS_BACKGROUND_THREAD, true); // GIVEN an 'unfiltered-keyguard-showing' state setupUnfilteredState(mEntry); // WHEN the notification's user is in public mode and settings are configured to disallow // notifications in public mode when(mLockscreenUserManager.isLockscreenPublicMode(CURR_USER_ID)).thenReturn(true); mEntry.setRanking(new RankingBuilder() .setKey(mEntry.getKey()) .setVisibilityOverride(VISIBILITY_SECRET).build()); // THEN allow the entry assertFalse(mKeyguardNotificationVisibilityProvider.shouldHideNotification(mEntry)); } @Test public void publicMode_notifDisallowed() { mFeatureFlags.set(Flags.NOTIF_LS_BACKGROUND_THREAD, true); Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/KeyguardNotificationVisibilityProvider.kt +2 −1 Original line number Diff line number Diff line Loading @@ -223,7 +223,8 @@ class KeyguardNotificationVisibilityProviderImpl @Inject constructor( // ranking.lockscreenVisibilityOverride contains possibly out of date DPC and Setting // info, and NotificationLockscreenUserManagerImpl is already listening for updates // to those entry.ranking.channel.lockscreenVisibility == VISIBILITY_SECRET entry.ranking.channel != null && entry.ranking.channel.lockscreenVisibility == VISIBILITY_SECRET } else { entry.ranking.lockscreenVisibilityOverride == VISIBILITY_SECRET } Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/KeyguardNotificationVisibilityProviderTest.java +17 −0 Original line number Diff line number Diff line Loading @@ -471,6 +471,23 @@ public class KeyguardNotificationVisibilityProviderTest extends SysuiTestCase { assertTrue(mKeyguardNotificationVisibilityProvider.shouldHideNotification(mEntry)); } @Test public void publicMode_nullChannel_allowed() { mFeatureFlags.set(Flags.NOTIF_LS_BACKGROUND_THREAD, true); // GIVEN an 'unfiltered-keyguard-showing' state setupUnfilteredState(mEntry); // WHEN the notification's user is in public mode and settings are configured to disallow // notifications in public mode when(mLockscreenUserManager.isLockscreenPublicMode(CURR_USER_ID)).thenReturn(true); mEntry.setRanking(new RankingBuilder() .setKey(mEntry.getKey()) .setVisibilityOverride(VISIBILITY_SECRET).build()); // THEN allow the entry assertFalse(mKeyguardNotificationVisibilityProvider.shouldHideNotification(mEntry)); } @Test public void publicMode_notifDisallowed() { mFeatureFlags.set(Flags.NOTIF_LS_BACKGROUND_THREAD, true); Loading