| Index: chrome/android/java/src/org/chromium/chrome/browser/notifications/ChannelsInitializer.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/ChannelsInitializer.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/ChannelsInitializer.java
|
| index 33e09943eadd1fb1a4383022c57c3ce11ea87f40..2e0bd88c32e90348e39944a8ba8f50a3a90bb0c9 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/notifications/ChannelsInitializer.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/ChannelsInitializer.java
|
| @@ -4,7 +4,9 @@
|
|
|
| package org.chromium.chrome.browser.notifications;
|
|
|
| +import android.annotation.TargetApi;
|
| import android.app.NotificationManager;
|
| +import android.os.Build;
|
| import android.support.annotation.StringDef;
|
|
|
| import java.lang.annotation.Retention;
|
| @@ -19,10 +21,14 @@ import java.util.Map;
|
| public class ChannelsInitializer {
|
| // To define a new channel, add the channel ID to this StringDef and add a new entry to
|
| // PredefinedChannels.MAP below with the appropriate channel parameters.
|
| - @StringDef({CHANNEL_ID_BROWSER, CHANNEL_ID_SITES})
|
| + @StringDef({CHANNEL_ID_BROWSER, CHANNEL_ID_DOWNLOADS, CHANNEL_ID_INCOGNITO, CHANNEL_ID_MEDIA,
|
| + CHANNEL_ID_SITES})
|
| @Retention(RetentionPolicy.SOURCE)
|
| public @interface ChannelId {}
|
| public static final String CHANNEL_ID_BROWSER = "browser";
|
| + public static final String CHANNEL_ID_DOWNLOADS = "downloads";
|
| + public static final String CHANNEL_ID_INCOGNITO = "incognito";
|
| + public static final String CHANNEL_ID_MEDIA = "media";
|
| public static final String CHANNEL_ID_SITES = "sites";
|
|
|
| @StringDef({CHANNEL_GROUP_ID_GENERAL})
|
| @@ -31,6 +37,7 @@ public class ChannelsInitializer {
|
| static final String CHANNEL_GROUP_ID_GENERAL = "general";
|
|
|
| // Lazy holder idiom
|
| + @TargetApi(Build.VERSION_CODES.N)
|
| private static class PredefinedChannels {
|
| /**
|
| * The set of predefined channels to be initialized on startup.
|
| @@ -44,6 +51,18 @@ public class ChannelsInitializer {
|
| new Channel(CHANNEL_ID_BROWSER,
|
| org.chromium.chrome.R.string.notification_category_browser,
|
| NotificationManager.IMPORTANCE_LOW, CHANNEL_GROUP_ID_GENERAL));
|
| + map.put(CHANNEL_ID_DOWNLOADS,
|
| + new Channel(CHANNEL_ID_DOWNLOADS,
|
| + org.chromium.chrome.R.string.notification_category_downloads,
|
| + NotificationManager.IMPORTANCE_LOW, CHANNEL_GROUP_ID_GENERAL));
|
| + map.put(CHANNEL_ID_INCOGNITO,
|
| + new Channel(CHANNEL_ID_INCOGNITO,
|
| + org.chromium.chrome.R.string.notification_category_incognito,
|
| + NotificationManager.IMPORTANCE_LOW, CHANNEL_GROUP_ID_GENERAL));
|
| + map.put(CHANNEL_ID_MEDIA,
|
| + new Channel(CHANNEL_ID_MEDIA,
|
| + org.chromium.chrome.R.string.notification_category_media,
|
| + NotificationManager.IMPORTANCE_LOW, CHANNEL_GROUP_ID_GENERAL));
|
| map.put(CHANNEL_ID_SITES,
|
| new Channel(CHANNEL_ID_SITES,
|
| org.chromium.chrome.R.string.notification_category_sites,
|
|
|