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.hardware.biometrics.IBiometricSysuiReceiver;
23 import android.hardware.biometrics.PromptInfo;
24 import android.hardware.fingerprint.IUdfpsHbmListener;
25 import android.net.Uri;
26 import android.os.Bundle;
27 import android.os.UserHandle;
28 import android.service.notification.StatusBarNotification;
29 
30 import com.android.internal.statusbar.IStatusBar;
31 import com.android.internal.statusbar.RegisterStatusBarResult;
32 import com.android.internal.statusbar.StatusBarIcon;
33 import com.android.internal.statusbar.StatusBarIconList;
34 import com.android.internal.statusbar.NotificationVisibility;
35 
36 /** @hide */
37 interface IStatusBarService
38 {
39     @UnsupportedAppUsage
expandNotificationsPanel()40     void expandNotificationsPanel();
41     @UnsupportedAppUsage
collapsePanels()42     void collapsePanels();
togglePanel()43     void togglePanel();
44     @UnsupportedAppUsage
disable(int what, IBinder token, String pkg)45     void disable(int what, IBinder token, String pkg);
disableForUser(int what, IBinder token, String pkg, int userId)46     void disableForUser(int what, IBinder token, String pkg, int userId);
disable2(int what, IBinder token, String pkg)47     void disable2(int what, IBinder token, String pkg);
disable2ForUser(int what, IBinder token, String pkg, int userId)48     void disable2ForUser(int what, IBinder token, String pkg, int userId);
getDisableFlags(IBinder token, int userId)49     int[] getDisableFlags(IBinder token, int userId);
setIcon(String slot, String iconPackage, int iconId, int iconLevel, String contentDescription)50     void setIcon(String slot, String iconPackage, int iconId, int iconLevel, String contentDescription);
51     @UnsupportedAppUsage
setIconVisibility(String slot, boolean visible)52     void setIconVisibility(String slot, boolean visible);
53     @UnsupportedAppUsage
removeIcon(String slot)54     void removeIcon(String slot);
setImeWindowStatus(int displayId, in IBinder token, int vis, int backDisposition, boolean showImeSwitcher, boolean isMultiClientImeEnabled)55     void setImeWindowStatus(int displayId, in IBinder token, int vis, int backDisposition,
56             boolean showImeSwitcher, boolean isMultiClientImeEnabled);
expandSettingsPanel(String subPanel)57     void expandSettingsPanel(String subPanel);
58 
59     // ---- Methods below are for use by the status bar policy services ----
60     // You need the STATUS_BAR_SERVICE permission
registerStatusBar(IStatusBar callbacks)61     RegisterStatusBarResult registerStatusBar(IStatusBar callbacks);
onPanelRevealed(boolean clearNotificationEffects, int numItems)62     void onPanelRevealed(boolean clearNotificationEffects, int numItems);
onPanelHidden()63     void onPanelHidden();
64     // Mark current notifications as "seen" and stop ringing, vibrating, blinking.
clearNotificationEffects()65     void clearNotificationEffects();
onNotificationClick(String key, in NotificationVisibility nv)66     void onNotificationClick(String key, in NotificationVisibility nv);
onNotificationActionClick(String key, int actionIndex, in Notification.Action action, in NotificationVisibility nv, boolean generatedByAssistant)67     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)68     void onNotificationError(String pkg, String tag, int id,
69             int uid, int initialPid, String message, int userId);
onClearAllNotifications(int userId)70     void onClearAllNotifications(int userId);
onNotificationClear(String pkg, int userId, String key, int dismissalSurface, int dismissalSentiment, in NotificationVisibility nv)71     void onNotificationClear(String pkg, int userId, String key,
72             int dismissalSurface, int dismissalSentiment, in NotificationVisibility nv);
onNotificationVisibilityChanged( in NotificationVisibility[] newlyVisibleKeys, in NotificationVisibility[] noLongerVisibleKeys)73     void onNotificationVisibilityChanged( in NotificationVisibility[] newlyVisibleKeys,
74             in NotificationVisibility[] noLongerVisibleKeys);
onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded, in int notificationLocation)75     void onNotificationExpansionChanged(in String key, in boolean userAction, in boolean expanded, in int notificationLocation);
onNotificationDirectReplied(String key)76     void onNotificationDirectReplied(String key);
onNotificationSmartSuggestionsAdded(String key, int smartReplyCount, int smartActionCount, boolean generatedByAsssistant, boolean editBeforeSending)77     void onNotificationSmartSuggestionsAdded(String key, int smartReplyCount, int smartActionCount,
78             boolean generatedByAsssistant, boolean editBeforeSending);
onNotificationSmartReplySent(in String key, in int replyIndex, in CharSequence reply, in int notificationLocation, boolean modifiedBeforeSending)79     void onNotificationSmartReplySent(in String key, in int replyIndex, in CharSequence reply,
80             in int notificationLocation, boolean modifiedBeforeSending);
onNotificationSettingsViewed(String key)81     void onNotificationSettingsViewed(String key);
onNotificationBubbleChanged(String key, boolean isBubble, int flags)82     void onNotificationBubbleChanged(String key, boolean isBubble, int flags);
onBubbleNotificationSuppressionChanged(String key, boolean isNotifSuppressed, boolean isBubbleSuppressed)83     void onBubbleNotificationSuppressionChanged(String key, boolean isNotifSuppressed, boolean isBubbleSuppressed);
hideCurrentInputMethodForBubbles()84     void hideCurrentInputMethodForBubbles();
grantInlineReplyUriPermission(String key, in Uri uri, in UserHandle user, String packageName)85     void grantInlineReplyUriPermission(String key, in Uri uri, in UserHandle user, String packageName);
clearInlineReplyUriPermissions(String key)86     void clearInlineReplyUriPermissions(String key);
onNotificationFeedbackReceived(String key, in Bundle feedback)87     void onNotificationFeedbackReceived(String key, in Bundle feedback);
88 
onGlobalActionsShown()89     void onGlobalActionsShown();
onGlobalActionsHidden()90     void onGlobalActionsHidden();
91 
92     /**
93      * These methods are needed for global actions control which the UI is shown in sysui.
94      */
shutdown()95     void shutdown();
reboot(boolean safeMode)96     void reboot(boolean safeMode);
97 
addTile(in ComponentName tile)98     void addTile(in ComponentName tile);
remTile(in ComponentName tile)99     void remTile(in ComponentName tile);
clickTile(in ComponentName tile)100     void clickTile(in ComponentName tile);
101     @UnsupportedAppUsage
handleSystemKey(in int key)102     void handleSystemKey(in int key);
103 
104     /**
105      * Methods to show toast messages for screen pinning
106      */
showPinningEnterExitToast(boolean entering)107     void showPinningEnterExitToast(boolean entering);
showPinningEscapeToast()108     void showPinningEscapeToast();
109 
110     // Used to show the authentication dialog (Biometrics, Device Credential)
showAuthenticationDialog(in PromptInfo promptInfo, IBiometricSysuiReceiver sysuiReceiver, in int[] sensorIds, boolean credentialAllowed, boolean requireConfirmation, int userId, long operationId, String opPackageName, long requestId, int multiSensorConfig)111     void showAuthenticationDialog(in PromptInfo promptInfo, IBiometricSysuiReceiver sysuiReceiver,
112             in int[] sensorIds, boolean credentialAllowed, boolean requireConfirmation,
113             int userId, long operationId, String opPackageName, long requestId,
114             int multiSensorConfig);
115 
116     // Used to notify the authentication dialog that a biometric has been authenticated
onBiometricAuthenticated()117     void onBiometricAuthenticated();
118     // Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc
onBiometricHelp(int modality, String message)119     void onBiometricHelp(int modality, String message);
120     // Used to show an error - the dialog will dismiss after a certain amount of time
onBiometricError(int modality, int error, int vendorCode)121     void onBiometricError(int modality, int error, int vendorCode);
122     // Used to hide the authentication dialog, e.g. when the application cancels authentication
hideAuthenticationDialog()123     void hideAuthenticationDialog();
124 
125     /**
126      * Sets an instance of IUdfpsHbmListener for UdfpsController.
127      */
setUdfpsHbmListener(in IUdfpsHbmListener listener)128     void setUdfpsHbmListener(in IUdfpsHbmListener listener);
129 
130     /**
131      * Show a warning that the device is about to go to sleep due to user inactivity.
132      */
showInattentiveSleepWarning()133     void showInattentiveSleepWarning();
134 
135     /**
136      * Dismiss the warning that the device is about to go to sleep due to user inactivity.
137      */
dismissInattentiveSleepWarning(boolean animated)138     void dismissInattentiveSleepWarning(boolean animated);
139 
140     /**
141      * Notifies SystemUI to start tracing.
142      */
startTracing()143     void startTracing();
144 
145     /**
146      * Notifies SystemUI to stop tracing.
147      */
stopTracing()148     void stopTracing();
149 
150     /**
151      * Returns whether SystemUI tracing is enabled.
152      */
isTracing()153     boolean isTracing();
154 
155     /**
156      * If true, suppresses the ambient display from showing. If false, re-enables the ambient
157      * display.
158      */
suppressAmbientDisplay(boolean suppress)159     void suppressAmbientDisplay(boolean suppress);
160 }
161