diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-05-18 20:22:03 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-05-18 20:22:03 +0000 |
commit | 619080d929b914e218bd32aa30287a67bf10551b (patch) | |
tree | b06adc296ac3ce728b01653c4932984aac857f71 /java/com/android/dialer/notification/DialerNotificationManager.java | |
parent | 10ac0aafddc6f8610ea6c5c5c831692da4b5439d (diff) | |
parent | bd2899608c69691e4da65fac499c6fe228b9b86c (diff) |
Merge "Don't post throttled notifications again."
Diffstat (limited to 'java/com/android/dialer/notification/DialerNotificationManager.java')
-rw-r--r-- | java/com/android/dialer/notification/DialerNotificationManager.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/java/com/android/dialer/notification/DialerNotificationManager.java b/java/com/android/dialer/notification/DialerNotificationManager.java index 2a66cd5ac..eb730be0f 100644 --- a/java/com/android/dialer/notification/DialerNotificationManager.java +++ b/java/com/android/dialer/notification/DialerNotificationManager.java @@ -27,12 +27,17 @@ import android.text.TextUtils; import android.util.Pair; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; +import java.util.HashSet; +import java.util.Set; /** * Wrapper around the notification manager APIs. The wrapper ensures that channels are set and that * notifications are limited to 10 per group. */ public final class DialerNotificationManager { + + private static final Set<StatusBarNotification> throttledNotificationSet = new HashSet<>(); + public static void notify(@NonNull Context context, int id, @NonNull Notification notification) { Assert.isNotNull(context); Assert.isNotNull(notification); @@ -50,7 +55,7 @@ public final class DialerNotificationManager { } getNotificationManager(context).notify(tag, id, notification); - NotificationThrottler.throttle(context, notification); + throttledNotificationSet.addAll(NotificationThrottler.throttle(context, notification)); } public static void cancel(@NonNull Context context, int id) { @@ -131,5 +136,9 @@ public final class DialerNotificationManager { return context.getSystemService(NotificationManager.class); } + public static Set<StatusBarNotification> getThrottledNotificationSet() { + return throttledNotificationSet; + } + private DialerNotificationManager() {} } |