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