INotificationManager.aidl revision c8e54e8d5ec038ee6f520ee95948e2ef20490e97
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 setTopicVisibilityOverride(String pkg, int uid, in Notification.Topic topic, int visibility);
52    int getTopicVisibilityOverride(String pkg, int uid, in Notification.Topic topic);
53    void setTopicPriority(String pkg, int uid, in Notification.Topic topic, int priority);
54    int getTopicPriority(String pkg, int uid, in Notification.Topic topic);
55
56    // TODO: Remove this when callers have been migrated to the equivalent
57    // INotificationListener method.
58    StatusBarNotification[] getActiveNotifications(String callingPkg);
59    StatusBarNotification[] getHistoricalNotifications(String callingPkg, int count);
60
61    void registerListener(in INotificationListener listener, in ComponentName component, int userid);
62    void unregisterListener(in INotificationListener listener, int userid);
63
64    void cancelNotificationFromListener(in INotificationListener token, String pkg, String tag, int id);
65    void cancelNotificationsFromListener(in INotificationListener token, in String[] keys);
66
67    void setNotificationsShownFromListener(in INotificationListener token, in String[] keys);
68
69    ParceledListSlice getActiveNotificationsFromListener(in INotificationListener token, in String[] keys, int trim);
70    void requestHintsFromListener(in INotificationListener token, int hints);
71    int getHintsFromListener(in INotificationListener token);
72    void requestInterruptionFilterFromListener(in INotificationListener token, int interruptionFilter);
73    int getInterruptionFilterFromListener(in INotificationListener token);
74    void setOnNotificationPostedTrimFromListener(in INotificationListener token, int trim);
75    void setInterruptionFilter(String pkg, int interruptionFilter);
76
77    ComponentName getEffectsSuppressor();
78    boolean matchesCallFilter(in Bundle extras);
79    boolean isSystemConditionProviderEnabled(String path);
80
81    int getZenMode();
82    ZenModeConfig getZenModeConfig();
83    oneway void setZenMode(int mode, in Uri conditionId, String reason);
84    oneway void notifyConditions(String pkg, in IConditionProvider provider, in Condition[] conditions);
85    boolean isNotificationPolicyAccessGranted(String pkg);
86    NotificationManager.Policy getNotificationPolicy(String pkg);
87    void setNotificationPolicy(String pkg, in NotificationManager.Policy policy);
88    String[] getPackagesRequestingNotificationPolicyAccess();
89    boolean isNotificationPolicyAccessGrantedForPackage(String pkg);
90    void setNotificationPolicyAccessGranted(String pkg, boolean granted);
91    AutomaticZenRule getAutomaticZenRule(String id);
92    List<AutomaticZenRule> getAutomaticZenRules();
93    AutomaticZenRule addAutomaticZenRule(in AutomaticZenRule automaticZenRule);
94    boolean updateAutomaticZenRule(in AutomaticZenRule automaticZenRule);
95    boolean removeAutomaticZenRule(String id);
96    boolean removeAutomaticZenRules(String packageName);
97
98    byte[] getBackupPayload(int user);
99    void applyRestore(in byte[] payload, int user);
100
101    ParceledListSlice getAppActiveNotifications(String callingPkg, int userId);
102}
103