IActivityManager.aidl revision d4f08a007d7b640c0bd046c7a8168fb93491b7e3
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    void requestBugReport(int bugreportType);
323    long inputDispatchingTimedOut(int pid, boolean aboveSystem, in String reason);
324    void clearPendingBackup();
325    Intent getIntentForIntentSender(in IIntentSender sender);
326    Bundle getAssistContextExtras(int requestType);
327    void reportAssistContextExtras(in IBinder token, in Bundle extras,
328            in AssistStructure structure, in AssistContent content, in Uri referrer);
329    // This is not public because you need to be very careful in how you
330    // manage your activity to make sure it is always the uid you expect.
331    String getLaunchedFromPackage(in IBinder activityToken);
332    void killUid(int appId, int userId, in String reason);
333    void setUserIsMonkey(boolean monkey);
334    void hang(in IBinder who, boolean allowRestart);
335    IActivityContainer createVirtualActivityContainer(in IBinder parentActivityToken,
336            in IActivityContainerCallback callback);
337    void moveTaskToStack(int taskId, int stackId, boolean toTop);
338    /**
339     * Resizes the input stack id to the given bounds.
340     *
341     * @param stackId Id of the stack to resize.
342     * @param bounds Bounds to resize the stack to or {@code null} for fullscreen.
343     * @param allowResizeInDockedMode True if the resize should be allowed when the docked stack is
344     *                                active.
345     * @param preserveWindows True if the windows of activities contained in the stack should be
346     *                        preserved.
347     * @param animate True if the stack resize should be animated.
348     * @param animationDuration The duration of the resize animation in milliseconds or -1 if the
349     *                          default animation duration should be used.
350     * @throws RemoteException
351     */
352    void resizeStack(int stackId, in Rect bounds, boolean allowResizeInDockedMode,
353            boolean preserveWindows, boolean animate, int animationDuration);
354    List<ActivityManager.StackInfo> getAllStackInfos();
355    void setFocusedStack(int stackId);
356    ActivityManager.StackInfo getStackInfo(int stackId);
357    boolean convertFromTranslucent(in IBinder token);
358    boolean convertToTranslucent(in IBinder token, in Bundle options);
359    void notifyActivityDrawn(in IBinder token);
360    void reportActivityFullyDrawn(in IBinder token);
361    void restart();
362    void performIdleMaintenance();
363    void takePersistableUriPermission(in Uri uri, int modeFlags, int userId);
364    void releasePersistableUriPermission(in Uri uri, int modeFlags, int userId);
365    ParceledListSlice getPersistedUriPermissions(in String packageName, boolean incoming);
366    void appNotRespondingViaProvider(in IBinder connection);
367    Rect getTaskBounds(int taskId);
368    int getActivityDisplayId(in IBinder activityToken);
369    boolean setProcessMemoryTrimLevel(in String process, int uid, int level);
370
371
372    // Start of L transactions
373    String getTagForIntentSender(in IIntentSender sender, in String prefix);
374    boolean startUserInBackground(int userid);
375    void startLockTaskModeById(int taskId);
376    void startLockTaskModeByToken(in IBinder token);
377    void stopLockTaskMode();
378    boolean isInLockTaskMode();
379    void setTaskDescription(in IBinder token, in ActivityManager.TaskDescription values);
380    int startVoiceActivity(in String callingPackage, int callingPid, int callingUid,
381            in Intent intent, in String resolvedType, in IVoiceInteractionSession session,
382            in IVoiceInteractor interactor, int flags, in ProfilerInfo profilerInfo,
383            in Bundle options, int userId);
384    Bundle getActivityOptions(in IBinder token);
385    List<IBinder> getAppTasks(in String callingPackage);
386    void startSystemLockTaskMode(int taskId);
387    void stopSystemLockTaskMode();
388    void finishVoiceTask(in IVoiceInteractionSession session);
389    boolean isTopOfTask(in IBinder token);
390    boolean requestVisibleBehind(in IBinder token, boolean visible);
391    boolean isBackgroundVisibleBehind(in IBinder token);
392    void backgroundResourcesReleased(in IBinder token);
393    void notifyLaunchTaskBehindComplete(in IBinder token);
394    int startActivityFromRecents(int taskId, in Bundle options);
395    void notifyEnterAnimationComplete(in IBinder token);
396    int startActivityAsCaller(in IApplicationThread caller, in String callingPackage,
397            in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
398            int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options,
399            boolean ignoreTargetSecurity, int userId);
400    int addAppTask(in IBinder activityToken, in Intent intent,
401            in ActivityManager.TaskDescription description, in Bitmap thumbnail);
402    Point getAppTaskThumbnailSize();
403    boolean releaseActivityInstance(in IBinder token);
404    void releaseSomeActivities(in IApplicationThread app);
405    void bootAnimationComplete();
406    Bitmap getTaskDescriptionIcon(in String filename, int userId);
407    boolean launchAssistIntent(in Intent intent, int requestType, in String hint, int userHandle,
408            in Bundle args);
409    void startInPlaceAnimationOnFrontMostApplication(in Bundle opts);
410    int checkPermissionWithToken(in String permission, int pid, int uid,
411            in IBinder callerToken);
412    void registerTaskStackListener(in ITaskStackListener listener);
413
414
415    // Start of M transactions
416    void notifyCleartextNetwork(int uid, in byte[] firstPacket);
417    IActivityContainer createStackOnDisplay(int displayId);
418    int getFocusedStackId();
419    void setTaskResizeable(int taskId, int resizeableMode);
420    boolean requestAssistContextExtras(int requestType, in IResultReceiver receiver,
421            in Bundle receiverExtras, in IBinder activityToken,
422            boolean focused, boolean newSessionId);
423    void resizeTask(int taskId, in Rect bounds, int resizeMode);
424    int getLockTaskModeState();
425    void setDumpHeapDebugLimit(in String processName, int uid, long maxMemSize,
426            in String reportPackage);
427    void dumpHeapFinished(in String path);
428    void setVoiceKeepAwake(in IVoiceInteractionSession session, boolean keepAwake);
429    void updateLockTaskPackages(int userId, in String[] packages);
430    void noteAlarmStart(in IIntentSender sender, int sourceUid, in String tag);
431    void noteAlarmFinish(in IIntentSender sender, int sourceUid, in String tag);
432    int getPackageProcessState(in String packageName, in String callingPackage);
433    oneway void showLockTaskEscapeMessage(in IBinder token);
434    void updateDeviceOwner(in String packageName);
435    /**
436     * Notify the system that the keyguard is going away.
437     *
438     * @param flags See {@link android.view.WindowManagerPolicy#KEYGUARD_GOING_AWAY_FLAG_TO_SHADE}
439     *              etc.
440     */
441    void keyguardGoingAway(int flags);
442    void registerUidObserver(in IUidObserver observer, int which, int cutpoint,
443            String callingPackage);
444    void unregisterUidObserver(in IUidObserver observer);
445    boolean isAssistDataAllowedOnCurrentActivity();
446    boolean showAssistFromActivity(in IBinder token, in Bundle args);
447    boolean isRootVoiceInteraction(in IBinder token);
448
449
450    // Start of N transactions
451    // Start Binder transaction tracking for all applications.
452    boolean startBinderTracking();
453    // Stop Binder transaction tracking for all applications and dump trace data to the given file
454    // descriptor.
455    boolean stopBinderTrackingAndDump(in ParcelFileDescriptor fd);
456    void positionTaskInStack(int taskId, int stackId, int position);
457    int getActivityStackId(in IBinder token);
458    void exitFreeformMode(in IBinder token);
459    void reportSizeConfigurations(in IBinder token, in int[] horizontalSizeConfiguration,
460            in int[] verticalSizeConfigurations, in int[] smallestWidthConfigurations);
461    boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate,
462            in Rect initialBounds, boolean moveHomeStackFront);
463    void suppressResizeConfigChanges(boolean suppress);
464    void moveTasksToFullscreenStack(int fromStackId, boolean onTop);
465    boolean moveTopActivityToPinnedStack(int stackId, in Rect bounds);
466    int getAppStartMode(int uid, in String packageName);
467    boolean unlockUser(int userid, in byte[] token, in byte[] secret,
468            in IProgressListener listener);
469    boolean isInMultiWindowMode(in IBinder token);
470    boolean isInPictureInPictureMode(in IBinder token);
471    void killPackageDependents(in String packageName, int userId);
472    void enterPictureInPictureMode(in IBinder token);
473    void enterPictureInPictureModeWithAspectRatio(in IBinder token, float aspectRatio);
474    void enterPictureInPictureModeOnMoveToBackground(in IBinder token,
475            boolean enterPictureInPictureOnMoveToBg);
476    void setPictureInPictureAspectRatio(in IBinder token, float aspectRatio);
477    void activityRelaunched(in IBinder token);
478    IBinder getUriPermissionOwnerForActivity(in IBinder activityToken);
479    /**
480     * Resizes the docked stack, and all other stacks as the result of the dock stack bounds change.
481     *
482     * @param dockedBounds The bounds for the docked stack.
483     * @param tempDockedTaskBounds The temporary bounds for the tasks in the docked stack, which
484     *                             might be different from the stack bounds to allow more
485     *                             flexibility while resizing, or {@code null} if they should be the
486     *                             same as the stack bounds.
487     * @param tempDockedTaskInsetBounds The temporary bounds for the tasks to calculate the insets.
488     *                                  When resizing, we usually "freeze" the layout of a task. To
489     *                                  achieve that, we also need to "freeze" the insets, which
490     *                                  gets achieved by changing task bounds but not bounds used
491     *                                  to calculate the insets in this transient state
492     * @param tempOtherTaskBounds The temporary bounds for the tasks in all other stacks, or
493     *                            {@code null} if they should be the same as the stack bounds.
494     * @param tempOtherTaskInsetBounds Like {@code tempDockedTaskInsetBounds}, but for the other
495     *                                 stacks.
496     * @throws RemoteException
497     */
498    void resizeDockedStack(in Rect dockedBounds, in Rect tempDockedTaskBounds,
499            in Rect tempDockedTaskInsetBounds,
500            in Rect tempOtherTaskBounds, in Rect tempOtherTaskInsetBounds);
501    int setVrMode(in IBinder token, boolean enabled, in ComponentName packageName);
502    // Gets the URI permissions granted to an arbitrary package.
503    // NOTE: this is different from getPersistedUriPermissions(), which returns the URIs the package
504    // granted to another packages (instead of those granted to it).
505    ParceledListSlice getGrantedUriPermissions(in String packageName, int userId);
506    // Clears the URI permissions granted to an arbitrary package.
507    void clearGrantedUriPermissions(in String packageName, int userId);
508    boolean isAppForeground(int uid);
509    void startLocalVoiceInteraction(in IBinder token, in Bundle options);
510    void stopLocalVoiceInteraction(in IBinder token);
511    boolean supportsLocalVoiceInteraction();
512    void notifyPinnedStackAnimationEnded();
513    void removeStack(int stackId);
514    void makePackageIdle(String packageName, int userId);
515    int getMemoryTrimLevel();
516    /**
517     * Resizes the pinned stack.
518     *
519     * @param pinnedBounds The bounds for the pinned stack.
520     * @param tempPinnedTaskBounds The temporary bounds for the tasks in the pinned stack, which
521     *                             might be different from the stack bounds to allow more
522     *                             flexibility while resizing, or {@code null} if they should be the
523     *                             same as the stack bounds.
524     */
525    void resizePinnedStack(in Rect pinnedBounds, in Rect tempPinnedTaskBounds);
526    boolean isVrModePackageEnabled(in ComponentName packageName);
527    /**
528     * Moves all tasks from the docked stack in the fullscreen stack and puts the top task of the
529     * fullscreen stack into the docked stack.
530     */
531    void swapDockedAndFullscreenStack();
532    void notifyLockedProfile(int userId);
533    void startConfirmDeviceCredentialIntent(in Intent intent);
534    void sendIdleJobTrigger();
535    int sendIntentSender(in IIntentSender target, int code, in Intent intent,
536            in String resolvedType, in IIntentReceiver finishedReceiver,
537            in String requiredPermission, in Bundle options);
538
539
540    // Start of N MR1 transactions
541    void setVrThread(int tid);
542    void setRenderThread(int tid);
543    /**
544     * Lets activity manager know whether the calling process is currently showing "top-level" UI
545     * that is not an activity, i.e. windows on the screen the user is currently interacting with.
546     *
547     * <p>This flag can only be set for persistent processes.
548     *
549     * @param hasTopUi Whether the calling process has "top-level" UI.
550     */
551    void setHasTopUi(boolean hasTopUi);
552    /**
553     * Returns if the target of the PendingIntent can be fired directly, without triggering
554     * a work profile challenge. This can happen if the PendingIntent is to start direct-boot
555     * aware activities, and the target user is in RUNNING_LOCKED state, i.e. we should allow
556     * direct-boot aware activity to bypass work challenge when the user hasn't unlocked yet.
557     * @param intent the {@link  PendingIntent} to be tested.
558     * @return {@code true} if the intent should not trigger a work challenge, {@code false}
559     *     otherwise.
560     * @throws RemoteException
561     */
562    boolean canBypassWorkChallenge(in PendingIntent intent);
563
564    // Start of O transactions
565    void requestActivityRelaunch(in IBinder token);
566    /**
567     * Updates override configuration applied to specific display.
568     * @param values Update values for display configuration. If null is passed it will request the
569     *               Window Manager to compute new config for the specified display.
570     * @param displayId Id of the display to apply the config to.
571     * @throws RemoteException
572     * @return Returns true if the configuration was updated.
573     */
574    boolean updateDisplayOverrideConfiguration(in Configuration values, int displayId);
575    void unregisterTaskStackListener(ITaskStackListener listener);
576    void moveStackToDisplay(int stackId, int displayId);
577    boolean requestAutoFillData(in IResultReceiver receiver, in Bundle receiverExtras,
578            in IBinder activityToken, int flags);
579    void dismissKeyguard(in IBinder token, in IKeyguardDismissCallback callback);
580
581    // WARNING: when these transactions are updated, check if they are any callers on the native
582    // side. If so, make sure they are using the correct transaction ids and arguments.
583    // If a transaction which will also be used on the native side is being inserted, add it
584    // alongside with other transactions of this kind at the top of this file.
585}
586