1 /** 2 * Copyright (c) 2013, The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.service.notification; 18 19 import android.app.Notification; 20 import android.app.NotificationChannel; 21 import android.app.NotificationChannelGroup; 22 import android.content.pm.ParceledListSlice; 23 import android.os.Bundle; 24 import android.os.UserHandle; 25 import android.service.notification.NotificationStats; 26 import android.service.notification.IStatusBarNotificationHolder; 27 import android.service.notification.StatusBarNotification; 28 import android.service.notification.NotificationRankingUpdate; 29 30 /** @hide */ 31 oneway interface INotificationListener 32 { 33 // listeners and assistant onListenerConnected(in NotificationRankingUpdate update)34 void onListenerConnected(in NotificationRankingUpdate update); onNotificationPosted(in IStatusBarNotificationHolder notificationHolder, in NotificationRankingUpdate update)35 void onNotificationPosted(in IStatusBarNotificationHolder notificationHolder, 36 in NotificationRankingUpdate update); onNotificationPostedFull(in StatusBarNotification sbn, in NotificationRankingUpdate update)37 void onNotificationPostedFull(in StatusBarNotification sbn, 38 in NotificationRankingUpdate update); onStatusBarIconsBehaviorChanged(boolean hideSilentStatusIcons)39 void onStatusBarIconsBehaviorChanged(boolean hideSilentStatusIcons); 40 // stats only for assistant onNotificationRemoved(in IStatusBarNotificationHolder notificationHolder, in NotificationRankingUpdate update, in NotificationStats stats, int reason)41 void onNotificationRemoved(in IStatusBarNotificationHolder notificationHolder, 42 in NotificationRankingUpdate update, in NotificationStats stats, int reason); onNotificationRemovedFull(in StatusBarNotification sbn, in NotificationRankingUpdate update, in NotificationStats stats, int reason)43 void onNotificationRemovedFull(in StatusBarNotification sbn, 44 in NotificationRankingUpdate update, in NotificationStats stats, int reason); onNotificationRankingUpdate(in NotificationRankingUpdate update)45 void onNotificationRankingUpdate(in NotificationRankingUpdate update); onListenerHintsChanged(int hints)46 void onListenerHintsChanged(int hints); onInterruptionFilterChanged(int interruptionFilter)47 void onInterruptionFilterChanged(int interruptionFilter); 48 49 // companion device managers and assistants only onNotificationChannelModification(String pkgName, in UserHandle user, in NotificationChannel channel, int modificationType)50 void onNotificationChannelModification(String pkgName, in UserHandle user, in NotificationChannel channel, int modificationType); onNotificationChannelGroupModification(String pkgName, in UserHandle user, in NotificationChannelGroup group, int modificationType)51 void onNotificationChannelGroupModification(String pkgName, in UserHandle user, in NotificationChannelGroup group, int modificationType); 52 53 // assistants only onNotificationEnqueuedWithChannel(in IStatusBarNotificationHolder notificationHolder, in NotificationChannel channel, in NotificationRankingUpdate update)54 void onNotificationEnqueuedWithChannel(in IStatusBarNotificationHolder notificationHolder, in NotificationChannel channel, in NotificationRankingUpdate update); onNotificationEnqueuedWithChannelFull(in StatusBarNotification sbn, in NotificationChannel channel, in NotificationRankingUpdate update)55 void onNotificationEnqueuedWithChannelFull(in StatusBarNotification sbn, in NotificationChannel channel, in NotificationRankingUpdate update); onNotificationSnoozedUntilContext(in IStatusBarNotificationHolder notificationHolder, String snoozeCriterionId)56 void onNotificationSnoozedUntilContext(in IStatusBarNotificationHolder notificationHolder, String snoozeCriterionId); onNotificationSnoozedUntilContextFull(in StatusBarNotification sbn, String snoozeCriterionId)57 void onNotificationSnoozedUntilContextFull(in StatusBarNotification sbn, String snoozeCriterionId); onNotificationsSeen(in List<String> keys)58 void onNotificationsSeen(in List<String> keys); onPanelRevealed(int items)59 void onPanelRevealed(int items); onPanelHidden()60 void onPanelHidden(); onNotificationVisibilityChanged(String key, boolean isVisible)61 void onNotificationVisibilityChanged(String key, boolean isVisible); onNotificationExpansionChanged(String key, boolean userAction, boolean expanded)62 void onNotificationExpansionChanged(String key, boolean userAction, boolean expanded); onNotificationDirectReply(String key)63 void onNotificationDirectReply(String key); onSuggestedReplySent(String key, in CharSequence reply, int source)64 void onSuggestedReplySent(String key, in CharSequence reply, int source); onActionClicked(String key, in Notification.Action action, int source)65 void onActionClicked(String key, in Notification.Action action, int source); onNotificationClicked(String key)66 void onNotificationClicked(String key); onAllowedAdjustmentsChanged()67 void onAllowedAdjustmentsChanged(); onNotificationFeedbackReceived(String key, in NotificationRankingUpdate update, in Bundle feedback)68 void onNotificationFeedbackReceived(String key, in NotificationRankingUpdate update, in Bundle feedback); 69 } 70