OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 package org.chromium.chrome.browser.notifications; |
| 6 |
| 7 import org.chromium.base.BuildInfo; |
| 8 import org.chromium.base.annotations.CalledByNative; |
| 9 |
| 10 /** |
| 11 * Interface for native code to interact with Android notification channels. |
| 12 */ |
| 13 public class NotificationSettingsBridge { |
| 14 // TODO(awdf): Remove this and check BuildInfo.sdk_int() from native instead
, once SdkVersion |
| 15 // enum includes Android O. |
| 16 @CalledByNative |
| 17 static boolean shouldUseChannelSettings() { |
| 18 return BuildInfo.isAtLeastO(); |
| 19 } |
| 20 |
| 21 /** |
| 22 * Creates a notification channel for the given origin. |
| 23 * @param origin The site origin to be used as the channel name. |
| 24 * @param enabled True if the channel should be initially enabled, false if |
| 25 * it should start off as blocked. |
| 26 * @return true if the channel was successfully created, false otherwise. |
| 27 */ |
| 28 @CalledByNative |
| 29 static boolean createChannel(String origin, boolean enabled) { |
| 30 // TODO(crbug.com/700377) Actually construct a channel. |
| 31 return false; |
| 32 } |
| 33 |
| 34 @CalledByNative |
| 35 static @NotificationChannelStatus int getChannelStatus(String origin) { |
| 36 // TODO(crbug.com/700377) Actually check channel status. |
| 37 return NotificationChannelStatus.UNAVAILABLE; |
| 38 } |
| 39 |
| 40 @CalledByNative |
| 41 static void deleteChannel(String origin) { |
| 42 // TODO(crbug.com/700377) Actually delete channel. |
| 43 } |
| 44 } |
OLD | NEW |