1 /**
2  * Copyright (c) 2014, The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.android.server.notification;
17 
18 import android.app.NotificationChannel;
19 import android.app.NotificationChannelGroup;
20 import android.content.pm.ParceledListSlice;
21 import android.os.UserHandle;
22 
23 import java.util.Collection;
24 
25 public interface RankingConfig {
26 
setShowBadge(String packageName, int uid, boolean showBadge)27     void setShowBadge(String packageName, int uid, boolean showBadge);
canShowBadge(String packageName, int uid)28     boolean canShowBadge(String packageName, int uid);
badgingEnabled(UserHandle userHandle)29     boolean badgingEnabled(UserHandle userHandle);
getBubblePreference(String packageName, int uid)30     int getBubblePreference(String packageName, int uid);
31     /** Returns true when the bubbles feature is enabled for this user. */
bubblesEnabled(UserHandle userHandle)32     boolean bubblesEnabled(UserHandle userHandle);
33     /** Returns true when feature is enabled that shows media notifications in quick settings. */
isMediaNotificationFilteringEnabled()34     boolean isMediaNotificationFilteringEnabled();
isGroupBlocked(String packageName, int uid, String groupId)35     boolean isGroupBlocked(String packageName, int uid, String groupId);
canShowNotificationsOnLockscreen(int userId)36     boolean canShowNotificationsOnLockscreen(int userId);
canShowPrivateNotificationsOnLockScreen(int userId)37     boolean canShowPrivateNotificationsOnLockScreen(int userId);
38 
getNotificationChannelGroups(String pkg, int uid)39     Collection<NotificationChannelGroup> getNotificationChannelGroups(String pkg,
40             int uid);
createNotificationChannelGroup(String pkg, int uid, NotificationChannelGroup group, boolean fromTargetApp, int callingUid, boolean isSystemOrSystemUi)41     void createNotificationChannelGroup(String pkg, int uid, NotificationChannelGroup group,
42             boolean fromTargetApp, int callingUid, boolean isSystemOrSystemUi);
createNotificationChannel(String pkg, int uid, NotificationChannel channel, boolean fromTargetApp, boolean hasDndAccess, int callingUid, boolean isSystemOrSystemUi)43     boolean createNotificationChannel(String pkg, int uid, NotificationChannel channel,
44             boolean fromTargetApp, boolean hasDndAccess, int callingUid,
45             boolean isSystemOrSystemUi);
updateNotificationChannel(String pkg, int uid, NotificationChannel updatedChannel, boolean fromUser, int callingUid, boolean fromSystemOrSystemUi)46     void updateNotificationChannel(String pkg, int uid, NotificationChannel updatedChannel,
47             boolean fromUser, int callingUid, boolean fromSystemOrSystemUi);
getNotificationChannel(String pkg, int uid, String channelId, boolean includeDeleted)48     NotificationChannel getNotificationChannel(String pkg, int uid, String channelId,
49             boolean includeDeleted);
getConversationNotificationChannel(String pkg, int uid, String channelId, String conversationId, boolean returnParentIfNoConversationChannel, boolean includeDeleted)50     NotificationChannel getConversationNotificationChannel(String pkg, int uid, String channelId,
51             String conversationId, boolean returnParentIfNoConversationChannel,
52             boolean includeDeleted);
deleteNotificationChannel(String pkg, int uid, String channelId, int callingUid, boolean fromSystemOrSystemUi)53     boolean deleteNotificationChannel(String pkg, int uid, String channelId,
54             int callingUid, boolean fromSystemOrSystemUi);
permanentlyDeleteNotificationChannel(String pkg, int uid, String channelId)55     void permanentlyDeleteNotificationChannel(String pkg, int uid, String channelId);
permanentlyDeleteNotificationChannels(String pkg, int uid)56     void permanentlyDeleteNotificationChannels(String pkg, int uid);
getNotificationChannels(String pkg, int uid, boolean includeDeleted)57     ParceledListSlice<NotificationChannel> getNotificationChannels(String pkg, int uid,
58             boolean includeDeleted);
59 }
60