From bd2899608c69691e4da65fac499c6fe228b9b86c Mon Sep 17 00:00:00 2001 From: yueg Date: Fri, 18 May 2018 11:43:36 -0700 Subject: Don't post throttled notifications again. Throttled missed call notification can be post again since they are in the newCalls list and not in activeNotifications list. We should record them and don't post again. Test: MissedCallNotifierTest, NotificationThrottlerTest PiperOrigin-RevId: 197177610 Change-Id: I1b03029663621f0a0c06951564eadf78bad016a1 --- java/com/android/dialer/app/calllog/MissedCallNotifier.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'java/com/android/dialer/app') diff --git a/java/com/android/dialer/app/calllog/MissedCallNotifier.java b/java/com/android/dialer/app/calllog/MissedCallNotifier.java index 2cd0f775c..f671fb7fd 100644 --- a/java/com/android/dialer/app/calllog/MissedCallNotifier.java +++ b/java/com/android/dialer/app/calllog/MissedCallNotifier.java @@ -229,15 +229,20 @@ public class MissedCallNotifier implements Worker, Void> { if (useCallList) { // Do not repost active notifications to prevent erasing post call notes. - Set activeTags = new ArraySet<>(); + Set activeAndThrottledTags = new ArraySet<>(); for (StatusBarNotification activeNotification : DialerNotificationManager.getActiveNotifications(context)) { - activeTags.add(activeNotification.getTag()); + activeAndThrottledTags.add(activeNotification.getTag()); + } + // Do not repost throttled notifications + for (StatusBarNotification throttledNotification : + DialerNotificationManager.getThrottledNotificationSet()) { + activeAndThrottledTags.add(throttledNotification.getTag()); } for (NewCall call : newCalls) { String callTag = getNotificationTagForCall(call); - if (!activeTags.contains(callTag)) { + if (!activeAndThrottledTags.contains(callTag)) { DialerNotificationManager.notify( context, callTag, -- cgit v1.2.3