Group suppression shouldn't affect rating limiting

For real this time

Test: runtest systemui-notification
Change-Id: Ia4d771399ca17e9f8dcb386f6f3daff64dc66a69
Fixes: 69300511
This commit is contained in:
Julia Reynolds
2018-04-17 15:36:33 -04:00
parent da80202bae
commit 79dfdd6c67
2 changed files with 12 additions and 1 deletions

View File

@@ -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

View File

@@ -941,6 +941,15 @@ public class BuzzBeepBlinkTest extends UiServiceTestCase {
verify(mUsageStats, never()).isAlertRateLimited(any());
}
@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")