Home | History | Annotate | Download | only in app
      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.NotificationManager;
     23 import android.content.ComponentName;
     24 import android.content.Intent;
     25 import android.content.pm.ParceledListSlice;
     26 import android.net.Uri;
     27 import android.os.Bundle;
     28 import android.service.notification.Adjustment;
     29 import android.service.notification.Condition;
     30 import android.service.notification.IConditionListener;
     31 import android.service.notification.IConditionProvider;
     32 import android.service.notification.INotificationListener;
     33 import android.service.notification.StatusBarNotification;
     34 import android.app.AutomaticZenRule;
     35 import android.service.notification.ZenModeConfig;
     36 
     37 /** {@hide} */
     38 interface INotificationManager
     39 {
     40     void cancelAllNotifications(String pkg, int userId);
     41 
     42     void enqueueToast(String pkg, ITransientNotification callback, int duration);
     43     void cancelToast(String pkg, ITransientNotification callback);
     44     void enqueueNotificationWithTag(String pkg, String opPkg, String tag, int id,
     45             in Notification notification, inout int[] idReceived, int userId);
     46     void cancelNotificationWithTag(String pkg, String tag, int id, int userId);
     47 
     48     void setNotificationsEnabledForPackage(String pkg, int uid, boolean enabled);
     49     boolean areNotificationsEnabledForPackage(String pkg, int uid);
     50     boolean areNotificationsEnabled(String pkg);
     51 
     52     void setVisibilityOverride(String pkg, int uid, int visibility);
     53     int getVisibilityOverride(String pkg, int uid);
     54     void setPriority(String pkg, int uid, int priority);
     55     int getPriority(String pkg, int uid);
     56     void setImportance(String pkg, int uid, int importance);
     57     int getImportance(String pkg, int uid);
     58     int getPackageImportance(String pkg);
     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 applyAdjustmentFromRankerService(in INotificationListener token, in Adjustment adjustment);
     85     void applyAdjustmentsFromRankerService(in INotificationListener token, in List<Adjustment> adjustments);
     86 
     87     ComponentName getEffectsSuppressor();
     88     boolean matchesCallFilter(in Bundle extras);
     89     boolean isSystemConditionProviderEnabled(String path);
     90 
     91     int getZenMode();
     92     ZenModeConfig getZenModeConfig();
     93     oneway void setZenMode(int mode, in Uri conditionId, String reason);
     94     oneway void notifyConditions(String pkg, in IConditionProvider provider, in Condition[] conditions);
     95     boolean isNotificationPolicyAccessGranted(String pkg);
     96     NotificationManager.Policy getNotificationPolicy(String pkg);
     97     void setNotificationPolicy(String pkg, in NotificationManager.Policy policy);
     98     String[] getPackagesRequestingNotificationPolicyAccess();
     99     boolean isNotificationPolicyAccessGrantedForPackage(String pkg);
    100     void setNotificationPolicyAccessGranted(String pkg, boolean granted);
    101     AutomaticZenRule getAutomaticZenRule(String id);
    102     List<ZenModeConfig.ZenRule> getZenRules();
    103     String addAutomaticZenRule(in AutomaticZenRule automaticZenRule);
    104     boolean updateAutomaticZenRule(String id, in AutomaticZenRule automaticZenRule);
    105     boolean removeAutomaticZenRule(String id);
    106     boolean removeAutomaticZenRules(String packageName);
    107     int getRuleInstanceCount(in ComponentName owner);
    108 
    109     byte[] getBackupPayload(int user);
    110     void applyRestore(in byte[] payload, int user);
    111 
    112     ParceledListSlice getAppActiveNotifications(String callingPkg, int userId);
    113 }
    114