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