summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/app
diff options
context:
space:
mode:
authoryueg <yueg@google.com>2018-05-18 11:43:36 -0700
committerCopybara-Service <copybara-piper@google.com>2018-05-18 11:44:53 -0700
commitbd2899608c69691e4da65fac499c6fe228b9b86c (patch)
treeb06adc296ac3ce728b01653c4932984aac857f71 /java/com/android/dialer/app
parentbe11b3283325fe23788bf1d597911dfbe21d6296 (diff)
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
Diffstat (limited to 'java/com/android/dialer/app')
-rw-r--r--java/com/android/dialer/app/calllog/MissedCallNotifier.java11
1 files changed, 8 insertions, 3 deletions
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<Pair<Integer, String>, Void> {
if (useCallList) {
// Do not repost active notifications to prevent erasing post call notes.
- Set<String> activeTags = new ArraySet<>();
+ Set<String> 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,