DescriptionPush API: Grace - allow one in ten pushes to show no notification.
For developers who have opted in to showing a user-visible UI change on
every push (in exchange for showing the user a less scary permission
prompt), we currently[1] enforce that each push shows a notification.
This patch allows one in ten pushes to show no notification, so
occasional bugs in developer push handlers don't needlessly spam the
user.
Specifically, it keeps track of whether the last (up to) 10 push
messages showed a notification (ignoring pushes didn't show a
notification but were exempt, e.g. due to https://crrev.com/866443003)
and only shows a forced notification if one of those (up to) 10 also
failed to show a notification.
[1]: (since https://crrev.com/842233003)
BUG=437277
Committed: https://crrev.com/8b5b00d6cc8f02139c1d15209612ab4126de5add
Cr-Commit-Position: refs/heads/master@{#314851}
Patch Set 1 #Patch Set 2 : Use static methods on PushMessagingService to save state #
Total comments: 14
Patch Set 3 : Address review comments (e.g. use bitset) #
Total comments: 2
Patch Set 4 : Use anonymouse namespace #Patch Set 5 : Fix Android to_string compile #Patch Set 6 : Fix typo (invesed needed but not shown logic) #
Messages
Total messages: 19 (7 generated)
|