blob: 780dd630d834f78ec83bd0cc25481c6b0f42591f [file] [log] [blame]
Sudheer Shankafc46e9b2016-10-21 17:55:27 -07001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.app;
18
19import android.app.ActivityManager;
20import android.app.ApplicationErrorReport;
21import android.app.ContentProviderHolder;
Felipe Leme23a0c7a2018-01-24 08:43:34 -080022import android.app.GrantedUriPermission;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070023import android.app.IApplicationThread;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070024import android.app.IActivityController;
25import android.app.IAppTask;
Winson Chunge2104682017-11-08 17:31:14 -080026import android.app.IAssistDataReceiver;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070027import android.app.IInstrumentationWatcher;
28import android.app.IProcessObserver;
29import android.app.IServiceConnection;
30import android.app.IStopUserCallback;
31import android.app.ITaskStackListener;
32import android.app.IUiAutomationConnection;
33import android.app.IUidObserver;
34import android.app.IUserSwitchObserver;
35import android.app.Notification;
36import android.app.PendingIntent;
Winson Chung709904f2017-04-25 11:00:48 -070037import android.app.PictureInPictureParams;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070038import android.app.ProfilerInfo;
39import android.app.WaitResult;
40import android.app.assist.AssistContent;
41import android.app.assist.AssistStructure;
42import android.content.ComponentName;
43import android.content.IIntentReceiver;
44import android.content.IIntentSender;
45import android.content.Intent;
46import android.content.IntentFilter;
47import android.content.IntentSender;
48import android.content.pm.ApplicationInfo;
49import android.content.pm.ConfigurationInfo;
50import android.content.pm.IPackageDataObserver;
51import android.content.pm.ParceledListSlice;
52import android.content.pm.ProviderInfo;
53import android.content.pm.UserInfo;
54import android.content.res.Configuration;
55import android.graphics.Bitmap;
Jorim Jaggi02886a82016-12-06 09:10:06 -080056import android.graphics.GraphicBuffer;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070057import android.graphics.Point;
58import android.graphics.Rect;
59import android.net.Uri;
60import android.os.Bundle;
61import android.os.Debug;
62import android.os.IBinder;
63import android.os.IProgressListener;
64import android.os.ParcelFileDescriptor;
65import android.os.PersistableBundle;
Makoto Onuki2c6657f2018-06-06 15:24:02 -070066import android.os.RemoteCallback;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070067import android.os.StrictMode;
Narayan Kamath695cf722017-12-21 18:32:47 +000068import android.os.WorkSource;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070069import android.service.voice.IVoiceInteractionSession;
Winson Chunge2d72172018-01-25 17:46:20 +000070import android.view.IRecentsAnimationRunner;
Jorim Jaggif84e2f62018-01-16 14:17:59 +010071import android.view.RemoteAnimationDefinition;
Jorim Jaggi04dc5962018-01-29 18:54:13 +010072import android.view.RemoteAnimationAdapter;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070073import com.android.internal.app.IVoiceInteractor;
74import com.android.internal.os.IResultReceiver;
Jorim Jaggi241ae102016-11-02 21:57:33 -070075import com.android.internal.policy.IKeyguardDismissCallback;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070076
77import java.util.List;
78
79/**
80 * System private API for talking with the activity manager service. This
81 * provides calls from the application back to the activity manager.
82 *
83 * {@hide}
84 */
85interface IActivityManager {
Sudheer Shankaee148f92016-11-14 16:21:07 -080086 // WARNING: when these transactions are updated, check if they are any callers on the native
Sudheer Shanka027a33d2016-11-23 15:24:51 -080087 // side. If so, make sure they are using the correct transaction ids and arguments.
Sudheer Shankaee148f92016-11-14 16:21:07 -080088 // If a transaction which will also be used on the native side is being inserted, add it to
89 // below block of transactions.
90
Sudheer Shanka027a33d2016-11-23 15:24:51 -080091 // Since these transactions are also called from native code, these must be kept in sync with
Peter Visontaycee76322017-09-05 11:43:36 +010092 // the ones in frameworks/native/libs/binder/include/binder/IActivityManager.h
Sudheer Shankaee148f92016-11-14 16:21:07 -080093 // =============== Beginning of transactions used on native side as well ======================
94 ParcelFileDescriptor openContentUri(in String uriString);
Svet Ganov14ab9672017-11-22 18:49:32 -080095 void registerUidObserver(in IUidObserver observer, int which, int cutpoint,
96 String callingPackage);
97 void unregisterUidObserver(in IUidObserver observer);
Svet Ganov0c1c9cd2018-03-25 13:14:47 -070098 boolean isUidActive(int uid, String callingPackage);
Eric Laurent25f2eac2018-10-18 14:58:22 -070099 int getUidProcessState(int uid, in String callingPackage);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800100 // =============== End of transactions used on native side as well ============================
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700101
102 // Special low-level communication with activity manager.
103 void handleApplicationCrash(in IBinder app,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800104 in ApplicationErrorReport.ParcelableCrashInfo crashInfo);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700105 int startActivity(in IApplicationThread caller, in String callingPackage, in Intent intent,
106 in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800107 int flags, in ProfilerInfo profilerInfo, in Bundle options);
108 void unhandledBack();
Sudheer Shankaee148f92016-11-14 16:21:07 -0800109 boolean finishActivity(in IBinder token, int code, in Intent data, int finishTask);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700110 Intent registerReceiver(in IApplicationThread caller, in String callerPackage,
111 in IIntentReceiver receiver, in IntentFilter filter,
Chad Brubaker6d6015f2017-04-18 11:25:16 -0700112 in String requiredPermission, int userId, int flags);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800113 void unregisterReceiver(in IIntentReceiver receiver);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700114 int broadcastIntent(in IApplicationThread caller, in Intent intent,
115 in String resolvedType, in IIntentReceiver resultTo, int resultCode,
116 in String resultData, in Bundle map, in String[] requiredPermissions,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800117 int appOp, in Bundle options, boolean serialized, boolean sticky, int userId);
118 void unbroadcastIntent(in IApplicationThread caller, in Intent intent, int userId);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700119 oneway void finishReceiver(in IBinder who, int resultCode, in String resultData, in Bundle map,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800120 boolean abortBroadcast, int flags);
Sudheer Shankaf6690102017-10-16 10:20:32 -0700121 void attachApplication(in IApplicationThread app, long startSeq);
Winson Chung61c9e5a2017-10-11 10:39:32 -0700122 List<ActivityManager.RunningTaskInfo> getTasks(int maxNum);
123 List<ActivityManager.RunningTaskInfo> getFilteredTasks(int maxNum, int ignoreActivityType,
124 int ignoreWindowingMode);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800125 void moveTaskToFront(int task, int flags, in Bundle options);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800126 int getTaskForActivity(in IBinder token, in boolean onlyRoot);
Dianne Hackborn24bbe582018-12-17 11:58:31 -0800127 ContentProviderHolder getContentProvider(in IApplicationThread caller, in String callingPackage,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800128 in String name, int userId, boolean stable);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700129 void publishContentProviders(in IApplicationThread caller,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800130 in List<ContentProviderHolder> providers);
131 boolean refContentProvider(in IBinder connection, int stableDelta, int unstableDelta);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800132 PendingIntent getRunningServiceControlPanel(in ComponentName service);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700133 ComponentName startService(in IApplicationThread caller, in Intent service,
Christopher Tate242ba3e92017-04-14 15:07:06 -0700134 in String resolvedType, boolean requireForeground, in String callingPackage, int userId);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700135 int stopService(in IApplicationThread caller, in Intent service,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800136 in String resolvedType, int userId);
Dianne Hackborn27b4d942018-11-12 15:01:40 -0800137 // Currently keeping old bindService because it is on the greylist
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700138 int bindService(in IApplicationThread caller, in IBinder token, in Intent service,
139 in String resolvedType, in IServiceConnection connection, int flags,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800140 in String callingPackage, int userId);
Dianne Hackborn27b4d942018-11-12 15:01:40 -0800141 int bindIsolatedService(in IApplicationThread caller, in IBinder token, in Intent service,
142 in String resolvedType, in IServiceConnection connection, int flags,
143 in String instanceName, in String callingPackage, int userId);
Dianne Hackborna631d562018-11-20 15:58:15 -0800144 void updateServiceGroup(in IServiceConnection connection, int group, int importance);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800145 boolean unbindService(in IServiceConnection connection);
146 void publishService(in IBinder token, in Intent intent, in IBinder service);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800147 void setDebugApp(in String packageName, boolean waitForDebugger, boolean persistent);
Andreas Gampe5b495d52018-01-22 15:15:54 -0800148 void setAgentApp(in String packageName, @nullable String agent);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800149 void setAlwaysFinish(boolean enabled);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700150 boolean startInstrumentation(in ComponentName className, in String profileFile,
151 int flags, in Bundle arguments, in IInstrumentationWatcher watcher,
152 in IUiAutomationConnection connection, int userId,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800153 in String abiOverride);
Dianne Hackborn34041732017-01-31 15:27:13 -0800154 void addInstrumentationResults(in IApplicationThread target, in Bundle results);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700155 void finishInstrumentation(in IApplicationThread target, int resultCode,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800156 in Bundle results);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700157 /**
158 * @return A copy of global {@link Configuration}, contains general settings for the entire
159 * system. Corresponds to the configuration of the default display.
160 * @throws RemoteException
161 */
Sudheer Shankaee148f92016-11-14 16:21:07 -0800162 Configuration getConfiguration();
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700163 /**
164 * Updates global configuration and applies changes to the entire system.
165 * @param values Update values for global configuration. If null is passed it will request the
166 * Window Manager to compute new config for the default display.
167 * @throws RemoteException
168 * @return Returns true if the configuration was updated.
169 */
Sudheer Shankaee148f92016-11-14 16:21:07 -0800170 boolean updateConfiguration(in Configuration values);
171 boolean stopServiceToken(in ComponentName className, in IBinder token, int startId);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800172 void setProcessLimit(int max);
173 int getProcessLimit();
174 int checkPermission(in String permission, int pid, int uid);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700175 int checkUriPermission(in Uri uri, int pid, int uid, int mode, int userId,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800176 in IBinder callerToken);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700177 void grantUriPermission(in IApplicationThread caller, in String targetPkg, in Uri uri,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800178 int mode, int userId);
Dianne Hackborna47223f2017-03-30 13:49:13 -0700179 void revokeUriPermission(in IApplicationThread caller, in String targetPkg, in Uri uri,
180 int mode, int userId);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800181 void setActivityController(in IActivityController watcher, boolean imAMonkey);
182 void showWaitingForDebugger(in IApplicationThread who, boolean waiting);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700183 /*
184 * This will deliver the specified signal to all the persistent processes. Currently only
185 * SIGUSR1 is delivered. All others are ignored.
186 */
Sudheer Shankaee148f92016-11-14 16:21:07 -0800187 void signalPersistentProcesses(int signal);
Winson Chung5fa39752017-10-04 14:50:15 -0700188
189 ParceledListSlice getRecentTasks(int maxNum, int flags, int userId);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800190 oneway void serviceDoneExecuting(in IBinder token, int type, int startId, int res);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700191 IIntentSender getIntentSender(int type, in String packageName, in IBinder token,
192 in String resultWho, int requestCode, in Intent[] intents, in String[] resolvedTypes,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800193 int flags, in Bundle options, int userId);
194 void cancelIntentSender(in IIntentSender sender);
195 String getPackageForIntentSender(in IIntentSender sender);
Dianne Hackbornf66adfd2017-04-13 11:01:48 -0700196 void registerIntentSenderCancelListener(in IIntentSender sender, in IResultReceiver receiver);
197 void unregisterIntentSenderCancelListener(in IIntentSender sender, in IResultReceiver receiver);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800198 void enterSafeMode();
Narayan Kamath695cf722017-12-21 18:32:47 +0000199 void noteWakeupAlarm(in IIntentSender sender, in WorkSource workSource, int sourceUid,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800200 in String sourcePkg, in String tag);
201 void removeContentProvider(in IBinder connection, boolean stable);
202 void setRequestedOrientation(in IBinder token, int requestedOrientation);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800203 void unbindFinished(in IBinder token, in Intent service, boolean doRebind);
Dianne Hackbornf965f402017-05-04 23:27:23 -0700204 void setProcessImportant(in IBinder token, int pid, boolean isForeground, String reason);
Sudheer Shankac9d94072017-02-22 22:13:55 +0000205 void setServiceForeground(in ComponentName className, in IBinder token,
Hui Yu2d4207f2019-01-22 15:32:20 -0800206 int id, in Notification notification, int flags, int foregroundServiceType);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800207 boolean moveActivityTaskToBack(in IBinder token, boolean nonRoot);
208 void getMemoryInfo(out ActivityManager.MemoryInfo outInfo);
209 List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState();
Christopher Tate1d99c392017-12-07 16:54:04 -0800210 boolean clearApplicationUserData(in String packageName, boolean keepState,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800211 in IPackageDataObserver observer, int userId);
212 void forceStopPackage(in String packageName, int userId);
213 boolean killPids(in int[] pids, in String reason, boolean secure);
214 List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700215 // Retrieve running application processes in the system
Sudheer Shankaee148f92016-11-14 16:21:07 -0800216 List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses();
Sudheer Shankaee148f92016-11-14 16:21:07 -0800217 IBinder peekService(in Intent service, in String resolvedType, in String callingPackage);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700218 // Turn on/off profiling in a particular process.
219 boolean profileControl(in String process, int userId, boolean start,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800220 in ProfilerInfo profilerInfo, int profileType);
221 boolean shutdown(int timeout);
222 void stopAppSwitches();
223 void resumeAppSwitches();
Annie Mengd5827872019-01-30 20:28:57 +0000224 boolean bindBackupAgent(in String packageName, int backupRestoreMode, int targetUserId);
225 void backupAgentCreated(in String packageName, in IBinder agent, int userId);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800226 void unbindBackupAgent(in ApplicationInfo appInfo);
227 int getUidForIntentSender(in IIntentSender sender);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700228 int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800229 boolean requireFull, in String name, in String callerPackage);
230 void addPackageDependency(in String packageName);
231 void killApplication(in String pkg, int appId, int userId, in String reason);
Winson Chung84deaa22017-11-02 15:57:28 -0700232 void closeSystemDialogs(in String reason);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800233 Debug.MemoryInfo[] getProcessMemoryInfo(in int[] pids);
234 void killApplicationProcess(in String processName, int uid);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700235 // Special low-level communication with activity manager.
236 boolean handleApplicationWtf(in IBinder app, in String tag, boolean system,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800237 in ApplicationErrorReport.ParcelableCrashInfo crashInfo);
238 void killBackgroundProcesses(in String packageName, int userId);
239 boolean isUserAMonkey();
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700240 // Retrieve info of applications installed on external media that are currently
241 // running.
Sudheer Shankaee148f92016-11-14 16:21:07 -0800242 List<ApplicationInfo> getRunningExternalApplications();
243 void finishHeavyWeightApp();
Jeff Sharkey3ac2a432018-06-26 10:52:48 -0600244 // A StrictMode violation to be handled.
245 void handleApplicationStrictModeViolation(in IBinder app, int penaltyMask,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800246 in StrictMode.ViolationInfo crashInfo);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800247 boolean isTopActivityImmersive();
Christopher Tate8aa8fe12017-01-20 17:50:32 -0800248 void crashApplication(int uid, int initialPid, in String packageName, int userId, in String message);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800249 String getProviderMimeType(in Uri uri, int userId);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700250 // Cause the specified process to dump the specified heap.
Christopher Ferris8d652f82017-04-11 16:29:18 -0700251 boolean dumpHeap(in String process, int userId, boolean managed, boolean mallocInfo,
Makoto Onuki2c6657f2018-06-06 15:24:02 -0700252 boolean runGc, in String path, in ParcelFileDescriptor fd,
253 in RemoteCallback finishCallback);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800254 boolean isUserRunning(int userid, int flags);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800255 void setPackageScreenCompatMode(in String packageName, int mode);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800256 boolean switchUser(int userid);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800257 boolean removeTask(int taskId);
258 void registerProcessObserver(in IProcessObserver observer);
259 void unregisterProcessObserver(in IProcessObserver observer);
260 boolean isIntentSenderTargetedToPackage(in IIntentSender sender);
261 void updatePersistentConfiguration(in Configuration values);
262 long[] getProcessPss(in int[] pids);
263 void showBootMessage(in CharSequence msg, boolean always);
264 void killAllBackgroundProcesses();
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700265 ContentProviderHolder getContentProviderExternal(in String name, int userId,
Dianne Hackborn95031ef2018-07-09 09:09:05 -0700266 in IBinder token, String tag);
Makoto Onuki679760a2018-09-19 09:48:00 -0700267 /** @deprecated - Use {@link #removeContentProviderExternalAsUser} which takes a user ID. */
Sudheer Shankaee148f92016-11-14 16:21:07 -0800268 void removeContentProviderExternal(in String name, in IBinder token);
Makoto Onuki679760a2018-09-19 09:48:00 -0700269 void removeContentProviderExternalAsUser(in String name, in IBinder token, int userId);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700270 // Get memory information about the calling process.
Sudheer Shankaee148f92016-11-14 16:21:07 -0800271 void getMyMemoryState(out ActivityManager.RunningAppProcessInfo outInfo);
272 boolean killProcessesBelowForeground(in String reason);
273 UserInfo getCurrentUser();
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700274 // This is not public because you need to be very careful in how you
275 // manage your activity to make sure it is always the uid you expect.
Sudheer Shankaee148f92016-11-14 16:21:07 -0800276 int getLaunchedFromUid(in IBinder activityToken);
277 void unstableProviderDied(in IBinder connection);
278 boolean isIntentSenderAnActivity(in IIntentSender sender);
Suprabh Shukladb6bf662017-08-30 15:41:53 -0700279 boolean isIntentSenderAForegroundService(in IIntentSender sender);
Christopher Tate2f558d22019-01-17 16:58:31 -0800280 boolean isIntentSenderABroadcast(in IIntentSender sender);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700281 int startActivityAsUser(in IApplicationThread caller, in String callingPackage,
282 in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
283 int requestCode, int flags, in ProfilerInfo profilerInfo,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800284 in Bundle options, int userId);
285 int stopUser(int userid, boolean force, in IStopUserCallback callback);
286 void registerUserSwitchObserver(in IUserSwitchObserver observer, in String name);
287 void unregisterUserSwitchObserver(in IUserSwitchObserver observer);
288 int[] getRunningUserIds();
Felipe Leme10bb9b52016-12-20 09:10:14 -0800289
290 // Deprecated - This method is only used by a few internal components and it will soon be
291 // replaced by a proper bug report API (which will be restricted to a few, pre-defined apps).
292 // No new code should be calling it.
Sudheer Shankaee148f92016-11-14 16:21:07 -0800293 void requestBugReport(int bugreportType);
Felipe Leme10bb9b52016-12-20 09:10:14 -0800294
Naveen Kallaca3d5432017-03-16 19:15:04 -0700295 /**
296 * Takes a telephony bug report and notifies the user with the title and description
297 * that are passed to this API as parameters
298 *
299 * @param shareTitle should be a valid legible string less than 50 chars long
300 * @param shareDescription should be less than 91 bytes when encoded into UTF-8 format
301 *
302 * @throws IllegalArgumentException if shareTitle or shareDescription is too big or if the
303 * paremeters cannot be encoding to an UTF-8 charset.
304 */
305 void requestTelephonyBugReport(in String shareTitle, in String shareDescription);
306
mukesh agrawald9e1df52018-01-22 14:07:31 -0800307 /**
308 * Deprecated - This method is only used by Wifi, and it will soon be replaced by a proper
309 * bug report API.
310 *
311 * Takes a minimal bugreport of Wifi-related state.
312 *
313 * @param shareTitle should be a valid legible string less than 50 chars long
314 * @param shareDescription should be less than 91 bytes when encoded into UTF-8 format
315 *
316 * @throws IllegalArgumentException if shareTitle or shareDescription is too big or if the
317 * parameters cannot be encoding to an UTF-8 charset.
318 */
319 void requestWifiBugReport(in String shareTitle, in String shareDescription);
320
Sudheer Shankaee148f92016-11-14 16:21:07 -0800321 Intent getIntentForIntentSender(in IIntentSender sender);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700322 // This is not public because you need to be very careful in how you
323 // manage your activity to make sure it is always the uid you expect.
Sudheer Shankaee148f92016-11-14 16:21:07 -0800324 String getLaunchedFromPackage(in IBinder activityToken);
325 void killUid(int appId, int userId, in String reason);
326 void setUserIsMonkey(boolean monkey);
327 void hang(in IBinder who, boolean allowRestart);
Wale Ogunwale388945c2017-10-04 12:13:46 -0700328
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700329 List<ActivityManager.StackInfo> getAllStackInfos();
Sudheer Shankaee148f92016-11-14 16:21:07 -0800330 void moveTaskToStack(int taskId, int stackId, boolean toTop);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700331 /**
332 * Resizes the input stack id to the given bounds.
333 *
334 * @param stackId Id of the stack to resize.
335 * @param bounds Bounds to resize the stack to or {@code null} for fullscreen.
336 * @param allowResizeInDockedMode True if the resize should be allowed when the docked stack is
337 * active.
338 * @param preserveWindows True if the windows of activities contained in the stack should be
339 * preserved.
340 * @param animate True if the stack resize should be animated.
341 * @param animationDuration The duration of the resize animation in milliseconds or -1 if the
342 * default animation duration should be used.
343 * @throws RemoteException
344 */
345 void resizeStack(int stackId, in Rect bounds, boolean allowResizeInDockedMode,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800346 boolean preserveWindows, boolean animate, int animationDuration);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800347 void setFocusedStack(int stackId);
Wale Ogunwale68278562017-09-23 17:13:55 -0700348 ActivityManager.StackInfo getFocusedStackInfo();
Sudheer Shankaee148f92016-11-14 16:21:07 -0800349 void restart();
350 void performIdleMaintenance();
Sudheer Shankaee148f92016-11-14 16:21:07 -0800351 void appNotRespondingViaProvider(in IBinder connection);
352 Rect getTaskBounds(int taskId);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800353 boolean setProcessMemoryTrimLevel(in String process, int uid, int level);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700354
355
356 // Start of L transactions
Sudheer Shankaee148f92016-11-14 16:21:07 -0800357 String getTagForIntentSender(in IIntentSender sender, in String prefix);
358 boolean startUserInBackground(int userid);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800359 boolean isInLockTaskMode();
Winson Chunge2d72172018-01-25 17:46:20 +0000360 void startRecentsActivity(in Intent intent, in IAssistDataReceiver assistDataReceiver,
361 in IRecentsAnimationRunner recentsAnimationRunner);
Winson Chung6a38fca2018-03-28 17:57:09 -0700362 void cancelRecentsAnimation(boolean restoreHomeStackPosition);
Winson Chungec1ef092017-10-25 16:22:34 -0700363 int startActivityFromRecents(int taskId, in Bundle options);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800364 void startSystemLockTaskMode(int taskId);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800365 boolean isTopOfTask(in IBinder token);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800366 void bootAnimationComplete();
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700367 int checkPermissionWithToken(in String permission, int pid, int uid,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800368 in IBinder callerToken);
369 void registerTaskStackListener(in ITaskStackListener listener);
Winson Chungaa357452017-10-31 11:35:30 -0700370 void unregisterTaskStackListener(in ITaskStackListener listener);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800371 void notifyCleartextNetwork(int uid, in byte[] firstPacket);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800372 void setTaskResizeable(int taskId, int resizeableMode);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800373 void resizeTask(int taskId, in Rect bounds, int resizeMode);
374 int getLockTaskModeState();
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700375 void setDumpHeapDebugLimit(in String processName, int uid, long maxMemSize,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800376 in String reportPackage);
377 void dumpHeapFinished(in String path);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800378 void updateLockTaskPackages(int userId, in String[] packages);
Narayan Kamath695cf722017-12-21 18:32:47 +0000379 void noteAlarmStart(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String tag);
380 void noteAlarmFinish(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String tag);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800381 int getPackageProcessState(in String packageName, in String callingPackage);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800382 void updateDeviceOwner(in String packageName);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700383
384 // Start of N transactions
385 // Start Binder transaction tracking for all applications.
Sudheer Shankaee148f92016-11-14 16:21:07 -0800386 boolean startBinderTracking();
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700387 // Stop Binder transaction tracking for all applications and dump trace data to the given file
388 // descriptor.
Sudheer Shankaee148f92016-11-14 16:21:07 -0800389 boolean stopBinderTrackingAndDump(in ParcelFileDescriptor fd);
Andrii Kuliand2765632016-12-12 22:26:34 -0800390 /**
391 * Try to place task to provided position. The final position might be different depending on
392 * current user and stacks state. The task will be moved to target stack if it's currently in
393 * different stack.
394 */
Sudheer Shankaee148f92016-11-14 16:21:07 -0800395 void positionTaskInStack(int taskId, int stackId, int position);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800396 void suppressResizeConfigChanges(boolean suppress);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800397 boolean moveTopActivityToPinnedStack(int stackId, in Rect bounds);
Dianne Hackbornc3af19a2017-01-20 17:00:44 -0800398 boolean isAppStartModeDisabled(int uid, in String packageName);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700399 boolean unlockUser(int userid, in byte[] token, in byte[] secret,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800400 in IProgressListener listener);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800401 void killPackageDependents(in String packageName, int userId);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700402 /**
403 * Resizes the docked stack, and all other stacks as the result of the dock stack bounds change.
404 *
405 * @param dockedBounds The bounds for the docked stack.
406 * @param tempDockedTaskBounds The temporary bounds for the tasks in the docked stack, which
407 * might be different from the stack bounds to allow more
408 * flexibility while resizing, or {@code null} if they should be the
409 * same as the stack bounds.
410 * @param tempDockedTaskInsetBounds The temporary bounds for the tasks to calculate the insets.
411 * When resizing, we usually "freeze" the layout of a task. To
412 * achieve that, we also need to "freeze" the insets, which
413 * gets achieved by changing task bounds but not bounds used
414 * to calculate the insets in this transient state
415 * @param tempOtherTaskBounds The temporary bounds for the tasks in all other stacks, or
416 * {@code null} if they should be the same as the stack bounds.
417 * @param tempOtherTaskInsetBounds Like {@code tempDockedTaskInsetBounds}, but for the other
418 * stacks.
419 * @throws RemoteException
420 */
421 void resizeDockedStack(in Rect dockedBounds, in Rect tempDockedTaskBounds,
422 in Rect tempDockedTaskInsetBounds,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800423 in Rect tempOtherTaskBounds, in Rect tempOtherTaskInsetBounds);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800424 void removeStack(int stackId);
425 void makePackageIdle(String packageName, int userId);
426 int getMemoryTrimLevel();
Sudheer Shankaee148f92016-11-14 16:21:07 -0800427 boolean isVrModePackageEnabled(in ComponentName packageName);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800428 void notifyLockedProfile(int userId);
Robin Lee5d592422017-01-18 13:48:15 +0000429 void startConfirmDeviceCredentialIntent(in Intent intent, in Bundle options);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800430 void sendIdleJobTrigger();
Dianne Hackborn98305522017-05-05 17:53:53 -0700431 int sendIntentSender(in IIntentSender target, in IBinder whitelistToken, int code,
432 in Intent intent, in String resolvedType, in IIntentReceiver finishedReceiver,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800433 in String requiredPermission, in Bundle options);
Suprabh Shukla4d64c092018-02-21 20:06:14 -0800434 boolean isBackgroundRestricted(in String packageName);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700435
436 // Start of N MR1 transactions
Sudheer Shankaee148f92016-11-14 16:21:07 -0800437 void setRenderThread(int tid);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700438 /**
439 * Lets activity manager know whether the calling process is currently showing "top-level" UI
440 * that is not an activity, i.e. windows on the screen the user is currently interacting with.
441 *
442 * <p>This flag can only be set for persistent processes.
443 *
444 * @param hasTopUi Whether the calling process has "top-level" UI.
445 */
Sudheer Shankaee148f92016-11-14 16:21:07 -0800446 void setHasTopUi(boolean hasTopUi);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700447
448 // Start of O transactions
Andrew Scull85a63bc2016-10-24 13:47:47 +0100449 int restartUserInBackground(int userId);
Wale Ogunwalee1fe7fa22016-12-15 18:27:00 -0800450 /** Cancels the window transitions for the given task. */
451 void cancelTaskWindowTransition(int taskId);
Jorim Jaggi02886a82016-12-06 09:10:06 -0800452 /**
Svet Ganovfd31f852017-04-26 15:54:27 -0700453 * @param taskId the id of the task to retrieve the sAutoapshots for
Jorim Jaggi35e3f532017-03-17 17:06:50 +0100454 * @param reducedResolution if set, if the snapshot needs to be loaded from disk, this will load
455 * a reduced resolution of it, which is much faster
Jorim Jaggi02886a82016-12-06 09:10:06 -0800456 * @return a graphic buffer representing a screenshot of a task
457 */
Jorim Jaggi35e3f532017-03-17 17:06:50 +0100458 ActivityManager.TaskSnapshot getTaskSnapshot(int taskId, boolean reducedResolution);
Mårten Kongstad49a4a1d2017-01-12 08:36:37 +0100459 void scheduleApplicationInfoChanged(in List<String> packageNames, int userId);
Craig Donnerdc4796c2017-03-08 09:51:47 -0800460 void setPersistentVrThread(int tid);
Mårten Kongstad49a4a1d2017-01-12 08:36:37 +0100461
Sudheer Shanka84a48952017-03-08 18:19:01 -0800462 void waitForNetworkStateUpdate(long procStateSeq);
Christopher Tate424b03f2017-04-04 14:23:44 -0700463 /**
464 * Add a bare uid to the background restrictions whitelist. Only the system uid may call this.
465 */
Charles Hee078db72017-10-19 18:03:20 +0100466 void backgroundWhitelistUid(int uid);
467
468 // Start of P transactions
Rajeev Kumar22d92b72018-02-07 18:38:36 -0800469 /**
470 * Similar to {@link #startUserInBackground(int userId), but with a listener to report
471 * user unlock progress.
472 */
473 boolean startUserInBackgroundWithListener(int userid, IProgressListener unlockProgressListener);
Svet Ganovd873ae62018-06-25 16:39:23 -0700474
475 /**
476 * Method for the shell UID to start deletating its permission identity to an
477 * active instrumenation. The shell can delegate permissions only to one active
478 * instrumentation at a time. An active instrumentation is one running and
479 * started from the shell.
480 */
Svet Ganov5e869592018-11-09 09:30:52 -0800481 void startDelegateShellPermissionIdentity(int uid, in String[] permissions);
Svet Ganovd873ae62018-06-25 16:39:23 -0700482
483 /**
484 * Method for the shell UID to stop deletating its permission identity to an
485 * active instrumenation. An active instrumentation is one running and
486 * started from the shell.
487 */
488 void stopDelegateShellPermissionIdentity();
Makoto Onukib4469f92019-02-19 15:55:44 -0800489
490 /** Returns a file descriptor that'll be closed when the system server process dies. */
491 ParcelFileDescriptor getLifeMonitor();
Keun-young Park42118d22019-02-19 15:16:29 -0800492
493 /**
494 * Start user, if it us not already running, and bring it to foreground.
495 * unlockProgressListener can be null if monitoring progress is not necessary.
496 */
497 boolean startUserInForegroundWithListener(int userid, IProgressListener unlockProgressListener);
Winson Chungb5c41b72016-12-07 15:00:47 -0800498}