diff options
| -rw-r--r-- | services/core/java/com/android/server/notification/NotificationManagerService.java | 4 | ||||
| -rw-r--r-- | services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index d112c0212fa6..8a6430869288 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -4763,7 +4763,9 @@ public class NotificationManagerService extends SystemService { // Suppressed because another notification in its group handles alerting if (record.sbn.isGroup()) { - return notification.suppressAlertingDueToGrouping(); + if (notification.suppressAlertingDueToGrouping()) { + return true; + } } // Suppressed for being too recently noisy diff --git a/services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java b/services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java index cb64c9c5edd7..78099996a1a0 100644 --- a/services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java +++ b/services/tests/uiservicestests/src/com/android/server/notification/BuzzBeepBlinkTest.java @@ -942,6 +942,15 @@ public class BuzzBeepBlinkTest extends UiServiceTestCase { } @Test + public void testGroupSuppressionFailureDoesNotAffectRateLimiting() { + NotificationRecord summary = getBeepyNotificationRecord("a", GROUP_ALERT_SUMMARY); + summary.getNotification().flags |= Notification.FLAG_GROUP_SUMMARY; + + mService.buzzBeepBlinkLocked(summary); + verify(mUsageStats, times(1)).isAlertRateLimited(any()); + } + + @Test public void testCrossUserSoundMuted() throws Exception { final Notification n = new Builder(getContext(), "test") .setSmallIcon(android.R.drawable.sym_def_app_icon).build(); |