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: 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.
| |
15 @CalledByNative | |
16 static boolean shouldUseChannelSettings() { | |
17 return BuildInfo.isAtLeastO(); | |
18 } | |
19 | |
20 /** | |
21 * Creates a notification channel for the given origin. | |
22 * @param origin The site origin to be used as the channel name. | |
23 * @param enabled True if the channel should be initially enabled, false if | |
24 * it should start off as blocked. | |
25 * @return true if the channel was successfully created, false otherwise. | |
26 */ | |
27 @CalledByNative | |
28 static boolean createChannel(String origin, boolean enabled) { | |
29 // TODO(crbug.com/700377) Actually construct a channel. | |
30 return false; | |
31 } | |
32 | |
33 @CalledByNative | |
34 static @NotificationChannelStatus int getChannelStatus(String origin) { | |
35 // TODO(crbug.com/700377) Actually check channel status. | |
36 return NotificationChannelStatus.UNAVAILABLE; | |
37 } | |
38 | |
39 @CalledByNative | |
40 static void deleteChannel(String origin) { | |
41 // TODO(crbug.com/700377) Actually delete channel. | |
42 } | |
43 } | |
OLD | NEW |