Merge "Fix sound rate limiting issue" into oc-dr1-dev
am: 61913f178e
Change-Id: I4e00fbaefeee3afc4a2fde9e16fe14b169ddcc22
This commit is contained in:
@@ -3828,13 +3828,6 @@ public class NotificationManagerService extends SystemService {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Suppressed for being too recently noisy
|
|
||||||
final String pkg = record.sbn.getPackageName();
|
|
||||||
if (mUsageStats.isAlertRateLimited(pkg)) {
|
|
||||||
Slog.e(TAG, "Muting recently noisy " + record.getKey());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// muted by listener
|
// muted by listener
|
||||||
final String disableEffects = disableNotificationEffects(record);
|
final String disableEffects = disableNotificationEffects(record);
|
||||||
if (disableEffects != null) {
|
if (disableEffects != null) {
|
||||||
@@ -3852,6 +3845,13 @@ public class NotificationManagerService extends SystemService {
|
|||||||
return notification.suppressAlertingDueToGrouping();
|
return notification.suppressAlertingDueToGrouping();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Suppressed for being too recently noisy
|
||||||
|
final String pkg = record.sbn.getPackageName();
|
||||||
|
if (mUsageStats.isAlertRateLimited(pkg)) {
|
||||||
|
Slog.e(TAG, "Muting recently noisy " + record.getKey());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -830,6 +830,16 @@ public class BuzzBeepBlinkTest extends NotificationTestCase {
|
|||||||
verify(mUsageStats, never()).isAlertRateLimited(any());
|
verify(mUsageStats, never()).isAlertRateLimited(any());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testPostingGroupSuppressedDoesNotAffectRateLimiting() throws Exception {
|
||||||
|
NotificationRecord summary = getBeepyNotificationRecord("a", GROUP_ALERT_CHILDREN);
|
||||||
|
summary.getNotification().flags |= Notification.FLAG_GROUP_SUMMARY;
|
||||||
|
|
||||||
|
mService.buzzBeepBlinkLocked(summary);
|
||||||
|
|
||||||
|
verify(mUsageStats, never()).isAlertRateLimited(any());
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testCrossUserSoundMuted() throws Exception {
|
public void testCrossUserSoundMuted() throws Exception {
|
||||||
final Notification n = new Builder(getContext(), "test")
|
final Notification n = new Builder(getContext(), "test")
|
||||||
|
|||||||
Reference in New Issue
Block a user