1 /**
2  * Copyright (c) 2007, 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.internal.statusbar;
18 
19 import android.app.Notification;
20 import android.content.ComponentName;
21 import android.graphics.Rect;
22 import android.os.Bundle;
23 import android.service.notification.StatusBarNotification;
24 import android.hardware.biometrics.IBiometricServiceReceiverInternal;
25 
26 import com.android.internal.statusbar.IStatusBar;
27 import com.android.internal.statusbar.RegisterStatusBarResult;
28 import com.android.internal.statusbar.StatusBarIcon;
29 import com.android.internal.statusbar.StatusBarIconList;
30 import com.android.internal.statusbar.NotificationVisibility;
31 
32 /** @hide */
33 interface IStatusBarService
34 {
35     @UnsupportedAppUsage
expandNotificationsPanel()36     void expandNotificationsPanel();
37     @UnsupportedAppUsage
collapsePanels()38     void collapsePanels();
togglePanel()39     void togglePanel();
40     @UnsupportedAppUsage
disable(int what, IBinder token, String pkg)41     void disable(int what, IBinder token, String pkg);
disableForUser(int what, IBinder token, String pkg, int userId)42     void disableForUser(int what, IBinder token, String pkg, int userId);
disable2(int what, IBinder token, String pkg)43     void disable2(int what, IBinder token, String pkg);
disable2ForUser(int what, IBinder token, String pkg, int userId)44     void disable2ForUser(int what, IBinder token, String pkg, int userId);
getDisableFlags(IBinder token, int userId)45     int[] getDisableFlags(IBinder token, int userId);
setIcon(String slot, String iconPackage, int iconId, int iconLevel, String contentDescription)46     void setIcon(String slot, String iconPackage, int iconId, int iconLevel, String contentDescription);
47     @UnsupportedAppUsage
setIconVisibility(String slot, boolean visible)48     void setIconVisibility(String slot, boolean visible);
49     @UnsupportedAppUsage
removeIcon(String slot)50     void removeIcon(String slot);
setImeWindowStatus(int displayId, in IBinder token, int vis, int backDisposition, boolean showImeSwitcher)51     void setImeWindowStatus(int displayId, in IBinder token, int vis, int backDisposition,
52             boolean showImeSwitcher);
expandSettingsPanel(String subPanel)53     void expandSettingsPanel(String subPanel);
54 
55     // ---- Methods below are for use by the status bar policy services ----
56     // You need the STATUS_BAR_SERVICE permission
registerStatusBar(IStatusBar callbacks)57     RegisterStatusBarResult registerStatusBar(IStatusBar callbacks);
onPanelRevealed(boolean clearNotificationEffects, int numItems)58     void onPanelRevealed(boolean clearNotificationEffects, int numItems);
onPanelHidden()59     void onPanelHidden();
60     // Mark current notifications as "seen" and stop ringing, vibrating, blinking.
clearNotificationEffects()61     void clearNotificationEffects();
onNotificationClick(String key, in NotificationVisibility nv)62     void onNotificationClick(String key, in NotificationVisibility nv);
onNotificationActionClick(String key, int actionIndex, in Notification.Action action, in NotificationVisibility nv, boolean generatedByAssistant)63     void onNotificationActionClick(String key, int actionIndex, in Notification.Action action, in NotificationVisibility nv, boolean generatedByAssistant);
onNotificationError(String pkg, String tag, int id, int uid, int initialPid, String message, int userId)64     void onNotificationError(String pkg, String tag, int id,
65             int uid, int initialPid, String message, int userId);
onClearAllNotifications(int userId)66     void onClearAllNotifications(int userId);
onNotificationClear(String pkg, String tag, int id, int userId, String key, int dismissalSurface, int dismissalSentiment, in NotificationVisibility nv)67     void onNotificationClear(String pkg, String tag, int id, int userId, String key,
68             int dismissalSurface, int dismissalSentiment, in NotificationVisibility nv);
onNotificationVisibilityChanged( in NotificationVisibility[] newlyVisibleKeys, in NotificationVisibility[] noLongerVisibleKeys)69     void onNotificationVisibilityChanged( in NotificationVisibility[] newlyVisibleKeys,
70             in NotificationVisibility[] noLongerVisibleKeys);
onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded, in int notificationLocation)71     void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded, in int notificationLocation);
onNotificationDirectReplied(String key)72     void onNotificationDirectReplied(String key);
onNotificationSmartSuggestionsAdded(String key, int smartReplyCount, int smartActionCount, boolean generatedByAsssistant, boolean editBeforeSending)73     void onNotificationSmartSuggestionsAdded(String key, int smartReplyCount, int smartActionCount,
74             boolean generatedByAsssistant, boolean editBeforeSending);
onNotificationSmartReplySent(in String key, in int replyIndex, in CharSequence reply, in int notificationLocation, boolean modifiedBeforeSending)75     void onNotificationSmartReplySent(in String key, in int replyIndex, in CharSequence reply,
76             in int notificationLocation, boolean modifiedBeforeSending);
onNotificationSettingsViewed(String key)77     void onNotificationSettingsViewed(String key);
setSystemUiVisibility(int displayId, int vis, int mask, String cause)78     void setSystemUiVisibility(int displayId, int vis, int mask, String cause);
onNotificationBubbleChanged(String key, boolean isBubble)79     void onNotificationBubbleChanged(String key, boolean isBubble);
80 
onGlobalActionsShown()81     void onGlobalActionsShown();
onGlobalActionsHidden()82     void onGlobalActionsHidden();
83 
84     /**
85      * These methods are needed for global actions control which the UI is shown in sysui.
86      */
shutdown()87     void shutdown();
reboot(boolean safeMode)88     void reboot(boolean safeMode);
89 
addTile(in ComponentName tile)90     void addTile(in ComponentName tile);
remTile(in ComponentName tile)91     void remTile(in ComponentName tile);
clickTile(in ComponentName tile)92     void clickTile(in ComponentName tile);
93     @UnsupportedAppUsage
handleSystemKey(in int key)94     void handleSystemKey(in int key);
95 
96     /**
97      * Methods to show toast messages for screen pinning
98      */
showPinningEnterExitToast(boolean entering)99     void showPinningEnterExitToast(boolean entering);
showPinningEscapeToast()100     void showPinningEscapeToast();
101 
102     // Used to show the dialog when BiometricService starts authentication
showBiometricDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver, int type, boolean requireConfirmation, int userId)103     void showBiometricDialog(in Bundle bundle, IBiometricServiceReceiverInternal receiver, int type,
104             boolean requireConfirmation, int userId);
105     // Used to hide the dialog when a biometric is authenticated
onBiometricAuthenticated(boolean authenticated, String failureReason)106     void onBiometricAuthenticated(boolean authenticated, String failureReason);
107     // Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc
onBiometricHelp(String message)108     void onBiometricHelp(String message);
109     // Used to set a message - the dialog will dismiss after a certain amount of time
onBiometricError(String error)110     void onBiometricError(String error);
111     // Used to hide the biometric dialog when the AuthenticationClient is stopped
hideBiometricDialog()112     void hideBiometricDialog();
113 }
114