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.UserHandle; 24 import android.service.notification.NotificationStats; 25 import android.service.notification.IStatusBarNotificationHolder; 26 import android.service.notification.StatusBarNotification; 27 import android.service.notification.NotificationRankingUpdate; 28 29 /** @hide */ 30 oneway interface INotificationListener 31 { 32 // listeners and assistant onListenerConnected(in NotificationRankingUpdate update)33 void onListenerConnected(in NotificationRankingUpdate update); onNotificationPosted(in IStatusBarNotificationHolder notificationHolder, in NotificationRankingUpdate update)34 void onNotificationPosted(in IStatusBarNotificationHolder notificationHolder, 35 in NotificationRankingUpdate update); onStatusBarIconsBehaviorChanged(boolean hideSilentStatusIcons)36 void onStatusBarIconsBehaviorChanged(boolean hideSilentStatusIcons); 37 // stats only for assistant onNotificationRemoved(in IStatusBarNotificationHolder notificationHolder, in NotificationRankingUpdate update, in NotificationStats stats, int reason)38 void onNotificationRemoved(in IStatusBarNotificationHolder notificationHolder, 39 in NotificationRankingUpdate update, in NotificationStats stats, int reason); onNotificationRankingUpdate(in NotificationRankingUpdate update)40 void onNotificationRankingUpdate(in NotificationRankingUpdate update); onListenerHintsChanged(int hints)41 void onListenerHintsChanged(int hints); onInterruptionFilterChanged(int interruptionFilter)42 void onInterruptionFilterChanged(int interruptionFilter); 43 44 // companion device managers only onNotificationChannelModification(String pkgName, in UserHandle user, in NotificationChannel channel, int modificationType)45 void onNotificationChannelModification(String pkgName, in UserHandle user, in NotificationChannel channel, int modificationType); onNotificationChannelGroupModification(String pkgName, in UserHandle user, in NotificationChannelGroup group, int modificationType)46 void onNotificationChannelGroupModification(String pkgName, in UserHandle user, in NotificationChannelGroup group, int modificationType); 47 48 // assistants only onNotificationEnqueuedWithChannel(in IStatusBarNotificationHolder notificationHolder, in NotificationChannel channel)49 void onNotificationEnqueuedWithChannel(in IStatusBarNotificationHolder notificationHolder, in NotificationChannel channel); onNotificationSnoozedUntilContext(in IStatusBarNotificationHolder notificationHolder, String snoozeCriterionId)50 void onNotificationSnoozedUntilContext(in IStatusBarNotificationHolder notificationHolder, String snoozeCriterionId); onNotificationsSeen(in List<String> keys)51 void onNotificationsSeen(in List<String> keys); onNotificationExpansionChanged(String key, boolean userAction, boolean expanded)52 void onNotificationExpansionChanged(String key, boolean userAction, boolean expanded); onNotificationDirectReply(String key)53 void onNotificationDirectReply(String key); onSuggestedReplySent(String key, in CharSequence reply, int source)54 void onSuggestedReplySent(String key, in CharSequence reply, int source); onActionClicked(String key, in Notification.Action action, int source)55 void onActionClicked(String key, in Notification.Action action, int source); onAllowedAdjustmentsChanged()56 void onAllowedAdjustmentsChanged(); 57 } 58