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

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

Issue 2893833003: [Android] Give public versions of notifications a channel (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java
index 4d86567f7987f28766a92ecb04e44eb803cf0863..16fa66e7d17e0effe0777cb3a3276b7a4258a061 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationBuilderBase.java
@@ -21,6 +21,7 @@ import android.graphics.drawable.Icon;
import android.os.Build;
import org.chromium.base.VisibleForTesting;
+import org.chromium.chrome.browser.notifications.channels.ChannelDefinitions;
import org.chromium.chrome.browser.widget.RoundedIconGenerator;
import java.util.ArrayList;
@@ -358,9 +359,11 @@ public abstract class NotificationBuilderBase {
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
protected Notification createPublicNotification(Context context) {
- // Use Android's Notification.Builder because we want the default small icon behaviour.
- Notification.Builder builder =
- new Notification.Builder(context)
+ // Use a non-compat builder because we want the default small icon behaviour.
+ ChromeNotificationBuilder builder =
+ NotificationBuilderFactory
+ .createChromeNotificationBuilder(
+ false /* preferCompat */, ChannelDefinitions.CHANNEL_ID_SITES)
.setContentText(context.getString(
org.chromium.chrome.R.string.notification_hidden_text))
.setSmallIcon(org.chromium.chrome.R.drawable.ic_chrome);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698