blob: 5f3bad6ad1a83cdaf2ac2cce247ce08e0981453e [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;
Jing Ji8055a3a2019-12-17 15:55:33 -080021import android.app.ApplicationExitInfo;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070022import android.app.ContentProviderHolder;
Felipe Leme23a0c7a2018-01-24 08:43:34 -080023import android.app.GrantedUriPermission;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070024import android.app.IApplicationThread;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070025import android.app.IActivityController;
26import android.app.IAppTask;
Winson Chunge2104682017-11-08 17:31:14 -080027import android.app.IAssistDataReceiver;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070028import android.app.IInstrumentationWatcher;
29import android.app.IProcessObserver;
30import android.app.IServiceConnection;
31import android.app.IStopUserCallback;
32import android.app.ITaskStackListener;
33import android.app.IUiAutomationConnection;
34import android.app.IUidObserver;
35import android.app.IUserSwitchObserver;
36import android.app.Notification;
37import android.app.PendingIntent;
Winson Chung709904f2017-04-25 11:00:48 -070038import android.app.PictureInPictureParams;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070039import android.app.ProfilerInfo;
40import android.app.WaitResult;
41import android.app.assist.AssistContent;
42import android.app.assist.AssistStructure;
43import android.content.ComponentName;
44import android.content.IIntentReceiver;
45import android.content.IIntentSender;
46import android.content.Intent;
47import android.content.IntentFilter;
48import android.content.IntentSender;
49import android.content.pm.ApplicationInfo;
50import android.content.pm.ConfigurationInfo;
51import android.content.pm.IPackageDataObserver;
52import android.content.pm.ParceledListSlice;
53import android.content.pm.ProviderInfo;
54import android.content.pm.UserInfo;
55import android.content.res.Configuration;
Yuliya Kamatkova48c38072020-01-09 15:43:25 -080056import android.content.LocusId;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070057import android.graphics.Bitmap;
Jorim Jaggi02886a82016-12-06 09:10:06 -080058import android.graphics.GraphicBuffer;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070059import android.graphics.Point;
60import android.graphics.Rect;
61import android.net.Uri;
62import android.os.Bundle;
63import android.os.Debug;
64import android.os.IBinder;
65import android.os.IProgressListener;
66import android.os.ParcelFileDescriptor;
67import android.os.PersistableBundle;
Makoto Onuki2c6657f2018-06-06 15:24:02 -070068import android.os.RemoteCallback;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070069import android.os.StrictMode;
Narayan Kamath695cf722017-12-21 18:32:47 +000070import android.os.WorkSource;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070071import android.service.voice.IVoiceInteractionSession;
Winson Chunge2d72172018-01-25 17:46:20 +000072import android.view.IRecentsAnimationRunner;
Jorim Jaggif84e2f62018-01-16 14:17:59 +010073import android.view.RemoteAnimationDefinition;
Jorim Jaggi04dc5962018-01-29 18:54:13 +010074import android.view.RemoteAnimationAdapter;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070075import com.android.internal.app.IVoiceInteractor;
76import com.android.internal.os.IResultReceiver;
Jorim Jaggi241ae102016-11-02 21:57:33 -070077import com.android.internal.policy.IKeyguardDismissCallback;
Sudheer Shankafc46e9b2016-10-21 17:55:27 -070078
79import java.util.List;
80
81/**
82 * System private API for talking with the activity manager service. This
83 * provides calls from the application back to the activity manager.
84 *
85 * {@hide}
86 */
87interface IActivityManager {
Sudheer Shankaee148f92016-11-14 16:21:07 -080088 // WARNING: when these transactions are updated, check if they are any callers on the native
Sudheer Shanka027a33d2016-11-23 15:24:51 -080089 // side. If so, make sure they are using the correct transaction ids and arguments.
Sudheer Shankaee148f92016-11-14 16:21:07 -080090 // If a transaction which will also be used on the native side is being inserted, add it to
91 // below block of transactions.
92
Sudheer Shanka027a33d2016-11-23 15:24:51 -080093 // Since these transactions are also called from native code, these must be kept in sync with
Peter Visontaycee76322017-09-05 11:43:36 +010094 // the ones in frameworks/native/libs/binder/include/binder/IActivityManager.h
Sudheer Shankaee148f92016-11-14 16:21:07 -080095 // =============== Beginning of transactions used on native side as well ======================
96 ParcelFileDescriptor openContentUri(in String uriString);
Svet Ganov14ab9672017-11-22 18:49:32 -080097 void registerUidObserver(in IUidObserver observer, int which, int cutpoint,
98 String callingPackage);
99 void unregisterUidObserver(in IUidObserver observer);
Svet Ganov0c1c9cd2018-03-25 13:14:47 -0700100 boolean isUidActive(int uid, String callingPackage);
Eric Laurent25f2eac2018-10-18 14:58:22 -0700101 int getUidProcessState(int uid, in String callingPackage);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800102 // =============== End of transactions used on native side as well ============================
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700103
104 // Special low-level communication with activity manager.
105 void handleApplicationCrash(in IBinder app,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800106 in ApplicationErrorReport.ParcelableCrashInfo crashInfo);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000107 @UnsupportedAppUsage
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700108 int startActivity(in IApplicationThread caller, in String callingPackage, in Intent intent,
109 in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800110 int flags, in ProfilerInfo profilerInfo, in Bundle options);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000111 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800112 void unhandledBack();
Andrei Onea4b2116c2019-02-28 15:13:42 +0000113 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800114 boolean finishActivity(in IBinder token, int code, in Intent data, int finishTask);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000115 @UnsupportedAppUsage
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700116 Intent registerReceiver(in IApplicationThread caller, in String callerPackage,
117 in IIntentReceiver receiver, in IntentFilter filter,
Chad Brubaker6d6015f2017-04-18 11:25:16 -0700118 in String requiredPermission, int userId, int flags);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000119 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800120 void unregisterReceiver(in IIntentReceiver receiver);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000121 @UnsupportedAppUsage
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700122 int broadcastIntent(in IApplicationThread caller, in Intent intent,
123 in String resolvedType, in IIntentReceiver resultTo, int resultCode,
124 in String resultData, in Bundle map, in String[] requiredPermissions,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800125 int appOp, in Bundle options, boolean serialized, boolean sticky, int userId);
126 void unbroadcastIntent(in IApplicationThread caller, in Intent intent, int userId);
Artur Satayev751e5512019-11-15 19:12:49 +0000127 @UnsupportedAppUsage
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700128 oneway void finishReceiver(in IBinder who, int resultCode, in String resultData, in Bundle map,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800129 boolean abortBroadcast, int flags);
Sudheer Shankaf6690102017-10-16 10:20:32 -0700130 void attachApplication(in IApplicationThread app, long startSeq);
Winson Chung61c9e5a2017-10-11 10:39:32 -0700131 List<ActivityManager.RunningTaskInfo> getTasks(int maxNum);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000132 @UnsupportedAppUsage
Winson Chung61c9e5a2017-10-11 10:39:32 -0700133 List<ActivityManager.RunningTaskInfo> getFilteredTasks(int maxNum, int ignoreActivityType,
134 int ignoreWindowingMode);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000135 @UnsupportedAppUsage
Ricky Waiaca8a772019-04-04 16:01:06 +0100136 void moveTaskToFront(in IApplicationThread caller, in String callingPackage, int task,
137 int flags, in Bundle options);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000138 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800139 int getTaskForActivity(in IBinder token, in boolean onlyRoot);
Dianne Hackborn24bbe582018-12-17 11:58:31 -0800140 ContentProviderHolder getContentProvider(in IApplicationThread caller, in String callingPackage,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800141 in String name, int userId, boolean stable);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000142 @UnsupportedAppUsage
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700143 void publishContentProviders(in IApplicationThread caller,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800144 in List<ContentProviderHolder> providers);
145 boolean refContentProvider(in IBinder connection, int stableDelta, int unstableDelta);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800146 PendingIntent getRunningServiceControlPanel(in ComponentName service);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700147 ComponentName startService(in IApplicationThread caller, in Intent service,
Christopher Tate242ba3e92017-04-14 15:07:06 -0700148 in String resolvedType, boolean requireForeground, in String callingPackage, int userId);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000149 @UnsupportedAppUsage
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700150 int stopService(in IApplicationThread caller, in Intent service,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800151 in String resolvedType, int userId);
Dianne Hackborn27b4d942018-11-12 15:01:40 -0800152 // Currently keeping old bindService because it is on the greylist
Andrei Onea4b2116c2019-02-28 15:13:42 +0000153 @UnsupportedAppUsage
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700154 int bindService(in IApplicationThread caller, in IBinder token, in Intent service,
155 in String resolvedType, in IServiceConnection connection, int flags,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800156 in String callingPackage, int userId);
Dianne Hackborn27b4d942018-11-12 15:01:40 -0800157 int bindIsolatedService(in IApplicationThread caller, in IBinder token, in Intent service,
158 in String resolvedType, in IServiceConnection connection, int flags,
159 in String instanceName, in String callingPackage, int userId);
Dianne Hackborna631d562018-11-20 15:58:15 -0800160 void updateServiceGroup(in IServiceConnection connection, int group, int importance);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000161 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800162 boolean unbindService(in IServiceConnection connection);
163 void publishService(in IBinder token, in Intent intent, in IBinder service);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000164 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800165 void setDebugApp(in String packageName, boolean waitForDebugger, boolean persistent);
Andreas Gampe5b495d52018-01-22 15:15:54 -0800166 void setAgentApp(in String packageName, @nullable String agent);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000167 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800168 void setAlwaysFinish(boolean enabled);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000169 @UnsupportedAppUsage
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700170 boolean startInstrumentation(in ComponentName className, in String profileFile,
171 int flags, in Bundle arguments, in IInstrumentationWatcher watcher,
172 in IUiAutomationConnection connection, int userId,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800173 in String abiOverride);
Dianne Hackborn34041732017-01-31 15:27:13 -0800174 void addInstrumentationResults(in IApplicationThread target, in Bundle results);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700175 void finishInstrumentation(in IApplicationThread target, int resultCode,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800176 in Bundle results);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700177 /**
178 * @return A copy of global {@link Configuration}, contains general settings for the entire
179 * system. Corresponds to the configuration of the default display.
180 * @throws RemoteException
181 */
Andrei Onea4b2116c2019-02-28 15:13:42 +0000182 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800183 Configuration getConfiguration();
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700184 /**
185 * Updates global configuration and applies changes to the entire system.
186 * @param values Update values for global configuration. If null is passed it will request the
187 * Window Manager to compute new config for the default display.
188 * @throws RemoteException
189 * @return Returns true if the configuration was updated.
190 */
Andrei Onea4b2116c2019-02-28 15:13:42 +0000191 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800192 boolean updateConfiguration(in Configuration values);
Shuo Qianb9c9bfa2020-01-08 17:59:42 -0800193 /**
194 * Updates mcc mnc configuration and applies changes to the entire system.
195 *
196 * @param mcc mcc configuration to update.
197 * @param mnc mnc configuration to update.
198 * @throws RemoteException; IllegalArgumentException if mcc or mnc is null.
199 * @return Returns {@code true} if the configuration was updated;
200 * {@code false} otherwise.
201 */
202 boolean updateMccMncConfiguration(in String mcc, in String mnc);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800203 boolean stopServiceToken(in ComponentName className, in IBinder token, int startId);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000204 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800205 void setProcessLimit(int max);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000206 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800207 int getProcessLimit();
Andrei Onea4b2116c2019-02-28 15:13:42 +0000208 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800209 int checkPermission(in String permission, int pid, int uid);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700210 int checkUriPermission(in Uri uri, int pid, int uid, int mode, int userId,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800211 in IBinder callerToken);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700212 void grantUriPermission(in IApplicationThread caller, in String targetPkg, in Uri uri,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800213 int mode, int userId);
Dianne Hackborna47223f2017-03-30 13:49:13 -0700214 void revokeUriPermission(in IApplicationThread caller, in String targetPkg, in Uri uri,
215 int mode, int userId);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000216 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800217 void setActivityController(in IActivityController watcher, boolean imAMonkey);
218 void showWaitingForDebugger(in IApplicationThread who, boolean waiting);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700219 /*
220 * This will deliver the specified signal to all the persistent processes. Currently only
221 * SIGUSR1 is delivered. All others are ignored.
222 */
Sudheer Shankaee148f92016-11-14 16:21:07 -0800223 void signalPersistentProcesses(int signal);
Winson Chung5fa39752017-10-04 14:50:15 -0700224
Andrei Onea4b2116c2019-02-28 15:13:42 +0000225 @UnsupportedAppUsage
Winson Chung5fa39752017-10-04 14:50:15 -0700226 ParceledListSlice getRecentTasks(int maxNum, int flags, int userId);
Artur Satayev751e5512019-11-15 19:12:49 +0000227 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800228 oneway void serviceDoneExecuting(in IBinder token, int type, int startId, int res);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000229 @UnsupportedAppUsage
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700230 IIntentSender getIntentSender(int type, in String packageName, in IBinder token,
231 in String resultWho, int requestCode, in Intent[] intents, in String[] resolvedTypes,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800232 int flags, in Bundle options, int userId);
233 void cancelIntentSender(in IIntentSender sender);
234 String getPackageForIntentSender(in IIntentSender sender);
Dianne Hackbornf66adfd2017-04-13 11:01:48 -0700235 void registerIntentSenderCancelListener(in IIntentSender sender, in IResultReceiver receiver);
236 void unregisterIntentSenderCancelListener(in IIntentSender sender, in IResultReceiver receiver);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800237 void enterSafeMode();
Narayan Kamath695cf722017-12-21 18:32:47 +0000238 void noteWakeupAlarm(in IIntentSender sender, in WorkSource workSource, int sourceUid,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800239 in String sourcePkg, in String tag);
Riddle Hsu4e8e3b02019-04-12 17:37:10 +0800240 oneway void removeContentProvider(in IBinder connection, boolean stable);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000241 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800242 void setRequestedOrientation(in IBinder token, int requestedOrientation);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800243 void unbindFinished(in IBinder token, in Intent service, boolean doRebind);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000244 @UnsupportedAppUsage
Dianne Hackbornf965f402017-05-04 23:27:23 -0700245 void setProcessImportant(in IBinder token, int pid, boolean isForeground, String reason);
Sudheer Shankac9d94072017-02-22 22:13:55 +0000246 void setServiceForeground(in ComponentName className, in IBinder token,
Hui Yu2d4207f2019-01-22 15:32:20 -0800247 int id, in Notification notification, int flags, int foregroundServiceType);
Hui Yufb72b992019-02-20 10:04:07 -0800248 int getForegroundServiceType(in ComponentName className, in IBinder token);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000249 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800250 boolean moveActivityTaskToBack(in IBinder token, boolean nonRoot);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000251 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800252 void getMemoryInfo(out ActivityManager.MemoryInfo outInfo);
253 List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState();
Christopher Tate1d99c392017-12-07 16:54:04 -0800254 boolean clearApplicationUserData(in String packageName, boolean keepState,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800255 in IPackageDataObserver observer, int userId);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000256 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800257 void forceStopPackage(in String packageName, int userId);
258 boolean killPids(in int[] pids, in String reason, boolean secure);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000259 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800260 List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700261 // Retrieve running application processes in the system
Andrei Onea4b2116c2019-02-28 15:13:42 +0000262 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800263 List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses();
Sudheer Shankaee148f92016-11-14 16:21:07 -0800264 IBinder peekService(in Intent service, in String resolvedType, in String callingPackage);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700265 // Turn on/off profiling in a particular process.
Andrei Onea4b2116c2019-02-28 15:13:42 +0000266 @UnsupportedAppUsage
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700267 boolean profileControl(in String process, int userId, boolean start,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800268 in ProfilerInfo profilerInfo, int profileType);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000269 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800270 boolean shutdown(int timeout);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000271 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800272 void stopAppSwitches();
Andrei Onea4b2116c2019-02-28 15:13:42 +0000273 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800274 void resumeAppSwitches();
Annie Mengd5827872019-01-30 20:28:57 +0000275 boolean bindBackupAgent(in String packageName, int backupRestoreMode, int targetUserId);
276 void backupAgentCreated(in String packageName, in IBinder agent, int userId);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800277 void unbindBackupAgent(in ApplicationInfo appInfo);
278 int getUidForIntentSender(in IIntentSender sender);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700279 int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800280 boolean requireFull, in String name, in String callerPackage);
281 void addPackageDependency(in String packageName);
282 void killApplication(in String pkg, int appId, int userId, in String reason);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000283 @UnsupportedAppUsage
Winson Chung84deaa22017-11-02 15:57:28 -0700284 void closeSystemDialogs(in String reason);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000285 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800286 Debug.MemoryInfo[] getProcessMemoryInfo(in int[] pids);
287 void killApplicationProcess(in String processName, int uid);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700288 // Special low-level communication with activity manager.
289 boolean handleApplicationWtf(in IBinder app, in String tag, boolean system,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800290 in ApplicationErrorReport.ParcelableCrashInfo crashInfo);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000291 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800292 void killBackgroundProcesses(in String packageName, int userId);
293 boolean isUserAMonkey();
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700294 // Retrieve info of applications installed on external media that are currently
295 // running.
Sudheer Shankaee148f92016-11-14 16:21:07 -0800296 List<ApplicationInfo> getRunningExternalApplications();
Andrei Onea4b2116c2019-02-28 15:13:42 +0000297 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800298 void finishHeavyWeightApp();
Jeff Sharkey3ac2a432018-06-26 10:52:48 -0600299 // A StrictMode violation to be handled.
Andrei Onea4b2116c2019-02-28 15:13:42 +0000300 @UnsupportedAppUsage
Jeff Sharkey3ac2a432018-06-26 10:52:48 -0600301 void handleApplicationStrictModeViolation(in IBinder app, int penaltyMask,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800302 in StrictMode.ViolationInfo crashInfo);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800303 boolean isTopActivityImmersive();
Christopher Tate9fbc5e72019-08-19 16:16:20 -0700304 void crashApplication(int uid, int initialPid, in String packageName, int userId,
305 in String message, boolean force);
Dmitri Plotnikovd55a3872020-01-16 17:00:02 -0800306 /** @deprecated -- use getProviderMimeTypeAsync */
307 @UnsupportedAppUsage(maxTargetSdk = 29, publicAlternatives =
308 "Use {@link android.content.ContentResolver#getType} public API instead.")
Sudheer Shankaee148f92016-11-14 16:21:07 -0800309 String getProviderMimeType(in Uri uri, int userId);
Dmitri Plotnikovd55a3872020-01-16 17:00:02 -0800310
311 oneway void getProviderMimeTypeAsync(in Uri uri, int userId, in RemoteCallback resultCallback);
312
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700313 // Cause the specified process to dump the specified heap.
Christopher Ferris8d652f82017-04-11 16:29:18 -0700314 boolean dumpHeap(in String process, int userId, boolean managed, boolean mallocInfo,
Makoto Onuki2c6657f2018-06-06 15:24:02 -0700315 boolean runGc, in String path, in ParcelFileDescriptor fd,
316 in RemoteCallback finishCallback);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000317 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800318 boolean isUserRunning(int userid, int flags);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000319 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800320 void setPackageScreenCompatMode(in String packageName, int mode);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000321 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800322 boolean switchUser(int userid);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000323 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800324 boolean removeTask(int taskId);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000325 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800326 void registerProcessObserver(in IProcessObserver observer);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000327 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800328 void unregisterProcessObserver(in IProcessObserver observer);
329 boolean isIntentSenderTargetedToPackage(in IIntentSender sender);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000330 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800331 void updatePersistentConfiguration(in Configuration values);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000332 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800333 long[] getProcessPss(in int[] pids);
334 void showBootMessage(in CharSequence msg, boolean always);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000335 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800336 void killAllBackgroundProcesses();
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700337 ContentProviderHolder getContentProviderExternal(in String name, int userId,
Dianne Hackborn95031ef2018-07-09 09:09:05 -0700338 in IBinder token, String tag);
Makoto Onuki679760a2018-09-19 09:48:00 -0700339 /** @deprecated - Use {@link #removeContentProviderExternalAsUser} which takes a user ID. */
Andrei Onea4b2116c2019-02-28 15:13:42 +0000340 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800341 void removeContentProviderExternal(in String name, in IBinder token);
Makoto Onuki679760a2018-09-19 09:48:00 -0700342 void removeContentProviderExternalAsUser(in String name, in IBinder token, int userId);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700343 // Get memory information about the calling process.
Sudheer Shankaee148f92016-11-14 16:21:07 -0800344 void getMyMemoryState(out ActivityManager.RunningAppProcessInfo outInfo);
345 boolean killProcessesBelowForeground(in String reason);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000346 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800347 UserInfo getCurrentUser();
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700348 // This is not public because you need to be very careful in how you
349 // manage your activity to make sure it is always the uid you expect.
Andrei Onea4b2116c2019-02-28 15:13:42 +0000350 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800351 int getLaunchedFromUid(in IBinder activityToken);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000352 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800353 void unstableProviderDied(in IBinder connection);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000354 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800355 boolean isIntentSenderAnActivity(in IIntentSender sender);
Suprabh Shukladb6bf662017-08-30 15:41:53 -0700356 boolean isIntentSenderAForegroundService(in IIntentSender sender);
Christopher Tate2f558d22019-01-17 16:58:31 -0800357 boolean isIntentSenderABroadcast(in IIntentSender sender);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000358 @UnsupportedAppUsage
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700359 int startActivityAsUser(in IApplicationThread caller, in String callingPackage,
360 in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
361 int requestCode, int flags, in ProfilerInfo profilerInfo,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800362 in Bundle options, int userId);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000363 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800364 int stopUser(int userid, boolean force, in IStopUserCallback callback);
Keun young Park4cb99332019-09-19 17:08:41 -0700365 /**
366 * Check {@link com.android.server.am.ActivityManagerService#stopUserWithDelayedLocking(int, boolean, IStopUserCallback)}
367 * for details.
368 */
369 int stopUserWithDelayedLocking(int userid, boolean force, in IStopUserCallback callback);
370
Andrei Onea4b2116c2019-02-28 15:13:42 +0000371 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800372 void registerUserSwitchObserver(in IUserSwitchObserver observer, in String name);
373 void unregisterUserSwitchObserver(in IUserSwitchObserver observer);
374 int[] getRunningUserIds();
Felipe Leme10bb9b52016-12-20 09:10:14 -0800375
Kweku Adamsa3513f02019-03-21 12:48:08 -0700376 // Request a heap dump for the system server.
377 void requestSystemServerHeapDump();
378
Sudheer Shankaee148f92016-11-14 16:21:07 -0800379 void requestBugReport(int bugreportType);
Abhijeet Kaure9998512019-08-23 16:39:54 +0100380 void requestBugReportWithDescription(in @nullable String shareTitle,
381 in @nullable String shareDescription, int bugreportType);
Felipe Leme10bb9b52016-12-20 09:10:14 -0800382
Naveen Kallaca3d5432017-03-16 19:15:04 -0700383 /**
384 * Takes a telephony bug report and notifies the user with the title and description
385 * that are passed to this API as parameters
386 *
387 * @param shareTitle should be a valid legible string less than 50 chars long
Abhijeet Kaur8cd863b2019-10-15 17:42:41 +0100388 * @param shareDescription should be less than 150 chars long
Naveen Kallaca3d5432017-03-16 19:15:04 -0700389 *
390 * @throws IllegalArgumentException if shareTitle or shareDescription is too big or if the
391 * paremeters cannot be encoding to an UTF-8 charset.
392 */
393 void requestTelephonyBugReport(in String shareTitle, in String shareDescription);
394
mukesh agrawald9e1df52018-01-22 14:07:31 -0800395 /**
Abhijeet Kaur8cd863b2019-10-15 17:42:41 +0100396 * This method is only used by Wifi.
mukesh agrawald9e1df52018-01-22 14:07:31 -0800397 *
398 * Takes a minimal bugreport of Wifi-related state.
399 *
400 * @param shareTitle should be a valid legible string less than 50 chars long
Abhijeet Kaur8cd863b2019-10-15 17:42:41 +0100401 * @param shareDescription should be less than 150 chars long
mukesh agrawald9e1df52018-01-22 14:07:31 -0800402 *
403 * @throws IllegalArgumentException if shareTitle or shareDescription is too big or if the
404 * parameters cannot be encoding to an UTF-8 charset.
405 */
406 void requestWifiBugReport(in String shareTitle, in String shareDescription);
Abhijeet Kaure9998512019-08-23 16:39:54 +0100407 void requestInteractiveBugReportWithDescription(in String shareTitle,
408 in String shareDescription);
409
410 void requestInteractiveBugReport();
411 void requestFullBugReport();
412 void requestRemoteBugReport();
Paul Changc40f5782019-11-04 18:55:31 +0800413 boolean launchBugReportHandlerApp();
Paul Changc4153512019-12-08 21:35:27 +0800414 List<String> getBugreportWhitelistedPackages();
mukesh agrawald9e1df52018-01-22 14:07:31 -0800415
Andrei Onea4b2116c2019-02-28 15:13:42 +0000416 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800417 Intent getIntentForIntentSender(in IIntentSender sender);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700418 // This is not public because you need to be very careful in how you
419 // manage your activity to make sure it is always the uid you expect.
Andrei Onea4b2116c2019-02-28 15:13:42 +0000420 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800421 String getLaunchedFromPackage(in IBinder activityToken);
422 void killUid(int appId, int userId, in String reason);
423 void setUserIsMonkey(boolean monkey);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000424 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800425 void hang(in IBinder who, boolean allowRestart);
Wale Ogunwale388945c2017-10-04 12:13:46 -0700426
Andrei Onea4b2116c2019-02-28 15:13:42 +0000427 @UnsupportedAppUsage
Wale Ogunwale04d9cb52018-04-30 13:55:07 -0700428 List<ActivityManager.StackInfo> getAllStackInfos();
Andrei Onea4b2116c2019-02-28 15:13:42 +0000429 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800430 void moveTaskToStack(int taskId, int stackId, boolean toTop);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800431 void setFocusedStack(int stackId);
Wale Ogunwale68278562017-09-23 17:13:55 -0700432 ActivityManager.StackInfo getFocusedStackInfo();
Andrei Onea4b2116c2019-02-28 15:13:42 +0000433 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800434 void restart();
435 void performIdleMaintenance();
Sudheer Shankaee148f92016-11-14 16:21:07 -0800436 void appNotRespondingViaProvider(in IBinder connection);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000437 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800438 Rect getTaskBounds(int taskId);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000439 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800440 boolean setProcessMemoryTrimLevel(in String process, int uid, int level);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700441
442
443 // Start of L transactions
Sudheer Shankaee148f92016-11-14 16:21:07 -0800444 String getTagForIntentSender(in IIntentSender sender, in String prefix);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000445 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800446 boolean startUserInBackground(int userid);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000447 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800448 boolean isInLockTaskMode();
Andrei Onea4b2116c2019-02-28 15:13:42 +0000449 @UnsupportedAppUsage
Winson Chunge2d72172018-01-25 17:46:20 +0000450 void startRecentsActivity(in Intent intent, in IAssistDataReceiver assistDataReceiver,
451 in IRecentsAnimationRunner recentsAnimationRunner);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000452 @UnsupportedAppUsage
Winson Chung6a38fca2018-03-28 17:57:09 -0700453 void cancelRecentsAnimation(boolean restoreHomeStackPosition);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000454 @UnsupportedAppUsage
Winson Chungec1ef092017-10-25 16:22:34 -0700455 int startActivityFromRecents(int taskId, in Bundle options);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000456 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800457 void startSystemLockTaskMode(int taskId);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000458 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800459 boolean isTopOfTask(in IBinder token);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800460 void bootAnimationComplete();
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700461 int checkPermissionWithToken(in String permission, int pid, int uid,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800462 in IBinder callerToken);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000463 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800464 void registerTaskStackListener(in ITaskStackListener listener);
Winson Chungaa357452017-10-31 11:35:30 -0700465 void unregisterTaskStackListener(in ITaskStackListener listener);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800466 void notifyCleartextNetwork(int uid, in byte[] firstPacket);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000467 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800468 void setTaskResizeable(int taskId, int resizeableMode);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000469 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800470 void resizeTask(int taskId, in Rect bounds, int resizeMode);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000471 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800472 int getLockTaskModeState();
Andrei Onea4b2116c2019-02-28 15:13:42 +0000473 @UnsupportedAppUsage
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700474 void setDumpHeapDebugLimit(in String processName, int uid, long maxMemSize,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800475 in String reportPackage);
476 void dumpHeapFinished(in String path);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800477 void updateLockTaskPackages(int userId, in String[] packages);
Narayan Kamath695cf722017-12-21 18:32:47 +0000478 void noteAlarmStart(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String tag);
479 void noteAlarmFinish(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String tag);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000480 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800481 int getPackageProcessState(in String packageName, in String callingPackage);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800482 void updateDeviceOwner(in String packageName);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700483
484 // Start of N transactions
485 // Start Binder transaction tracking for all applications.
Andrei Onea4b2116c2019-02-28 15:13:42 +0000486 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800487 boolean startBinderTracking();
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700488 // Stop Binder transaction tracking for all applications and dump trace data to the given file
489 // descriptor.
Andrei Onea4b2116c2019-02-28 15:13:42 +0000490 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800491 boolean stopBinderTrackingAndDump(in ParcelFileDescriptor fd);
Andrii Kuliand2765632016-12-12 22:26:34 -0800492 /**
493 * Try to place task to provided position. The final position might be different depending on
494 * current user and stacks state. The task will be moved to target stack if it's currently in
495 * different stack.
496 */
Andrei Onea4b2116c2019-02-28 15:13:42 +0000497 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800498 void positionTaskInStack(int taskId, int stackId, int position);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000499 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800500 void suppressResizeConfigChanges(boolean suppress);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000501 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800502 boolean moveTopActivityToPinnedStack(int stackId, in Rect bounds);
Dianne Hackbornc3af19a2017-01-20 17:00:44 -0800503 boolean isAppStartModeDisabled(int uid, in String packageName);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000504 @UnsupportedAppUsage
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700505 boolean unlockUser(int userid, in byte[] token, in byte[] secret,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800506 in IProgressListener listener);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800507 void killPackageDependents(in String packageName, int userId);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700508 /**
509 * Resizes the docked stack, and all other stacks as the result of the dock stack bounds change.
510 *
511 * @param dockedBounds The bounds for the docked stack.
512 * @param tempDockedTaskBounds The temporary bounds for the tasks in the docked stack, which
513 * might be different from the stack bounds to allow more
514 * flexibility while resizing, or {@code null} if they should be the
515 * same as the stack bounds.
516 * @param tempDockedTaskInsetBounds The temporary bounds for the tasks to calculate the insets.
517 * When resizing, we usually "freeze" the layout of a task. To
518 * achieve that, we also need to "freeze" the insets, which
519 * gets achieved by changing task bounds but not bounds used
520 * to calculate the insets in this transient state
521 * @param tempOtherTaskBounds The temporary bounds for the tasks in all other stacks, or
522 * {@code null} if they should be the same as the stack bounds.
523 * @param tempOtherTaskInsetBounds Like {@code tempDockedTaskInsetBounds}, but for the other
524 * stacks.
525 * @throws RemoteException
526 */
Andrei Onea4b2116c2019-02-28 15:13:42 +0000527 @UnsupportedAppUsage
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700528 void resizeDockedStack(in Rect dockedBounds, in Rect tempDockedTaskBounds,
529 in Rect tempDockedTaskInsetBounds,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800530 in Rect tempOtherTaskBounds, in Rect tempOtherTaskInsetBounds);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000531 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800532 void removeStack(int stackId);
533 void makePackageIdle(String packageName, int userId);
534 int getMemoryTrimLevel();
Sudheer Shankaee148f92016-11-14 16:21:07 -0800535 boolean isVrModePackageEnabled(in ComponentName packageName);
Sudheer Shankaee148f92016-11-14 16:21:07 -0800536 void notifyLockedProfile(int userId);
Robin Lee5d592422017-01-18 13:48:15 +0000537 void startConfirmDeviceCredentialIntent(in Intent intent, in Bundle options);
Andrei Onea4b2116c2019-02-28 15:13:42 +0000538 @UnsupportedAppUsage
Sudheer Shankaee148f92016-11-14 16:21:07 -0800539 void sendIdleJobTrigger();
Dianne Hackborn98305522017-05-05 17:53:53 -0700540 int sendIntentSender(in IIntentSender target, in IBinder whitelistToken, int code,
541 in Intent intent, in String resolvedType, in IIntentReceiver finishedReceiver,
Sudheer Shankaee148f92016-11-14 16:21:07 -0800542 in String requiredPermission, in Bundle options);
Suprabh Shukla4d64c092018-02-21 20:06:14 -0800543 boolean isBackgroundRestricted(in String packageName);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700544
545 // Start of N MR1 transactions
Sudheer Shankaee148f92016-11-14 16:21:07 -0800546 void setRenderThread(int tid);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700547 /**
548 * Lets activity manager know whether the calling process is currently showing "top-level" UI
549 * that is not an activity, i.e. windows on the screen the user is currently interacting with.
550 *
551 * <p>This flag can only be set for persistent processes.
552 *
553 * @param hasTopUi Whether the calling process has "top-level" UI.
554 */
Sudheer Shankaee148f92016-11-14 16:21:07 -0800555 void setHasTopUi(boolean hasTopUi);
Sudheer Shankafc46e9b2016-10-21 17:55:27 -0700556
557 // Start of O transactions
Andrew Scull85a63bc2016-10-24 13:47:47 +0100558 int restartUserInBackground(int userId);
Wale Ogunwalee1fe7fa22016-12-15 18:27:00 -0800559 /** Cancels the window transitions for the given task. */
Andrei Onea4b2116c2019-02-28 15:13:42 +0000560 @UnsupportedAppUsage
Wale Ogunwalee1fe7fa22016-12-15 18:27:00 -0800561 void cancelTaskWindowTransition(int taskId);
Jorim Jaggi02886a82016-12-06 09:10:06 -0800562 /**
Svet Ganovfd31f852017-04-26 15:54:27 -0700563 * @param taskId the id of the task to retrieve the sAutoapshots for
Jorim Jaggi35e3f532017-03-17 17:06:50 +0100564 * @param reducedResolution if set, if the snapshot needs to be loaded from disk, this will load
565 * a reduced resolution of it, which is much faster
Jorim Jaggi02886a82016-12-06 09:10:06 -0800566 * @return a graphic buffer representing a screenshot of a task
567 */
Andrei Onea4b2116c2019-02-28 15:13:42 +0000568 @UnsupportedAppUsage
Jorim Jaggi35e3f532017-03-17 17:06:50 +0100569 ActivityManager.TaskSnapshot getTaskSnapshot(int taskId, boolean reducedResolution);
Mårten Kongstad49a4a1d2017-01-12 08:36:37 +0100570 void scheduleApplicationInfoChanged(in List<String> packageNames, int userId);
Craig Donnerdc4796c2017-03-08 09:51:47 -0800571 void setPersistentVrThread(int tid);
Mårten Kongstad49a4a1d2017-01-12 08:36:37 +0100572
Sudheer Shanka84a48952017-03-08 18:19:01 -0800573 void waitForNetworkStateUpdate(long procStateSeq);
Christopher Tate424b03f2017-04-04 14:23:44 -0700574 /**
575 * Add a bare uid to the background restrictions whitelist. Only the system uid may call this.
576 */
Charles Hee078db72017-10-19 18:03:20 +0100577 void backgroundWhitelistUid(int uid);
578
579 // Start of P transactions
Rajeev Kumar22d92b72018-02-07 18:38:36 -0800580 /**
581 * Similar to {@link #startUserInBackground(int userId), but with a listener to report
582 * user unlock progress.
583 */
584 boolean startUserInBackgroundWithListener(int userid, IProgressListener unlockProgressListener);
Svet Ganovd873ae62018-06-25 16:39:23 -0700585
586 /**
587 * Method for the shell UID to start deletating its permission identity to an
588 * active instrumenation. The shell can delegate permissions only to one active
589 * instrumentation at a time. An active instrumentation is one running and
590 * started from the shell.
591 */
Svet Ganov5e869592018-11-09 09:30:52 -0800592 void startDelegateShellPermissionIdentity(int uid, in String[] permissions);
Svet Ganovd873ae62018-06-25 16:39:23 -0700593
594 /**
595 * Method for the shell UID to stop deletating its permission identity to an
596 * active instrumenation. An active instrumentation is one running and
597 * started from the shell.
598 */
599 void stopDelegateShellPermissionIdentity();
Makoto Onukib4469f92019-02-19 15:55:44 -0800600
601 /** Returns a file descriptor that'll be closed when the system server process dies. */
602 ParcelFileDescriptor getLifeMonitor();
Keun-young Park42118d22019-02-19 15:16:29 -0800603
604 /**
605 * Start user, if it us not already running, and bring it to foreground.
606 * unlockProgressListener can be null if monitoring progress is not necessary.
607 */
608 boolean startUserInForegroundWithListener(int userid, IProgressListener unlockProgressListener);
Jing Ji83c6bc52019-12-19 11:53:31 -0800609
610 /**
611 * Method for the app to tell system that it's wedged and would like to trigger an ANR.
612 */
613 void appNotResponding(String reason);
Jing Ji8055a3a2019-12-17 15:55:33 -0800614
615 /**
616 * Return a list of {@link ApplicationExitInfo} records.
617 *
618 * <p class="note"> Note: System stores these historical information in a ring buffer, older
619 * records would be overwritten by newer records. </p>
620 *
621 * <p class="note"> Note: In the case that this application bound to an external service with
622 * flag {@link android.content.Context#BIND_EXTERNAL_SERVICE}, the process of that external
623 * service will be included in this package's exit info. </p>
624 *
625 * @param packageName Optional, an empty value means match all packages belonging to the
626 * caller's UID. If this package belongs to another UID, you must hold
627 * {@link android.Manifest.permission#DUMP} in order to retrieve it.
628 * @param pid Optional, it could be a process ID that used to belong to this package but
629 * died later; A value of 0 means to ignore this parameter and return all
630 * matching records.
631 * @param maxNum Optional, the maximum number of results should be returned; A value of 0
632 * means to ignore this parameter and return all matching records
633 * @param userId The userId in the multi-user environment.
634 *
635 * @return a list of {@link ApplicationExitInfo} records with the matching criteria, sorted in
636 * the order from most recent to least recent.
637 */
638 ParceledListSlice<ApplicationExitInfo> getHistoricalProcessExitReasons(String packageName,
639 int pid, int maxNum, int userId);
Jing Jie423f762019-12-10 15:05:18 -0800640
641 /*
642 * Kill the given PIDs, but the killing will be delayed until the device is idle
643 * and the given process is imperceptible.
644 */
645 void killProcessesWhenImperceptible(in int[] pids, String reason);
Yuliya Kamatkova48c38072020-01-09 15:43:25 -0800646
647 /**
648 * Set locus context for a given activity.
649 * @param activity
650 * @param locusId a unique, stable id that identifies this activity instance from others.
651 * @param appToken ActivityRecord's appToken.
652 */
653 void setActivityLocusContext(in ComponentName activity, in LocusId locusId,
654 in IBinder appToken);
Winson Chungb5c41b72016-12-07 15:00:47 -0800655}