IActivityManager.aidl revision 402de825e7d1e27d34e56d71b6e2ef2e541c986d
1/* 2 * Copyright (C) 2016 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 17package android.app; 18 19import android.app.ActivityManager; 20import android.app.ApplicationErrorReport; 21import android.app.ContentProviderHolder; 22import android.app.GrantedUriPermission; 23import android.app.IApplicationThread; 24import android.app.IActivityController; 25import android.app.IAppTask; 26import android.app.IAssistDataReceiver; 27import android.app.IInstrumentationWatcher; 28import android.app.IProcessObserver; 29import android.app.IServiceConnection; 30import android.app.IStopUserCallback; 31import android.app.ITaskStackListener; 32import android.app.IUiAutomationConnection; 33import android.app.IUidObserver; 34import android.app.IUserSwitchObserver; 35import android.app.Notification; 36import android.app.PendingIntent; 37import android.app.PictureInPictureParams; 38import android.app.ProfilerInfo; 39import android.app.WaitResult; 40import android.app.assist.AssistContent; 41import android.app.assist.AssistStructure; 42import android.content.ComponentName; 43import android.content.IIntentReceiver; 44import android.content.IIntentSender; 45import android.content.Intent; 46import android.content.IntentFilter; 47import android.content.IntentSender; 48import android.content.pm.ApplicationInfo; 49import android.content.pm.ConfigurationInfo; 50import android.content.pm.IPackageDataObserver; 51import android.content.pm.ParceledListSlice; 52import android.content.pm.ProviderInfo; 53import android.content.pm.UserInfo; 54import android.content.res.Configuration; 55import android.graphics.Bitmap; 56import android.graphics.GraphicBuffer; 57import android.graphics.Point; 58import android.graphics.Rect; 59import android.net.Uri; 60import android.os.Bundle; 61import android.os.Debug; 62import android.os.IBinder; 63import android.os.IProgressListener; 64import android.os.ParcelFileDescriptor; 65import android.os.PersistableBundle; 66import android.os.StrictMode; 67import android.os.WorkSource; 68import android.service.voice.IVoiceInteractionSession; 69import android.view.IRecentsAnimationRunner; 70import android.view.RemoteAnimationDefinition; 71import android.view.RemoteAnimationAdapter; 72import com.android.internal.app.IVoiceInteractor; 73import com.android.internal.os.IResultReceiver; 74import com.android.internal.policy.IKeyguardDismissCallback; 75 76import java.util.List; 77 78/** 79 * System private API for talking with the activity manager service. This 80 * provides calls from the application back to the activity manager. 81 * 82 * {@hide} 83 */ 84interface IActivityManager { 85 // WARNING: when these transactions are updated, check if they are any callers on the native 86 // side. If so, make sure they are using the correct transaction ids and arguments. 87 // If a transaction which will also be used on the native side is being inserted, add it to 88 // below block of transactions. 89 90 // Since these transactions are also called from native code, these must be kept in sync with 91 // the ones in frameworks/native/libs/binder/include/binder/IActivityManager.h 92 // =============== Beginning of transactions used on native side as well ====================== 93 ParcelFileDescriptor openContentUri(in String uriString); 94 void registerUidObserver(in IUidObserver observer, int which, int cutpoint, 95 String callingPackage); 96 void unregisterUidObserver(in IUidObserver observer); 97 // =============== End of transactions used on native side as well ============================ 98 99 // Special low-level communication with activity manager. 100 void handleApplicationCrash(in IBinder app, 101 in ApplicationErrorReport.ParcelableCrashInfo crashInfo); 102 int startActivity(in IApplicationThread caller, in String callingPackage, in Intent intent, 103 in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode, 104 int flags, in ProfilerInfo profilerInfo, in Bundle options); 105 void unhandledBack(); 106 107 boolean finishActivity(in IBinder token, int code, in Intent data, int finishTask); 108 Intent registerReceiver(in IApplicationThread caller, in String callerPackage, 109 in IIntentReceiver receiver, in IntentFilter filter, 110 in String requiredPermission, int userId, int flags); 111 void unregisterReceiver(in IIntentReceiver receiver); 112 int broadcastIntent(in IApplicationThread caller, in Intent intent, 113 in String resolvedType, in IIntentReceiver resultTo, int resultCode, 114 in String resultData, in Bundle map, in String[] requiredPermissions, 115 int appOp, in Bundle options, boolean serialized, boolean sticky, int userId); 116 void unbroadcastIntent(in IApplicationThread caller, in Intent intent, int userId); 117 oneway void finishReceiver(in IBinder who, int resultCode, in String resultData, in Bundle map, 118 boolean abortBroadcast, int flags); 119 void attachApplication(in IApplicationThread app, long startSeq); 120 oneway void activityIdle(in IBinder token, in Configuration config, 121 in boolean stopProfiling); 122 void activityPaused(in IBinder token); 123 oneway void activityStopped(in IBinder token, in Bundle state, 124 in PersistableBundle persistentState, in CharSequence description); 125 String getCallingPackage(in IBinder token); 126 ComponentName getCallingActivity(in IBinder token); 127 List<ActivityManager.RunningTaskInfo> getTasks(int maxNum); 128 List<ActivityManager.RunningTaskInfo> getFilteredTasks(int maxNum, int ignoreActivityType, 129 int ignoreWindowingMode); 130 void moveTaskToFront(int task, int flags, in Bundle options); 131 void moveTaskBackwards(int task); 132 int getTaskForActivity(in IBinder token, in boolean onlyRoot); 133 ContentProviderHolder getContentProvider(in IApplicationThread caller, 134 in String name, int userId, boolean stable); 135 void publishContentProviders(in IApplicationThread caller, 136 in List<ContentProviderHolder> providers); 137 boolean refContentProvider(in IBinder connection, int stableDelta, int unstableDelta); 138 void finishSubActivity(in IBinder token, in String resultWho, int requestCode); 139 PendingIntent getRunningServiceControlPanel(in ComponentName service); 140 ComponentName startService(in IApplicationThread caller, in Intent service, 141 in String resolvedType, boolean requireForeground, in String callingPackage, int userId); 142 int stopService(in IApplicationThread caller, in Intent service, 143 in String resolvedType, int userId); 144 int bindService(in IApplicationThread caller, in IBinder token, in Intent service, 145 in String resolvedType, in IServiceConnection connection, int flags, 146 in String callingPackage, int userId); 147 boolean unbindService(in IServiceConnection connection); 148 void publishService(in IBinder token, in Intent intent, in IBinder service); 149 void activityResumed(in IBinder token); 150 void setDebugApp(in String packageName, boolean waitForDebugger, boolean persistent); 151 void setAgentApp(in String packageName, @nullable String agent); 152 void setAlwaysFinish(boolean enabled); 153 boolean startInstrumentation(in ComponentName className, in String profileFile, 154 int flags, in Bundle arguments, in IInstrumentationWatcher watcher, 155 in IUiAutomationConnection connection, int userId, 156 in String abiOverride); 157 void addInstrumentationResults(in IApplicationThread target, in Bundle results); 158 void finishInstrumentation(in IApplicationThread target, int resultCode, 159 in Bundle results); 160 /** 161 * @return A copy of global {@link Configuration}, contains general settings for the entire 162 * system. Corresponds to the configuration of the default display. 163 * @throws RemoteException 164 */ 165 Configuration getConfiguration(); 166 /** 167 * Updates global configuration and applies changes to the entire system. 168 * @param values Update values for global configuration. If null is passed it will request the 169 * Window Manager to compute new config for the default display. 170 * @throws RemoteException 171 * @return Returns true if the configuration was updated. 172 */ 173 boolean updateConfiguration(in Configuration values); 174 boolean stopServiceToken(in ComponentName className, in IBinder token, int startId); 175 ComponentName getActivityClassForToken(in IBinder token); 176 String getPackageForToken(in IBinder token); 177 void setProcessLimit(int max); 178 int getProcessLimit(); 179 int checkPermission(in String permission, int pid, int uid); 180 int checkUriPermission(in Uri uri, int pid, int uid, int mode, int userId, 181 in IBinder callerToken); 182 void grantUriPermission(in IApplicationThread caller, in String targetPkg, in Uri uri, 183 int mode, int userId); 184 void revokeUriPermission(in IApplicationThread caller, in String targetPkg, in Uri uri, 185 int mode, int userId); 186 void setActivityController(in IActivityController watcher, boolean imAMonkey); 187 void showWaitingForDebugger(in IApplicationThread who, boolean waiting); 188 /* 189 * This will deliver the specified signal to all the persistent processes. Currently only 190 * SIGUSR1 is delivered. All others are ignored. 191 */ 192 void signalPersistentProcesses(int signal); 193 194 ParceledListSlice getRecentTasks(int maxNum, int flags, int userId); 195 oneway void serviceDoneExecuting(in IBinder token, int type, int startId, int res); 196 oneway void activityDestroyed(in IBinder token); 197 IIntentSender getIntentSender(int type, in String packageName, in IBinder token, 198 in String resultWho, int requestCode, in Intent[] intents, in String[] resolvedTypes, 199 int flags, in Bundle options, int userId); 200 void cancelIntentSender(in IIntentSender sender); 201 String getPackageForIntentSender(in IIntentSender sender); 202 void registerIntentSenderCancelListener(in IIntentSender sender, in IResultReceiver receiver); 203 void unregisterIntentSenderCancelListener(in IIntentSender sender, in IResultReceiver receiver); 204 void enterSafeMode(); 205 boolean startNextMatchingActivity(in IBinder callingActivity, 206 in Intent intent, in Bundle options); 207 void noteWakeupAlarm(in IIntentSender sender, in WorkSource workSource, int sourceUid, 208 in String sourcePkg, in String tag); 209 void removeContentProvider(in IBinder connection, boolean stable); 210 void setRequestedOrientation(in IBinder token, int requestedOrientation); 211 int getRequestedOrientation(in IBinder token); 212 void unbindFinished(in IBinder token, in Intent service, boolean doRebind); 213 void setProcessImportant(in IBinder token, int pid, boolean isForeground, String reason); 214 void setServiceForeground(in ComponentName className, in IBinder token, 215 int id, in Notification notification, int flags); 216 boolean moveActivityTaskToBack(in IBinder token, boolean nonRoot); 217 void getMemoryInfo(out ActivityManager.MemoryInfo outInfo); 218 List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState(); 219 boolean clearApplicationUserData(in String packageName, boolean keepState, 220 in IPackageDataObserver observer, int userId); 221 void forceStopPackage(in String packageName, int userId); 222 boolean killPids(in int[] pids, in String reason, boolean secure); 223 List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags); 224 ActivityManager.TaskDescription getTaskDescription(int taskId); 225 // Retrieve running application processes in the system 226 List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses(); 227 // Get device configuration 228 ConfigurationInfo getDeviceConfigurationInfo(); 229 IBinder peekService(in Intent service, in String resolvedType, in String callingPackage); 230 // Turn on/off profiling in a particular process. 231 boolean profileControl(in String process, int userId, boolean start, 232 in ProfilerInfo profilerInfo, int profileType); 233 boolean shutdown(int timeout); 234 void stopAppSwitches(); 235 void resumeAppSwitches(); 236 boolean bindBackupAgent(in String packageName, int backupRestoreMode, int userId); 237 void backupAgentCreated(in String packageName, in IBinder agent); 238 void unbindBackupAgent(in ApplicationInfo appInfo); 239 int getUidForIntentSender(in IIntentSender sender); 240 int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, 241 boolean requireFull, in String name, in String callerPackage); 242 void addPackageDependency(in String packageName); 243 void killApplication(in String pkg, int appId, int userId, in String reason); 244 void closeSystemDialogs(in String reason); 245 Debug.MemoryInfo[] getProcessMemoryInfo(in int[] pids); 246 void killApplicationProcess(in String processName, int uid); 247 int startActivityIntentSender(in IApplicationThread caller, 248 in IIntentSender target, in IBinder whitelistToken, in Intent fillInIntent, 249 in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode, 250 int flagsMask, int flagsValues, in Bundle options); 251 void overridePendingTransition(in IBinder token, in String packageName, 252 int enterAnim, int exitAnim); 253 // Special low-level communication with activity manager. 254 boolean handleApplicationWtf(in IBinder app, in String tag, boolean system, 255 in ApplicationErrorReport.ParcelableCrashInfo crashInfo); 256 void killBackgroundProcesses(in String packageName, int userId); 257 boolean isUserAMonkey(); 258 WaitResult startActivityAndWait(in IApplicationThread caller, in String callingPackage, 259 in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, 260 int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options, 261 int userId); 262 boolean willActivityBeVisible(in IBinder token); 263 int startActivityWithConfig(in IApplicationThread caller, in String callingPackage, 264 in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, 265 int requestCode, int startFlags, in Configuration newConfig, 266 in Bundle options, int userId); 267 // Retrieve info of applications installed on external media that are currently 268 // running. 269 List<ApplicationInfo> getRunningExternalApplications(); 270 void finishHeavyWeightApp(); 271 // A StrictMode violation to be handled. The violationMask is a 272 // subset of the original StrictMode policy bitmask, with only the 273 // bit violated and penalty bits to be executed by the 274 // ActivityManagerService remaining set. 275 void handleApplicationStrictModeViolation(in IBinder app, int violationMask, 276 in StrictMode.ViolationInfo crashInfo); 277 boolean isImmersive(in IBinder token); 278 void setImmersive(in IBinder token, boolean immersive); 279 boolean isTopActivityImmersive(); 280 void crashApplication(int uid, int initialPid, in String packageName, int userId, in String message); 281 String getProviderMimeType(in Uri uri, int userId); 282 IBinder newUriPermissionOwner(in String name); 283 void grantUriPermissionFromOwner(in IBinder owner, int fromUid, in String targetPkg, 284 in Uri uri, int mode, int sourceUserId, int targetUserId); 285 void revokeUriPermissionFromOwner(in IBinder owner, in Uri uri, int mode, int userId); 286 int checkGrantUriPermission(int callingUid, in String targetPkg, in Uri uri, 287 int modeFlags, int userId); 288 // Cause the specified process to dump the specified heap. 289 boolean dumpHeap(in String process, int userId, boolean managed, boolean mallocInfo, 290 boolean runGc, in String path, in ParcelFileDescriptor fd); 291 int startActivities(in IApplicationThread caller, in String callingPackage, 292 in Intent[] intents, in String[] resolvedTypes, in IBinder resultTo, 293 in Bundle options, int userId); 294 boolean isUserRunning(int userid, int flags); 295 oneway void activitySlept(in IBinder token); 296 int getFrontActivityScreenCompatMode(); 297 void setFrontActivityScreenCompatMode(int mode); 298 int getPackageScreenCompatMode(in String packageName); 299 void setPackageScreenCompatMode(in String packageName, int mode); 300 boolean getPackageAskScreenCompat(in String packageName); 301 void setPackageAskScreenCompat(in String packageName, boolean ask); 302 boolean switchUser(int userid); 303 void setFocusedTask(int taskId); 304 boolean removeTask(int taskId); 305 void registerProcessObserver(in IProcessObserver observer); 306 void unregisterProcessObserver(in IProcessObserver observer); 307 boolean isIntentSenderTargetedToPackage(in IIntentSender sender); 308 void updatePersistentConfiguration(in Configuration values); 309 long[] getProcessPss(in int[] pids); 310 void showBootMessage(in CharSequence msg, boolean always); 311 void killAllBackgroundProcesses(); 312 ContentProviderHolder getContentProviderExternal(in String name, int userId, 313 in IBinder token); 314 void removeContentProviderExternal(in String name, in IBinder token); 315 // Get memory information about the calling process. 316 void getMyMemoryState(out ActivityManager.RunningAppProcessInfo outInfo); 317 boolean killProcessesBelowForeground(in String reason); 318 UserInfo getCurrentUser(); 319 boolean shouldUpRecreateTask(in IBinder token, in String destAffinity); 320 boolean navigateUpTo(in IBinder token, in Intent target, int resultCode, 321 in Intent resultData); 322 /** 323 * Informs ActivityManagerService that the keyguard is showing. 324 * 325 * @param showing True if the keyguard is showing, false otherwise. 326 * @param secondaryDisplayShowing The displayId of the secondary display on which the keyguard 327 * is showing, or INVALID_DISPLAY if there is no such display. Only meaningful if 328 * showing is true. 329 */ 330 void setLockScreenShown(boolean showing, int secondaryDisplayShowing); 331 boolean finishActivityAffinity(in IBinder token); 332 // This is not public because you need to be very careful in how you 333 // manage your activity to make sure it is always the uid you expect. 334 int getLaunchedFromUid(in IBinder activityToken); 335 void unstableProviderDied(in IBinder connection); 336 boolean isIntentSenderAnActivity(in IIntentSender sender); 337 boolean isIntentSenderAForegroundService(in IIntentSender sender); 338 int startActivityAsUser(in IApplicationThread caller, in String callingPackage, 339 in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, 340 int requestCode, int flags, in ProfilerInfo profilerInfo, 341 in Bundle options, int userId); 342 int stopUser(int userid, boolean force, in IStopUserCallback callback); 343 void registerUserSwitchObserver(in IUserSwitchObserver observer, in String name); 344 void unregisterUserSwitchObserver(in IUserSwitchObserver observer); 345 int[] getRunningUserIds(); 346 347 // Deprecated - This method is only used by a few internal components and it will soon be 348 // replaced by a proper bug report API (which will be restricted to a few, pre-defined apps). 349 // No new code should be calling it. 350 void requestBugReport(int bugreportType); 351 352 /** 353 * Takes a telephony bug report and notifies the user with the title and description 354 * that are passed to this API as parameters 355 * 356 * @param shareTitle should be a valid legible string less than 50 chars long 357 * @param shareDescription should be less than 91 bytes when encoded into UTF-8 format 358 * 359 * @throws IllegalArgumentException if shareTitle or shareDescription is too big or if the 360 * paremeters cannot be encoding to an UTF-8 charset. 361 */ 362 void requestTelephonyBugReport(in String shareTitle, in String shareDescription); 363 364 /** 365 * Deprecated - This method is only used by Wifi, and it will soon be replaced by a proper 366 * bug report API. 367 * 368 * Takes a minimal bugreport of Wifi-related state. 369 * 370 * @param shareTitle should be a valid legible string less than 50 chars long 371 * @param shareDescription should be less than 91 bytes when encoded into UTF-8 format 372 * 373 * @throws IllegalArgumentException if shareTitle or shareDescription is too big or if the 374 * parameters cannot be encoding to an UTF-8 charset. 375 */ 376 void requestWifiBugReport(in String shareTitle, in String shareDescription); 377 378 long inputDispatchingTimedOut(int pid, boolean aboveSystem, in String reason); 379 void clearPendingBackup(); 380 Intent getIntentForIntentSender(in IIntentSender sender); 381 Bundle getAssistContextExtras(int requestType); 382 void reportAssistContextExtras(in IBinder token, in Bundle extras, 383 in AssistStructure structure, in AssistContent content, in Uri referrer); 384 // This is not public because you need to be very careful in how you 385 // manage your activity to make sure it is always the uid you expect. 386 String getLaunchedFromPackage(in IBinder activityToken); 387 void killUid(int appId, int userId, in String reason); 388 void setUserIsMonkey(boolean monkey); 389 void hang(in IBinder who, boolean allowRestart); 390 391 /** 392 * Sets the windowing mode for a specific task. Only works on tasks of type 393 * {@link WindowConfiguration#ACTIVITY_TYPE_STANDARD} 394 * @param taskId The id of the task to set the windowing mode for. 395 * @param windowingMode The windowing mode to set for the task. 396 * @param toTop If the task should be moved to the top once the windowing mode changes. 397 */ 398 void setTaskWindowingMode(int taskId, int windowingMode, boolean toTop); 399 void moveTaskToStack(int taskId, int stackId, boolean toTop); 400 /** 401 * Resizes the input stack id to the given bounds. 402 * 403 * @param stackId Id of the stack to resize. 404 * @param bounds Bounds to resize the stack to or {@code null} for fullscreen. 405 * @param allowResizeInDockedMode True if the resize should be allowed when the docked stack is 406 * active. 407 * @param preserveWindows True if the windows of activities contained in the stack should be 408 * preserved. 409 * @param animate True if the stack resize should be animated. 410 * @param animationDuration The duration of the resize animation in milliseconds or -1 if the 411 * default animation duration should be used. 412 * @throws RemoteException 413 */ 414 void resizeStack(int stackId, in Rect bounds, boolean allowResizeInDockedMode, 415 boolean preserveWindows, boolean animate, int animationDuration); 416 List<ActivityManager.StackInfo> getAllStackInfos(); 417 void setFocusedStack(int stackId); 418 ActivityManager.StackInfo getFocusedStackInfo(); 419 ActivityManager.StackInfo getStackInfo(int windowingMode, int activityType); 420 boolean convertFromTranslucent(in IBinder token); 421 boolean convertToTranslucent(in IBinder token, in Bundle options); 422 void notifyActivityDrawn(in IBinder token); 423 void reportActivityFullyDrawn(in IBinder token, boolean restoredFromBundle); 424 void restart(); 425 void performIdleMaintenance(); 426 void takePersistableUriPermission(in Uri uri, int modeFlags, String toPackage, int userId); 427 void releasePersistableUriPermission(in Uri uri, int modeFlags, String toPackage, int userId); 428 ParceledListSlice getPersistedUriPermissions(in String packageName, boolean incoming); 429 void appNotRespondingViaProvider(in IBinder connection); 430 Rect getTaskBounds(int taskId); 431 int getActivityDisplayId(in IBinder activityToken); 432 boolean setProcessMemoryTrimLevel(in String process, int uid, int level); 433 434 435 // Start of L transactions 436 String getTagForIntentSender(in IIntentSender sender, in String prefix); 437 boolean startUserInBackground(int userid); 438 void startLockTaskModeByToken(in IBinder token); 439 void stopLockTaskModeByToken(in IBinder token); 440 boolean isInLockTaskMode(); 441 void setTaskDescription(in IBinder token, in ActivityManager.TaskDescription values); 442 int startVoiceActivity(in String callingPackage, int callingPid, int callingUid, 443 in Intent intent, in String resolvedType, in IVoiceInteractionSession session, 444 in IVoiceInteractor interactor, int flags, in ProfilerInfo profilerInfo, 445 in Bundle options, int userId); 446 int startAssistantActivity(in String callingPackage, int callingPid, int callingUid, 447 in Intent intent, in String resolvedType, in Bundle options, int userId); 448 void startRecentsActivity(in Intent intent, in IAssistDataReceiver assistDataReceiver, 449 in IRecentsAnimationRunner recentsAnimationRunner); 450 void cancelRecentsAnimation(); 451 int startActivityFromRecents(int taskId, in Bundle options); 452 Bundle getActivityOptions(in IBinder token); 453 List<IBinder> getAppTasks(in String callingPackage); 454 void startSystemLockTaskMode(int taskId); 455 void stopSystemLockTaskMode(); 456 void finishVoiceTask(in IVoiceInteractionSession session); 457 boolean isTopOfTask(in IBinder token); 458 void notifyLaunchTaskBehindComplete(in IBinder token); 459 void notifyEnterAnimationComplete(in IBinder token); 460 int startActivityAsCaller(in IApplicationThread caller, in String callingPackage, 461 in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, 462 int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options, 463 boolean ignoreTargetSecurity, int userId); 464 int addAppTask(in IBinder activityToken, in Intent intent, 465 in ActivityManager.TaskDescription description, in Bitmap thumbnail); 466 Point getAppTaskThumbnailSize(); 467 boolean releaseActivityInstance(in IBinder token); 468 void releaseSomeActivities(in IApplicationThread app); 469 void bootAnimationComplete(); 470 Bitmap getTaskDescriptionIcon(in String filename, int userId); 471 boolean launchAssistIntent(in Intent intent, int requestType, in String hint, int userHandle, 472 in Bundle args); 473 void startInPlaceAnimationOnFrontMostApplication(in Bundle opts); 474 int checkPermissionWithToken(in String permission, int pid, int uid, 475 in IBinder callerToken); 476 void registerTaskStackListener(in ITaskStackListener listener); 477 void unregisterTaskStackListener(in ITaskStackListener listener); 478 479 void notifyCleartextNetwork(int uid, in byte[] firstPacket); 480 int createStackOnDisplay(int displayId); 481 void setTaskResizeable(int taskId, int resizeableMode); 482 boolean requestAssistContextExtras(int requestType, in IAssistDataReceiver receiver, 483 in Bundle receiverExtras, in IBinder activityToken, 484 boolean focused, boolean newSessionId); 485 void resizeTask(int taskId, in Rect bounds, int resizeMode); 486 int getLockTaskModeState(); 487 void setDumpHeapDebugLimit(in String processName, int uid, long maxMemSize, 488 in String reportPackage); 489 void dumpHeapFinished(in String path); 490 void setVoiceKeepAwake(in IVoiceInteractionSession session, boolean keepAwake); 491 void updateLockTaskPackages(int userId, in String[] packages); 492 void noteAlarmStart(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String tag); 493 void noteAlarmFinish(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String tag); 494 int getPackageProcessState(in String packageName, in String callingPackage); 495 oneway void showLockTaskEscapeMessage(in IBinder token); 496 void updateDeviceOwner(in String packageName); 497 /** 498 * Notify the system that the keyguard is going away. 499 * 500 * @param flags See {@link android.view.WindowManagerPolicyConstants#KEYGUARD_GOING_AWAY_FLAG_TO_SHADE} 501 * etc. 502 */ 503 void keyguardGoingAway(int flags); 504 int getUidProcessState(int uid, in String callingPackage); 505 boolean isAssistDataAllowedOnCurrentActivity(); 506 boolean showAssistFromActivity(in IBinder token, in Bundle args); 507 boolean isRootVoiceInteraction(in IBinder token); 508 509 510 // Start of N transactions 511 // Start Binder transaction tracking for all applications. 512 boolean startBinderTracking(); 513 // Stop Binder transaction tracking for all applications and dump trace data to the given file 514 // descriptor. 515 boolean stopBinderTrackingAndDump(in ParcelFileDescriptor fd); 516 /** 517 * Try to place task to provided position. The final position might be different depending on 518 * current user and stacks state. The task will be moved to target stack if it's currently in 519 * different stack. 520 */ 521 void positionTaskInStack(int taskId, int stackId, int position); 522 void exitFreeformMode(in IBinder token); 523 void reportSizeConfigurations(in IBinder token, in int[] horizontalSizeConfiguration, 524 in int[] verticalSizeConfigurations, in int[] smallestWidthConfigurations); 525 boolean setTaskWindowingModeSplitScreenPrimary(int taskId, int createMode, boolean toTop, 526 boolean animate, in Rect initialBounds, boolean showRecents); 527 /** 528 * Dismisses split-screen multi-window mode. 529 * {@param toTop} If true the current primary split-screen stack will be placed or left on top. 530 */ 531 void dismissSplitScreenMode(boolean toTop); 532 /** 533 * Dismisses PiP 534 * @param animate True if the dismissal should be animated. 535 * @param animationDuration The duration of the resize animation in milliseconds or -1 if the 536 * default animation duration should be used. 537 */ 538 void dismissPip(boolean animate, int animationDuration); 539 void suppressResizeConfigChanges(boolean suppress); 540 void moveTasksToFullscreenStack(int fromStackId, boolean onTop); 541 boolean moveTopActivityToPinnedStack(int stackId, in Rect bounds); 542 boolean isAppStartModeDisabled(int uid, in String packageName); 543 boolean unlockUser(int userid, in byte[] token, in byte[] secret, 544 in IProgressListener listener); 545 boolean isInMultiWindowMode(in IBinder token); 546 boolean isInPictureInPictureMode(in IBinder token); 547 void killPackageDependents(in String packageName, int userId); 548 boolean enterPictureInPictureMode(in IBinder token, in PictureInPictureParams params); 549 void setPictureInPictureParams(in IBinder token, in PictureInPictureParams params); 550 int getMaxNumPictureInPictureActions(in IBinder token); 551 void activityRelaunched(in IBinder token); 552 IBinder getUriPermissionOwnerForActivity(in IBinder activityToken); 553 /** 554 * Resizes the docked stack, and all other stacks as the result of the dock stack bounds change. 555 * 556 * @param dockedBounds The bounds for the docked stack. 557 * @param tempDockedTaskBounds The temporary bounds for the tasks in the docked stack, which 558 * might be different from the stack bounds to allow more 559 * flexibility while resizing, or {@code null} if they should be the 560 * same as the stack bounds. 561 * @param tempDockedTaskInsetBounds The temporary bounds for the tasks to calculate the insets. 562 * When resizing, we usually "freeze" the layout of a task. To 563 * achieve that, we also need to "freeze" the insets, which 564 * gets achieved by changing task bounds but not bounds used 565 * to calculate the insets in this transient state 566 * @param tempOtherTaskBounds The temporary bounds for the tasks in all other stacks, or 567 * {@code null} if they should be the same as the stack bounds. 568 * @param tempOtherTaskInsetBounds Like {@code tempDockedTaskInsetBounds}, but for the other 569 * stacks. 570 * @throws RemoteException 571 */ 572 void resizeDockedStack(in Rect dockedBounds, in Rect tempDockedTaskBounds, 573 in Rect tempDockedTaskInsetBounds, 574 in Rect tempOtherTaskBounds, in Rect tempOtherTaskInsetBounds); 575 int setVrMode(in IBinder token, boolean enabled, in ComponentName packageName); 576 // Gets the URI permissions granted to an arbitrary package (or all packages if null) 577 // NOTE: this is different from getPersistedUriPermissions(), which returns the URIs the package 578 // granted to another packages (instead of those granted to it). 579 ParceledListSlice getGrantedUriPermissions(in String packageName, int userId); 580 // Clears the URI permissions granted to an arbitrary package. 581 void clearGrantedUriPermissions(in String packageName, int userId); 582 boolean isAppForeground(int uid); 583 void startLocalVoiceInteraction(in IBinder token, in Bundle options); 584 void stopLocalVoiceInteraction(in IBinder token); 585 boolean supportsLocalVoiceInteraction(); 586 void notifyPinnedStackAnimationStarted(); 587 void notifyPinnedStackAnimationEnded(); 588 void removeStack(int stackId); 589 /** 590 * Removes stacks in the input windowing modes from the system if they are of activity type 591 * ACTIVITY_TYPE_STANDARD or ACTIVITY_TYPE_UNDEFINED 592 */ 593 void removeStacksInWindowingModes(in int[] windowingModes); 594 /** Removes stack of the activity types from the system. */ 595 void removeStacksWithActivityTypes(in int[] activityTypes); 596 void makePackageIdle(String packageName, int userId); 597 int getMemoryTrimLevel(); 598 /** 599 * Resizes the pinned stack. 600 * 601 * @param pinnedBounds The bounds for the pinned stack. 602 * @param tempPinnedTaskBounds The temporary bounds for the tasks in the pinned stack, which 603 * might be different from the stack bounds to allow more 604 * flexibility while resizing, or {@code null} if they should be the 605 * same as the stack bounds. 606 */ 607 void resizePinnedStack(in Rect pinnedBounds, in Rect tempPinnedTaskBounds); 608 boolean isVrModePackageEnabled(in ComponentName packageName); 609 void notifyLockedProfile(int userId); 610 void startConfirmDeviceCredentialIntent(in Intent intent, in Bundle options); 611 void sendIdleJobTrigger(); 612 int sendIntentSender(in IIntentSender target, in IBinder whitelistToken, int code, 613 in Intent intent, in String resolvedType, in IIntentReceiver finishedReceiver, 614 in String requiredPermission, in Bundle options); 615 boolean isBackgroundRestricted(in String packageName); 616 617 // Start of N MR1 transactions 618 void setVrThread(int tid); 619 void setRenderThread(int tid); 620 /** 621 * Lets activity manager know whether the calling process is currently showing "top-level" UI 622 * that is not an activity, i.e. windows on the screen the user is currently interacting with. 623 * 624 * <p>This flag can only be set for persistent processes. 625 * 626 * @param hasTopUi Whether the calling process has "top-level" UI. 627 */ 628 void setHasTopUi(boolean hasTopUi); 629 630 // Start of O transactions 631 /** 632 * Updates override configuration applied to specific display. 633 * @param values Update values for display configuration. If null is passed it will request the 634 * Window Manager to compute new config for the specified display. 635 * @param displayId Id of the display to apply the config to. 636 * @throws RemoteException 637 * @return Returns true if the configuration was updated. 638 */ 639 boolean updateDisplayOverrideConfiguration(in Configuration values, int displayId); 640 void moveStackToDisplay(int stackId, int displayId); 641 boolean requestAutofillData(in IAssistDataReceiver receiver, in Bundle receiverExtras, 642 in IBinder activityToken, int flags); 643 void dismissKeyguard(in IBinder token, in IKeyguardDismissCallback callback, 644 in CharSequence message); 645 int restartUserInBackground(int userId); 646 647 /** Cancels the window transitions for the given task. */ 648 void cancelTaskWindowTransition(int taskId); 649 650 /** 651 * @param taskId the id of the task to retrieve the sAutoapshots for 652 * @param reducedResolution if set, if the snapshot needs to be loaded from disk, this will load 653 * a reduced resolution of it, which is much faster 654 * @return a graphic buffer representing a screenshot of a task 655 */ 656 ActivityManager.TaskSnapshot getTaskSnapshot(int taskId, boolean reducedResolution); 657 658 void scheduleApplicationInfoChanged(in List<String> packageNames, int userId); 659 void setPersistentVrThread(int tid); 660 661 void waitForNetworkStateUpdate(long procStateSeq); 662 663 /** 664 * See {@link android.app.Activity#setDisablePreviewScreenshots} 665 */ 666 void setDisablePreviewScreenshots(IBinder token, boolean disable); 667 668 /** 669 * Return the user id of last resumed activity. 670 */ 671 int getLastResumedActivityUserId(); 672 673 /** 674 * Add a bare uid to the background restrictions whitelist. Only the system uid may call this. 675 */ 676 void backgroundWhitelistUid(int uid); 677 678 // Start of P transactions 679 void updateLockTaskFeatures(int userId, int flags); 680 681 // WARNING: when these transactions are updated, check if they are any callers on the native 682 // side. If so, make sure they are using the correct transaction ids and arguments. 683 // If a transaction which will also be used on the native side is being inserted, add it 684 // alongside with other transactions of this kind at the top of this file. 685 686 void setShowWhenLocked(in IBinder token, boolean showWhenLocked); 687 void setTurnScreenOn(in IBinder token, boolean turnScreenOn); 688 689 /** 690 * Similar to {@link #startUserInBackground(int userId), but with a listener to report 691 * user unlock progress. 692 */ 693 boolean startUserInBackgroundWithListener(int userid, IProgressListener unlockProgressListener); 694 695 /** 696 * Registers remote animations for a specific activity. 697 */ 698 void registerRemoteAnimations(in IBinder token, in RemoteAnimationDefinition definition); 699 700 /** 701 * Registers a remote animation to be run for all activity starts from a certain package during 702 * a short predefined amount of time. 703 */ 704 void registerRemoteAnimationForNextActivityStart(in String packageName, 705 in RemoteAnimationAdapter adapter); 706 707 /** @see android.app.ActivityManager#alwaysShowUnsupportedCompileSdkWarning */ 708 void alwaysShowUnsupportedCompileSdkWarning(in ComponentName activity); 709} 710