summaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authorsail <sail@google.com>2017-08-15 03:26:40 -0700
committerEric Erfanian <erfanian@google.com>2017-08-15 08:30:26 -0700
commitf6ece054859eeac5265931a83ba122b85b6c89e3 (patch)
tree25f2660a63f4e7a1c04f0b21c6880e2206f65566 /assets
parent1998bb675eb9e3b3363095b3b6a09d71e947e179 (diff)
Add a rate limiter for Dialer notifications
Android only allows apps to post a maximum of 50 notifications. After this limit is exhausted no more notifications are allowed. This breaks features like incoming phone calls. This CL works around the issue by adding a rate limiter for all cases where a feature posts more than one notification: - call quality feedbakc notifications - missed call notifications - visual vociemail notifications - spam notifications The rate limit is applied on a per group basis. Each group is allowed a maximum of 10 notifications. When the limit is exceeded older notifications are cancelled until we're under the threshold. Some things to note: - the "group summary" for bundles don't count as a notification - because we're not implementing a global rate limiter it could be possible to exceed the maximum system limit. For example, if all features post their maximum number of notifications and all the "one off" notifications are shown then we could potentially be above the limit. - this CL adds groups for spam and feedback notifications. Those notifications don't have a group summary so the UI is unchanged. To enforce all of the above, all notifications must now be posted using the DialerNotificationManager class. This is a thin wrapper around the system NotificationManager API. Using the system API directly is now forbidden. Bug: 62937258 Test: NotificationRateLimiterTest PiperOrigin-RevId: 165289368 Change-Id: I40e688bea3af40d829fd32d985cf04d22f7e384a
Diffstat (limited to 'assets')
0 files changed, 0 insertions, 0 deletions