DescriptionPush API: Fix unsubscribing from GCM on Android
We were calling Android GCM's unregister API, which clears all of an app's subscriptions (all sender ids and subtypes). Since from Android's point of view, the app is Chrome, if any webapp unsubscribed from push messaging, all webapps would be unsubscribed!
Instead now we call the unsubscribe API, which only unsubscribes a specific (sender_id,subtype) pair (where the subtype corresponds to GCMDriver's app_id). So now if a Service Worker calls pushSubscription.unsubscribe(), it'll only unsubscribe that SW's push subscription.
In order for this to work, we now also call the corresponding subscribe API (accepting a single sender_id) instead of register.
GoogleCloudMessagingV2.java is still temporary code, that will be removed once we switch to the Google Play Services client library.
BUG=457374
Committed: https://crrev.com/07b355ac6423c7957c87c66bd0f36220ca2aeaa2
Cr-Commit-Position: refs/heads/master@{#317062}
Patch Set 1 #
Total comments: 6
Patch Set 2 : Now compiles and passes tests (and uses CHECK_EQ) #
Total comments: 14
Patch Set 3 : Address Jian's comments #Patch Set 4 : Comment nits I missed earlier #
Total comments: 6
Patch Set 5 : Add GCMDriver::UnregisterWithSender instead of changing all callers #Patch Set 6 : Whitespace nit #Patch Set 7 : Rebase #Patch Set 8 : Compile fix #
Total comments: 20
Patch Set 9 : Address peter & jianli's review comments #
Total comments: 8
Patch Set 10 : Addressed peter's nits #
Total comments: 2
Patch Set 11 : Tweak comment per jianli #
Total comments: 2
Patch Set 12 : Rebase #Patch Set 13 : Rebase due to https://codereview.chromium.org/930083002 #Patch Set 14 : Fix compile #Patch Set 15 : Remove obsolete PushEventNoPermission test #Messages
Total messages: 42 (15 generated)
|