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.drawable.Icon; 22 import android.graphics.Rect; 23 import android.hardware.biometrics.IBiometricContextListener; 24 import android.hardware.biometrics.IBiometricSysuiReceiver; 25 import android.hardware.biometrics.PromptInfo; 26 import android.hardware.fingerprint.IUdfpsHbmListener; 27 import android.media.INearbyMediaDevicesProvider; 28 import android.media.MediaRoute2Info; 29 import android.os.Bundle; 30 import android.os.ParcelFileDescriptor; 31 import android.service.notification.StatusBarNotification; 32 import android.view.InsetsVisibilities; 33 34 import com.android.internal.statusbar.IAddTileResultCallback; 35 import com.android.internal.statusbar.IUndoMediaTransferCallback; 36 import com.android.internal.statusbar.LetterboxDetails; 37 import com.android.internal.statusbar.StatusBarIcon; 38 import com.android.internal.view.AppearanceRegion; 39 40 /** @hide */ 41 oneway interface IStatusBar 42 { setIcon(String slot, in StatusBarIcon icon)43 void setIcon(String slot, in StatusBarIcon icon); removeIcon(String slot)44 void removeIcon(String slot); disable(int displayId, int state1, int state2)45 void disable(int displayId, int state1, int state2); animateExpandNotificationsPanel()46 void animateExpandNotificationsPanel(); animateExpandSettingsPanel(String subPanel)47 void animateExpandSettingsPanel(String subPanel); animateCollapsePanels()48 void animateCollapsePanels(); togglePanel()49 void togglePanel(); 50 showWirelessChargingAnimation(int batteryLevel)51 void showWirelessChargingAnimation(int batteryLevel); 52 setImeWindowStatus(int displayId, in IBinder token, int vis, int backDisposition, boolean showImeSwitcher)53 void setImeWindowStatus(int displayId, in IBinder token, int vis, int backDisposition, 54 boolean showImeSwitcher); setWindowState(int display, int window, int state)55 void setWindowState(int display, int window, int state); 56 showRecentApps(boolean triggeredFromAltTab)57 void showRecentApps(boolean triggeredFromAltTab); hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey)58 void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey); toggleRecentApps()59 void toggleRecentApps(); toggleSplitScreen()60 void toggleSplitScreen(); preloadRecentApps()61 void preloadRecentApps(); cancelPreloadRecentApps()62 void cancelPreloadRecentApps(); showScreenPinningRequest(int taskId)63 void showScreenPinningRequest(int taskId); 64 dismissKeyboardShortcutsMenu()65 void dismissKeyboardShortcutsMenu(); toggleKeyboardShortcutsMenu(int deviceId)66 void toggleKeyboardShortcutsMenu(int deviceId); 67 68 /** 69 * Notifies System UI on the specified display that an app transition is pending to delay 70 * applying some flags with visual impact until {@link #appTransitionReady} is called. 71 * 72 * @param displayId the id of the display to notify 73 */ appTransitionPending(int displayId)74 void appTransitionPending(int displayId); 75 76 /** 77 * Notifies System UI on the specified display that a pending app transition has been cancelled. 78 * 79 * @param displayId the id of the display to notify 80 */ appTransitionCancelled(int displayId)81 void appTransitionCancelled(int displayId); 82 83 /** 84 * Notifies System UI on the specified display that an app transition is now being executed. 85 * 86 * @param displayId the id of the display to notify 87 * @param statusBarAnimationsStartTime the desired start time for all visual animations in the 88 * status bar caused by this app transition in uptime millis 89 * @param statusBarAnimationsDuration the duration for all visual animations in the status 90 * bar caused by this app transition in millis 91 */ appTransitionStarting(int displayId, long statusBarAnimationsStartTime, long statusBarAnimationsDuration)92 void appTransitionStarting(int displayId, long statusBarAnimationsStartTime, 93 long statusBarAnimationsDuration); 94 95 /** 96 * Notifies System UI on the specified display that an app transition is done. 97 * 98 * @param displayId the id of the display to notify 99 */ appTransitionFinished(int displayId)100 void appTransitionFinished(int displayId); 101 showAssistDisclosure()102 void showAssistDisclosure(); startAssist(in Bundle args)103 void startAssist(in Bundle args); 104 105 /** 106 * Notifies the status bar that a camera launch gesture has been detected. 107 * 108 * @param source the identifier for the gesture, see {@link StatusBarManager} 109 */ onCameraLaunchGestureDetected(int source)110 void onCameraLaunchGestureDetected(int source); 111 112 /** 113 * Notifies the status bar that the Emergency Action launch gesture has been detected. 114 * 115 * TODO(b/169175022) Update method name and docs when feature name is locked. 116 */ onEmergencyActionLaunchGestureDetected()117 void onEmergencyActionLaunchGestureDetected(); 118 119 /** 120 * Shows the picture-in-picture menu if an activity is in picture-in-picture mode. 121 */ showPictureInPictureMenu()122 void showPictureInPictureMenu(); 123 124 /** 125 * Shows the global actions menu. 126 */ showGlobalActionsMenu()127 void showGlobalActionsMenu(); 128 129 /** 130 * Notifies the status bar that a new rotation suggestion is available. 131 */ onProposedRotationChanged(int rotation, boolean isValid)132 void onProposedRotationChanged(int rotation, boolean isValid); 133 134 /** 135 * Set whether the top app currently hides the statusbar. 136 * 137 * @param hidesStatusBar whether it is being hidden 138 */ setTopAppHidesStatusBar(boolean hidesStatusBar)139 void setTopAppHidesStatusBar(boolean hidesStatusBar); 140 addQsTile(in ComponentName tile)141 void addQsTile(in ComponentName tile); remQsTile(in ComponentName tile)142 void remQsTile(in ComponentName tile); clickQsTile(in ComponentName tile)143 void clickQsTile(in ComponentName tile); handleSystemKey(in int key)144 void handleSystemKey(in int key); 145 146 /** 147 * Methods to show toast messages for screen pinning 148 */ showPinningEnterExitToast(boolean entering)149 void showPinningEnterExitToast(boolean entering); showPinningEscapeToast()150 void showPinningEscapeToast(); 151 showShutdownUi(boolean isReboot, String reason)152 void showShutdownUi(boolean isReboot, String reason); 153 154 /** 155 * Used to show the authentication dialog (Biometrics, Device Credential). 156 */ showAuthenticationDialog(in PromptInfo promptInfo, IBiometricSysuiReceiver sysuiReceiver, in int[] sensorIds, boolean credentialAllowed, boolean requireConfirmation, int userId, long operationId, String opPackageName, long requestId, int multiSensorConfig)157 void showAuthenticationDialog(in PromptInfo promptInfo, IBiometricSysuiReceiver sysuiReceiver, 158 in int[] sensorIds, boolean credentialAllowed, boolean requireConfirmation, int userId, 159 long operationId, String opPackageName, long requestId, int multiSensorConfig); 160 /** 161 * Used to notify the authentication dialog that a biometric has been authenticated. 162 */ onBiometricAuthenticated(int modality)163 void onBiometricAuthenticated(int modality); 164 /** 165 * Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc. 166 */ onBiometricHelp(int modality, String message)167 void onBiometricHelp(int modality, String message); 168 /** Used to show an error - the dialog will dismiss after a certain amount of time. */ onBiometricError(int modality, int error, int vendorCode)169 void onBiometricError(int modality, int error, int vendorCode); 170 /** 171 * Used to hide the authentication dialog, e.g. when the application cancels authentication. 172 */ hideAuthenticationDialog(long requestId)173 void hideAuthenticationDialog(long requestId); 174 /* Used to notify the biometric service of events that occur outside of an operation. */ setBiometicContextListener(in IBiometricContextListener listener)175 void setBiometicContextListener(in IBiometricContextListener listener); 176 177 /** 178 * Sets an instance of IUdfpsHbmListener for UdfpsController. 179 */ setUdfpsHbmListener(in IUdfpsHbmListener listener)180 void setUdfpsHbmListener(in IUdfpsHbmListener listener); 181 182 /** 183 * Notifies System UI that the display is ready to show system decorations. 184 */ onDisplayReady(int displayId)185 void onDisplayReady(int displayId); 186 187 /** 188 * Notifies System UI whether the recents animation is running or not. 189 */ onRecentsAnimationStateChanged(boolean running)190 void onRecentsAnimationStateChanged(boolean running); 191 192 /** 193 * Notifies System UI side of system bar attribute change on the specified display. 194 * 195 * @param displayId the ID of the display to notify. 196 * @param appearance the appearance of the focused window. The light top bar appearance is not 197 * controlled here, but primaryAppearance and secondaryAppearance. 198 * @param appearanceRegions a set of appearances which will be only applied in their own bounds. 199 * This is for system bars which across multiple stack, e.g., status 200 * bar, that the bar can have partial appearances in corresponding 201 * stacks. 202 * @param navbarColorManagedByIme {@code true} if navigation bar color is managed by IME. 203 * @param behavior the behavior of the focused window. 204 * @param requestedVisibilities the collection of the requested visibilities of system insets. 205 * @param packageName the package name of the focused app. 206 * @param letterboxDetails a set of letterbox details of apps visible on the screen. 207 */ onSystemBarAttributesChanged(int displayId, int appearance, in AppearanceRegion[] appearanceRegions, boolean navbarColorManagedByIme, int behavior, in InsetsVisibilities requestedVisibilities, String packageName, in LetterboxDetails[] letterboxDetails)208 void onSystemBarAttributesChanged(int displayId, int appearance, 209 in AppearanceRegion[] appearanceRegions, boolean navbarColorManagedByIme, 210 int behavior, in InsetsVisibilities requestedVisibilities, String packageName, 211 in LetterboxDetails[] letterboxDetails); 212 213 /** 214 * Notifies System UI to show transient bars. The transient bars are system bars, e.g., status 215 * bar and navigation bar which are temporarily visible to the user. 216 * 217 * @param displayId the ID of the display to notify. 218 * @param types the internal insets types of the bars are about to show transiently. 219 * @param isGestureOnSystemBar whether the gesture to show the transient bar was a gesture on 220 * one of the bars itself. 221 */ showTransient(int displayId, in int[] types, boolean isGestureOnSystemBar)222 void showTransient(int displayId, in int[] types, boolean isGestureOnSystemBar); 223 224 /** 225 * Notifies System UI to abort the transient state of system bars, which prevents the bars being 226 * hidden automatically. This is usually called when the app wants to show the permanent system 227 * bars again. 228 * 229 * @param displayId the ID of the display to notify. 230 * @param types the internal insets types of the bars are about to abort the transient state. 231 */ abortTransient(int displayId, in int[] types)232 void abortTransient(int displayId, in int[] types); 233 234 /** 235 * Show a warning that the device is about to go to sleep due to user inactivity. 236 */ showInattentiveSleepWarning()237 void showInattentiveSleepWarning(); 238 239 /** 240 * Dismiss the warning that the device is about to go to sleep due to user inactivity. 241 */ dismissInattentiveSleepWarning(boolean animated)242 void dismissInattentiveSleepWarning(boolean animated); 243 244 /** 245 * Displays a text toast. 246 */ showToast(int uid, String packageName, IBinder token, CharSequence text, IBinder windowToken, int duration, @nullable ITransientNotificationCallback callback, int displayId)247 void showToast(int uid, String packageName, IBinder token, CharSequence text, 248 IBinder windowToken, int duration, @nullable ITransientNotificationCallback callback, 249 int displayId); 250 251 /** 252 * Cancels toast with token {@code token} in {@code packageName}. 253 */ hideToast(String packageName, IBinder token)254 void hideToast(String packageName, IBinder token); 255 256 /** 257 * Notifies SystemUI to start tracing. 258 */ startTracing()259 void startTracing(); 260 261 /** 262 * Notifies SystemUI to stop tracing. 263 */ stopTracing()264 void stopTracing(); 265 266 /** 267 * If true, suppresses the ambient display from showing. If false, re-enables the ambient 268 * display. 269 */ suppressAmbientDisplay(boolean suppress)270 void suppressAmbientDisplay(boolean suppress); 271 272 /** 273 * Requests {@link WindowMagnification} to set window magnification connection through 274 * {@link AccessibilityManager#setWindowMagnificationConnection(IWindowMagnificationConnection)} 275 * 276 * @param connect {@code true} if needs connection, otherwise set the connection to null. 277 */ requestWindowMagnificationConnection(boolean connect)278 void requestWindowMagnificationConnection(boolean connect); 279 280 /** 281 * Allow for pass-through arguments from `adb shell cmd statusbar <args>`, and write to the 282 * file descriptor passed in. 283 */ passThroughShellCommand(in String[] args, in ParcelFileDescriptor pfd)284 void passThroughShellCommand(in String[] args, in ParcelFileDescriptor pfd); 285 286 /** 287 * Enables/disables the navigation bar luma sampling. 288 * 289 * @param displayId the id of the display to notify. 290 * @param enable {@code true} if enable, otherwise set to {@code false}. 291 */ setNavigationBarLumaSamplingEnabled(int displayId, boolean enable)292 void setNavigationBarLumaSamplingEnabled(int displayId, boolean enable); 293 294 /** 295 * Triggers a GC in the system and status bar. 296 */ runGcForTest()297 void runGcForTest(); 298 299 /** 300 * Send a request to SystemUI to put a given active tile in listening state 301 */ requestTileServiceListeningState(in ComponentName componentName)302 void requestTileServiceListeningState(in ComponentName componentName); 303 requestAddTile(in ComponentName componentName, in CharSequence appName, in CharSequence label, in Icon icon, in IAddTileResultCallback callback)304 void requestAddTile(in ComponentName componentName, in CharSequence appName, in CharSequence label, in Icon icon, in IAddTileResultCallback callback); cancelRequestAddTile(in String packageName)305 void cancelRequestAddTile(in String packageName); 306 307 /** Notifies System UI about an update to the media tap-to-transfer sender state. */ updateMediaTapToTransferSenderDisplay( int displayState, in MediaRoute2Info routeInfo, in IUndoMediaTransferCallback undoCallback)308 void updateMediaTapToTransferSenderDisplay( 309 int displayState, 310 in MediaRoute2Info routeInfo, 311 in IUndoMediaTransferCallback undoCallback); 312 313 /** Notifies System UI about an update to the media tap-to-transfer receiver state. */ updateMediaTapToTransferReceiverDisplay( int displayState, in MediaRoute2Info routeInfo, in Icon appIcon, in CharSequence appName)314 void updateMediaTapToTransferReceiverDisplay( 315 int displayState, 316 in MediaRoute2Info routeInfo, 317 in Icon appIcon, 318 in CharSequence appName); 319 320 /** Registers a nearby media devices provider. */ registerNearbyMediaDevicesProvider(in INearbyMediaDevicesProvider provider)321 void registerNearbyMediaDevicesProvider(in INearbyMediaDevicesProvider provider); 322 323 /** Unregisters a nearby media devices provider. */ unregisterNearbyMediaDevicesProvider(in INearbyMediaDevicesProvider provider)324 void unregisterNearbyMediaDevicesProvider(in INearbyMediaDevicesProvider provider); 325 326 /** Dump protos from SystemUI. The proto definition is defined there */ dumpProto(in String[] args, in ParcelFileDescriptor pfd)327 void dumpProto(in String[] args, in ParcelFileDescriptor pfd); 328 329 /** Shows rear display educational dialog */ showRearDisplayDialog(int currentBaseState)330 void showRearDisplayDialog(int currentBaseState); 331 332 /** Called when requested to go to fullscreen from the active split app. */ goToFullscreenFromSplit()333 void goToFullscreenFromSplit(); 334 335 /** 336 * Enters stage split from a current running app. 337 * 338 * @param leftOrTop indicates where the stage split is. 339 */ enterStageSplitFromRunningApp(boolean leftOrTop)340 void enterStageSplitFromRunningApp(boolean leftOrTop); 341 342 /** 343 * Shows the media output switcher dialog. 344 * 345 * @param packageName of the session for which the output switcher is shown. 346 */ showMediaOutputSwitcher(String packageName)347 void showMediaOutputSwitcher(String packageName); 348 } 349