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();
crashApplicationWithType(int uid, int initialPid, in String packageName, int userId, in String message, boolean force, int exceptionTypeId)322     void crashApplicationWithType(int uid, int initialPid, in String packageName, int userId,
323             in String message, boolean force, int exceptionTypeId);
crashApplicationWithTypeWithExtras(int uid, int initialPid, in String packageName, int userId, in String message, boolean force, int exceptionTypeId, in Bundle extras)324     void crashApplicationWithTypeWithExtras(int uid, int initialPid, in String packageName,
325             int userId, in String message, boolean force, int exceptionTypeId, in Bundle extras);
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);
getSwitchingFromUserMessage()343     String getSwitchingFromUserMessage();
getSwitchingToUserMessage()344     String getSwitchingToUserMessage();
345     @UnsupportedAppUsage
setStopUserOnSwitch(int value)346     void setStopUserOnSwitch(int value);
removeTask(int taskId)347     boolean removeTask(int taskId);
348     @UnsupportedAppUsage
registerProcessObserver(in IProcessObserver observer)349     void registerProcessObserver(in IProcessObserver observer);
350     @UnsupportedAppUsage
unregisterProcessObserver(in IProcessObserver observer)351     void unregisterProcessObserver(in IProcessObserver observer);
isIntentSenderTargetedToPackage(in IIntentSender sender)352     boolean isIntentSenderTargetedToPackage(in IIntentSender sender);
353     @UnsupportedAppUsage
updatePersistentConfiguration(in Configuration values)354     void updatePersistentConfiguration(in Configuration values);
updatePersistentConfigurationWithAttribution(in Configuration values, String callingPackageName, String callingAttributionTag)355     void updatePersistentConfigurationWithAttribution(in Configuration values,
356             String callingPackageName, String callingAttributionTag);
357     @UnsupportedAppUsage
getProcessPss(in int[] pids)358     long[] getProcessPss(in int[] pids);
showBootMessage(in CharSequence msg, boolean always)359     void showBootMessage(in CharSequence msg, boolean always);
360     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
killAllBackgroundProcesses()361     void killAllBackgroundProcesses();
getContentProviderExternal(in String name, int userId, in IBinder token, String tag)362     ContentProviderHolder getContentProviderExternal(in String name, int userId,
363             in IBinder token, String tag);
364     /** @deprecated - Use {@link #removeContentProviderExternalAsUser} which takes a user ID. */
365     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
removeContentProviderExternal(in String name, in IBinder token)366     void removeContentProviderExternal(in String name, in IBinder token);
removeContentProviderExternalAsUser(in String name, in IBinder token, int userId)367     void removeContentProviderExternalAsUser(in String name, in IBinder token, int userId);
368     // Get memory information about the calling process.
getMyMemoryState(out ActivityManager.RunningAppProcessInfo outInfo)369     void getMyMemoryState(out ActivityManager.RunningAppProcessInfo outInfo);
killProcessesBelowForeground(in String reason)370     boolean killProcessesBelowForeground(in String reason);
371     @UnsupportedAppUsage
getCurrentUser()372     UserInfo getCurrentUser();
getCurrentUserId()373     int getCurrentUserId();
374     // This is not public because you need to be very careful in how you
375     // manage your activity to make sure it is always the uid you expect.
376     @UnsupportedAppUsage
getLaunchedFromUid(in IBinder activityToken)377     int getLaunchedFromUid(in IBinder activityToken);
378     @UnsupportedAppUsage
unstableProviderDied(in IBinder connection)379     void unstableProviderDied(in IBinder connection);
380     @UnsupportedAppUsage
isIntentSenderAnActivity(in IIntentSender sender)381     boolean isIntentSenderAnActivity(in IIntentSender sender);
382     /** @deprecated Use {@link startActivityAsUserWithFeature} instead */
383     @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)384     int startActivityAsUser(in IApplicationThread caller, in String callingPackage,
385             in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
386             int requestCode, int flags, in ProfilerInfo profilerInfo,
387             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)388     int startActivityAsUserWithFeature(in IApplicationThread caller, in String callingPackage,
389             in String callingFeatureId, in Intent intent, in String resolvedType,
390             in IBinder resultTo, in String resultWho, int requestCode, int flags,
391             in ProfilerInfo profilerInfo, in Bundle options, int userId);
392     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
stopUser(int userid, boolean force, in IStopUserCallback callback)393     int stopUser(int userid, boolean force, in IStopUserCallback callback);
394     /**
395      * Check {@link com.android.server.am.ActivityManagerService#stopUserWithDelayedLocking(int, boolean, IStopUserCallback)}
396      * for details.
397      */
stopUserWithDelayedLocking(int userid, boolean force, in IStopUserCallback callback)398     int stopUserWithDelayedLocking(int userid, boolean force, in IStopUserCallback callback);
399 
400     @UnsupportedAppUsage
registerUserSwitchObserver(in IUserSwitchObserver observer, in String name)401     void registerUserSwitchObserver(in IUserSwitchObserver observer, in String name);
unregisterUserSwitchObserver(in IUserSwitchObserver observer)402     void unregisterUserSwitchObserver(in IUserSwitchObserver observer);
getRunningUserIds()403     int[] getRunningUserIds();
404 
405     // Request a heap dump for the system server.
requestSystemServerHeapDump()406     void requestSystemServerHeapDump();
407 
requestBugReport(int bugreportType)408     void requestBugReport(int bugreportType);
requestBugReportWithDescription(in @ullable String shareTitle, in @nullable String shareDescription, int bugreportType)409     void requestBugReportWithDescription(in @nullable String shareTitle,
410                 in @nullable String shareDescription, int bugreportType);
411 
412     /**
413      *  Takes a telephony bug report and notifies the user with the title and description
414      *  that are passed to this API as parameters
415      *
416      *  @param shareTitle should be a valid legible string less than 50 chars long
417      *  @param shareDescription should be less than 150 chars long
418      *
419      *  @throws IllegalArgumentException if shareTitle or shareDescription is too big or if the
420      *          paremeters cannot be encoding to an UTF-8 charset.
421      */
requestTelephonyBugReport(in String shareTitle, in String shareDescription)422     void requestTelephonyBugReport(in String shareTitle, in String shareDescription);
423 
424     /**
425      *  This method is only used by Wifi.
426      *
427      *  Takes a minimal bugreport of Wifi-related state.
428      *
429      *  @param shareTitle should be a valid legible string less than 50 chars long
430      *  @param shareDescription should be less than 150 chars long
431      *
432      *  @throws IllegalArgumentException if shareTitle or shareDescription is too big or if the
433      *          parameters cannot be encoding to an UTF-8 charset.
434      */
requestWifiBugReport(in String shareTitle, in String shareDescription)435     void requestWifiBugReport(in String shareTitle, in String shareDescription);
requestInteractiveBugReportWithDescription(in String shareTitle, in String shareDescription)436     void requestInteractiveBugReportWithDescription(in String shareTitle,
437             in String shareDescription);
438 
requestInteractiveBugReport()439     void requestInteractiveBugReport();
requestFullBugReport()440     void requestFullBugReport();
requestRemoteBugReport()441     void requestRemoteBugReport();
launchBugReportHandlerApp()442     boolean launchBugReportHandlerApp();
getBugreportWhitelistedPackages()443     List<String> getBugreportWhitelistedPackages();
444 
445     @UnsupportedAppUsage
getIntentForIntentSender(in IIntentSender sender)446     Intent getIntentForIntentSender(in IIntentSender sender);
447     // This is not public because you need to be very careful in how you
448     // manage your activity to make sure it is always the uid you expect.
449     @UnsupportedAppUsage
getLaunchedFromPackage(in IBinder activityToken)450     String getLaunchedFromPackage(in IBinder activityToken);
killUid(int appId, int userId, in String reason)451     void killUid(int appId, int userId, in String reason);
setUserIsMonkey(boolean monkey)452     void setUserIsMonkey(boolean monkey);
453     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
hang(in IBinder who, boolean allowRestart)454     void hang(in IBinder who, boolean allowRestart);
455 
getAllRootTaskInfos()456     List<ActivityTaskManager.RootTaskInfo> getAllRootTaskInfos();
moveTaskToRootTask(int taskId, int rootTaskId, boolean toTop)457     void moveTaskToRootTask(int taskId, int rootTaskId, boolean toTop);
setFocusedRootTask(int taskId)458     void setFocusedRootTask(int taskId);
getFocusedRootTaskInfo()459     ActivityTaskManager.RootTaskInfo getFocusedRootTaskInfo();
460     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
restart()461     void restart();
performIdleMaintenance()462     void performIdleMaintenance();
appNotRespondingViaProvider(in IBinder connection)463     void appNotRespondingViaProvider(in IBinder connection);
464     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
getTaskBounds(int taskId)465     Rect getTaskBounds(int taskId);
466     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
setProcessMemoryTrimLevel(in String process, int userId, int level)467     boolean setProcessMemoryTrimLevel(in String process, int userId, int level);
468 
469 
470     // Start of L transactions
getTagForIntentSender(in IIntentSender sender, in String prefix)471     String getTagForIntentSender(in IIntentSender sender, in String prefix);
472     @UnsupportedAppUsage
startUserInBackground(int userid)473     boolean startUserInBackground(int userid);
474     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
isInLockTaskMode()475     boolean isInLockTaskMode();
476     @UnsupportedAppUsage
startActivityFromRecents(int taskId, in Bundle options)477     int startActivityFromRecents(int taskId, in Bundle options);
478     @UnsupportedAppUsage
startSystemLockTaskMode(int taskId)479     void startSystemLockTaskMode(int taskId);
480     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
isTopOfTask(in IBinder token)481     boolean isTopOfTask(in IBinder token);
bootAnimationComplete()482     void bootAnimationComplete();
483     @UnsupportedAppUsage
registerTaskStackListener(in ITaskStackListener listener)484     void registerTaskStackListener(in ITaskStackListener listener);
unregisterTaskStackListener(in ITaskStackListener listener)485     void unregisterTaskStackListener(in ITaskStackListener listener);
notifyCleartextNetwork(int uid, in byte[] firstPacket)486     void notifyCleartextNetwork(int uid, in byte[] firstPacket);
487     @UnsupportedAppUsage
setTaskResizeable(int taskId, int resizeableMode)488     void setTaskResizeable(int taskId, int resizeableMode);
489     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
resizeTask(int taskId, in Rect bounds, int resizeMode)490     void resizeTask(int taskId, in Rect bounds, int resizeMode);
491     @UnsupportedAppUsage
getLockTaskModeState()492     int getLockTaskModeState();
493     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
setDumpHeapDebugLimit(in String processName, int uid, long maxMemSize, in String reportPackage)494     void setDumpHeapDebugLimit(in String processName, int uid, long maxMemSize,
495             in String reportPackage);
dumpHeapFinished(in String path)496     void dumpHeapFinished(in String path);
updateLockTaskPackages(int userId, in String[] packages)497     void updateLockTaskPackages(int userId, in String[] packages);
noteAlarmStart(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String tag)498     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)499     void noteAlarmFinish(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String tag);
500     @UnsupportedAppUsage
getPackageProcessState(in String packageName, in String callingPackage)501     int getPackageProcessState(in String packageName, in String callingPackage);
updateDeviceOwner(in String packageName)502     void updateDeviceOwner(in String packageName);
503 
504     // Start of N transactions
505     // Start Binder transaction tracking for all applications.
506     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
startBinderTracking()507     boolean startBinderTracking();
508     // Stop Binder transaction tracking for all applications and dump trace data to the given file
509     // descriptor.
510     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
stopBinderTrackingAndDump(in ParcelFileDescriptor fd)511     boolean stopBinderTrackingAndDump(in ParcelFileDescriptor fd);
512     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
suppressResizeConfigChanges(boolean suppress)513     void suppressResizeConfigChanges(boolean suppress);
514     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
unlockUser(int userid, in byte[] token, in byte[] secret, in IProgressListener listener)515     boolean unlockUser(int userid, in byte[] token, in byte[] secret,
516             in IProgressListener listener);
killPackageDependents(in String packageName, int userId)517     void killPackageDependents(in String packageName, int userId);
makePackageIdle(String packageName, int userId)518     void makePackageIdle(String packageName, int userId);
getMemoryTrimLevel()519     int getMemoryTrimLevel();
isVrModePackageEnabled(in ComponentName packageName)520     boolean isVrModePackageEnabled(in ComponentName packageName);
notifyLockedProfile(int userId)521     void notifyLockedProfile(int userId);
startConfirmDeviceCredentialIntent(in Intent intent, in Bundle options)522     void startConfirmDeviceCredentialIntent(in Intent intent, in Bundle options);
523     @UnsupportedAppUsage(maxTargetSdk = 30, trackingBug = 170729553)
sendIdleJobTrigger()524     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)525     int sendIntentSender(in IIntentSender target, in IBinder whitelistToken, int code,
526             in Intent intent, in String resolvedType, in IIntentReceiver finishedReceiver,
527             in String requiredPermission, in Bundle options);
isBackgroundRestricted(in String packageName)528     boolean isBackgroundRestricted(in String packageName);
529 
530     // Start of N MR1 transactions
setRenderThread(int tid)531     void setRenderThread(int tid);
532     /**
533      * Lets activity manager know whether the calling process is currently showing "top-level" UI
534      * that is not an activity, i.e. windows on the screen the user is currently interacting with.
535      *
536      * <p>This flag can only be set for persistent processes.
537      *
538      * @param hasTopUi Whether the calling process has "top-level" UI.
539      */
setHasTopUi(boolean hasTopUi)540     void setHasTopUi(boolean hasTopUi);
541 
542     // Start of O transactions
restartUserInBackground(int userId)543     int restartUserInBackground(int userId);
544     /** Cancels the window transitions for the given task. */
545     @UnsupportedAppUsage
cancelTaskWindowTransition(int taskId)546     void cancelTaskWindowTransition(int taskId);
scheduleApplicationInfoChanged(in List<String> packageNames, int userId)547     void scheduleApplicationInfoChanged(in List<String> packageNames, int userId);
setPersistentVrThread(int tid)548     void setPersistentVrThread(int tid);
549 
waitForNetworkStateUpdate(long procStateSeq)550     void waitForNetworkStateUpdate(long procStateSeq);
551     /**
552      * Add a bare uid to the background restrictions whitelist.  Only the system uid may call this.
553      */
backgroundAllowlistUid(int uid)554     void backgroundAllowlistUid(int uid);
555 
556     // Start of P transactions
557     /**
558      *  Similar to {@link #startUserInBackground(int userId), but with a listener to report
559      *  user unlock progress.
560      */
startUserInBackgroundWithListener(int userid, IProgressListener unlockProgressListener)561     boolean startUserInBackgroundWithListener(int userid, IProgressListener unlockProgressListener);
562 
563     /**
564      * Method for the shell UID to start deletating its permission identity to an
565      * active instrumenation. The shell can delegate permissions only to one active
566      * instrumentation at a time. An active instrumentation is one running and
567      * started from the shell.
568      */
startDelegateShellPermissionIdentity(int uid, in String[] permissions)569     void startDelegateShellPermissionIdentity(int uid, in String[] permissions);
570 
571     /**
572      * Method for the shell UID to stop deletating its permission identity to an
573      * active instrumenation. An active instrumentation is one running and
574      * started from the shell.
575      */
stopDelegateShellPermissionIdentity()576     void stopDelegateShellPermissionIdentity();
577 
578     /**
579      * Method for the shell UID to get currently adopted permissions for an active instrumentation.
580      * An active instrumentation is one running and started from the shell.
581      */
getDelegatedShellPermissions()582     List<String> getDelegatedShellPermissions();
583 
584     /** Returns a file descriptor that'll be closed when the system server process dies. */
getLifeMonitor()585     ParcelFileDescriptor getLifeMonitor();
586 
587     /**
588      * Start user, if it us not already running, and bring it to foreground.
589      * unlockProgressListener can be null if monitoring progress is not necessary.
590      */
startUserInForegroundWithListener(int userid, IProgressListener unlockProgressListener)591     boolean startUserInForegroundWithListener(int userid, IProgressListener unlockProgressListener);
592 
593     /**
594      * Method for the app to tell system that it's wedged and would like to trigger an ANR.
595      */
appNotResponding(String reason)596     void appNotResponding(String reason);
597 
598     /**
599      * Return a list of {@link ApplicationExitInfo} records.
600      *
601      * <p class="note"> Note: System stores these historical information in a ring buffer, older
602      * records would be overwritten by newer records. </p>
603      *
604      * <p class="note"> Note: In the case that this application bound to an external service with
605      * flag {@link android.content.Context#BIND_EXTERNAL_SERVICE}, the process of that external
606      * service will be included in this package's exit info. </p>
607      *
608      * @param packageName Optional, an empty value means match all packages belonging to the
609      *                    caller's UID. If this package belongs to another UID, you must hold
610      *                    {@link android.Manifest.permission#DUMP} in order to retrieve it.
611      * @param pid         Optional, it could be a process ID that used to belong to this package but
612      *                    died later; A value of 0 means to ignore this parameter and return all
613      *                    matching records.
614      * @param maxNum      Optional, the maximum number of results should be returned; A value of 0
615      *                    means to ignore this parameter and return all matching records
616      * @param userId      The userId in the multi-user environment.
617      *
618      * @return a list of {@link ApplicationExitInfo} records with the matching criteria, sorted in
619      *         the order from most recent to least recent.
620      */
getHistoricalProcessExitReasons(String packageName, int pid, int maxNum, int userId)621     ParceledListSlice<ApplicationExitInfo> getHistoricalProcessExitReasons(String packageName,
622             int pid, int maxNum, int userId);
623 
624     /*
625      * Kill the given PIDs, but the killing will be delayed until the device is idle
626      * and the given process is imperceptible.
627      */
killProcessesWhenImperceptible(in int[] pids, String reason)628     void killProcessesWhenImperceptible(in int[] pids, String reason);
629 
630     /**
631      * Set locus context for a given activity.
632      * @param activity
633      * @param locusId a unique, stable id that identifies this activity instance from others.
634      * @param appToken ActivityRecord's appToken.
635      */
setActivityLocusContext(in ComponentName activity, in LocusId locusId, in IBinder appToken)636     void setActivityLocusContext(in ComponentName activity, in LocusId locusId,
637             in IBinder appToken);
638 
639     /**
640      * Set custom state data for this process. It will be included in the record of
641      * {@link ApplicationExitInfo} on the death of the current calling process; the new process
642      * of the app can retrieve this state data by calling
643      * {@link ApplicationExitInfo#getProcessStateSummary} on the record returned by
644      * {@link #getHistoricalProcessExitReasons}.
645      *
646      * <p> This would be useful for the calling app to save its stateful data: if it's
647      * killed later for any reason, the new process of the app can know what the
648      * previous process of the app was doing. For instance, you could use this to encode
649      * the current level in a game, or a set of features/experiments that were enabled. Later you
650      * could analyze under what circumstances the app tends to crash or use too much memory.
651      * However, it's not suggested to rely on this to restore the applications previous UI state
652      * or so, it's only meant for analyzing application healthy status.</p>
653      *
654      * <p> System might decide to throttle the calls to this API; so call this API in a reasonable
655      * manner, excessive calls to this API could result a {@link java.lang.RuntimeException}.
656      * </p>
657      *
658      * @param state The customized state data
659      */
setProcessStateSummary(in byte[] state)660     void setProcessStateSummary(in byte[] state);
661 
662     /**
663      * Return whether the app freezer is supported (true) or not (false) by this system.
664      */
isAppFreezerSupported()665     boolean isAppFreezerSupported();
666 
667 
668     /**
669      * Kills uid with the reason of permission change.
670      */
killUidForPermissionChange(int appId, int userId, String reason)671     void killUidForPermissionChange(int appId, int userId, String reason);
672 
673     /**
674      * Resets the state of the {@link com.android.server.am.AppErrors} instance.
675      * This is intended for testing within the CTS only and is protected by
676      * android.permission.RESET_APP_ERRORS.
677      */
resetAppErrors()678     void resetAppErrors();
679 
680     /**
681      * Control the app freezer state. Returns true in case of success, false if the operation
682      * didn't succeed (for example, when the app freezer isn't supported).
683      * Handling the freezer state via this method is reentrant, that is it can be
684      * disabled and re-enabled multiple times in parallel. As long as there's a 1:1 disable to
685      * enable match, the freezer is re-enabled at last enable only.
686      * @param enable set it to true to enable the app freezer, false to disable it.
687      */
enableAppFreezer(in boolean enable)688     boolean enableAppFreezer(in boolean enable);
689 
690     /**
691      * Suppress or reenable the rate limit on foreground service notification deferral.
692      * This is for use within CTS and is protected by android.permission.WRITE_DEVICE_CONFIG.
693      *
694      * @param enable false to suppress rate-limit policy; true to reenable it.
695      */
enableFgsNotificationRateLimit(in boolean enable)696     boolean enableFgsNotificationRateLimit(in boolean enable);
697 
698     /**
699      * Holds the AM lock for the specified amount of milliseconds.
700      * This is intended for use by the tests that need to imitate lock contention.
701      * The token should be obtained by
702      * {@link android.content.pm.PackageManager#getHoldLockToken()}.
703      */
holdLock(in IBinder token, in int durationMs)704     void holdLock(in IBinder token, in int durationMs);
705 
706     /**
707      * Starts a profile.
708      * @param userId the user id of the profile.
709      * @return true if the profile has been successfully started or if the profile is already
710      * running, false if profile failed to start.
711      * @throws IllegalArgumentException if the user is not a profile.
712      */
startProfile(int userId)713     boolean startProfile(int userId);
714 
715     /**
716      * Stops a profile.
717      * @param userId the user id of the profile.
718      * @return true if the profile has been successfully stopped or is already stopped. Otherwise
719      * the exceptions listed below are thrown.
720      * @throws IllegalArgumentException if the user is not a profile.
721      */
stopProfile(int userId)722     boolean stopProfile(int userId);
723 
724     /** Called by PendingIntent.queryIntentComponents() */
queryIntentComponentsForIntentSender(in IIntentSender sender, int matchFlags)725     ParceledListSlice queryIntentComponentsForIntentSender(in IIntentSender sender, int matchFlags);
726 
getUidProcessCapabilities(int uid, in String callingPackage)727     int getUidProcessCapabilities(int uid, in String callingPackage);
728 
729     /** Blocks until all broadcast queues become idle. */
waitForBroadcastIdle()730     void waitForBroadcastIdle();
731 }
732