Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4100)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderForO.java

Issue 2922443002: [Web apks] Stop setting channels on web apk notifications (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderForO.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderForO.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderForO.java
index f442367066e1c0006d71c2df871fa4b01af6f9f2..7800aee5c21a0784d2513107d00a2f40b349ced7 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderForO.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderForO.java
@@ -27,6 +27,11 @@ public class NotificationBuilderForO extends NotificationBuilder {
ChannelsInitializer channelsInitializer) {
super(context);
assert BuildInfo.isAtLeastO();
+ if (channelId == null) {
+ // The channelId may be null if the notification will be posted by another app that
+ // does not target O or sets its own channels. E.g. Web apk notifications.
+ return;
+ }
channelsInitializer.ensureInitialized(channelId);
// TODO(crbug.com/707804) Stop using reflection once compileSdkVersion is high enough.
try {

Powered by Google App Engine
This is Rietveld 408576698