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