• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* //device/java/android/android/app/INotificationManager.aidl
2 **
3 ** Copyright 2007, The Android Open Source Project
4 **
5 ** Licensed under the Apache License, Version 2.0 (the "License");
6 ** you may not use this file except in compliance with the License.
7 ** You may obtain a copy of the License at
8 **
9 **     http://www.apache.org/licenses/LICENSE-2.0
10 **
11 ** Unless required by applicable law or agreed to in writing, software
12 ** distributed under the License is distributed on an "AS IS" BASIS,
13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ** See the License for the specific language governing permissions and
15 ** limitations under the License.
16 */
17 
18 package android.app;
19 
20 import android.app.ITransientNotification;
21 import android.app.Notification;
22 import android.app.NotificationChannel;
23 import android.app.NotificationChannelGroup;
24 import android.app.NotificationManager;
25 import android.content.ComponentName;
26 import android.content.Intent;
27 import android.content.pm.ParceledListSlice;
28 import android.net.Uri;
29 import android.os.Bundle;
30 import android.os.UserHandle;
31 import android.service.notification.Adjustment;
32 import android.service.notification.Condition;
33 import android.service.notification.IConditionListener;
34 import android.service.notification.IConditionProvider;
35 import android.service.notification.INotificationListener;
36 import android.service.notification.StatusBarNotification;
37 import android.app.AutomaticZenRule;
38 import android.service.notification.ZenModeConfig;
39 
40 /** {@hide} */
41 interface INotificationManager
42 {
cancelAllNotifications(String pkg, int userId)43     void cancelAllNotifications(String pkg, int userId);
44 
clearData(String pkg, int uid, boolean fromApp)45     void clearData(String pkg, int uid, boolean fromApp);
enqueueToast(String pkg, ITransientNotification callback, int duration)46     void enqueueToast(String pkg, ITransientNotification callback, int duration);
cancelToast(String pkg, ITransientNotification callback)47     void cancelToast(String pkg, ITransientNotification callback);
enqueueNotificationWithTag(String pkg, String opPkg, String tag, int id, in Notification notification, int userId)48     void enqueueNotificationWithTag(String pkg, String opPkg, String tag, int id,
49             in Notification notification, int userId);
cancelNotificationWithTag(String pkg, String tag, int id, int userId)50     void cancelNotificationWithTag(String pkg, String tag, int id, int userId);
51 
setShowBadge(String pkg, int uid, boolean showBadge)52     void setShowBadge(String pkg, int uid, boolean showBadge);
canShowBadge(String pkg, int uid)53     boolean canShowBadge(String pkg, int uid);
setNotificationsEnabledForPackage(String pkg, int uid, boolean enabled)54     void setNotificationsEnabledForPackage(String pkg, int uid, boolean enabled);
areNotificationsEnabledForPackage(String pkg, int uid)55     boolean areNotificationsEnabledForPackage(String pkg, int uid);
areNotificationsEnabled(String pkg)56     boolean areNotificationsEnabled(String pkg);
getPackageImportance(String pkg)57     int getPackageImportance(String pkg);
58 
createNotificationChannelGroups(String pkg, in ParceledListSlice channelGroupList)59     void createNotificationChannelGroups(String pkg, in ParceledListSlice channelGroupList);
createNotificationChannels(String pkg, in ParceledListSlice channelsList)60     void createNotificationChannels(String pkg, in ParceledListSlice channelsList);
createNotificationChannelsForPackage(String pkg, int uid, in ParceledListSlice channelsList)61     void createNotificationChannelsForPackage(String pkg, int uid, in ParceledListSlice channelsList);
getNotificationChannelGroupsForPackage(String pkg, int uid, boolean includeDeleted)62     ParceledListSlice getNotificationChannelGroupsForPackage(String pkg, int uid, boolean includeDeleted);
getNotificationChannelGroupForPackage(String groupId, String pkg, int uid)63     NotificationChannelGroup getNotificationChannelGroupForPackage(String groupId, String pkg, int uid);
updateNotificationChannelForPackage(String pkg, int uid, in NotificationChannel channel)64     void updateNotificationChannelForPackage(String pkg, int uid, in NotificationChannel channel);
getNotificationChannel(String pkg, String channelId)65     NotificationChannel getNotificationChannel(String pkg, String channelId);
getNotificationChannelForPackage(String pkg, int uid, String channelId, boolean includeDeleted)66     NotificationChannel getNotificationChannelForPackage(String pkg, int uid, String channelId, boolean includeDeleted);
deleteNotificationChannel(String pkg, String channelId)67     void deleteNotificationChannel(String pkg, String channelId);
getNotificationChannels(String pkg)68     ParceledListSlice getNotificationChannels(String pkg);
getNotificationChannelsForPackage(String pkg, int uid, boolean includeDeleted)69     ParceledListSlice getNotificationChannelsForPackage(String pkg, int uid, boolean includeDeleted);
getNumNotificationChannelsForPackage(String pkg, int uid, boolean includeDeleted)70     int getNumNotificationChannelsForPackage(String pkg, int uid, boolean includeDeleted);
getDeletedChannelCount(String pkg, int uid)71     int getDeletedChannelCount(String pkg, int uid);
deleteNotificationChannelGroup(String pkg, String channelGroupId)72     void deleteNotificationChannelGroup(String pkg, String channelGroupId);
getNotificationChannelGroups(String pkg)73     ParceledListSlice getNotificationChannelGroups(String pkg);
onlyHasDefaultChannel(String pkg, int uid)74     boolean onlyHasDefaultChannel(String pkg, int uid);
75 
76     // TODO: Remove this when callers have been migrated to the equivalent
77     // INotificationListener method.
getActiveNotifications(String callingPkg)78     StatusBarNotification[] getActiveNotifications(String callingPkg);
getHistoricalNotifications(String callingPkg, int count)79     StatusBarNotification[] getHistoricalNotifications(String callingPkg, int count);
80 
registerListener(in INotificationListener listener, in ComponentName component, int userid)81     void registerListener(in INotificationListener listener, in ComponentName component, int userid);
unregisterListener(in INotificationListener listener, int userid)82     void unregisterListener(in INotificationListener listener, int userid);
83 
cancelNotificationFromListener(in INotificationListener token, String pkg, String tag, int id)84     void cancelNotificationFromListener(in INotificationListener token, String pkg, String tag, int id);
cancelNotificationsFromListener(in INotificationListener token, in String[] keys)85     void cancelNotificationsFromListener(in INotificationListener token, in String[] keys);
86 
snoozeNotificationUntilContextFromListener(in INotificationListener token, String key, String snoozeCriterionId)87     void snoozeNotificationUntilContextFromListener(in INotificationListener token, String key, String snoozeCriterionId);
snoozeNotificationUntilFromListener(in INotificationListener token, String key, long until)88     void snoozeNotificationUntilFromListener(in INotificationListener token, String key, long until);
89 
requestBindListener(in ComponentName component)90     void requestBindListener(in ComponentName component);
requestUnbindListener(in INotificationListener token)91     void requestUnbindListener(in INotificationListener token);
requestBindProvider(in ComponentName component)92     void requestBindProvider(in ComponentName component);
requestUnbindProvider(in IConditionProvider token)93     void requestUnbindProvider(in IConditionProvider token);
94 
setNotificationsShownFromListener(in INotificationListener token, in String[] keys)95     void setNotificationsShownFromListener(in INotificationListener token, in String[] keys);
96 
getActiveNotificationsFromListener(in INotificationListener token, in String[] keys, int trim)97     ParceledListSlice getActiveNotificationsFromListener(in INotificationListener token, in String[] keys, int trim);
getSnoozedNotificationsFromListener(in INotificationListener token, int trim)98     ParceledListSlice getSnoozedNotificationsFromListener(in INotificationListener token, int trim);
requestHintsFromListener(in INotificationListener token, int hints)99     void requestHintsFromListener(in INotificationListener token, int hints);
getHintsFromListener(in INotificationListener token)100     int getHintsFromListener(in INotificationListener token);
requestInterruptionFilterFromListener(in INotificationListener token, int interruptionFilter)101     void requestInterruptionFilterFromListener(in INotificationListener token, int interruptionFilter);
getInterruptionFilterFromListener(in INotificationListener token)102     int getInterruptionFilterFromListener(in INotificationListener token);
setOnNotificationPostedTrimFromListener(in INotificationListener token, int trim)103     void setOnNotificationPostedTrimFromListener(in INotificationListener token, int trim);
setInterruptionFilter(String pkg, int interruptionFilter)104     void setInterruptionFilter(String pkg, int interruptionFilter);
105 
updateNotificationChannelFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user, in NotificationChannel channel)106     void updateNotificationChannelFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user, in NotificationChannel channel);
getNotificationChannelsFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user)107     ParceledListSlice getNotificationChannelsFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user);
getNotificationChannelGroupsFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user)108     ParceledListSlice getNotificationChannelGroupsFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user);
109 
applyEnqueuedAdjustmentFromAssistant(in INotificationListener token, in Adjustment adjustment)110     void applyEnqueuedAdjustmentFromAssistant(in INotificationListener token, in Adjustment adjustment);
applyAdjustmentFromAssistant(in INotificationListener token, in Adjustment adjustment)111     void applyAdjustmentFromAssistant(in INotificationListener token, in Adjustment adjustment);
applyAdjustmentsFromAssistant(in INotificationListener token, in List<Adjustment> adjustments)112     void applyAdjustmentsFromAssistant(in INotificationListener token, in List<Adjustment> adjustments);
unsnoozeNotificationFromAssistant(in INotificationListener token, String key)113     void unsnoozeNotificationFromAssistant(in INotificationListener token, String key);
114 
getEffectsSuppressor()115     ComponentName getEffectsSuppressor();
matchesCallFilter(in Bundle extras)116     boolean matchesCallFilter(in Bundle extras);
isSystemConditionProviderEnabled(String path)117     boolean isSystemConditionProviderEnabled(String path);
118 
isNotificationListenerAccessGranted(in ComponentName listener)119     boolean isNotificationListenerAccessGranted(in ComponentName listener);
isNotificationListenerAccessGrantedForUser(in ComponentName listener, int userId)120     boolean isNotificationListenerAccessGrantedForUser(in ComponentName listener, int userId);
isNotificationAssistantAccessGranted(in ComponentName assistant)121     boolean isNotificationAssistantAccessGranted(in ComponentName assistant);
setNotificationListenerAccessGranted(in ComponentName listener, boolean enabled)122     void setNotificationListenerAccessGranted(in ComponentName listener, boolean enabled);
setNotificationAssistantAccessGranted(in ComponentName assistant, boolean enabled)123     void setNotificationAssistantAccessGranted(in ComponentName assistant, boolean enabled);
setNotificationListenerAccessGrantedForUser(in ComponentName listener, int userId, boolean enabled)124     void setNotificationListenerAccessGrantedForUser(in ComponentName listener, int userId, boolean enabled);
setNotificationAssistantAccessGrantedForUser(in ComponentName assistant, int userId, boolean enabled)125     void setNotificationAssistantAccessGrantedForUser(in ComponentName assistant, int userId, boolean enabled);
getEnabledNotificationListenerPackages()126     List<String> getEnabledNotificationListenerPackages();
getEnabledNotificationListeners(int userId)127     List<ComponentName> getEnabledNotificationListeners(int userId);
128 
getZenMode()129     int getZenMode();
getZenModeConfig()130     ZenModeConfig getZenModeConfig();
setZenMode(int mode, in Uri conditionId, String reason)131     oneway void setZenMode(int mode, in Uri conditionId, String reason);
notifyConditions(String pkg, in IConditionProvider provider, in Condition[] conditions)132     oneway void notifyConditions(String pkg, in IConditionProvider provider, in Condition[] conditions);
isNotificationPolicyAccessGranted(String pkg)133     boolean isNotificationPolicyAccessGranted(String pkg);
getNotificationPolicy(String pkg)134     NotificationManager.Policy getNotificationPolicy(String pkg);
setNotificationPolicy(String pkg, in NotificationManager.Policy policy)135     void setNotificationPolicy(String pkg, in NotificationManager.Policy policy);
isNotificationPolicyAccessGrantedForPackage(String pkg)136     boolean isNotificationPolicyAccessGrantedForPackage(String pkg);
setNotificationPolicyAccessGranted(String pkg, boolean granted)137     void setNotificationPolicyAccessGranted(String pkg, boolean granted);
setNotificationPolicyAccessGrantedForUser(String pkg, int userId, boolean granted)138     void setNotificationPolicyAccessGrantedForUser(String pkg, int userId, boolean granted);
getAutomaticZenRule(String id)139     AutomaticZenRule getAutomaticZenRule(String id);
getZenRules()140     List<ZenModeConfig.ZenRule> getZenRules();
addAutomaticZenRule(in AutomaticZenRule automaticZenRule)141     String addAutomaticZenRule(in AutomaticZenRule automaticZenRule);
updateAutomaticZenRule(String id, in AutomaticZenRule automaticZenRule)142     boolean updateAutomaticZenRule(String id, in AutomaticZenRule automaticZenRule);
removeAutomaticZenRule(String id)143     boolean removeAutomaticZenRule(String id);
removeAutomaticZenRules(String packageName)144     boolean removeAutomaticZenRules(String packageName);
getRuleInstanceCount(in ComponentName owner)145     int getRuleInstanceCount(in ComponentName owner);
146 
getBackupPayload(int user)147     byte[] getBackupPayload(int user);
applyRestore(in byte[] payload, int user)148     void applyRestore(in byte[] payload, int user);
149 
getAppActiveNotifications(String callingPkg, int userId)150     ParceledListSlice getAppActiveNotifications(String callingPkg, int userId);
151 }
152