19066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/* //device/java/android/android/app/INotificationManager.aidl 29066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** 39066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** Copyright 2007, The Android Open Source Project 49066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** 5e75a66e87a4c4cf59f0ea6f4bd509fd707c2383fGeoffrey Pitsch** Licensed under the Apache License, Version 2.0 (the "License"); 6e75a66e87a4c4cf59f0ea6f4bd509fd707c2383fGeoffrey Pitsch** you may not use this file except in compliance with the License. 7e75a66e87a4c4cf59f0ea6f4bd509fd707c2383fGeoffrey Pitsch** You may obtain a copy of the License at 89066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** 9e75a66e87a4c4cf59f0ea6f4bd509fd707c2383fGeoffrey Pitsch** http://www.apache.org/licenses/LICENSE-2.0 109066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** 11e75a66e87a4c4cf59f0ea6f4bd509fd707c2383fGeoffrey Pitsch** Unless required by applicable law or agreed to in writing, software 12e75a66e87a4c4cf59f0ea6f4bd509fd707c2383fGeoffrey Pitsch** distributed under the License is distributed on an "AS IS" BASIS, 13e75a66e87a4c4cf59f0ea6f4bd509fd707c2383fGeoffrey Pitsch** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14e75a66e87a4c4cf59f0ea6f4bd509fd707c2383fGeoffrey Pitsch** See the License for the specific language governing permissions and 159066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project** limitations under the License. 169066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project*/ 179066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 189066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectpackage android.app; 199066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 209066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.app.ITransientNotification; 219066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.app.Notification; 22b5e44b796618c376cf535e43aaa86ea4522e7770Julia Reynoldsimport android.app.NotificationChannel; 23df44b606f357bb67e7a3b44e58f551c1c731ce42Geoffrey Pitschimport android.app.NotificationChannelGroup; 241fc476d51203c0b76ebd0f2062adf3059437b0dcJohn Spurlockimport android.app.NotificationManager; 255feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandlerimport android.content.ComponentName; 269066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectimport android.content.Intent; 27cee44ba418bef83571349acb2d24ef29833502e0Christoph Studerimport android.content.pm.ParceledListSlice; 28e77bb36d48b6b8b5c3bb6a1195aca469bb237919John Spurlockimport android.net.Uri; 292b122f4c2e691f0319e4f9ea5873989792bb56a6John Spurlockimport android.os.Bundle; 30f27d6b2b821bf818810a0e303d536906b889588dJulia Reynoldsimport android.os.UserHandle; 31e46bb37acf6d3cfb9974672ace93f5381f70ad99Julia Reynoldsimport android.service.notification.Adjustment; 327340fc8665ae3f9f1978f42aa0e5e1da85036158John Spurlockimport android.service.notification.Condition; 33e77bb36d48b6b8b5c3bb6a1195aca469bb237919John Spurlockimport android.service.notification.IConditionListener; 347340fc8665ae3f9f1978f42aa0e5e1da85036158John Spurlockimport android.service.notification.IConditionProvider; 355feceebb892d4cb5777cea3c6174b206705d456bDaniel Sandlerimport android.service.notification.INotificationListener; 36e77bb36d48b6b8b5c3bb6a1195aca469bb237919John Spurlockimport android.service.notification.StatusBarNotification; 37a47a27ffd92f172298c2728040e49d502a2d6c87Julia Reynoldsimport android.app.AutomaticZenRule; 38056c519df1dfb8fdc57daddfdf09bc0e1ffddac4John Spurlockimport android.service.notification.ZenModeConfig; 39fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler 409066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project/** {@hide} */ 419066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Projectinterface INotificationManager 429066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project{ 434120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn void cancelAllNotifications(String pkg, int userId); 449066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 455355e8593a6962f2990a88cd0101ab53a852a1a2Julia Reynolds void clearData(String pkg, int uid, boolean fromApp); 469066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project void enqueueToast(String pkg, ITransientNotification callback, int duration); 479066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project void cancelToast(String pkg, ITransientNotification callback); 488fd7f1ed7c11d35b3f2a97878e68ee38a551dd15Christoph Studer void enqueueNotificationWithTag(String pkg, String opPkg, String tag, int id, 49fea6f7b799225f6f0211d7114c779183adbf7b6bJulia Reynolds in Notification notification, int userId); 504120375d46091df8527bb701882e056fbb0e6b06Dianne Hackborn void cancelNotificationWithTag(String pkg, String tag, int id, int userId); 510da673f02e542c644c300568807c80e196296860Daniel Sandler 52924eed1ca6d3fec5dae7eb0f9c11b8f23f628697Julia Reynolds void setShowBadge(String pkg, int uid, boolean showBadge); 53924eed1ca6d3fec5dae7eb0f9c11b8f23f628697Julia Reynolds boolean canShowBadge(String pkg, int uid); 544a900acdef4559f9f84ca7e2bce45485215fc130Daniel Sandler void setNotificationsEnabledForPackage(String pkg, int uid, boolean enabled); 554a900acdef4559f9f84ca7e2bce45485215fc130Daniel Sandler boolean areNotificationsEnabledForPackage(String pkg, int uid); 5681afbcdbf96c687b61ed53170e1654f4f8ea5b15Julia Reynolds boolean areNotificationsEnabled(String pkg); 57ef37f284364cc45c2ed91bfe04c489d2cedd32d2Julia Reynolds int getPackageImportance(String pkg); 583ad4e3a45bbe44129b14c4d391431e44f1e04f0cChris Wren 5959e152e92e6ebb71bab974973ce29b4f8d11f7cfJulia Reynolds void createNotificationChannelGroups(String pkg, in ParceledListSlice channelGroupList); 6003533715295154f0bb66f84b7c25832d21156805Geoffrey Pitsch void createNotificationChannels(String pkg, in ParceledListSlice channelsList); 613560f847fbffa54f7841320cc0f722778df1222aGeoffrey Pitsch void createNotificationChannelsForPackage(String pkg, int uid, in ParceledListSlice channelsList); 6259e152e92e6ebb71bab974973ce29b4f8d11f7cfJulia Reynolds ParceledListSlice getNotificationChannelGroupsForPackage(String pkg, int uid, boolean includeDeleted); 63df44b606f357bb67e7a3b44e58f551c1c731ce42Geoffrey Pitsch NotificationChannelGroup getNotificationChannelGroupForPackage(String groupId, String pkg, int uid); 64b5e44b796618c376cf535e43aaa86ea4522e7770Julia Reynolds void updateNotificationChannelForPackage(String pkg, int uid, in NotificationChannel channel); 65b5e44b796618c376cf535e43aaa86ea4522e7770Julia Reynolds NotificationChannel getNotificationChannel(String pkg, String channelId); 664036e8d4c636ae36f28585d283b522a7a97eaf72Julia Reynolds NotificationChannel getNotificationChannelForPackage(String pkg, int uid, String channelId, boolean includeDeleted); 67b5e44b796618c376cf535e43aaa86ea4522e7770Julia Reynolds void deleteNotificationChannel(String pkg, String channelId); 68b5e44b796618c376cf535e43aaa86ea4522e7770Julia Reynolds ParceledListSlice getNotificationChannels(String pkg); 694036e8d4c636ae36f28585d283b522a7a97eaf72Julia Reynolds ParceledListSlice getNotificationChannelsForPackage(String pkg, int uid, boolean includeDeleted); 70df44b606f357bb67e7a3b44e58f551c1c731ce42Geoffrey Pitsch int getNumNotificationChannelsForPackage(String pkg, int uid, boolean includeDeleted); 7141103f42126acbd602de81ac87a2e605492ff528Julia Reynolds int getDeletedChannelCount(String pkg, int uid); 729bfba59417fd0789023005064565d744ed7483d2Julia Reynolds void deleteNotificationChannelGroup(String pkg, String channelGroupId); 739bfba59417fd0789023005064565d744ed7483d2Julia Reynolds ParceledListSlice getNotificationChannelGroups(String pkg); 7417717f5a6d46632cb75df78fd2a7038a4ac764eaJulia Reynolds boolean onlyHasDefaultChannel(String pkg, int uid); 75b5e44b796618c376cf535e43aaa86ea4522e7770Julia Reynolds 76cee44ba418bef83571349acb2d24ef29833502e0Christoph Studer // TODO: Remove this when callers have been migrated to the equivalent 77cee44ba418bef83571349acb2d24ef29833502e0Christoph Studer // INotificationListener method. 78fde19b106b2b77bc3540b04445357870caf878b5Daniel Sandler StatusBarNotification[] getActiveNotifications(String callingPkg); 7978d0d25dca42fcde5dcea98ab74bfc7f5c8e1114Daniel Sandler StatusBarNotification[] getHistoricalNotifications(String callingPkg, int count); 8009a247e9a86df068422cbe8b60430fb6583c028cDaniel Sandler 810efdb88ccc9d650e7a644b9be8f63792f2c66841Chris Wren void registerListener(in INotificationListener listener, in ComponentName component, int userid); 8209a247e9a86df068422cbe8b60430fb6583c028cDaniel Sandler void unregisterListener(in INotificationListener listener, int userid); 839066cfe9886ac131c34d59ed0e2d287b0e3c0087The Android Open Source Project 84e6f7f2e3a01b8deb00e03ccfa93751c315f14ef0Daniel Sandler void cancelNotificationFromListener(in INotificationListener token, String pkg, String tag, int id); 85a4294297d46cc0b9f45897bc688c267502cce3efJohn Spurlock void cancelNotificationsFromListener(in INotificationListener token, in String[] keys); 8625cf8cee6f304a286d321204e448b18ce733a60cDaniel Sandler 877967230de20aeb6993d8332347752c8e508769e4Julia Reynolds void snoozeNotificationUntilContextFromListener(in INotificationListener token, String key, String snoozeCriterionId); 88b6c1f99bd96d2f38980f4473baf3aa908d059db2Julia Reynolds void snoozeNotificationUntilFromListener(in INotificationListener token, String key, long until); 8972f1cbb3b988d6daa61c45a69aa9f8024c029b06Julia Reynolds 90ab41eecf22352f54167ce9a272a397715ffd0015Chris Wren void requestBindListener(in ComponentName component); 91ab41eecf22352f54167ce9a272a397715ffd0015Chris Wren void requestUnbindListener(in INotificationListener token); 9238e6ca4e7481f3b1c8072705bfd38b8b454ccfe7Julia Reynolds void requestBindProvider(in ComponentName component); 9338e6ca4e7481f3b1c8072705bfd38b8b454ccfe7Julia Reynolds void requestUnbindProvider(in IConditionProvider token); 94ab41eecf22352f54167ce9a272a397715ffd0015Chris Wren 95f47e51ec605fccf7fed9e50d1adc98fbd4e8b340Amith Yamasani void setNotificationsShownFromListener(in INotificationListener token, in String[] keys); 96f47e51ec605fccf7fed9e50d1adc98fbd4e8b340Amith Yamasani 97b82bc785c966b59621a3a2523ba7cdf84a73697bChristoph Studer ParceledListSlice getActiveNotificationsFromListener(in INotificationListener token, in String[] keys, int trim); 98cf63ff1532e793560f62e1c75f3402b48b0f09baJulia Reynolds ParceledListSlice getSnoozedNotificationsFromListener(in INotificationListener token, int trim); 99d8afe3c41e65a8f6ff4283c124ba250c92cf50c6John Spurlock void requestHintsFromListener(in INotificationListener token, int hints); 100d8afe3c41e65a8f6ff4283c124ba250c92cf50c6John Spurlock int getHintsFromListener(in INotificationListener token); 10185a384b4256121eb85b7e72bcd50f3348f365d41Christoph Studer void requestInterruptionFilterFromListener(in INotificationListener token, int interruptionFilter); 10285a384b4256121eb85b7e72bcd50f3348f365d41Christoph Studer int getInterruptionFilterFromListener(in INotificationListener token); 103b82bc785c966b59621a3a2523ba7cdf84a73697bChristoph Studer void setOnNotificationPostedTrimFromListener(in INotificationListener token, int trim); 104807749301fcbda892dfc8a5832b19acf7d1cf53bJohn Spurlock void setInterruptionFilter(String pkg, int interruptionFilter); 105056c519df1dfb8fdc57daddfdf09bc0e1ffddac4John Spurlock 106f27d6b2b821bf818810a0e303d536906b889588dJulia Reynolds void updateNotificationChannelFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user, in NotificationChannel channel); 107f27d6b2b821bf818810a0e303d536906b889588dJulia Reynolds ParceledListSlice getNotificationChannelsFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user); 108f27d6b2b821bf818810a0e303d536906b889588dJulia Reynolds ParceledListSlice getNotificationChannelGroupsFromPrivilegedListener(in INotificationListener token, String pkg, in UserHandle user); 10973ed76bc6f92ecee9ae2e3172ec54c081443953bJulia Reynolds 1104b82f6ddb0a771ce846724385aaa1d0ff8389449Julia Reynolds void applyEnqueuedAdjustmentFromAssistant(in INotificationListener token, in Adjustment adjustment); 11152e64d0162bd71164c6e23e3975e98091f70588aJulia Reynolds void applyAdjustmentFromAssistant(in INotificationListener token, in Adjustment adjustment); 11252e64d0162bd71164c6e23e3975e98091f70588aJulia Reynolds void applyAdjustmentsFromAssistant(in INotificationListener token, in List<Adjustment> adjustments); 113cf63ff1532e793560f62e1c75f3402b48b0f09baJulia Reynolds void unsnoozeNotificationFromAssistant(in INotificationListener token, String key); 11451017d0e23ce9855fabcf786a2067ceb19121fbcChris Wren 115b4782526f5600d9759baac64b23e0c0cd05e2050John Spurlock ComponentName getEffectsSuppressor(); 1162b122f4c2e691f0319e4f9ea5873989792bb56a6John Spurlock boolean matchesCallFilter(in Bundle extras); 117530052a2fe3b6a6a4246ce28ab0ced647fe7f470John Spurlock boolean isSystemConditionProviderEnabled(String path); 118b4782526f5600d9759baac64b23e0c0cd05e2050John Spurlock 119b2278d65714c0dd0a6f94d1913db1ebc8bfc8b06John Spurlock int getZenMode(); 120056c519df1dfb8fdc57daddfdf09bc0e1ffddac4John Spurlock ZenModeConfig getZenModeConfig(); 121b2278d65714c0dd0a6f94d1913db1ebc8bfc8b06John Spurlock oneway void setZenMode(int mode, in Uri conditionId, String reason); 122e77bb36d48b6b8b5c3bb6a1195aca469bb237919John Spurlock oneway void notifyConditions(String pkg, in IConditionProvider provider, in Condition[] conditions); 123807749301fcbda892dfc8a5832b19acf7d1cf53bJohn Spurlock boolean isNotificationPolicyAccessGranted(String pkg); 124807749301fcbda892dfc8a5832b19acf7d1cf53bJohn Spurlock NotificationManager.Policy getNotificationPolicy(String pkg); 125807749301fcbda892dfc8a5832b19acf7d1cf53bJohn Spurlock void setNotificationPolicy(String pkg, in NotificationManager.Policy policy); 126807749301fcbda892dfc8a5832b19acf7d1cf53bJohn Spurlock String[] getPackagesRequestingNotificationPolicyAccess(); 127807749301fcbda892dfc8a5832b19acf7d1cf53bJohn Spurlock boolean isNotificationPolicyAccessGrantedForPackage(String pkg); 128807749301fcbda892dfc8a5832b19acf7d1cf53bJohn Spurlock void setNotificationPolicyAccessGranted(String pkg, boolean granted); 1294fe98d6d4cc4898809b81d001f6b8a1b71b08f3aJulia Reynolds AutomaticZenRule getAutomaticZenRule(String id); 130361e82d399d33e0c45e9a002f2e519f1457a84adJulia Reynolds List<ZenModeConfig.ZenRule> getZenRules(); 131361e82d399d33e0c45e9a002f2e519f1457a84adJulia Reynolds String addAutomaticZenRule(in AutomaticZenRule automaticZenRule); 132361e82d399d33e0c45e9a002f2e519f1457a84adJulia Reynolds boolean updateAutomaticZenRule(String id, in AutomaticZenRule automaticZenRule); 1334fe98d6d4cc4898809b81d001f6b8a1b71b08f3aJulia Reynolds boolean removeAutomaticZenRule(String id); 134c8e54e8d5ec038ee6f520ee95948e2ef20490e97Julia Reynolds boolean removeAutomaticZenRules(String packageName); 13543b70cdc395d3a6cf3bd0a78b686a7f5d3ed86e0Julia Reynolds int getRuleInstanceCount(in ComponentName owner); 136f9767d680d63ac1771a17ccc5775cd337ff967b8Christopher Tate 137f9767d680d63ac1771a17ccc5775cd337ff967b8Christopher Tate byte[] getBackupPayload(int user); 138f9767d680d63ac1771a17ccc5775cd337ff967b8Christopher Tate void applyRestore(in byte[] payload, int user); 139994349c61e8697e626a7cd2b241a16b2b7669305Dan Sandler 140994349c61e8697e626a7cd2b241a16b2b7669305Dan Sandler ParceledListSlice getAppActiveNotifications(String callingPkg, int userId); 141ea75fddbb452638f286c2fcdbddff145ee1a85cbDan Sandler} 142