• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 package android.app;
18 
19 import android.app.ActivityManager;
20 import android.app.ActivityManager.PendingIntentInfo;
21 import android.app.ActivityTaskManager;
22 import android.app.ApplicationErrorReport;
23 import android.app.ApplicationExitInfo;
24 import android.app.ContentProviderHolder;
25 import android.app.GrantedUriPermission;
26 import android.app.IApplicationThread;
27 import android.app.IActivityController;
28 import android.app.IAppTask;
29 import android.app.IInstrumentationWatcher;
30 import android.app.IProcessObserver;
31 import android.app.IServiceConnection;
32 import android.app.IStopUserCallback;
33 import android.app.ITaskStackListener;
34 import android.app.IUiAutomationConnection;
35 import android.app.IUidObserver;
36 import android.app.IUserSwitchObserver;
37 import android.app.Notification;
38 import android.app.PendingIntent;
39 import android.app.PictureInPictureParams;
40 import android.app.ProfilerInfo;
41 import android.app.WaitResult;
42 import android.app.assist.AssistContent;
43 import android.app.assist.AssistStructure;
44 import android.content.ComponentName;
45 import android.content.IIntentReceiver;
46 import android.content.IIntentSender;
47 import android.content.Intent;
48 import android.content.IntentFilter;
49 import android.content.IntentSender;
50 import android.content.pm.ApplicationInfo;
51 import android.content.pm.ConfigurationInfo;
52 import android.content.pm.IPackageDataObserver;
53 import android.content.pm.ParceledListSlice;
54 import android.content.pm.ProviderInfo;
55 import android.content.pm.ResolveInfo;
56 import android.content.pm.UserInfo;
57 import android.content.res.Configuration;
58 import android.content.LocusId;
59 import android.graphics.Bitmap;
60 import android.graphics.GraphicBuffer;
61 import android.graphics.Point;
62 import android.graphics.Rect;
63 import android.net.Uri;
64 import android.os.Bundle;
65 import android.os.Debug;
66 import android.os.IBinder;
67 import android.os.IProgressListener;
68 import android.os.ParcelFileDescriptor;
69 import android.os.PersistableBundle;
70 import android.os.RemoteCallback;
71 import android.os.StrictMode;
72 import android.os.WorkSource;
73 import android.service.voice.IVoiceInteractionSession;
74 import android.view.RemoteAnimationDefinition;
75 import android.view.RemoteAnimationAdapter;
76 import com.android.internal.app.IVoiceInteractor;
77 import com.android.internal.os.IResultReceiver;
78 import com.android.internal.policy.IKeyguardDismissCallback;
79 
80 import java.util.List;
81 
82 /**
83  * System private API for talking with the activity manager service.  This
84  * provides calls from the application back to the activity manager.
85  *
86  * {@hide}
87  */
88 interface IActivityManager {
89     // WARNING: when these transactions are updated, check if they are any callers on the native
90     // side. If so, make sure they are using the correct transaction ids and arguments.
91     // If a transaction which will also be used on the native side is being inserted, add it to
92     // below block of transactions.
93 
94     // Since these transactions are also called from native code, these must be kept in sync with
95     // the ones in frameworks/native/libs/binder/include/binder/IActivityManager.h
96     // =============== Beginning of transactions used on native side as well ======================
openContentUri(in String uriString)97     ParcelFileDescriptor openContentUri(in String uriString);
registerUidObserver(in IUidObserver observer, int which, int cutpoint, String callingPackage)98     void registerUidObserver(in IUidObserver observer, int which, int cutpoint,
99             String callingPackage);
unregisterUidObserver(in IUidObserver observer)100     void unregisterUidObserver(in IUidObserver observer);
isUidActive(int uid, String callingPackage)101     boolean isUidActive(int uid, String callingPackage);
getUidProcessState(int uid, in String callingPackage)102     int getUidProcessState(int uid, in String callingPackage);
103     @UnsupportedAppUsage
checkPermission(in String permission, int pid, int uid)104     int checkPermission(in String permission, int pid, int uid);
105     // =============== End of transactions used on native side as well ============================
106 
107     // Special low-level communication with activity manager.
handleApplicationCrash(in IBinder app, in ApplicationErrorReport.ParcelableCrashInfo crashInfo)108     void handleApplicationCrash(in IBinder app,
109             in ApplicationErrorReport.ParcelableCrashInfo crashInfo);
110     /** @deprecated Use {@link #startActivityWithFeature} instead */
111     @UnsupportedAppUsage(maxTargetSdk=29, publicAlternatives="Use {@link android.content.Context#startActivity(android.content.Intent)} instead")
startActivity(in IApplicationThread caller, in String callingPackage, in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options)112     int startActivity(in IApplicationThread caller, in String callingPackage, in Intent intent,
113             in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode,
114             int flags, in ProfilerInfo profilerInfo, in Bundle options);
startActivityWithFeature(in IApplicationThread caller, in String callingPackage, in String callingFeatureId, in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options)115     int startActivityWithFeature(in IApplicationThread caller, in String callingPackage,
116             in String callingFeatureId, in Intent intent, in String resolvedType,
117             in IBinder resultTo, in String resultWho, int requestCode, int flags,
118             in ProfilerInfo profilerInfo, in Bundle options);
119     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
unhandledBack()120     void unhandledBack();
121     @UnsupportedAppUsage
finishActivity(in IBinder token, int code, in Intent data, int finishTask)122     boolean finishActivity(in IBinder token, int code, in Intent data, int finishTask);
123     @UnsupportedAppUsage(maxTargetSdk=29, publicAlternatives="Use {@link android.content.Context#registerReceiver(android.content.BroadcastReceiver, android.content.IntentFilter)} instead")
registerReceiver(in IApplicationThread caller, in String callerPackage, in IIntentReceiver receiver, in IntentFilter filter, in String requiredPermission, int userId, int flags)124     Intent registerReceiver(in IApplicationThread caller, in String callerPackage,
125             in IIntentReceiver receiver, in IntentFilter filter,
126             in String requiredPermission, int userId, int flags);
registerReceiverWithFeature(in IApplicationThread caller, in String callerPackage, in String callingFeatureId, in String receiverId, in IIntentReceiver receiver, in IntentFilter filter, in String requiredPermission, int userId, int flags)127     Intent registerReceiverWithFeature(in IApplicationThread caller, in String callerPackage,
128             in String callingFeatureId, in String receiverId, in IIntentReceiver receiver,
129             in IntentFilter filter, in String requiredPermission, int userId, int flags);
130     @UnsupportedAppUsage
unregisterReceiver(in IIntentReceiver receiver)131     void unregisterReceiver(in IIntentReceiver receiver);
132     /** @deprecated Use {@link #broadcastIntentWithFeature} instead */
133     @UnsupportedAppUsage(maxTargetSdk=29, publicAlternatives="Use {@link android.content.Context#sendBroadcast(android.content.Intent)} instead")
broadcastIntent(in IApplicationThread caller, in Intent intent, in String resolvedType, in IIntentReceiver resultTo, int resultCode, in String resultData, in Bundle map, in String[] requiredPermissions, int appOp, in Bundle options, boolean serialized, boolean sticky, int userId)134     int broadcastIntent(in IApplicationThread caller, in Intent intent,
135             in String resolvedType, in IIntentReceiver resultTo, int resultCode,
136             in String resultData, in Bundle map, in String[] requiredPermissions,
137             int appOp, in Bundle options, boolean serialized, boolean sticky, int userId);
broadcastIntentWithFeature(in IApplicationThread caller, in String callingFeatureId, in Intent intent, in String resolvedType, in IIntentReceiver resultTo, int resultCode, in String resultData, in Bundle map, in String[] requiredPermissions, in String[] excludePermissions, int appOp, in Bundle options, boolean serialized, boolean sticky, int userId)138     int broadcastIntentWithFeature(in IApplicationThread caller, in String callingFeatureId,
139             in Intent intent, in String resolvedType, in IIntentReceiver resultTo, int resultCode,
140             in String resultData, in Bundle map, in String[] requiredPermissions, in String[] excludePermissions,
141             int appOp, in Bundle options, boolean serialized, boolean sticky, int userId);
unbroadcastIntent(in IApplicationThread caller, in Intent intent, int userId)142     void unbroadcastIntent(in IApplicationThread caller, in Intent intent, int userId);
143     @UnsupportedAppUsage
finishReceiver(in IBinder who, int resultCode, in String resultData, in Bundle map, boolean abortBroadcast, int flags)144     oneway void finishReceiver(in IBinder who, int resultCode, in String resultData, in Bundle map,
145             boolean abortBroadcast, int flags);
attachApplication(in IApplicationThread app, long startSeq)146     void attachApplication(in IApplicationThread app, long startSeq);
getTasks(int maxNum)147     List<ActivityManager.RunningTaskInfo> getTasks(int maxNum);
148     @UnsupportedAppUsage
moveTaskToFront(in IApplicationThread caller, in String callingPackage, int task, int flags, in Bundle options)149     void moveTaskToFront(in IApplicationThread caller, in String callingPackage, int task,
150             int flags, in Bundle options);
151     @UnsupportedAppUsage
getTaskForActivity(in IBinder token, in boolean onlyRoot)152     int getTaskForActivity(in IBinder token, in boolean onlyRoot);
getContentProvider(in IApplicationThread caller, in String callingPackage, in String name, int userId, boolean stable)153     ContentProviderHolder getContentProvider(in IApplicationThread caller, in String callingPackage,
154             in String name, int userId, boolean stable);
155     @UnsupportedAppUsage
publishContentProviders(in IApplicationThread caller, in List<ContentProviderHolder> providers)156     void publishContentProviders(in IApplicationThread caller,
157             in List<ContentProviderHolder> providers);
refContentProvider(in IBinder connection, int stableDelta, int unstableDelta)158     boolean refContentProvider(in IBinder connection, int stableDelta, int unstableDelta);
getRunningServiceControlPanel(in ComponentName service)159     PendingIntent getRunningServiceControlPanel(in ComponentName service);
startService(in IApplicationThread caller, in Intent service, in String resolvedType, boolean requireForeground, in String callingPackage, in String callingFeatureId, int userId)160     ComponentName startService(in IApplicationThread caller, in Intent service,
161             in String resolvedType, boolean requireForeground, in String callingPackage,
162             in String callingFeatureId, int userId);
163     @UnsupportedAppUsage
stopService(in IApplicationThread caller, in Intent service, in String resolvedType, int userId)164     int stopService(in IApplicationThread caller, in Intent service,
165             in String resolvedType, int userId);
166     // Currently keeping old bindService because it is on the greylist
167     @UnsupportedAppUsage
bindService(in IApplicationThread caller, in IBinder token, in Intent service, in String resolvedType, in IServiceConnection connection, int flags, in String callingPackage, int userId)168     int bindService(in IApplicationThread caller, in IBinder token, in Intent service,
169             in String resolvedType, in IServiceConnection connection, int flags,
170             in String callingPackage, int userId);
bindIsolatedService(in IApplicationThread caller, in IBinder token, in Intent service, in String resolvedType, in IServiceConnection connection, int flags, in String instanceName, in String callingPackage, int userId)171     int bindIsolatedService(in IApplicationThread caller, in IBinder token, in Intent service,
172             in String resolvedType, in IServiceConnection connection, int flags,
173             in String instanceName, in String callingPackage, int userId);
updateServiceGroup(in IServiceConnection connection, int group, int importance)174     void updateServiceGroup(in IServiceConnection connection, int group, int importance);
175     @UnsupportedAppUsage
unbindService(in IServiceConnection connection)176     boolean unbindService(in IServiceConnection connection);
publishService(in IBinder token, in Intent intent, in IBinder service)177     void publishService(in IBinder token, in Intent intent, in IBinder service);
178     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
setDebugApp(in String packageName, boolean waitForDebugger, boolean persistent)179     void setDebugApp(in String packageName, boolean waitForDebugger, boolean persistent);
setAgentApp(in String packageName, @nullable String agent)180     void setAgentApp(in String packageName, @nullable String agent);
181     @UnsupportedAppUsage
setAlwaysFinish(boolean enabled)182     void setAlwaysFinish(boolean enabled);
183     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
startInstrumentation(in ComponentName className, in String profileFile, int flags, in Bundle arguments, in IInstrumentationWatcher watcher, in IUiAutomationConnection connection, int userId, in String abiOverride)184     boolean startInstrumentation(in ComponentName className, in String profileFile,
185             int flags, in Bundle arguments, in IInstrumentationWatcher watcher,
186             in IUiAutomationConnection connection, int userId,
187             in String abiOverride);
addInstrumentationResults(in IApplicationThread target, in Bundle results)188     void addInstrumentationResults(in IApplicationThread target, in Bundle results);
finishInstrumentation(in IApplicationThread target, int resultCode, in Bundle results)189     void finishInstrumentation(in IApplicationThread target, int resultCode,
190             in Bundle results);
191     /**
192      * @return A copy of global {@link Configuration}, contains general settings for the entire
193      *         system. Corresponds to the configuration of the default display.
194      * @throws RemoteException
195      */
196     @UnsupportedAppUsage
getConfiguration()197     Configuration getConfiguration();
198     /**
199      * Updates global configuration and applies changes to the entire system.
200      * @param values Update values for global configuration. If null is passed it will request the
201      *               Window Manager to compute new config for the default display.
202      * @throws RemoteException
203      * @return Returns true if the configuration was updated.
204      */
205     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
updateConfiguration(in Configuration values)206     boolean updateConfiguration(in Configuration values);
207     /**
208      * Updates mcc mnc configuration and applies changes to the entire system.
209      *
210      * @param mcc mcc configuration to update.
211      * @param mnc mnc configuration to update.
212      * @throws RemoteException; IllegalArgumentException if mcc or mnc is null.
213      * @return Returns {@code true} if the configuration was updated;
214      *         {@code false} otherwise.
215      */
updateMccMncConfiguration(in String mcc, in String mnc)216     boolean updateMccMncConfiguration(in String mcc, in String mnc);
stopServiceToken(in ComponentName className, in IBinder token, int startId)217     boolean stopServiceToken(in ComponentName className, in IBinder token, int startId);
218     @UnsupportedAppUsage
setProcessLimit(int max)219     void setProcessLimit(int max);
220     @UnsupportedAppUsage
getProcessLimit()221     int getProcessLimit();
checkUriPermission(in Uri uri, int pid, int uid, int mode, int userId, in IBinder callerToken)222     int checkUriPermission(in Uri uri, int pid, int uid, int mode, int userId,
223             in IBinder callerToken);
checkUriPermissions(in List<Uri> uris, int pid, int uid, int mode, in IBinder callerToken)224     int[] checkUriPermissions(in List<Uri> uris, int pid, int uid, int mode,
225                 in IBinder callerToken);
grantUriPermission(in IApplicationThread caller, in String targetPkg, in Uri uri, int mode, int userId)226     void grantUriPermission(in IApplicationThread caller, in String targetPkg, in Uri uri,
227             int mode, int userId);
revokeUriPermission(in IApplicationThread caller, in String targetPkg, in Uri uri, int mode, int userId)228     void revokeUriPermission(in IApplicationThread caller, in String targetPkg, in Uri uri,
229             int mode, int userId);
230     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
setActivityController(in IActivityController watcher, boolean imAMonkey)231     void setActivityController(in IActivityController watcher, boolean imAMonkey);
showWaitingForDebugger(in IApplicationThread who, boolean waiting)232     void showWaitingForDebugger(in IApplicationThread who, boolean waiting);
233     /*
234      * This will deliver the specified signal to all the persistent processes. Currently only
235      * SIGUSR1 is delivered. All others are ignored.
236      */
signalPersistentProcesses(int signal)237     void signalPersistentProcesses(int signal);
238 
239     @UnsupportedAppUsage
getRecentTasks(int maxNum, int flags, int userId)240     ParceledListSlice getRecentTasks(int maxNum, int flags, int userId);
241     @UnsupportedAppUsage
serviceDoneExecuting(in IBinder token, int type, int startId, int res)242     oneway void serviceDoneExecuting(in IBinder token, int type, int startId, int res);
243     /** @deprecated  Use {@link #getIntentSenderWithFeature} instead */
244     @UnsupportedAppUsage(maxTargetSdk=29, publicAlternatives="Use {@link PendingIntent#getIntentSender()} instead")
getIntentSender(int type, in String packageName, in IBinder token, in String resultWho, int requestCode, in Intent[] intents, in String[] resolvedTypes, int flags, in Bundle options, int userId)245     IIntentSender getIntentSender(int type, in String packageName, in IBinder token,
246             in String resultWho, int requestCode, in Intent[] intents, in String[] resolvedTypes,
247             int flags, in Bundle options, int userId);
getIntentSenderWithFeature(int type, in String packageName, in String featureId, in IBinder token, in String resultWho, int requestCode, in Intent[] intents, in String[] resolvedTypes, int flags, in Bundle options, int userId)248     IIntentSender getIntentSenderWithFeature(int type, in String packageName, in String featureId,
249             in IBinder token, in String resultWho, int requestCode, in Intent[] intents,
250             in String[] resolvedTypes, int flags, in Bundle options, int userId);
cancelIntentSender(in IIntentSender sender)251     void cancelIntentSender(in IIntentSender sender);
getInfoForIntentSender(in IIntentSender sender)252     ActivityManager.PendingIntentInfo getInfoForIntentSender(in IIntentSender sender);
registerIntentSenderCancelListener(in IIntentSender sender, in IResultReceiver receiver)253     void registerIntentSenderCancelListener(in IIntentSender sender, in IResultReceiver receiver);
unregisterIntentSenderCancelListener(in IIntentSender sender, in IResultReceiver receiver)254     void unregisterIntentSenderCancelListener(in IIntentSender sender, in IResultReceiver receiver);
enterSafeMode()255     void enterSafeMode();
noteWakeupAlarm(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String sourcePkg, in String tag)256     void noteWakeupAlarm(in IIntentSender sender, in WorkSource workSource, int sourceUid,
257             in String sourcePkg, in String tag);
removeContentProvider(in IBinder connection, boolean stable)258     oneway void removeContentProvider(in IBinder connection, boolean stable);
259     @UnsupportedAppUsage
setRequestedOrientation(in IBinder token, int requestedOrientation)260     void setRequestedOrientation(in IBinder token, int requestedOrientation);
unbindFinished(in IBinder token, in Intent service, boolean doRebind)261     void unbindFinished(in IBinder token, in Intent service, boolean doRebind);
262     @UnsupportedAppUsage
setProcessImportant(in IBinder token, int pid, boolean isForeground, String reason)263     void setProcessImportant(in IBinder token, int pid, boolean isForeground, String reason);
setServiceForeground(in ComponentName className, in IBinder token, int id, in Notification notification, int flags, int foregroundServiceType)264     void setServiceForeground(in ComponentName className, in IBinder token,
265             int id, in Notification notification, int flags, int foregroundServiceType);
getForegroundServiceType(in ComponentName className, in IBinder token)266     int getForegroundServiceType(in ComponentName className, in IBinder token);
267     @UnsupportedAppUsage
moveActivityTaskToBack(in IBinder token, boolean nonRoot)268     boolean moveActivityTaskToBack(in IBinder token, boolean nonRoot);
269     @UnsupportedAppUsage
getMemoryInfo(out ActivityManager.MemoryInfo outInfo)270     void getMemoryInfo(out ActivityManager.MemoryInfo outInfo);
getProcessesInErrorState()271     List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState();
clearApplicationUserData(in String packageName, boolean keepState, in IPackageDataObserver observer, int userId)272     boolean clearApplicationUserData(in String packageName, boolean keepState,
273             in IPackageDataObserver observer, int userId);
274     @UnsupportedAppUsage
forceStopPackage(in String packageName, int userId)275     void forceStopPackage(in String packageName, int userId);
killPids(in int[] pids, in String reason, boolean secure)276     boolean killPids(in int[] pids, in String reason, boolean secure);
277     @UnsupportedAppUsage
getServices(int maxNum, int flags)278     List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags);
279     // Retrieve running application processes in the system
280     @UnsupportedAppUsage
getRunningAppProcesses()281     List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses();
peekService(in Intent service, in String resolvedType, in String callingPackage)282     IBinder peekService(in Intent service, in String resolvedType, in String callingPackage);
283     // Turn on/off profiling in a particular process.
284     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
profileControl(in String process, int userId, boolean start, in ProfilerInfo profilerInfo, int profileType)285     boolean profileControl(in String process, int userId, boolean start,
286             in ProfilerInfo profilerInfo, int profileType);
287     @UnsupportedAppUsage
shutdown(int timeout)288     boolean shutdown(int timeout);
289     @UnsupportedAppUsage
stopAppSwitches()290     void stopAppSwitches();
291     @UnsupportedAppUsage
resumeAppSwitches()292     void resumeAppSwitches();
bindBackupAgent(in String packageName, int backupRestoreMode, int targetUserId, int operationType)293     boolean bindBackupAgent(in String packageName, int backupRestoreMode, int targetUserId,
294             int operationType);
backupAgentCreated(in String packageName, in IBinder agent, int userId)295     void backupAgentCreated(in String packageName, in IBinder agent, int userId);
unbindBackupAgent(in ApplicationInfo appInfo)296     void unbindBackupAgent(in ApplicationInfo appInfo);
handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, boolean requireFull, in String name, in String callerPackage)297     int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
298             boolean requireFull, in String name, in String callerPackage);
addPackageDependency(in String packageName)299     void addPackageDependency(in String packageName);
killApplication(in String pkg, int appId, int userId, in String reason)300     void killApplication(in String pkg, int appId, int userId, in String reason);
301     @UnsupportedAppUsage
closeSystemDialogs(in String reason)302     void closeSystemDialogs(in String reason);
303     @UnsupportedAppUsage
getProcessMemoryInfo(in int[] pids)304     Debug.MemoryInfo[] getProcessMemoryInfo(in int[] pids);
killApplicationProcess(in String processName, int uid)305     void killApplicationProcess(in String processName, int uid);
306     // Special low-level communication with activity manager.
handleApplicationWtf(in IBinder app, in String tag, boolean system, in ApplicationErrorReport.ParcelableCrashInfo crashInfo, int immediateCallerPid)307     boolean handleApplicationWtf(in IBinder app, in String tag, boolean system,
308             in ApplicationErrorReport.ParcelableCrashInfo crashInfo, int immediateCallerPid);
309     @UnsupportedAppUsage
killBackgroundProcesses(in String packageName, int userId)310     void killBackgroundProcesses(in String packageName, int userId);
isUserAMonkey()311     boolean isUserAMonkey();
312     // Retrieve info of applications installed on external media that are currently
313     // running.
getRunningExternalApplications()314     List<ApplicationInfo> getRunningExternalApplications();
315     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
finishHeavyWeightApp()316     void finishHeavyWeightApp();
317     // A StrictMode violation to be handled.
318     @UnsupportedAppUsage
handleApplicationStrictModeViolation(in IBinder app, int penaltyMask, in StrictMode.ViolationInfo crashInfo)319     void handleApplicationStrictModeViolation(in IBinder app, int penaltyMask,
320             in StrictMode.ViolationInfo crashInfo);
isTopActivityImmersive()321     boolean isTopActivityImmersive();
crashApplication(int uid, int initialPid, in String packageName, int userId, in String message, boolean force)322     void crashApplication(int uid, int initialPid, in String packageName, int userId,
323             in String message, boolean force);
crashApplicationWithType(int uid, int initialPid, in String packageName, int userId, in String message, boolean force, int exceptionTypeId)324     void crashApplicationWithType(int uid, int initialPid, in String packageName, int userId,
325             in String message, boolean force, int exceptionTypeId);
326     /** @deprecated -- use getProviderMimeTypeAsync */
327     @UnsupportedAppUsage(maxTargetSdk = 29, publicAlternatives =
328             "Use {@link android.content.ContentResolver#getType} public API instead.")
getProviderMimeType(in Uri uri, int userId)329     String getProviderMimeType(in Uri uri, int userId);
330 
getProviderMimeTypeAsync(in Uri uri, int userId, in RemoteCallback resultCallback)331     oneway void getProviderMimeTypeAsync(in Uri uri, int userId, in RemoteCallback resultCallback);
332 
333     // Cause the specified process to dump the specified heap.
dumpHeap(in String process, int userId, boolean managed, boolean mallocInfo, boolean runGc, in String path, in ParcelFileDescriptor fd, in RemoteCallback finishCallback)334     boolean dumpHeap(in String process, int userId, boolean managed, boolean mallocInfo,
335             boolean runGc, in String path, in ParcelFileDescriptor fd,
336             in RemoteCallback finishCallback);
337     @UnsupportedAppUsage
isUserRunning(int userid, int flags)338     boolean isUserRunning(int userid, int flags);
339     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
setPackageScreenCompatMode(in String packageName, int mode)340     void setPackageScreenCompatMode(in String packageName, int mode);
341     @UnsupportedAppUsage
switchUser(int userid)342     boolean switchUser(int userid);
343     @UnsupportedAppUsage
removeTask(int taskId)344     boolean removeTask(int taskId);
345     @UnsupportedAppUsage
registerProcessObserver(in IProcessObserver observer)346     void registerProcessObserver(in IProcessObserver observer);
347     @UnsupportedAppUsage
unregisterProcessObserver(in IProcessObserver observer)348     void unregisterProcessObserver(in IProcessObserver observer);
isIntentSenderTargetedToPackage(in IIntentSender sender)349     boolean isIntentSenderTargetedToPackage(in IIntentSender sender);
350     @UnsupportedAppUsage
updatePersistentConfiguration(in Configuration values)351     void updatePersistentConfiguration(in Configuration values);
updatePersistentConfigurationWithAttribution(in Configuration values, String callingPackageName, String callingAttributionTag)352     void updatePersistentConfigurationWithAttribution(in Configuration values,
353             String callingPackageName, String callingAttributionTag);
354     @UnsupportedAppUsage
getProcessPss(in int[] pids)355     long[] getProcessPss(in int[] pids);
showBootMessage(in CharSequence msg, boolean always)356     void showBootMessage(in CharSequence msg, boolean always);
357     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
killAllBackgroundProcesses()358     void killAllBackgroundProcesses();
getContentProviderExternal(in String name, int userId, in IBinder token, String tag)359     ContentProviderHolder getContentProviderExternal(in String name, int userId,
360             in IBinder token, String tag);
361     /** @deprecated - Use {@link #removeContentProviderExternalAsUser} which takes a user ID. */
362     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
removeContentProviderExternal(in String name, in IBinder token)363     void removeContentProviderExternal(in String name, in IBinder token);
removeContentProviderExternalAsUser(in String name, in IBinder token, int userId)364     void removeContentProviderExternalAsUser(in String name, in IBinder token, int userId);
365     // Get memory information about the calling process.
getMyMemoryState(out ActivityManager.RunningAppProcessInfo outInfo)366     void getMyMemoryState(out ActivityManager.RunningAppProcessInfo outInfo);
killProcessesBelowForeground(in String reason)367     boolean killProcessesBelowForeground(in String reason);
368     @UnsupportedAppUsage
getCurrentUser()369     UserInfo getCurrentUser();
getCurrentUserId()370     int getCurrentUserId();
371     // This is not public because you need to be very careful in how you
372     // manage your activity to make sure it is always the uid you expect.
373     @UnsupportedAppUsage
getLaunchedFromUid(in IBinder activityToken)374     int getLaunchedFromUid(in IBinder activityToken);
375     @UnsupportedAppUsage
unstableProviderDied(in IBinder connection)376     void unstableProviderDied(in IBinder connection);
377     @UnsupportedAppUsage
isIntentSenderAnActivity(in IIntentSender sender)378     boolean isIntentSenderAnActivity(in IIntentSender sender);
379     /** @deprecated Use {@link startActivityAsUserWithFeature} instead */
380     @UnsupportedAppUsage(maxTargetSdk=29, publicAlternatives="Use {@code android.content.Context#createContextAsUser(android.os.UserHandle, int)} and {@link android.content.Context#startActivity(android.content.Intent)} instead")
startActivityAsUser(in IApplicationThread caller, in String callingPackage, in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options, int userId)381     int startActivityAsUser(in IApplicationThread caller, in String callingPackage,
382             in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
383             int requestCode, int flags, in ProfilerInfo profilerInfo,
384             in Bundle options, int userId);
startActivityAsUserWithFeature(in IApplicationThread caller, in String callingPackage, in String callingFeatureId, in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode, int flags, in ProfilerInfo profilerInfo, in Bundle options, int userId)385     int startActivityAsUserWithFeature(in IApplicationThread caller, in String callingPackage,
386             in String callingFeatureId, in Intent intent, in String resolvedType,
387             in IBinder resultTo, in String resultWho, int requestCode, int flags,
388             in ProfilerInfo profilerInfo, in Bundle options, int userId);
389     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
stopUser(int userid, boolean force, in IStopUserCallback callback)390     int stopUser(int userid, boolean force, in IStopUserCallback callback);
391     /**
392      * Check {@link com.android.server.am.ActivityManagerService#stopUserWithDelayedLocking(int, boolean, IStopUserCallback)}
393      * for details.
394      */
stopUserWithDelayedLocking(int userid, boolean force, in IStopUserCallback callback)395     int stopUserWithDelayedLocking(int userid, boolean force, in IStopUserCallback callback);
396 
397     @UnsupportedAppUsage
registerUserSwitchObserver(in IUserSwitchObserver observer, in String name)398     void registerUserSwitchObserver(in IUserSwitchObserver observer, in String name);
unregisterUserSwitchObserver(in IUserSwitchObserver observer)399     void unregisterUserSwitchObserver(in IUserSwitchObserver observer);
getRunningUserIds()400     int[] getRunningUserIds();
401 
402     // Request a heap dump for the system server.
requestSystemServerHeapDump()403     void requestSystemServerHeapDump();
404 
requestBugReport(int bugreportType)405     void requestBugReport(int bugreportType);
requestBugReportWithDescription(in @ullable String shareTitle, in @nullable String shareDescription, int bugreportType)406     void requestBugReportWithDescription(in @nullable String shareTitle,
407                 in @nullable String shareDescription, int bugreportType);
408 
409     /**
410      *  Takes a telephony bug report and notifies the user with the title and description
411      *  that are passed to this API as parameters
412      *
413      *  @param shareTitle should be a valid legible string less than 50 chars long
414      *  @param shareDescription should be less than 150 chars long
415      *
416      *  @throws IllegalArgumentException if shareTitle or shareDescription is too big or if the
417      *          paremeters cannot be encoding to an UTF-8 charset.
418      */
requestTelephonyBugReport(in String shareTitle, in String shareDescription)419     void requestTelephonyBugReport(in String shareTitle, in String shareDescription);
420 
421     /**
422      *  This method is only used by Wifi.
423      *
424      *  Takes a minimal bugreport of Wifi-related state.
425      *
426      *  @param shareTitle should be a valid legible string less than 50 chars long
427      *  @param shareDescription should be less than 150 chars long
428      *
429      *  @throws IllegalArgumentException if shareTitle or shareDescription is too big or if the
430      *          parameters cannot be encoding to an UTF-8 charset.
431      */
requestWifiBugReport(in String shareTitle, in String shareDescription)432     void requestWifiBugReport(in String shareTitle, in String shareDescription);
requestInteractiveBugReportWithDescription(in String shareTitle, in String shareDescription)433     void requestInteractiveBugReportWithDescription(in String shareTitle,
434             in String shareDescription);
435 
requestInteractiveBugReport()436     void requestInteractiveBugReport();
requestFullBugReport()437     void requestFullBugReport();
requestRemoteBugReport()438     void requestRemoteBugReport();
launchBugReportHandlerApp()439     boolean launchBugReportHandlerApp();
getBugreportWhitelistedPackages()440     List<String> getBugreportWhitelistedPackages();
441 
442     @UnsupportedAppUsage
getIntentForIntentSender(in IIntentSender sender)443     Intent getIntentForIntentSender(in IIntentSender sender);
444     // This is not public because you need to be very careful in how you
445     // manage your activity to make sure it is always the uid you expect.
446     @UnsupportedAppUsage
getLaunchedFromPackage(in IBinder activityToken)447     String getLaunchedFromPackage(in IBinder activityToken);
killUid(int appId, int userId, in String reason)448     void killUid(int appId, int userId, in String reason);
setUserIsMonkey(boolean monkey)449     void setUserIsMonkey(boolean monkey);
450     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
hang(in IBinder who, boolean allowRestart)451     void hang(in IBinder who, boolean allowRestart);
452 
getAllRootTaskInfos()453     List<ActivityTaskManager.RootTaskInfo> getAllRootTaskInfos();
moveTaskToRootTask(int taskId, int rootTaskId, boolean toTop)454     void moveTaskToRootTask(int taskId, int rootTaskId, boolean toTop);
setFocusedRootTask(int taskId)455     void setFocusedRootTask(int taskId);
getFocusedRootTaskInfo()456     ActivityTaskManager.RootTaskInfo getFocusedRootTaskInfo();
457     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
restart()458     void restart();
performIdleMaintenance()459     void performIdleMaintenance();
appNotRespondingViaProvider(in IBinder connection)460     void appNotRespondingViaProvider(in IBinder connection);
461     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
getTaskBounds(int taskId)462     Rect getTaskBounds(int taskId);
463     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
setProcessMemoryTrimLevel(in String process, int userId, int level)464     boolean setProcessMemoryTrimLevel(in String process, int userId, int level);
465 
466 
467     // Start of L transactions
getTagForIntentSender(in IIntentSender sender, in String prefix)468     String getTagForIntentSender(in IIntentSender sender, in String prefix);
469     @UnsupportedAppUsage
startUserInBackground(int userid)470     boolean startUserInBackground(int userid);
471     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
isInLockTaskMode()472     boolean isInLockTaskMode();
473     @UnsupportedAppUsage
startActivityFromRecents(int taskId, in Bundle options)474     int startActivityFromRecents(int taskId, in Bundle options);
475     @UnsupportedAppUsage
startSystemLockTaskMode(int taskId)476     void startSystemLockTaskMode(int taskId);
477     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
isTopOfTask(in IBinder token)478     boolean isTopOfTask(in IBinder token);
bootAnimationComplete()479     void bootAnimationComplete();
480     @UnsupportedAppUsage
registerTaskStackListener(in ITaskStackListener listener)481     void registerTaskStackListener(in ITaskStackListener listener);
unregisterTaskStackListener(in ITaskStackListener listener)482     void unregisterTaskStackListener(in ITaskStackListener listener);
notifyCleartextNetwork(int uid, in byte[] firstPacket)483     void notifyCleartextNetwork(int uid, in byte[] firstPacket);
484     @UnsupportedAppUsage
setTaskResizeable(int taskId, int resizeableMode)485     void setTaskResizeable(int taskId, int resizeableMode);
486     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
resizeTask(int taskId, in Rect bounds, int resizeMode)487     void resizeTask(int taskId, in Rect bounds, int resizeMode);
488     @UnsupportedAppUsage
getLockTaskModeState()489     int getLockTaskModeState();
490     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
setDumpHeapDebugLimit(in String processName, int uid, long maxMemSize, in String reportPackage)491     void setDumpHeapDebugLimit(in String processName, int uid, long maxMemSize,
492             in String reportPackage);
dumpHeapFinished(in String path)493     void dumpHeapFinished(in String path);
updateLockTaskPackages(int userId, in String[] packages)494     void updateLockTaskPackages(int userId, in String[] packages);
noteAlarmStart(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String tag)495     void noteAlarmStart(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String tag);
noteAlarmFinish(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String tag)496     void noteAlarmFinish(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String tag);
497     @UnsupportedAppUsage
getPackageProcessState(in String packageName, in String callingPackage)498     int getPackageProcessState(in String packageName, in String callingPackage);
updateDeviceOwner(in String packageName)499     void updateDeviceOwner(in String packageName);
500 
501     // Start of N transactions
502     // Start Binder transaction tracking for all applications.
503     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
startBinderTracking()504     boolean startBinderTracking();
505     // Stop Binder transaction tracking for all applications and dump trace data to the given file
506     // descriptor.
507     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
stopBinderTrackingAndDump(in ParcelFileDescriptor fd)508     boolean stopBinderTrackingAndDump(in ParcelFileDescriptor fd);
509     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
suppressResizeConfigChanges(boolean suppress)510     void suppressResizeConfigChanges(boolean suppress);
511     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
unlockUser(int userid, in byte[] token, in byte[] secret, in IProgressListener listener)512     boolean unlockUser(int userid, in byte[] token, in byte[] secret,
513             in IProgressListener listener);
killPackageDependents(in String packageName, int userId)514     void killPackageDependents(in String packageName, int userId);
makePackageIdle(String packageName, int userId)515     void makePackageIdle(String packageName, int userId);
getMemoryTrimLevel()516     int getMemoryTrimLevel();
isVrModePackageEnabled(in ComponentName packageName)517     boolean isVrModePackageEnabled(in ComponentName packageName);
notifyLockedProfile(int userId)518     void notifyLockedProfile(int userId);
startConfirmDeviceCredentialIntent(in Intent intent, in Bundle options)519     void startConfirmDeviceCredentialIntent(in Intent intent, in Bundle options);
520     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
sendIdleJobTrigger()521     void sendIdleJobTrigger();
sendIntentSender(in IIntentSender target, in IBinder whitelistToken, int code, in Intent intent, in String resolvedType, in IIntentReceiver finishedReceiver, in String requiredPermission, in Bundle options)522     int sendIntentSender(in IIntentSender target, in IBinder whitelistToken, int code,
523             in Intent intent, in String resolvedType, in IIntentReceiver finishedReceiver,
524             in String requiredPermission, in Bundle options);
isBackgroundRestricted(in String packageName)525     boolean isBackgroundRestricted(in String packageName);
526 
527     // Start of N MR1 transactions
setRenderThread(int tid)528     void setRenderThread(int tid);
529     /**
530      * Lets activity manager know whether the calling process is currently showing "top-level" UI
531      * that is not an activity, i.e. windows on the screen the user is currently interacting with.
532      *
533      * <p>This flag can only be set for persistent processes.
534      *
535      * @param hasTopUi Whether the calling process has "top-level" UI.
536      */
setHasTopUi(boolean hasTopUi)537     void setHasTopUi(boolean hasTopUi);
538 
539     // Start of O transactions
restartUserInBackground(int userId)540     int restartUserInBackground(int userId);
541     /** Cancels the window transitions for the given task. */
542     @UnsupportedAppUsage
cancelTaskWindowTransition(int taskId)543     void cancelTaskWindowTransition(int taskId);
scheduleApplicationInfoChanged(in List<String> packageNames, int userId)544     void scheduleApplicationInfoChanged(in List<String> packageNames, int userId);
setPersistentVrThread(int tid)545     void setPersistentVrThread(int tid);
546 
waitForNetworkStateUpdate(long procStateSeq)547     void waitForNetworkStateUpdate(long procStateSeq);
548     /**
549      * Add a bare uid to the background restrictions whitelist.  Only the system uid may call this.
550      */
backgroundAllowlistUid(int uid)551     void backgroundAllowlistUid(int uid);
552 
553     // Start of P transactions
554     /**
555      *  Similar to {@link #startUserInBackground(int userId), but with a listener to report
556      *  user unlock progress.
557      */
startUserInBackgroundWithListener(int userid, IProgressListener unlockProgressListener)558     boolean startUserInBackgroundWithListener(int userid, IProgressListener unlockProgressListener);
559 
560     /**
561      * Method for the shell UID to start deletating its permission identity to an
562      * active instrumenation. The shell can delegate permissions only to one active
563      * instrumentation at a time. An active instrumentation is one running and
564      * started from the shell.
565      */
startDelegateShellPermissionIdentity(int uid, in String[] permissions)566     void startDelegateShellPermissionIdentity(int uid, in String[] permissions);
567 
568     /**
569      * Method for the shell UID to stop deletating its permission identity to an
570      * active instrumenation. An active instrumentation is one running and
571      * started from the shell.
572      */
stopDelegateShellPermissionIdentity()573     void stopDelegateShellPermissionIdentity();
574 
575     /**
576      * Method for the shell UID to get currently adopted permissions for an active instrumentation.
577      * An active instrumentation is one running and started from the shell.
578      */
getDelegatedShellPermissions()579     List<String> getDelegatedShellPermissions();
580 
581     /** Returns a file descriptor that'll be closed when the system server process dies. */
getLifeMonitor()582     ParcelFileDescriptor getLifeMonitor();
583 
584     /**
585      * Start user, if it us not already running, and bring it to foreground.
586      * unlockProgressListener can be null if monitoring progress is not necessary.
587      */
startUserInForegroundWithListener(int userid, IProgressListener unlockProgressListener)588     boolean startUserInForegroundWithListener(int userid, IProgressListener unlockProgressListener);
589 
590     /**
591      * Method for the app to tell system that it's wedged and would like to trigger an ANR.
592      */
appNotResponding(String reason)593     void appNotResponding(String reason);
594 
595     /**
596      * Return a list of {@link ApplicationExitInfo} records.
597      *
598      * <p class="note"> Note: System stores these historical information in a ring buffer, older
599      * records would be overwritten by newer records. </p>
600      *
601      * <p class="note"> Note: In the case that this application bound to an external service with
602      * flag {@link android.content.Context#BIND_EXTERNAL_SERVICE}, the process of that external
603      * service will be included in this package's exit info. </p>
604      *
605      * @param packageName Optional, an empty value means match all packages belonging to the
606      *                    caller's UID. If this package belongs to another UID, you must hold
607      *                    {@link android.Manifest.permission#DUMP} in order to retrieve it.
608      * @param pid         Optional, it could be a process ID that used to belong to this package but
609      *                    died later; A value of 0 means to ignore this parameter and return all
610      *                    matching records.
611      * @param maxNum      Optional, the maximum number of results should be returned; A value of 0
612      *                    means to ignore this parameter and return all matching records
613      * @param userId      The userId in the multi-user environment.
614      *
615      * @return a list of {@link ApplicationExitInfo} records with the matching criteria, sorted in
616      *         the order from most recent to least recent.
617      */
getHistoricalProcessExitReasons(String packageName, int pid, int maxNum, int userId)618     ParceledListSlice<ApplicationExitInfo> getHistoricalProcessExitReasons(String packageName,
619             int pid, int maxNum, int userId);
620 
621     /*
622      * Kill the given PIDs, but the killing will be delayed until the device is idle
623      * and the given process is imperceptible.
624      */
killProcessesWhenImperceptible(in int[] pids, String reason)625     void killProcessesWhenImperceptible(in int[] pids, String reason);
626 
627     /**
628      * Set locus context for a given activity.
629      * @param activity
630      * @param locusId a unique, stable id that identifies this activity instance from others.
631      * @param appToken ActivityRecord's appToken.
632      */
setActivityLocusContext(in ComponentName activity, in LocusId locusId, in IBinder appToken)633     void setActivityLocusContext(in ComponentName activity, in LocusId locusId,
634             in IBinder appToken);
635 
636     /**
637      * Set custom state data for this process. It will be included in the record of
638      * {@link ApplicationExitInfo} on the death of the current calling process; the new process
639      * of the app can retrieve this state data by calling
640      * {@link ApplicationExitInfo#getProcessStateSummary} on the record returned by
641      * {@link #getHistoricalProcessExitReasons}.
642      *
643      * <p> This would be useful for the calling app to save its stateful data: if it's
644      * killed later for any reason, the new process of the app can know what the
645      * previous process of the app was doing. For instance, you could use this to encode
646      * the current level in a game, or a set of features/experiments that were enabled. Later you
647      * could analyze under what circumstances the app tends to crash or use too much memory.
648      * However, it's not suggested to rely on this to restore the applications previous UI state
649      * or so, it's only meant for analyzing application healthy status.</p>
650      *
651      * <p> System might decide to throttle the calls to this API; so call this API in a reasonable
652      * manner, excessive calls to this API could result a {@link java.lang.RuntimeException}.
653      * </p>
654      *
655      * @param state The customized state data
656      */
setProcessStateSummary(in byte[] state)657     void setProcessStateSummary(in byte[] state);
658 
659     /**
660      * Return whether the app freezer is supported (true) or not (false) by this system.
661      */
isAppFreezerSupported()662     boolean isAppFreezerSupported();
663 
664 
665     /**
666      * Kills uid with the reason of permission change.
667      */
killUidForPermissionChange(int appId, int userId, String reason)668     void killUidForPermissionChange(int appId, int userId, String reason);
669 
670     /**
671      * Resets the state of the {@link com.android.server.am.AppErrors} instance.
672      * This is intended for testing within the CTS only and is protected by
673      * android.permission.RESET_APP_ERRORS.
674      */
resetAppErrors()675     void resetAppErrors();
676 
677     /**
678      * Control the app freezer state. Returns true in case of success, false if the operation
679      * didn't succeed (for example, when the app freezer isn't supported).
680      * Handling the freezer state via this method is reentrant, that is it can be
681      * disabled and re-enabled multiple times in parallel. As long as there's a 1:1 disable to
682      * enable match, the freezer is re-enabled at last enable only.
683      * @param enable set it to true to enable the app freezer, false to disable it.
684      */
enableAppFreezer(in boolean enable)685     boolean enableAppFreezer(in boolean enable);
686 
687     /**
688      * Suppress or reenable the rate limit on foreground service notification deferral.
689      * This is for use within CTS and is protected by android.permission.WRITE_DEVICE_CONFIG.
690      *
691      * @param enable false to suppress rate-limit policy; true to reenable it.
692      */
enableFgsNotificationRateLimit(in boolean enable)693     boolean enableFgsNotificationRateLimit(in boolean enable);
694 
695     /**
696      * Holds the AM lock for the specified amount of milliseconds.
697      * This is intended for use by the tests that need to imitate lock contention.
698      * The token should be obtained by
699      * {@link android.content.pm.PackageManager#getHoldLockToken()}.
700      */
holdLock(in IBinder token, in int durationMs)701     void holdLock(in IBinder token, in int durationMs);
702 
703     /**
704      * Starts a profile.
705      * @param userId the user id of the profile.
706      * @return true if the profile has been successfully started or if the profile is already
707      * running, false if profile failed to start.
708      * @throws IllegalArgumentException if the user is not a profile.
709      */
startProfile(int userId)710     boolean startProfile(int userId);
711 
712     /**
713      * Stops a profile.
714      * @param userId the user id of the profile.
715      * @return true if the profile has been successfully stopped or is already stopped. Otherwise
716      * the exceptions listed below are thrown.
717      * @throws IllegalArgumentException if the user is not a profile.
718      */
stopProfile(int userId)719     boolean stopProfile(int userId);
720 
721     /** Called by PendingIntent.queryIntentComponents() */
queryIntentComponentsForIntentSender(in IIntentSender sender, int matchFlags)722     ParceledListSlice queryIntentComponentsForIntentSender(in IIntentSender sender, int matchFlags);
723 
getUidProcessCapabilities(int uid, in String callingPackage)724     int getUidProcessCapabilities(int uid, in String callingPackage);
725 
726     /** Blocks until all broadcast queues become idle. */
waitForBroadcastIdle()727     void waitForBroadcastIdle();
728 }
729