Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/CommonVisualInterruptionSuppressors.kt +5 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,11 @@ class BubbleNotAllowedSuppressor() : override fun shouldSuppress(entry: NotificationEntry) = !entry.canBubble() } class BubbleAppSuspendedSuppressor : VisualInterruptionFilter(types = setOf(BUBBLE), reason = "app is suspended") { override fun shouldSuppress(entry: NotificationEntry) = entry.ranking.isSuspended } class BubbleNoMetadataSuppressor() : VisualInterruptionFilter(types = setOf(BUBBLE), reason = "has no or invalid bubble metadata") { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptLogger.kt +8 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,14 @@ class NotificationInterruptLogger @Inject constructor( } } fun logSuspendedAppBubble(entry: NotificationEntry) { buffer.log(TAG, DEBUG, { str1 = entry.logKey }, { "No bubble up: notification: app $str1 is suspended" }) } fun logNoBubbleNoMetadata(entry: NotificationEntry) { buffer.log(TAG, DEBUG, { str1 = entry.logKey Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java +5 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,11 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter return false; } if (entry.getRanking().isSuspended()) { mLogger.logSuspendedAppBubble(entry); return false; } if (entry.getBubbleMetadata() == null || (entry.getBubbleMetadata().getShortcutId() == null && entry.getBubbleMetadata().getIntent() == null)) { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImpl.kt +1 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,7 @@ constructor( addFilter(PulseLockscreenVisibilityPrivateSuppressor()) addFilter(PulseLowImportanceSuppressor()) addFilter(BubbleNotAllowedSuppressor()) addFilter(BubbleAppSuspendedSuppressor()) addFilter(BubbleNoMetadataSuppressor()) addFilter(HunGroupAlertBehaviorSuppressor()) addFilter(HunJustLaunchedFsiSuppressor()) Loading packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java +16 −1 Original line number Diff line number Diff line Loading @@ -999,11 +999,25 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { assertThat(mNotifInterruptionStateProvider.shouldBubbleUp(createBubble())).isFalse(); } @Test public void shouldNotBubbleUp_suspended() { assertThat(mNotifInterruptionStateProvider.shouldBubbleUp(createSuspendedBubble())) .isFalse(); } private NotificationEntry createSuspendedBubble() { return createBubble(null, null, true); } private NotificationEntry createBubble() { return createBubble(null, null); return createBubble(null, null, false); } private NotificationEntry createBubble(String groupKey, Integer groupAlert) { return createBubble(groupKey, groupAlert, false); } private NotificationEntry createBubble(String groupKey, Integer groupAlert, Boolean suspended) { Notification.BubbleMetadata data = new Notification.BubbleMetadata.Builder( PendingIntent.getActivity(mContext, 0, new Intent().setPackage(mContext.getPackageName()), Loading Loading @@ -1031,6 +1045,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { .setNotification(n) .setImportance(IMPORTANCE_HIGH) .setCanBubble(true) .setSuspended(suspended) .build(); } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/CommonVisualInterruptionSuppressors.kt +5 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,11 @@ class BubbleNotAllowedSuppressor() : override fun shouldSuppress(entry: NotificationEntry) = !entry.canBubble() } class BubbleAppSuspendedSuppressor : VisualInterruptionFilter(types = setOf(BUBBLE), reason = "app is suspended") { override fun shouldSuppress(entry: NotificationEntry) = entry.ranking.isSuspended } class BubbleNoMetadataSuppressor() : VisualInterruptionFilter(types = setOf(BUBBLE), reason = "has no or invalid bubble metadata") { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptLogger.kt +8 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,14 @@ class NotificationInterruptLogger @Inject constructor( } } fun logSuspendedAppBubble(entry: NotificationEntry) { buffer.log(TAG, DEBUG, { str1 = entry.logKey }, { "No bubble up: notification: app $str1 is suspended" }) } fun logNoBubbleNoMetadata(entry: NotificationEntry) { buffer.log(TAG, DEBUG, { str1 = entry.logKey Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImpl.java +5 −0 Original line number Diff line number Diff line Loading @@ -204,6 +204,11 @@ public class NotificationInterruptStateProviderImpl implements NotificationInter return false; } if (entry.getRanking().isSuspended()) { mLogger.logSuspendedAppBubble(entry); return false; } if (entry.getBubbleMetadata() == null || (entry.getBubbleMetadata().getShortcutId() == null && entry.getBubbleMetadata().getIntent() == null)) { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/interruption/VisualInterruptionDecisionProviderImpl.kt +1 −0 Original line number Diff line number Diff line Loading @@ -159,6 +159,7 @@ constructor( addFilter(PulseLockscreenVisibilityPrivateSuppressor()) addFilter(PulseLowImportanceSuppressor()) addFilter(BubbleNotAllowedSuppressor()) addFilter(BubbleAppSuspendedSuppressor()) addFilter(BubbleNoMetadataSuppressor()) addFilter(HunGroupAlertBehaviorSuppressor()) addFilter(HunJustLaunchedFsiSuppressor()) Loading
packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/interruption/NotificationInterruptStateProviderImplTest.java +16 −1 Original line number Diff line number Diff line Loading @@ -999,11 +999,25 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { assertThat(mNotifInterruptionStateProvider.shouldBubbleUp(createBubble())).isFalse(); } @Test public void shouldNotBubbleUp_suspended() { assertThat(mNotifInterruptionStateProvider.shouldBubbleUp(createSuspendedBubble())) .isFalse(); } private NotificationEntry createSuspendedBubble() { return createBubble(null, null, true); } private NotificationEntry createBubble() { return createBubble(null, null); return createBubble(null, null, false); } private NotificationEntry createBubble(String groupKey, Integer groupAlert) { return createBubble(groupKey, groupAlert, false); } private NotificationEntry createBubble(String groupKey, Integer groupAlert, Boolean suspended) { Notification.BubbleMetadata data = new Notification.BubbleMetadata.Builder( PendingIntent.getActivity(mContext, 0, new Intent().setPackage(mContext.getPackageName()), Loading Loading @@ -1031,6 +1045,7 @@ public class NotificationInterruptStateProviderImplTest extends SysuiTestCase { .setNotification(n) .setImportance(IMPORTANCE_HIGH) .setCanBubble(true) .setSuspended(suspended) .build(); } Loading