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 com.android.server.notification;
18 
19 import android.app.Notification;
20 import android.service.notification.NotificationStats;
21 
22 import com.android.internal.statusbar.NotificationVisibility;
23 
24 public interface NotificationDelegate {
onSetDisabled(int status)25     void onSetDisabled(int status);
onClearAll(int callingUid, int callingPid, int userId)26     void onClearAll(int callingUid, int callingPid, int userId);
onNotificationClick(int callingUid, int callingPid, String key, NotificationVisibility nv)27     void onNotificationClick(int callingUid, int callingPid, String key,
28             NotificationVisibility nv);
onNotificationActionClick(int callingUid, int callingPid, String key, int actionIndex, Notification.Action action, NotificationVisibility nv, boolean generatedByAssistant)29     void onNotificationActionClick(int callingUid, int callingPid, String key, int actionIndex,
30             Notification.Action action, NotificationVisibility nv, boolean generatedByAssistant);
onNotificationClear(int callingUid, int callingPid, String pkg, String tag, int id, int userId, String key, @NotificationStats.DismissalSurface int dismissalSurface, @NotificationStats.DismissalSentiment int dismissalSentiment, NotificationVisibility nv)31     void onNotificationClear(int callingUid, int callingPid,
32             String pkg, String tag, int id, int userId, String key,
33             @NotificationStats.DismissalSurface int dismissalSurface,
34             @NotificationStats.DismissalSentiment int dismissalSentiment,
35             NotificationVisibility nv);
onNotificationError(int callingUid, int callingPid, String pkg, String tag, int id, int uid, int initialPid, String message, int userId)36     void onNotificationError(int callingUid, int callingPid,
37             String pkg, String tag, int id,
38             int uid, int initialPid, String message, int userId);
onPanelRevealed(boolean clearEffects, int numItems)39     void onPanelRevealed(boolean clearEffects, int numItems);
onPanelHidden()40     void onPanelHidden();
clearEffects()41     void clearEffects();
onNotificationVisibilityChanged( NotificationVisibility[] newlyVisibleKeys, NotificationVisibility[] noLongerVisibleKeys)42     void onNotificationVisibilityChanged(
43             NotificationVisibility[] newlyVisibleKeys,
44             NotificationVisibility[] noLongerVisibleKeys);
onNotificationExpansionChanged(String key, boolean userAction, boolean expanded, int notificationLocation)45     void onNotificationExpansionChanged(String key, boolean userAction, boolean expanded,
46             int notificationLocation);
onNotificationDirectReplied(String key)47     void onNotificationDirectReplied(String key);
onNotificationSettingsViewed(String key)48     void onNotificationSettingsViewed(String key);
onNotificationBubbleChanged(String key, boolean isBubble)49     void onNotificationBubbleChanged(String key, boolean isBubble);
50 
51     /**
52      * Notifies that smart replies and actions have been added to the UI.
53      */
onNotificationSmartSuggestionsAdded(String key, int smartReplyCount, int smartActionCount, boolean generatedByAssistant, boolean editBeforeSending)54     void onNotificationSmartSuggestionsAdded(String key, int smartReplyCount, int smartActionCount,
55             boolean generatedByAssistant, boolean editBeforeSending);
56 
57     /**
58      * Notifies a smart reply is sent.
59      *
60      * @param key the notification key
61      * @param clickedIndex the index of clicked reply
62      * @param reply the reply that is sent
63      * @param notificationLocation the location of the notification containing the smart reply
64      * @param modifiedBeforeSending whether the user changed the smart reply before sending
65      */
onNotificationSmartReplySent(String key, int clickedIndex, CharSequence reply, int notificationLocation, boolean modifiedBeforeSending)66     void onNotificationSmartReplySent(String key, int clickedIndex, CharSequence reply,
67             int notificationLocation, boolean modifiedBeforeSending);
68 }
69