Revoke site-level Notifications permission and FCM on Android.
go/fcm-revocation
If Chrome has no app-level Notifications permission on Android, we cannot display a push message and we should not process it but rather return early.
If the blocked state of the app-level Notifications permission on Android is permanent (longer than the grace period), then the site-level Notifications permission should be revoked and FCM should be unsubscribed.
Bug: 1336278
Change-Id: I068e0d13e44a4bf6a9493b90777e425a9f4b13fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3705212
Reviewed-by: Mike West <[email protected]>
Reviewed-by: Arthur Sonzogni <[email protected]>
Reviewed-by: Michael van Ouwerkerk <[email protected]>
Reviewed-by: Shakti Sahu <[email protected]>
Reviewed-by: Kamila Hasanbega <[email protected]>
Commit-Queue: Illia Klimov <[email protected]>
Reviewed-by: Peter Beverloo <[email protected]>
Reviewed-by: Theresa Sullivan <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1025226}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 022b7526..b5c7f1d 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -61,6 +61,7 @@
#include "chrome/browser/profiles/profile_impl.h"
#include "chrome/browser/profiles/profiles_state.h"
#include "chrome/browser/push_messaging/push_messaging_app_identifier.h"
+#include "chrome/browser/push_messaging/push_messaging_service_impl.h"
#include "chrome/browser/rlz/chrome_rlz_tracker_delegate.h"
#include "chrome/browser/search/search.h"
#include "chrome/browser/sharing/sharing_sync_preference.h"
@@ -1064,6 +1065,9 @@
ProfileAttributesStorage::RegisterPrefs(registry);
ProfileNetworkContextService::RegisterLocalStatePrefs(registry);
profiles::RegisterPrefs(registry);
+#if BUILDFLAG(IS_ANDROID)
+ PushMessagingServiceImpl::RegisterPrefs(registry);
+#endif
RegisterScreenshotPrefs(registry);
safe_browsing::RegisterLocalStatePrefs(registry);
secure_origin_allowlist::RegisterPrefs(registry);