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