IActivityManager.aidl revision e1fe7fa288a34ecaaab390f49ef540edc4a6c52d
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.IApplicationThread;
23import android.app.IActivityContainer;
24import android.app.IActivityContainerCallback;
25import android.app.IActivityController;
26import android.app.IAppTask;
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;
34
35import android.app.IUserSwitchObserver;
36import android.app.Notification;
37import android.app.PendingIntent;
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.Point;
57import android.graphics.Rect;
58import android.net.Uri;
59import android.os.Bundle;
60import android.os.Debug;
61import android.os.IBinder;
62import android.os.IProgressListener;
63import android.os.ParcelFileDescriptor;
64import android.os.PersistableBundle;
65import android.os.StrictMode;
66import android.service.voice.IVoiceInteractionSession;
67import com.android.internal.app.IVoiceInteractor;
68import com.android.internal.os.IResultReceiver;
69import com.android.internal.policy.IKeyguardDismissCallback;
70
71import java.util.List;
72
73/**
74 * System private API for talking with the activity manager service.  This
75 * provides calls from the application back to the activity manager.
76 *
77 * {@hide}
78 */
79interface IActivityManager {
80    // WARNING: when these transactions are updated, check if they are any callers on the native
81    // side. If so, make sure they are using the correct transaction ids and arguments.
82    // If a transaction which will also be used on the native side is being inserted, add it to
83    // below block of transactions.
84
85    // Since these transactions are also called from native code, these must be kept in sync with
86    // the ones in frameworks/native/include/binder/IActivityManager.h
87    // =============== Beginning of transactions used on native side as well ======================
88    ParcelFileDescriptor openContentUri(in String uriString);
89    // =============== End of transactions used on native side as well ============================
90
91    // Special low-level communication with activity manager.
92    void handleApplicationCrash(in IBinder app,
93            in ApplicationErrorReport.ParcelableCrashInfo crashInfo);
94    int startActivity(in IApplicationThread caller, in String callingPackage, in Intent intent,
95            in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode,
96            int flags, in ProfilerInfo profilerInfo, in Bundle options);
97    void unhandledBack();
98
99    boolean finishActivity(in IBinder token, int code, in Intent data, int finishTask);
100    Intent registerReceiver(in IApplicationThread caller, in String callerPackage,
101            in IIntentReceiver receiver, in IntentFilter filter,
102            in String requiredPermission, int userId);
103    void unregisterReceiver(in IIntentReceiver receiver);
104    int broadcastIntent(in IApplicationThread caller, in Intent intent,
105            in String resolvedType, in IIntentReceiver resultTo, int resultCode,
106            in String resultData, in Bundle map, in String[] requiredPermissions,
107            int appOp, in Bundle options, boolean serialized, boolean sticky, int userId);
108    void unbroadcastIntent(in IApplicationThread caller, in Intent intent, int userId);
109    oneway void finishReceiver(in IBinder who, int resultCode, in String resultData, in Bundle map,
110            boolean abortBroadcast, int flags);
111    void attachApplication(in IApplicationThread app);
112    oneway void activityIdle(in IBinder token, in Configuration config,
113            in boolean stopProfiling);
114    void activityPaused(in IBinder token);
115    oneway void activityStopped(in IBinder token, in Bundle state,
116            in PersistableBundle persistentState, in CharSequence description);
117    String getCallingPackage(in IBinder token);
118    ComponentName getCallingActivity(in IBinder token);
119    List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags);
120    void moveTaskToFront(int task, int flags, in Bundle options);
121    void moveTaskBackwards(int task);
122    int getTaskForActivity(in IBinder token, in boolean onlyRoot);
123    ContentProviderHolder getContentProvider(in IApplicationThread caller,
124            in String name, int userId, boolean stable);
125    void publishContentProviders(in IApplicationThread caller,
126            in List<ContentProviderHolder> providers);
127    boolean refContentProvider(in IBinder connection, int stableDelta, int unstableDelta);
128    void finishSubActivity(in IBinder token, in String resultWho, int requestCode);
129    PendingIntent getRunningServiceControlPanel(in ComponentName service);
130    ComponentName startService(in IApplicationThread caller, in Intent service,
131            in String resolvedType, in String callingPackage, int userId);
132    int stopService(in IApplicationThread caller, in Intent service,
133            in String resolvedType, int userId);
134    int bindService(in IApplicationThread caller, in IBinder token, in Intent service,
135            in String resolvedType, in IServiceConnection connection, int flags,
136            in String callingPackage, int userId);
137    boolean unbindService(in IServiceConnection connection);
138    void publishService(in IBinder token, in Intent intent, in IBinder service);
139    void activityResumed(in IBinder token);
140    void setDebugApp(in String packageName, boolean waitForDebugger, boolean persistent);
141    void setAlwaysFinish(boolean enabled);
142    boolean startInstrumentation(in ComponentName className, in String profileFile,
143            int flags, in Bundle arguments, in IInstrumentationWatcher watcher,
144            in IUiAutomationConnection connection, int userId,
145            in String abiOverride);
146    void finishInstrumentation(in IApplicationThread target, int resultCode,
147            in Bundle results);
148    /**
149     * @return A copy of global {@link Configuration}, contains general settings for the entire
150     *         system. Corresponds to the configuration of the default display.
151     * @throws RemoteException
152     */
153    Configuration getConfiguration();
154    /**
155     * Updates global configuration and applies changes to the entire system.
156     * @param values Update values for global configuration. If null is passed it will request the
157     *               Window Manager to compute new config for the default display.
158     * @throws RemoteException
159     * @return Returns true if the configuration was updated.
160     */
161    boolean updateConfiguration(in Configuration values);
162    boolean stopServiceToken(in ComponentName className, in IBinder token, int startId);
163    ComponentName getActivityClassForToken(in IBinder token);
164    String getPackageForToken(in IBinder token);
165    void setProcessLimit(int max);
166    int getProcessLimit();
167    int checkPermission(in String permission, int pid, int uid);
168    int checkUriPermission(in Uri uri, int pid, int uid, int mode, int userId,
169            in IBinder callerToken);
170    void grantUriPermission(in IApplicationThread caller, in String targetPkg, in Uri uri,
171            int mode, int userId);
172    void revokeUriPermission(in IApplicationThread caller, in Uri uri, int mode, int userId);
173    void setActivityController(in IActivityController watcher, boolean imAMonkey);
174    void showWaitingForDebugger(in IApplicationThread who, boolean waiting);
175    /*
176     * This will deliver the specified signal to all the persistent processes. Currently only
177     * SIGUSR1 is delivered. All others are ignored.
178     */
179    void signalPersistentProcesses(int signal);
180    ParceledListSlice getRecentTasks(int maxNum,
181            int flags, int userId);
182    oneway void serviceDoneExecuting(in IBinder token, int type, int startId, int res);
183    oneway void activityDestroyed(in IBinder token);
184    IIntentSender getIntentSender(int type, in String packageName, in IBinder token,
185            in String resultWho, int requestCode, in Intent[] intents, in String[] resolvedTypes,
186            int flags, in Bundle options, int userId);
187    void cancelIntentSender(in IIntentSender sender);
188    String getPackageForIntentSender(in IIntentSender sender);
189    void enterSafeMode();
190    boolean startNextMatchingActivity(in IBinder callingActivity,
191            in Intent intent, in Bundle options);
192    void noteWakeupAlarm(in IIntentSender sender, int sourceUid,
193            in String sourcePkg, in String tag);
194    void removeContentProvider(in IBinder connection, boolean stable);
195    void setRequestedOrientation(in IBinder token, int requestedOrientation);
196    int getRequestedOrientation(in IBinder token);
197    void unbindFinished(in IBinder token, in Intent service, boolean doRebind);
198    void setProcessForeground(in IBinder token, int pid, boolean isForeground);
199    void setServiceForeground(in ComponentName className, in IBinder token,
200            int id, in Notification notification, int flags);
201    boolean moveActivityTaskToBack(in IBinder token, boolean nonRoot);
202    void getMemoryInfo(out ActivityManager.MemoryInfo outInfo);
203    List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState();
204    boolean clearApplicationUserData(in String packageName,
205            in IPackageDataObserver observer, int userId);
206    void forceStopPackage(in String packageName, int userId);
207    boolean killPids(in int[] pids, in String reason, boolean secure);
208    List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags);
209    ActivityManager.TaskThumbnail getTaskThumbnail(int taskId);
210    // Retrieve running application processes in the system
211    List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses();
212    // Get device configuration
213    ConfigurationInfo getDeviceConfigurationInfo();
214    IBinder peekService(in Intent service, in String resolvedType, in String callingPackage);
215    // Turn on/off profiling in a particular process.
216    boolean profileControl(in String process, int userId, boolean start,
217            in ProfilerInfo profilerInfo, int profileType);
218    boolean shutdown(int timeout);
219    void stopAppSwitches();
220    void resumeAppSwitches();
221    boolean bindBackupAgent(in String packageName, int backupRestoreMode, int userId);
222    void backupAgentCreated(in String packageName, in IBinder agent);
223    void unbindBackupAgent(in ApplicationInfo appInfo);
224    int getUidForIntentSender(in IIntentSender sender);
225    int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
226            boolean requireFull, in String name, in String callerPackage);
227    void addPackageDependency(in String packageName);
228    void killApplication(in String pkg, int appId, int userId, in String reason);
229    void closeSystemDialogs(in String reason);
230    Debug.MemoryInfo[] getProcessMemoryInfo(in int[] pids);
231    void killApplicationProcess(in String processName, int uid);
232    int startActivityIntentSender(in IApplicationThread caller,
233            in IntentSender intent, in Intent fillInIntent, in String resolvedType,
234            in IBinder resultTo, in String resultWho, int requestCode,
235            int flagsMask, int flagsValues, in Bundle options);
236    void overridePendingTransition(in IBinder token, in String packageName,
237            int enterAnim, int exitAnim);
238    // Special low-level communication with activity manager.
239    boolean handleApplicationWtf(in IBinder app, in String tag, boolean system,
240            in ApplicationErrorReport.ParcelableCrashInfo crashInfo);
241    void killBackgroundProcesses(in String packageName, int userId);
242    boolean isUserAMonkey();
243    WaitResult startActivityAndWait(in IApplicationThread caller, in String callingPackage,
244            in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
245            int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options,
246            int userId);
247    boolean willActivityBeVisible(in IBinder token);
248    int startActivityWithConfig(in IApplicationThread caller, in String callingPackage,
249            in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
250            int requestCode, int startFlags, in Configuration newConfig,
251            in Bundle options, int userId);
252    // Retrieve info of applications installed on external media that are currently
253    // running.
254    List<ApplicationInfo> getRunningExternalApplications();
255    void finishHeavyWeightApp();
256    // A StrictMode violation to be handled.  The violationMask is a
257    // subset of the original StrictMode policy bitmask, with only the
258    // bit violated and penalty bits to be executed by the
259    // ActivityManagerService remaining set.
260    void handleApplicationStrictModeViolation(in IBinder app, int violationMask,
261            in StrictMode.ViolationInfo crashInfo);
262    boolean isImmersive(in IBinder token);
263    void setImmersive(in IBinder token, boolean immersive);
264    boolean isTopActivityImmersive();
265    void crashApplication(int uid, int initialPid, in String packageName, in String message);
266    String getProviderMimeType(in Uri uri, int userId);
267    IBinder newUriPermissionOwner(in String name);
268    void grantUriPermissionFromOwner(in IBinder owner, int fromUid, in String targetPkg,
269            in Uri uri, int mode, int sourceUserId, int targetUserId);
270    void revokeUriPermissionFromOwner(in IBinder owner, in Uri uri, int mode, int userId);
271    int checkGrantUriPermission(int callingUid, in String targetPkg, in Uri uri,
272            int modeFlags, int userId);
273    // Cause the specified process to dump the specified heap.
274    boolean dumpHeap(in String process, int userId, boolean managed, in String path,
275            in ParcelFileDescriptor fd);
276    int startActivities(in IApplicationThread caller, in String callingPackage,
277            in Intent[] intents, in String[] resolvedTypes, in IBinder resultTo,
278            in Bundle options, int userId);
279    boolean isUserRunning(int userid, int flags);
280    oneway void activitySlept(in IBinder token);
281    int getFrontActivityScreenCompatMode();
282    void setFrontActivityScreenCompatMode(int mode);
283    int getPackageScreenCompatMode(in String packageName);
284    void setPackageScreenCompatMode(in String packageName, int mode);
285    boolean getPackageAskScreenCompat(in String packageName);
286    void setPackageAskScreenCompat(in String packageName, boolean ask);
287    boolean switchUser(int userid);
288    void setFocusedTask(int taskId);
289    boolean removeTask(int taskId);
290    void registerProcessObserver(in IProcessObserver observer);
291    void unregisterProcessObserver(in IProcessObserver observer);
292    boolean isIntentSenderTargetedToPackage(in IIntentSender sender);
293    void updatePersistentConfiguration(in Configuration values);
294    long[] getProcessPss(in int[] pids);
295    void showBootMessage(in CharSequence msg, boolean always);
296    void killAllBackgroundProcesses();
297    ContentProviderHolder getContentProviderExternal(in String name, int userId,
298            in IBinder token);
299    void removeContentProviderExternal(in String name, in IBinder token);
300    // Get memory information about the calling process.
301    void getMyMemoryState(out ActivityManager.RunningAppProcessInfo outInfo);
302    boolean killProcessesBelowForeground(in String reason);
303    UserInfo getCurrentUser();
304    boolean shouldUpRecreateTask(in IBinder token, in String destAffinity);
305    boolean navigateUpTo(in IBinder token, in Intent target, int resultCode,
306            in Intent resultData);
307    void setLockScreenShown(boolean showing);
308    boolean finishActivityAffinity(in IBinder token);
309    // This is not public because you need to be very careful in how you
310    // manage your activity to make sure it is always the uid you expect.
311    int getLaunchedFromUid(in IBinder activityToken);
312    void unstableProviderDied(in IBinder connection);
313    boolean isIntentSenderAnActivity(in IIntentSender sender);
314    int startActivityAsUser(in IApplicationThread caller, in String callingPackage,
315            in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
316            int requestCode, int flags, in ProfilerInfo profilerInfo,
317            in Bundle options, int userId);
318    int stopUser(int userid, boolean force, in IStopUserCallback callback);
319    void registerUserSwitchObserver(in IUserSwitchObserver observer, in String name);
320    void unregisterUserSwitchObserver(in IUserSwitchObserver observer);
321    int[] getRunningUserIds();
322
323    // Deprecated - This method is only used by a few internal components and it will soon be
324    // replaced by a proper bug report API (which will be restricted to a few, pre-defined apps).
325    // No new code should be calling it.
326    void requestBugReport(int bugreportType);
327
328    long inputDispatchingTimedOut(int pid, boolean aboveSystem, in String reason);
329    void clearPendingBackup();
330    Intent getIntentForIntentSender(in IIntentSender sender);
331    Bundle getAssistContextExtras(int requestType);
332    void reportAssistContextExtras(in IBinder token, in Bundle extras,
333            in AssistStructure structure, in AssistContent content, in Uri referrer);
334    // This is not public because you need to be very careful in how you
335    // manage your activity to make sure it is always the uid you expect.
336    String getLaunchedFromPackage(in IBinder activityToken);
337    void killUid(int appId, int userId, in String reason);
338    void setUserIsMonkey(boolean monkey);
339    void hang(in IBinder who, boolean allowRestart);
340    IActivityContainer createVirtualActivityContainer(in IBinder parentActivityToken,
341            in IActivityContainerCallback callback);
342    void moveTaskToStack(int taskId, int stackId, boolean toTop);
343    /**
344     * Resizes the input stack id to the given bounds.
345     *
346     * @param stackId Id of the stack to resize.
347     * @param bounds Bounds to resize the stack to or {@code null} for fullscreen.
348     * @param allowResizeInDockedMode True if the resize should be allowed when the docked stack is
349     *                                active.
350     * @param preserveWindows True if the windows of activities contained in the stack should be
351     *                        preserved.
352     * @param animate True if the stack resize should be animated.
353     * @param animationDuration The duration of the resize animation in milliseconds or -1 if the
354     *                          default animation duration should be used.
355     * @throws RemoteException
356     */
357    void resizeStack(int stackId, in Rect bounds, boolean allowResizeInDockedMode,
358            boolean preserveWindows, boolean animate, int animationDuration);
359    List<ActivityManager.StackInfo> getAllStackInfos();
360    void setFocusedStack(int stackId);
361    ActivityManager.StackInfo getStackInfo(int stackId);
362    boolean convertFromTranslucent(in IBinder token);
363    boolean convertToTranslucent(in IBinder token, in Bundle options);
364    void notifyActivityDrawn(in IBinder token);
365    void reportActivityFullyDrawn(in IBinder token);
366    void restart();
367    void performIdleMaintenance();
368    void takePersistableUriPermission(in Uri uri, int modeFlags, int userId);
369    void releasePersistableUriPermission(in Uri uri, int modeFlags, int userId);
370    ParceledListSlice getPersistedUriPermissions(in String packageName, boolean incoming);
371    void appNotRespondingViaProvider(in IBinder connection);
372    Rect getTaskBounds(int taskId);
373    int getActivityDisplayId(in IBinder activityToken);
374    boolean setProcessMemoryTrimLevel(in String process, int uid, int level);
375
376
377    // Start of L transactions
378    String getTagForIntentSender(in IIntentSender sender, in String prefix);
379    boolean startUserInBackground(int userid);
380    void startLockTaskModeById(int taskId);
381    void startLockTaskModeByToken(in IBinder token);
382    void stopLockTaskMode();
383    boolean isInLockTaskMode();
384    void setTaskDescription(in IBinder token, in ActivityManager.TaskDescription values);
385    int startVoiceActivity(in String callingPackage, int callingPid, int callingUid,
386            in Intent intent, in String resolvedType, in IVoiceInteractionSession session,
387            in IVoiceInteractor interactor, int flags, in ProfilerInfo profilerInfo,
388            in Bundle options, int userId);
389    Bundle getActivityOptions(in IBinder token);
390    List<IBinder> getAppTasks(in String callingPackage);
391    void startSystemLockTaskMode(int taskId);
392    void stopSystemLockTaskMode();
393    void finishVoiceTask(in IVoiceInteractionSession session);
394    boolean isTopOfTask(in IBinder token);
395    boolean requestVisibleBehind(in IBinder token, boolean visible);
396    boolean isBackgroundVisibleBehind(in IBinder token);
397    void backgroundResourcesReleased(in IBinder token);
398    void notifyLaunchTaskBehindComplete(in IBinder token);
399    int startActivityFromRecents(int taskId, in Bundle options);
400    void notifyEnterAnimationComplete(in IBinder token);
401    int startActivityAsCaller(in IApplicationThread caller, in String callingPackage,
402            in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
403            int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options,
404            boolean ignoreTargetSecurity, int userId);
405    int addAppTask(in IBinder activityToken, in Intent intent,
406            in ActivityManager.TaskDescription description, in Bitmap thumbnail);
407    Point getAppTaskThumbnailSize();
408    boolean releaseActivityInstance(in IBinder token);
409    void releaseSomeActivities(in IApplicationThread app);
410    void bootAnimationComplete();
411    Bitmap getTaskDescriptionIcon(in String filename, int userId);
412    boolean launchAssistIntent(in Intent intent, int requestType, in String hint, int userHandle,
413            in Bundle args);
414    void startInPlaceAnimationOnFrontMostApplication(in Bundle opts);
415    int checkPermissionWithToken(in String permission, int pid, int uid,
416            in IBinder callerToken);
417    void registerTaskStackListener(in ITaskStackListener listener);
418
419
420    // Start of M transactions
421    void notifyCleartextNetwork(int uid, in byte[] firstPacket);
422    IActivityContainer createStackOnDisplay(int displayId);
423    int getFocusedStackId();
424    void setTaskResizeable(int taskId, int resizeableMode);
425    boolean requestAssistContextExtras(int requestType, in IResultReceiver receiver,
426            in Bundle receiverExtras, in IBinder activityToken,
427            boolean focused, boolean newSessionId);
428    void resizeTask(int taskId, in Rect bounds, int resizeMode);
429    int getLockTaskModeState();
430    void setDumpHeapDebugLimit(in String processName, int uid, long maxMemSize,
431            in String reportPackage);
432    void dumpHeapFinished(in String path);
433    void setVoiceKeepAwake(in IVoiceInteractionSession session, boolean keepAwake);
434    void updateLockTaskPackages(int userId, in String[] packages);
435    void noteAlarmStart(in IIntentSender sender, int sourceUid, in String tag);
436    void noteAlarmFinish(in IIntentSender sender, int sourceUid, in String tag);
437    int getPackageProcessState(in String packageName, in String callingPackage);
438    oneway void showLockTaskEscapeMessage(in IBinder token);
439    void updateDeviceOwner(in String packageName);
440    /**
441     * Notify the system that the keyguard is going away.
442     *
443     * @param flags See {@link android.view.WindowManagerPolicy#KEYGUARD_GOING_AWAY_FLAG_TO_SHADE}
444     *              etc.
445     */
446    void keyguardGoingAway(int flags);
447    void registerUidObserver(in IUidObserver observer, int which, int cutpoint,
448            String callingPackage);
449    void unregisterUidObserver(in IUidObserver observer);
450    boolean isAssistDataAllowedOnCurrentActivity();
451    boolean showAssistFromActivity(in IBinder token, in Bundle args);
452    boolean isRootVoiceInteraction(in IBinder token);
453
454
455    // Start of N transactions
456    // Start Binder transaction tracking for all applications.
457    boolean startBinderTracking();
458    // Stop Binder transaction tracking for all applications and dump trace data to the given file
459    // descriptor.
460    boolean stopBinderTrackingAndDump(in ParcelFileDescriptor fd);
461    /**
462     * Try to place task to provided position. The final position might be different depending on
463     * current user and stacks state. The task will be moved to target stack if it's currently in
464     * different stack.
465     */
466    void positionTaskInStack(int taskId, int stackId, int position);
467    int getActivityStackId(in IBinder token);
468    void exitFreeformMode(in IBinder token);
469    void reportSizeConfigurations(in IBinder token, in int[] horizontalSizeConfiguration,
470            in int[] verticalSizeConfigurations, in int[] smallestWidthConfigurations);
471    boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate,
472            in Rect initialBounds, boolean moveHomeStackFront);
473    void suppressResizeConfigChanges(boolean suppress);
474    void moveTasksToFullscreenStack(int fromStackId, boolean onTop);
475    boolean moveTopActivityToPinnedStack(int stackId, in Rect bounds);
476    int getAppStartMode(int uid, in String packageName);
477    boolean unlockUser(int userid, in byte[] token, in byte[] secret,
478            in IProgressListener listener);
479    boolean isInMultiWindowMode(in IBinder token);
480    boolean isInPictureInPictureMode(in IBinder token);
481    void killPackageDependents(in String packageName, int userId);
482    void enterPictureInPictureMode(in IBinder token);
483    void enterPictureInPictureModeWithAspectRatio(in IBinder token, float aspectRatio);
484    void enterPictureInPictureModeOnMoveToBackground(in IBinder token,
485            boolean enterPictureInPictureOnMoveToBg);
486    void setPictureInPictureAspectRatio(in IBinder token, float aspectRatio);
487    void setPictureInPictureActions(in IBinder token, in ParceledListSlice actions);
488    void activityRelaunched(in IBinder token);
489    IBinder getUriPermissionOwnerForActivity(in IBinder activityToken);
490    /**
491     * Resizes the docked stack, and all other stacks as the result of the dock stack bounds change.
492     *
493     * @param dockedBounds The bounds for the docked stack.
494     * @param tempDockedTaskBounds The temporary bounds for the tasks in the docked stack, which
495     *                             might be different from the stack bounds to allow more
496     *                             flexibility while resizing, or {@code null} if they should be the
497     *                             same as the stack bounds.
498     * @param tempDockedTaskInsetBounds The temporary bounds for the tasks to calculate the insets.
499     *                                  When resizing, we usually "freeze" the layout of a task. To
500     *                                  achieve that, we also need to "freeze" the insets, which
501     *                                  gets achieved by changing task bounds but not bounds used
502     *                                  to calculate the insets in this transient state
503     * @param tempOtherTaskBounds The temporary bounds for the tasks in all other stacks, or
504     *                            {@code null} if they should be the same as the stack bounds.
505     * @param tempOtherTaskInsetBounds Like {@code tempDockedTaskInsetBounds}, but for the other
506     *                                 stacks.
507     * @throws RemoteException
508     */
509    void resizeDockedStack(in Rect dockedBounds, in Rect tempDockedTaskBounds,
510            in Rect tempDockedTaskInsetBounds,
511            in Rect tempOtherTaskBounds, in Rect tempOtherTaskInsetBounds);
512    int setVrMode(in IBinder token, boolean enabled, in ComponentName packageName);
513    // Gets the URI permissions granted to an arbitrary package.
514    // NOTE: this is different from getPersistedUriPermissions(), which returns the URIs the package
515    // granted to another packages (instead of those granted to it).
516    ParceledListSlice getGrantedUriPermissions(in String packageName, int userId);
517    // Clears the URI permissions granted to an arbitrary package.
518    void clearGrantedUriPermissions(in String packageName, int userId);
519    boolean isAppForeground(int uid);
520    void startLocalVoiceInteraction(in IBinder token, in Bundle options);
521    void stopLocalVoiceInteraction(in IBinder token);
522    boolean supportsLocalVoiceInteraction();
523    void notifyPinnedStackAnimationEnded();
524    void removeStack(int stackId);
525    void makePackageIdle(String packageName, int userId);
526    int getMemoryTrimLevel();
527    /**
528     * Resizes the pinned stack.
529     *
530     * @param pinnedBounds The bounds for the pinned stack.
531     * @param tempPinnedTaskBounds The temporary bounds for the tasks in the pinned stack, which
532     *                             might be different from the stack bounds to allow more
533     *                             flexibility while resizing, or {@code null} if they should be the
534     *                             same as the stack bounds.
535     */
536    void resizePinnedStack(in Rect pinnedBounds, in Rect tempPinnedTaskBounds);
537    boolean isVrModePackageEnabled(in ComponentName packageName);
538    /**
539     * Moves all tasks from the docked stack in the fullscreen stack and puts the top task of the
540     * fullscreen stack into the docked stack.
541     */
542    void swapDockedAndFullscreenStack();
543    void notifyLockedProfile(int userId);
544    void startConfirmDeviceCredentialIntent(in Intent intent);
545    void sendIdleJobTrigger();
546    int sendIntentSender(in IIntentSender target, int code, in Intent intent,
547            in String resolvedType, in IIntentReceiver finishedReceiver,
548            in String requiredPermission, in Bundle options);
549
550
551    // Start of N MR1 transactions
552    void setVrThread(int tid);
553    void setRenderThread(int tid);
554    /**
555     * Lets activity manager know whether the calling process is currently showing "top-level" UI
556     * that is not an activity, i.e. windows on the screen the user is currently interacting with.
557     *
558     * <p>This flag can only be set for persistent processes.
559     *
560     * @param hasTopUi Whether the calling process has "top-level" UI.
561     */
562    void setHasTopUi(boolean hasTopUi);
563    /**
564     * Returns if the target of the PendingIntent can be fired directly, without triggering
565     * a work profile challenge. This can happen if the PendingIntent is to start direct-boot
566     * aware activities, and the target user is in RUNNING_LOCKED state, i.e. we should allow
567     * direct-boot aware activity to bypass work challenge when the user hasn't unlocked yet.
568     * @param intent the {@link  PendingIntent} to be tested.
569     * @return {@code true} if the intent should not trigger a work challenge, {@code false}
570     *     otherwise.
571     * @throws RemoteException
572     */
573    boolean canBypassWorkChallenge(in PendingIntent intent);
574
575    // Start of O transactions
576    void requestActivityRelaunch(in IBinder token);
577    /**
578     * Updates override configuration applied to specific display.
579     * @param values Update values for display configuration. If null is passed it will request the
580     *               Window Manager to compute new config for the specified display.
581     * @param displayId Id of the display to apply the config to.
582     * @throws RemoteException
583     * @return Returns true if the configuration was updated.
584     */
585    boolean updateDisplayOverrideConfiguration(in Configuration values, int displayId);
586    void unregisterTaskStackListener(ITaskStackListener listener);
587    void moveStackToDisplay(int stackId, int displayId);
588    boolean requestAutoFillData(in IResultReceiver receiver, in Bundle receiverExtras,
589            int resultCode, in IBinder activityToken, int flags);
590    void dismissKeyguard(in IBinder token, in IKeyguardDismissCallback callback);
591    int restartUserInBackground(int userId);
592
593    /** Cancels the window transitions for the given task. */
594    void cancelTaskWindowTransition(int taskId);
595
596    /** Cancels the thumbnail transitions for the given task. */
597    void cancelTaskThumbnailTransition(int taskId);
598
599    // WARNING: when these transactions are updated, check if they are any callers on the native
600    // side. If so, make sure they are using the correct transaction ids and arguments.
601    // If a transaction which will also be used on the native side is being inserted, add it
602    // alongside with other transactions of this kind at the top of this file.
603}
604