| 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 |
{ |
| 43 |
void setIcon(String slot, in StatusBarIcon icon); |
| 44 |
void removeIcon(String slot); |
| 45 |
void disable(int displayId, int state1, int state2); |
| 46 |
void animateExpandNotificationsPanel(); |
| 47 |
void animateExpandSettingsPanel(String subPanel); |
| 48 |
void animateCollapsePanels(); |
| 49 |
void togglePanel(); |
| 50 |
|
| 51 |
void showWirelessChargingAnimation(int batteryLevel); |
| 52 |
|
| 53 |
void setImeWindowStatus(int displayId, in IBinder token, int vis, int backDisposition, |
| 54 |
boolean showImeSwitcher); |
| 55 |
void setWindowState(int display, int window, int state); |
| 56 |
|
| 57 |
void showRecentApps(boolean triggeredFromAltTab); |
| 58 |
void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey); |
| 59 |
void toggleRecentApps(); |
| 60 |
void toggleSplitScreen(); |
| 61 |
void preloadRecentApps(); |
| 62 |
void cancelPreloadRecentApps(); |
| 63 |
void showScreenPinningRequest(int taskId); |
| 64 |
|
| 65 |
void dismissKeyboardShortcutsMenu(); |
| 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 |
*/ |
| 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 |
*/ |
| 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 |
*/ |
| 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 |
*/ |
| 100 |
void appTransitionFinished(int displayId); |
| 101 |
|
| 102 |
void showAssistDisclosure(); |
| 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 |
*/ |
| 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 |
*/ |
| 117 |
void onEmergencyActionLaunchGestureDetected(); |
| 118 |
|
| 119 |
/** |
| 120 |
* Shows the picture-in-picture menu if an activity is in picture-in-picture mode. |
| 121 |
*/ |
| 122 |
void showPictureInPictureMenu(); |
| 123 |
|
| 124 |
/** |
| 125 |
* Shows the global actions menu. |
| 126 |
*/ |
| 127 |
void showGlobalActionsMenu(); |
| 128 |
|
| 129 |
/** |
| 130 |
* Notifies the status bar that a new rotation suggestion is available. |
| 131 |
*/ |
| 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 |
*/ |
| 139 |
void setTopAppHidesStatusBar(boolean hidesStatusBar); |
| 140 |
|
| 141 |
void addQsTile(in ComponentName tile); |
| 142 |
void remQsTile(in ComponentName tile); |
| 143 |
void clickQsTile(in ComponentName tile); |
| 144 |
void handleSystemKey(in int key); |
| 145 |
|
| 146 |
/** |
| 147 |
* Methods to show toast messages for screen pinning |
| 148 |
*/ |
| 149 |
void showPinningEnterExitToast(boolean entering); |
| 150 |
void showPinningEscapeToast(); |
| 151 |
|
| 152 |
void showShutdownUi(boolean isReboot, String reason); |
| 153 |
|
| 154 |
/** |
| 155 |
* Used to show the authentication dialog (Biometrics, Device Credential). |
| 156 |
*/ |
| 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 |
*/ |
| 163 |
void onBiometricAuthenticated(int modality); |
| 164 |
/** |
| 165 |
* Used to set a temporary message, e.g. fingerprint not recognized, finger moved too fast, etc. |
| 166 |
*/ |
| 167 |
void onBiometricHelp(int modality, String message); |
| 168 |
/** Used to show an error - the dialog will dismiss after a certain amount of time. */ |
| 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 |
*/ |
| 173 |
void hideAuthenticationDialog(long requestId); |
| 174 |
/* Used to notify the biometric service of events that occur outside of an operation. */ |
| 175 |
void setBiometicContextListener(in IBiometricContextListener listener); |
| 176 |
|
| 177 |
/** |
| 178 |
* Sets an instance of IUdfpsHbmListener for UdfpsController. |
| 179 |
*/ |
| 180 |
void setUdfpsHbmListener(in IUdfpsHbmListener listener); |
| 181 |
|
| 182 |
/** |
| 183 |
* Notifies System UI that the display is ready to show system decorations. |
| 184 |
*/ |
| 185 |
void onDisplayReady(int displayId); |
| 186 |
|
| 187 |
/** |
| 188 |
* Notifies System UI whether the recents animation is running or not. |
| 189 |
*/ |
| 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 |
*/ |
| 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 |
*/ |
| 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 |
*/ |
| 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 |
*/ |
| 237 |
void showInattentiveSleepWarning(); |
| 238 |
|
| 239 |
/** |
| 240 |
* Dismiss the warning that the device is about to go to sleep due to user inactivity. |
| 241 |
*/ |
| 242 |
void dismissInattentiveSleepWarning(boolean animated); |
| 243 |
|
| 244 |
/** |
| 245 |
* Displays a text toast. |
| 246 |
*/ |
| 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 |
*/ |
| 254 |
void hideToast(String packageName, IBinder token); |
| 255 |
|
| 256 |
/** |
| 257 |
* Notifies SystemUI to start tracing. |
| 258 |
*/ |
| 259 |
void startTracing(); |
| 260 |
|
| 261 |
/** |
| 262 |
* Notifies SystemUI to stop tracing. |
| 263 |
*/ |
| 264 |
void stopTracing(); |
| 265 |
|
| 266 |
/** |
| 267 |
* If true, suppresses the ambient display from showing. If false, re-enables the ambient |
| 268 |
* display. |
| 269 |
*/ |
| 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 |
*/ |
| 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 |
*/ |
| 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 |
*/ |
| 292 |
void setNavigationBarLumaSamplingEnabled(int displayId, boolean enable); |
| 293 |
|
| 294 |
/** |
| 295 |
* Triggers a GC in the system and status bar. |
| 296 |
*/ |
| 297 |
void runGcForTest(); |
| 298 |
|
| 299 |
/** |
| 300 |
* Send a request to SystemUI to put a given active tile in listening state |
| 301 |
*/ |
| 302 |
void requestTileServiceListeningState(in ComponentName componentName); |
| 303 |
|
| 304 |
void requestAddTile(in ComponentName componentName, in CharSequence appName, in CharSequence label, in Icon icon, in IAddTileResultCallback callback); |
| 305 |
void cancelRequestAddTile(in String packageName); |
| 306 |
|
| 307 |
/** Notifies System UI about an update to the media tap-to-transfer sender state. */ |
| 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. */ |
| 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. */ |
| 321 |
void registerNearbyMediaDevicesProvider(in INearbyMediaDevicesProvider provider); |
| 322 |
|
| 323 |
/** Unregisters a nearby media devices provider. */ |
| 324 |
void unregisterNearbyMediaDevicesProvider(in INearbyMediaDevicesProvider provider); |
| 325 |
|
| 326 |
/** Dump protos from SystemUI. The proto definition is defined there */ |
| 327 |
void dumpProto(in String[] args, in ParcelFileDescriptor pfd); |
| 328 |
|
| 329 |
/** Shows rear display educational dialog */ |
| 330 |
void showRearDisplayDialog(int currentBaseState); |
| 331 |
|
| 332 |
/** Called when requested to go to fullscreen from the active split app. */ |
| 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 |
*/ |
| 340 |
void enterStageSplitFromRunningApp(boolean leftOrTop); |
| 341 |
} |