Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationSettingsBridge.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationSettingsBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationSettingsBridge.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c79989616511f0bbeb03a10e251ce616ac21370d |
| --- /dev/null |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/notifications/NotificationSettingsBridge.java |
| @@ -0,0 +1,43 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +package org.chromium.chrome.browser.notifications; |
| + |
| +import org.chromium.base.BuildInfo; |
| +import org.chromium.base.annotations.CalledByNative; |
| + |
| +/** |
| + * Interface for native code to interact with Android notification channels. |
| + */ |
| +public class NotificationSettingsBridge { |
| + // TODO: Remove this and check BuildInfo.sdk_int() instead, once SdkVersion enum includes O. |
|
Peter Beverloo
2017/05/16 16:15:34
TODO(awdf)
awdf
2017/05/17 17:14:40
Done.
|
| + @CalledByNative |
| + static boolean shouldUseChannelSettings() { |
| + return BuildInfo.isAtLeastO(); |
| + } |
| + |
| + /** |
| + * Creates a notification channel for the given origin. |
| + * @param origin The site origin to be used as the channel name. |
| + * @param enabled True if the channel should be initially enabled, false if |
| + * it should start off as blocked. |
| + * @return true if the channel was successfully created, false otherwise. |
| + */ |
| + @CalledByNative |
| + static boolean createChannel(String origin, boolean enabled) { |
| + // TODO(crbug.com/700377) Actually construct a channel. |
| + return false; |
| + } |
| + |
| + @CalledByNative |
| + static @NotificationChannelStatus int getChannelStatus(String origin) { |
| + // TODO(crbug.com/700377) Actually check channel status. |
| + return NotificationChannelStatus.UNAVAILABLE; |
| + } |
| + |
| + @CalledByNative |
| + static void deleteChannel(String origin) { |
| + // TODO(crbug.com/700377) Actually delete channel. |
| + } |
| +} |