INotificationManager.aidl revision dd3e86bcb0b6a5dc356d903df88c3d5a15510f7c
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
18package android.app;
19
20import android.app.ITransientNotification;
21import android.app.Notification;
22import android.app.NotificationManager;
23import android.content.ComponentName;
24import android.content.Intent;
25import android.content.pm.ParceledListSlice;
26import android.net.Uri;
27import android.os.Bundle;
28import android.service.notification.Condition;
29import android.service.notification.IConditionListener;
30import android.service.notification.IConditionProvider;
31import android.service.notification.INotificationListener;
32import android.service.notification.StatusBarNotification;
33import android.app.AutomaticZenRule;
34import android.service.notification.ZenModeConfig;
35
36/** {@hide} */
37interface INotificationManager
38{
39    void cancelAllNotifications(String pkg, int userId);
40
41    void enqueueToast(String pkg, ITransientNotification callback, int duration);
42    void cancelToast(String pkg, ITransientNotification callback);
43    void enqueueNotificationWithTag(String pkg, String opPkg, String tag, int id,
44            in Notification notification, inout int[] idReceived, int userId);
45    void cancelNotificationWithTag(String pkg, String tag, int id, int userId);
46
47    void setNotificationsEnabledForPackage(String pkg, int uid, boolean enabled);
48    boolean areNotificationsEnabledForPackage(String pkg, int uid);
49
50    ParceledListSlice getTopics(String pkg, int uid);
51    void setVisibilityOverride(String pkg, int uid, in Notification.Topic topic, int visibility);
52    int getVisibilityOverride(String pkg, int uid, in Notification.Topic topic);
53    void setPriority(String pkg, int uid, in Notification.Topic topic, int priority);
54    int getPriority(String pkg, int uid, in Notification.Topic topic);
55    void setImportance(String pkg, int uid, in Notification.Topic topic, int importance);
56    int getImportance(String pkg, int uid, in Notification.Topic topic);
57    boolean doesAppUseTopics(String pkg, int uid);
58    boolean hasBannedTopics(String pkg, int uid);
59
60    // TODO: Remove this when callers have been migrated to the equivalent
61    // INotificationListener method.
62    StatusBarNotification[] getActiveNotifications(String callingPkg);
63    StatusBarNotification[] getHistoricalNotifications(String callingPkg, int count);
64
65    void registerListener(in INotificationListener listener, in ComponentName component, int userid);
66    void unregisterListener(in INotificationListener listener, int userid);
67
68    void cancelNotificationFromListener(in INotificationListener token, String pkg, String tag, int id);
69    void cancelNotificationsFromListener(in INotificationListener token, in String[] keys);
70
71    void requestBindListener(in ComponentName component);
72    void requestUnbindListener(in INotificationListener token);
73
74    void setNotificationsShownFromListener(in INotificationListener token, in String[] keys);
75
76    ParceledListSlice getActiveNotificationsFromListener(in INotificationListener token, in String[] keys, int trim);
77    void requestHintsFromListener(in INotificationListener token, int hints);
78    int getHintsFromListener(in INotificationListener token);
79    void requestInterruptionFilterFromListener(in INotificationListener token, int interruptionFilter);
80    int getInterruptionFilterFromListener(in INotificationListener token);
81    void setOnNotificationPostedTrimFromListener(in INotificationListener token, int trim);
82    void setInterruptionFilter(String pkg, int interruptionFilter);
83
84    void setImportanceFromAssistant(in INotificationListener token, String key, int importance, CharSequence explanation);
85
86    ComponentName getEffectsSuppressor();
87    boolean matchesCallFilter(in Bundle extras);
88    boolean isSystemConditionProviderEnabled(String path);
89
90    int getZenMode();
91    ZenModeConfig getZenModeConfig();
92    oneway void setZenMode(int mode, in Uri conditionId, String reason);
93    oneway void notifyConditions(String pkg, in IConditionProvider provider, in Condition[] conditions);
94    boolean isNotificationPolicyAccessGranted(String pkg);
95    NotificationManager.Policy getNotificationPolicy(String pkg);
96    void setNotificationPolicy(String pkg, in NotificationManager.Policy policy);
97    String[] getPackagesRequestingNotificationPolicyAccess();
98    boolean isNotificationPolicyAccessGrantedForPackage(String pkg);
99    void setNotificationPolicyAccessGranted(String pkg, boolean granted);
100    AutomaticZenRule getAutomaticZenRule(String id);
101    List<AutomaticZenRule> getAutomaticZenRules();
102    AutomaticZenRule addAutomaticZenRule(in AutomaticZenRule automaticZenRule);
103    boolean updateAutomaticZenRule(in AutomaticZenRule automaticZenRule);
104    boolean removeAutomaticZenRule(String id);
105    boolean removeAutomaticZenRules(String packageName);
106    int getRuleInstanceCount(in ComponentName owner);
107
108    byte[] getBackupPayload(int user);
109    void applyRestore(in byte[] payload, int user);
110
111    ParceledListSlice getAppActiveNotifications(String callingPkg, int userId);
112}
113