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