• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.ITransientNotificationCallback;
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.os.Bundle;
26 import android.os.ParcelFileDescriptor;
27 import android.service.notification.StatusBarNotification;
28 
29 import com.android.internal.statusbar.StatusBarIcon;
30 import com.android.internal.view.AppearanceRegion;
31 
32 /** @hide */
33 oneway interface IStatusBar
34 {
setIcon(String slot, in StatusBarIcon icon)35     void setIcon(String slot, in StatusBarIcon icon);
removeIcon(String slot)36     void removeIcon(String slot);
disable(int displayId, int state1, int state2)37     void disable(int displayId, int state1, int state2);
animateExpandNotificationsPanel()38     void animateExpandNotificationsPanel();
animateExpandSettingsPanel(String subPanel)39     void animateExpandSettingsPanel(String subPanel);
animateCollapsePanels()40     void animateCollapsePanels();
togglePanel()41     void togglePanel();
42 
showWirelessChargingAnimation(int batteryLevel)43     void showWirelessChargingAnimation(int batteryLevel);
44 
setImeWindowStatus(int displayId, in IBinder token, int vis, int backDisposition, boolean showImeSwitcher, boolean isMultiClientImeEnabled)45     void setImeWindowStatus(int displayId, in IBinder token, int vis, int backDisposition,
46             boolean showImeSwitcher, boolean isMultiClientImeEnabled);
setWindowState(int display, int window, int state)47     void setWindowState(int display, int window, int state);
48 
showRecentApps(boolean triggeredFromAltTab)49     void showRecentApps(boolean triggeredFromAltTab);
hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey)50     void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey);
toggleRecentApps()51     void toggleRecentApps();
toggleSplitScreen()52     void toggleSplitScreen();
preloadRecentApps()53     void preloadRecentApps();
cancelPreloadRecentApps()54     void cancelPreloadRecentApps();
showScreenPinningRequest(int taskId)55     void showScreenPinningRequest(int taskId);
56 
dismissKeyboardShortcutsMenu()57     void dismissKeyboardShortcutsMenu();
toggleKeyboardShortcutsMenu(int deviceId)58     void toggleKeyboardShortcutsMenu(int deviceId);
59 
60     /**
61      * Notifies System UI on the specified display that an app transition is pending to delay
62      * applying some flags with visual impact until {@link #appTransitionReady} is called.
63      *
64      * @param displayId the id of the display to notify
65      */
appTransitionPending(int displayId)66     void appTransitionPending(int displayId);
67 
68     /**
69      * Notifies System UI on the specified display that a pending app transition has been cancelled.
70      *
71      * @param displayId the id of the display to notify
72      */
appTransitionCancelled(int displayId)73     void appTransitionCancelled(int displayId);
74 
75     /**
76      * Notifies System UI on the specified display that an app transition is now being executed.
77      *
78      * @param displayId the id of the display to notify
79      * @param statusBarAnimationsStartTime the desired start time for all visual animations in the
80      *        status bar caused by this app transition in uptime millis
81      * @param statusBarAnimationsDuration the duration for all visual animations in the status
82      *        bar caused by this app transition in millis
83      */
appTransitionStarting(int displayId, long statusBarAnimationsStartTime, long statusBarAnimationsDuration)84     void appTransitionStarting(int displayId, long statusBarAnimationsStartTime,
85             long statusBarAnimationsDuration);
86 
87     /**
88      * Notifies System UI on the specified display that an app transition is done.
89      *
90      * @param displayId the id of the display to notify
91      */
appTransitionFinished(int displayId)92     void appTransitionFinished(int displayId);
93 
showAssistDisclosure()94     void showAssistDisclosure();
startAssist(in Bundle args)95     void startAssist(in Bundle args);
96 
97     /**
98      * Notifies the status bar that a camera launch gesture has been detected.
99      *
100      * @param source the identifier for the gesture, see {@link StatusBarManager}
101      */
onCameraLaunchGestureDetected(int source)102     void onCameraLaunchGestureDetected(int source);
103 
104     /**
105      * Notifies the status bar that the Emergency Action launch gesture has been detected.
106      *
107      * TODO(b/169175022) Update method name and docs when feature name is locked.
108      */
onEmergencyActionLaunchGestureDetected()109     void onEmergencyActionLaunchGestureDetected();
110 
111     /**
112      * Shows the picture-in-picture menu if an activity is in picture-in-picture mode.
113      */
showPictureInPictureMenu()114     void showPictureInPictureMenu();
115 
116     /**
117      * Shows the global actions menu.
118      */
showGlobalActionsMenu()119     void showGlobalActionsMenu();
120 
121     /**
122      * Notifies the status bar that a new rotation suggestion is available.
123      */
onProposedRotationChanged(int rotation, boolean isValid)124     void onProposedRotationChanged(int rotation, boolean isValid);
125 
126     /**
127      * Set whether the top app currently hides the statusbar.
128      *
129      * @param hidesStatusBar whether it is being hidden
130      */
setTopAppHidesStatusBar(boolean hidesStatusBar)131     void setTopAppHidesStatusBar(boolean hidesStatusBar);
132 
addQsTile(in ComponentName tile)133     void addQsTile(in ComponentName tile);
remQsTile(in ComponentName tile)134     void remQsTile(in ComponentName tile);
clickQsTile(in ComponentName tile)135     void clickQsTile(in ComponentName tile);
handleSystemKey(in int key)136     void handleSystemKey(in int key);
137 
138     /**
139      * Methods to show toast messages for screen pinning
140      */
showPinningEnterExitToast(boolean entering)141     void showPinningEnterExitToast(boolean entering);
showPinningEscapeToast()142     void showPinningEscapeToast();
143 
showShutdownUi(boolean isReboot, String reason)144     void showShutdownUi(boolean isReboot, String reason);
145 
146     /**
147     * Used to show the authentication dialog (Biometrics, Device Credential).
148     */
showAuthenticationDialog(in PromptInfo promptInfo, IBiometricSysuiReceiver sysuiReceiver, in int[] sensorIds, boolean credentialAllowed, boolean requireConfirmation, int userId, String opPackageName, long operationId, int multiSensorConfig)149     void showAuthenticationDialog(in PromptInfo promptInfo, IBiometricSysuiReceiver sysuiReceiver,
150             in int[] sensorIds, boolean credentialAllowed, boolean requireConfirmation, int userId,
151             String opPackageName, long operationId, int multiSensorConfig);
152     /**
153     * Used to notify the authentication dialog that a biometric has been authenticated.
154     */
onBiometricAuthenticated()155     void onBiometricAuthenticated();
156     /**
157     * Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc.
158     */
onBiometricHelp(int modality, String message)159     void onBiometricHelp(int modality, String message);
160     /** Used to show an error - the dialog will dismiss after a certain amount of time. */
onBiometricError(int modality, int error, int vendorCode)161     void onBiometricError(int modality, int error, int vendorCode);
162     /**
163     * Used to hide the authentication dialog, e.g. when the application cancels authentication.
164     */
hideAuthenticationDialog()165     void hideAuthenticationDialog();
166 
167     /**
168      * Sets an instance of IUdfpsHbmListener for UdfpsController.
169      */
setUdfpsHbmListener(in IUdfpsHbmListener listener)170     void setUdfpsHbmListener(in IUdfpsHbmListener listener);
171 
172     /**
173      * Notifies System UI that the display is ready to show system decorations.
174      */
onDisplayReady(int displayId)175     void onDisplayReady(int displayId);
176 
177     /**
178      * Notifies System UI whether the recents animation is running or not.
179      */
onRecentsAnimationStateChanged(boolean running)180     void onRecentsAnimationStateChanged(boolean running);
181 
182     /**
183      * Notifies System UI side of system bar attribute change on the specified display.
184      *
185      * @param displayId the ID of the display to notify
186      * @param appearance the appearance of the focused window. The light top bar appearance is not
187      *                   controlled here, but primaryAppearance and secondaryAppearance.
188      * @param appearanceRegions a set of appearances which will be only applied in their own bounds.
189      *                         This is for system bars which across multiple stack, e.g., status
190      *                         bar, that the bar can have partial appearances in corresponding
191      *                         stacks.
192      * @param navbarColorManagedByIme {@code true} if navigation bar color is managed by IME.
193      * @param behavior the behavior of the focused window.
194      * @param isFullscreen whether any of status or navigation bar is requested invisible.
195      */
onSystemBarAttributesChanged(int displayId, int appearance, in AppearanceRegion[] appearanceRegions, boolean navbarColorManagedByIme, int behavior, boolean isFullscreen)196     void onSystemBarAttributesChanged(int displayId, int appearance,
197             in AppearanceRegion[] appearanceRegions, boolean navbarColorManagedByIme,
198             int behavior, boolean isFullscreen);
199 
200     /**
201      * Notifies System UI to show transient bars. The transient bars are system bars, e.g., status
202      * bar and navigation bar which are temporarily visible to the user.
203      *
204      * @param displayId the ID of the display to notify.
205      * @param types the internal insets types of the bars are about to show transiently.
206      */
showTransient(int displayId, in int[] types)207     void showTransient(int displayId, in int[] types);
208 
209     /**
210      * Notifies System UI to abort the transient state of system bars, which prevents the bars being
211      * hidden automatically. This is usually called when the app wants to show the permanent system
212      * bars again.
213      *
214      * @param displayId the ID of the display to notify.
215      * @param types the internal insets types of the bars are about to abort the transient state.
216      */
abortTransient(int displayId, in int[] types)217     void abortTransient(int displayId, in int[] types);
218 
219     /**
220      * Show a warning that the device is about to go to sleep due to user inactivity.
221      */
showInattentiveSleepWarning()222     void showInattentiveSleepWarning();
223 
224     /**
225      * Dismiss the warning that the device is about to go to sleep due to user inactivity.
226      */
dismissInattentiveSleepWarning(boolean animated)227     void dismissInattentiveSleepWarning(boolean animated);
228 
229     /**
230      * Displays a text toast.
231      */
showToast(int uid, String packageName, IBinder token, CharSequence text, IBinder windowToken, int duration, @nullable ITransientNotificationCallback callback)232     void showToast(int uid, String packageName, IBinder token, CharSequence text,
233             IBinder windowToken, int duration, @nullable ITransientNotificationCallback callback);
234 
235     /**
236      * Cancels toast with token {@code token} in {@code packageName}.
237      */
hideToast(String packageName, IBinder token)238     void hideToast(String packageName, IBinder token);
239 
240     /**
241      * Notifies SystemUI to start tracing.
242      */
startTracing()243     void startTracing();
244 
245     /**
246      * Notifies SystemUI to stop tracing.
247      */
stopTracing()248     void stopTracing();
249 
250     /**
251      * Handles a logging command from the WM shell command.
252      */
handleWindowManagerLoggingCommand(in String[] args, in ParcelFileDescriptor outFd)253     void handleWindowManagerLoggingCommand(in String[] args, in ParcelFileDescriptor outFd);
254 
255     /**
256      * If true, suppresses the ambient display from showing. If false, re-enables the ambient
257      * display.
258      */
suppressAmbientDisplay(boolean suppress)259     void suppressAmbientDisplay(boolean suppress);
260 
261     /**
262      * Requests {@link WindowMagnification} to set window magnification connection through
263      * {@link AccessibilityManager#setWindowMagnificationConnection(IWindowMagnificationConnection)}
264      *
265      * @param connect {@code true} if needs connection, otherwise set the connection to null.
266      */
requestWindowMagnificationConnection(boolean connect)267     void requestWindowMagnificationConnection(boolean connect);
268 
269     /**
270      * Allow for pass-through arguments from `adb shell cmd statusbar <args>`, and write to the
271      * file descriptor passed in.
272      */
passThroughShellCommand(in String[] args, in ParcelFileDescriptor pfd)273      void passThroughShellCommand(in String[] args, in ParcelFileDescriptor pfd);
274 
275     /**
276      * Enables/disables the navigation bar luma sampling.
277      *
278      * @param displayId the id of the display to notify.
279      * @param enable {@code true} if enable, otherwise set to {@code false}.
280      */
setNavigationBarLumaSamplingEnabled(int displayId, boolean enable)281     void setNavigationBarLumaSamplingEnabled(int displayId, boolean enable);
282 
283     /**
284      * Triggers a GC in the system and status bar.
285      */
runGcForTest()286     void runGcForTest();
287 }
288