The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 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 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 19 | import android.content.ComponentName; |
| 20 | import android.content.ContentProviderNative; |
| 21 | import android.content.IContentProvider; |
| 22 | import android.content.Intent; |
| 23 | import android.content.IntentFilter; |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 24 | import android.content.IIntentSender; |
| 25 | import android.content.IIntentReceiver; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 26 | import android.content.IntentSender; |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 27 | import android.content.pm.ApplicationInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 28 | import android.content.pm.ConfigurationInfo; |
| 29 | import android.content.pm.IPackageDataObserver; |
| 30 | import android.content.pm.ProviderInfo; |
| 31 | import android.content.res.Configuration; |
| 32 | import android.graphics.Bitmap; |
| 33 | import android.net.Uri; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 34 | import android.os.Debug; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 35 | import android.os.RemoteException; |
| 36 | import android.os.IBinder; |
| 37 | import android.os.IInterface; |
| 38 | import android.os.Parcel; |
| 39 | import android.os.Parcelable; |
| 40 | import android.os.ParcelFileDescriptor; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 41 | import android.os.Bundle; |
| 42 | |
| 43 | import java.util.List; |
| 44 | |
| 45 | /** |
| 46 | * System private API for talking with the activity manager service. This |
| 47 | * provides calls from the application back to the activity manager. |
| 48 | * |
| 49 | * {@hide} |
| 50 | */ |
| 51 | public interface IActivityManager extends IInterface { |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 52 | /** |
| 53 | * Returned by startActivity() if the start request was canceled because |
| 54 | * app switches are temporarily canceled to ensure the user's last request |
| 55 | * (such as pressing home) is performed. |
| 56 | */ |
| 57 | public static final int START_SWITCHES_CANCELED = 4; |
| 58 | /** |
| 59 | * Returned by startActivity() if an activity wasn't really started, but |
| 60 | * the given Intent was given to the existing top activity. |
| 61 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 62 | public static final int START_DELIVERED_TO_TOP = 3; |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 63 | /** |
| 64 | * Returned by startActivity() if an activity wasn't really started, but |
| 65 | * a task was simply brought to the foreground. |
| 66 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 67 | public static final int START_TASK_TO_FRONT = 2; |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 68 | /** |
| 69 | * Returned by startActivity() if the caller asked that the Intent not |
| 70 | * be executed if it is the recipient, and that is indeed the case. |
| 71 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 72 | public static final int START_RETURN_INTENT_TO_CALLER = 1; |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 73 | /** |
| 74 | * Activity was started successfully as normal. |
| 75 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 76 | public static final int START_SUCCESS = 0; |
| 77 | public static final int START_INTENT_NOT_RESOLVED = -1; |
| 78 | public static final int START_CLASS_NOT_FOUND = -2; |
| 79 | public static final int START_FORWARD_AND_REQUEST_CONFLICT = -3; |
| 80 | public static final int START_PERMISSION_DENIED = -4; |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 81 | public static final int START_NOT_ACTIVITY = -5; |
| 82 | public static final int START_CANCELED = -6; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 83 | public int startActivity(IApplicationThread caller, |
| 84 | Intent intent, String resolvedType, Uri[] grantedUriPermissions, |
| 85 | int grantedMode, IBinder resultTo, String resultWho, int requestCode, |
| 86 | boolean onlyIfNeeded, boolean debug) throws RemoteException; |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 87 | public WaitResult startActivityAndWait(IApplicationThread caller, |
| 88 | Intent intent, String resolvedType, Uri[] grantedUriPermissions, |
| 89 | int grantedMode, IBinder resultTo, String resultWho, int requestCode, |
| 90 | boolean onlyIfNeeded, boolean debug) throws RemoteException; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 91 | public int startActivityIntentSender(IApplicationThread caller, |
| 92 | IntentSender intent, Intent fillInIntent, String resolvedType, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 93 | IBinder resultTo, String resultWho, int requestCode, |
| 94 | int flagsMask, int flagsValues) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 95 | public boolean startNextMatchingActivity(IBinder callingActivity, |
| 96 | Intent intent) throws RemoteException; |
| 97 | public boolean finishActivity(IBinder token, int code, Intent data) |
| 98 | throws RemoteException; |
| 99 | public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException; |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 100 | public boolean willActivityBeVisible(IBinder token) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 101 | public Intent registerReceiver(IApplicationThread caller, |
| 102 | IIntentReceiver receiver, IntentFilter filter, |
| 103 | String requiredPermission) throws RemoteException; |
| 104 | public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException; |
| 105 | public static final int BROADCAST_SUCCESS = 0; |
| 106 | public static final int BROADCAST_STICKY_CANT_HAVE_PERMISSION = -1; |
| 107 | public int broadcastIntent(IApplicationThread caller, Intent intent, |
| 108 | String resolvedType, IIntentReceiver resultTo, int resultCode, |
| 109 | String resultData, Bundle map, String requiredPermission, |
| 110 | boolean serialized, boolean sticky) throws RemoteException; |
| 111 | public void unbroadcastIntent(IApplicationThread caller, Intent intent) throws RemoteException; |
| 112 | /* oneway */ |
| 113 | public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, boolean abortBroadcast) throws RemoteException; |
| 114 | public void setPersistent(IBinder token, boolean isPersistent) throws RemoteException; |
| 115 | public void attachApplication(IApplicationThread app) throws RemoteException; |
| 116 | /* oneway */ |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 117 | public void activityIdle(IBinder token, Configuration config) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 118 | public void activityPaused(IBinder token, Bundle state) throws RemoteException; |
| 119 | /* oneway */ |
| 120 | public void activityStopped(IBinder token, |
| 121 | Bitmap thumbnail, CharSequence description) throws RemoteException; |
| 122 | /* oneway */ |
| 123 | public void activityDestroyed(IBinder token) throws RemoteException; |
| 124 | public String getCallingPackage(IBinder token) throws RemoteException; |
| 125 | public ComponentName getCallingActivity(IBinder token) throws RemoteException; |
| 126 | public List getTasks(int maxNum, int flags, |
| 127 | IThumbnailReceiver receiver) throws RemoteException; |
| 128 | public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, |
| 129 | int flags) throws RemoteException; |
| 130 | public List getServices(int maxNum, int flags) throws RemoteException; |
| 131 | public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() |
| 132 | throws RemoteException; |
| 133 | public void moveTaskToFront(int task) throws RemoteException; |
| 134 | public void moveTaskToBack(int task) throws RemoteException; |
| 135 | public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) throws RemoteException; |
| 136 | public void moveTaskBackwards(int task) throws RemoteException; |
| 137 | public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException; |
| 138 | public void finishOtherInstances(IBinder token, ComponentName className) throws RemoteException; |
| 139 | /* oneway */ |
| 140 | public void reportThumbnail(IBinder token, |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 141 | Bitmap thumbnail, CharSequence description) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 142 | public ContentProviderHolder getContentProvider(IApplicationThread caller, |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 143 | String name) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 144 | public void removeContentProvider(IApplicationThread caller, |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 145 | String name) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 146 | public void publishContentProviders(IApplicationThread caller, |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 147 | List<ContentProviderHolder> providers) throws RemoteException; |
| 148 | public PendingIntent getRunningServiceControlPanel(ComponentName service) |
| 149 | throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 150 | public ComponentName startService(IApplicationThread caller, Intent service, |
| 151 | String resolvedType) throws RemoteException; |
| 152 | public int stopService(IApplicationThread caller, Intent service, |
| 153 | String resolvedType) throws RemoteException; |
| 154 | public boolean stopServiceToken(ComponentName className, IBinder token, |
| 155 | int startId) throws RemoteException; |
| 156 | public void setServiceForeground(ComponentName className, IBinder token, |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 157 | int id, Notification notification, boolean keepNotification) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 158 | public int bindService(IApplicationThread caller, IBinder token, |
| 159 | Intent service, String resolvedType, |
| 160 | IServiceConnection connection, int flags) throws RemoteException; |
| 161 | public boolean unbindService(IServiceConnection connection) throws RemoteException; |
| 162 | public void publishService(IBinder token, |
| 163 | Intent intent, IBinder service) throws RemoteException; |
| 164 | public void unbindFinished(IBinder token, Intent service, |
| 165 | boolean doRebind) throws RemoteException; |
| 166 | /* oneway */ |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 167 | public void serviceDoneExecuting(IBinder token, int type, int startId, |
| 168 | int res) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 169 | public IBinder peekService(Intent service, String resolvedType) throws RemoteException; |
| 170 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 171 | public boolean bindBackupAgent(ApplicationInfo appInfo, int backupRestoreMode) |
| 172 | throws RemoteException; |
| 173 | public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException; |
| 174 | public void unbindBackupAgent(ApplicationInfo appInfo) throws RemoteException; |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 175 | public void killApplicationProcess(String processName, int uid) throws RemoteException; |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 176 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 177 | public boolean startInstrumentation(ComponentName className, String profileFile, |
| 178 | int flags, Bundle arguments, IInstrumentationWatcher watcher) |
| 179 | throws RemoteException; |
| 180 | public void finishInstrumentation(IApplicationThread target, |
| 181 | int resultCode, Bundle results) throws RemoteException; |
| 182 | |
| 183 | public Configuration getConfiguration() throws RemoteException; |
| 184 | public void updateConfiguration(Configuration values) throws RemoteException; |
| 185 | public void setRequestedOrientation(IBinder token, |
| 186 | int requestedOrientation) throws RemoteException; |
| 187 | public int getRequestedOrientation(IBinder token) throws RemoteException; |
| 188 | |
| 189 | public ComponentName getActivityClassForToken(IBinder token) throws RemoteException; |
| 190 | public String getPackageForToken(IBinder token) throws RemoteException; |
| 191 | |
| 192 | public static final int INTENT_SENDER_BROADCAST = 1; |
| 193 | public static final int INTENT_SENDER_ACTIVITY = 2; |
| 194 | public static final int INTENT_SENDER_ACTIVITY_RESULT = 3; |
| 195 | public static final int INTENT_SENDER_SERVICE = 4; |
| 196 | public IIntentSender getIntentSender(int type, |
| 197 | String packageName, IBinder token, String resultWho, |
| 198 | int requestCode, Intent intent, String resolvedType, int flags) throws RemoteException; |
| 199 | public void cancelIntentSender(IIntentSender sender) throws RemoteException; |
| 200 | public boolean clearApplicationUserData(final String packageName, |
| 201 | final IPackageDataObserver observer) throws RemoteException; |
| 202 | public String getPackageForIntentSender(IIntentSender sender) throws RemoteException; |
| 203 | |
| 204 | public void setProcessLimit(int max) throws RemoteException; |
| 205 | public int getProcessLimit() throws RemoteException; |
| 206 | |
| 207 | public void setProcessForeground(IBinder token, int pid, boolean isForeground) throws RemoteException; |
| 208 | |
| 209 | public int checkPermission(String permission, int pid, int uid) |
| 210 | throws RemoteException; |
| 211 | |
| 212 | public int checkUriPermission(Uri uri, int pid, int uid, int mode) |
| 213 | throws RemoteException; |
| 214 | public void grantUriPermission(IApplicationThread caller, String targetPkg, |
| 215 | Uri uri, int mode) throws RemoteException; |
| 216 | public void revokeUriPermission(IApplicationThread caller, Uri uri, |
| 217 | int mode) throws RemoteException; |
| 218 | |
| 219 | public void showWaitingForDebugger(IApplicationThread who, boolean waiting) |
| 220 | throws RemoteException; |
| 221 | |
| 222 | public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException; |
| 223 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 224 | public void killBackgroundProcesses(final String packageName) throws RemoteException; |
| 225 | public void forceStopPackage(final String packageName) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 226 | |
| 227 | // Note: probably don't want to allow applications access to these. |
| 228 | public void goingToSleep() throws RemoteException; |
| 229 | public void wakingUp() throws RemoteException; |
| 230 | |
| 231 | public void unhandledBack() throws RemoteException; |
| 232 | public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException; |
| 233 | public void setDebugApp( |
| 234 | String packageName, boolean waitForDebugger, boolean persistent) |
| 235 | throws RemoteException; |
| 236 | public void setAlwaysFinish(boolean enabled) throws RemoteException; |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 237 | public void setActivityController(IActivityController watcher) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 238 | throws RemoteException; |
| 239 | |
| 240 | public void enterSafeMode() throws RemoteException; |
| 241 | |
| 242 | public void noteWakeupAlarm(IIntentSender sender) throws RemoteException; |
| 243 | |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame^] | 244 | public boolean killPids(int[] pids, String reason) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 245 | |
| 246 | public void reportPss(IApplicationThread caller, int pss) throws RemoteException; |
| 247 | |
| 248 | // Special low-level communication with activity manager. |
| 249 | public void startRunning(String pkg, String cls, String action, |
| 250 | String data) throws RemoteException; |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 251 | public void handleApplicationCrash(IBinder app, |
| 252 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException; |
| 253 | public boolean handleApplicationWtf(IBinder app, String tag, |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 254 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 255 | |
| 256 | /* |
| 257 | * This will deliver the specified signal to all the persistent processes. Currently only |
| 258 | * SIGUSR1 is delivered. All others are ignored. |
| 259 | */ |
| 260 | public void signalPersistentProcesses(int signal) throws RemoteException; |
| 261 | // Retrieve running application processes in the system |
| 262 | public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() |
| 263 | throws RemoteException; |
| 264 | // Get device configuration |
| 265 | public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException; |
| 266 | |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 267 | // Turn on/off profiling in a particular process. |
| 268 | public boolean profileControl(String process, boolean start, |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 269 | String path, ParcelFileDescriptor fd) throws RemoteException; |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 270 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 271 | public boolean shutdown(int timeout) throws RemoteException; |
| 272 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 273 | public void stopAppSwitches() throws RemoteException; |
| 274 | public void resumeAppSwitches() throws RemoteException; |
| 275 | |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 276 | public void registerActivityWatcher(IActivityWatcher watcher) |
| 277 | throws RemoteException; |
| 278 | public void unregisterActivityWatcher(IActivityWatcher watcher) |
| 279 | throws RemoteException; |
| 280 | |
Dianne Hackborn | 2d91af0 | 2009-07-16 13:34:33 -0700 | [diff] [blame] | 281 | public int startActivityInPackage(int uid, |
| 282 | Intent intent, String resolvedType, IBinder resultTo, |
| 283 | String resultWho, int requestCode, boolean onlyIfNeeded) |
| 284 | throws RemoteException; |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 285 | |
| 286 | public void killApplicationWithUid(String pkg, int uid) throws RemoteException; |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 287 | |
| 288 | public void closeSystemDialogs(String reason) throws RemoteException; |
| 289 | |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 290 | public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 291 | throws RemoteException; |
| 292 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 293 | public void overridePendingTransition(IBinder token, String packageName, |
| 294 | int enterAnim, int exitAnim) throws RemoteException; |
| 295 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 296 | public boolean isUserAMonkey() throws RemoteException; |
| 297 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 298 | /* |
| 299 | * Private non-Binder interfaces |
| 300 | */ |
| 301 | /* package */ boolean testIsSystemReady(); |
| 302 | |
| 303 | /** Information you can retrieve about a particular application. */ |
| 304 | public static class ContentProviderHolder implements Parcelable { |
| 305 | public final ProviderInfo info; |
| 306 | public final String permissionFailure; |
| 307 | public IContentProvider provider; |
| 308 | public boolean noReleaseNeeded; |
| 309 | |
| 310 | public ContentProviderHolder(ProviderInfo _info) { |
| 311 | info = _info; |
| 312 | permissionFailure = null; |
| 313 | } |
| 314 | |
| 315 | public ContentProviderHolder(ProviderInfo _info, |
| 316 | String _permissionFailure) { |
| 317 | info = _info; |
| 318 | permissionFailure = _permissionFailure; |
| 319 | } |
| 320 | |
| 321 | public int describeContents() { |
| 322 | return 0; |
| 323 | } |
| 324 | |
| 325 | public void writeToParcel(Parcel dest, int flags) { |
| 326 | info.writeToParcel(dest, 0); |
| 327 | dest.writeString(permissionFailure); |
| 328 | if (provider != null) { |
| 329 | dest.writeStrongBinder(provider.asBinder()); |
| 330 | } else { |
| 331 | dest.writeStrongBinder(null); |
| 332 | } |
| 333 | dest.writeInt(noReleaseNeeded ? 1:0); |
| 334 | } |
| 335 | |
| 336 | public static final Parcelable.Creator<ContentProviderHolder> CREATOR |
| 337 | = new Parcelable.Creator<ContentProviderHolder>() { |
| 338 | public ContentProviderHolder createFromParcel(Parcel source) { |
| 339 | return new ContentProviderHolder(source); |
| 340 | } |
| 341 | |
| 342 | public ContentProviderHolder[] newArray(int size) { |
| 343 | return new ContentProviderHolder[size]; |
| 344 | } |
| 345 | }; |
| 346 | |
| 347 | private ContentProviderHolder(Parcel source) { |
| 348 | info = ProviderInfo.CREATOR.createFromParcel(source); |
| 349 | permissionFailure = source.readString(); |
| 350 | provider = ContentProviderNative.asInterface( |
| 351 | source.readStrongBinder()); |
| 352 | noReleaseNeeded = source.readInt() != 0; |
| 353 | } |
| 354 | }; |
| 355 | |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 356 | /** Information returned after waiting for an activity start. */ |
| 357 | public static class WaitResult implements Parcelable { |
| 358 | public int result; |
| 359 | public boolean timeout; |
| 360 | public ComponentName who; |
| 361 | public long thisTime; |
| 362 | public long totalTime; |
| 363 | |
| 364 | public WaitResult() { |
| 365 | } |
| 366 | |
| 367 | public int describeContents() { |
| 368 | return 0; |
| 369 | } |
| 370 | |
| 371 | public void writeToParcel(Parcel dest, int flags) { |
| 372 | dest.writeInt(result); |
| 373 | dest.writeInt(timeout ? 1 : 0); |
| 374 | ComponentName.writeToParcel(who, dest); |
| 375 | dest.writeLong(thisTime); |
| 376 | dest.writeLong(totalTime); |
| 377 | } |
| 378 | |
| 379 | public static final Parcelable.Creator<WaitResult> CREATOR |
| 380 | = new Parcelable.Creator<WaitResult>() { |
| 381 | public WaitResult createFromParcel(Parcel source) { |
| 382 | return new WaitResult(source); |
| 383 | } |
| 384 | |
| 385 | public WaitResult[] newArray(int size) { |
| 386 | return new WaitResult[size]; |
| 387 | } |
| 388 | }; |
| 389 | |
| 390 | private WaitResult(Parcel source) { |
| 391 | result = source.readInt(); |
| 392 | timeout = source.readInt() != 0; |
| 393 | who = ComponentName.readFromParcel(source); |
| 394 | thisTime = source.readLong(); |
| 395 | totalTime = source.readLong(); |
| 396 | } |
| 397 | }; |
| 398 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 399 | String descriptor = "android.app.IActivityManager"; |
| 400 | |
| 401 | // Please keep these transaction codes the same -- they are also |
| 402 | // sent by C++ code. |
| 403 | int START_RUNNING_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION; |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 404 | int HANDLE_APPLICATION_CRASH_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+1; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 405 | int START_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+2; |
| 406 | int UNHANDLED_BACK_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+3; |
| 407 | int OPEN_CONTENT_URI_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+4; |
| 408 | |
| 409 | // Remaining non-native transaction codes. |
| 410 | int FINISH_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+10; |
| 411 | int REGISTER_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+11; |
| 412 | int UNREGISTER_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+12; |
| 413 | int BROADCAST_INTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+13; |
| 414 | int UNBROADCAST_INTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+14; |
| 415 | int FINISH_RECEIVER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+15; |
| 416 | int ATTACH_APPLICATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+16; |
| 417 | int ACTIVITY_IDLE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+17; |
| 418 | int ACTIVITY_PAUSED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+18; |
| 419 | int ACTIVITY_STOPPED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+19; |
| 420 | int GET_CALLING_PACKAGE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+20; |
| 421 | int GET_CALLING_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+21; |
| 422 | int GET_TASKS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+22; |
| 423 | int MOVE_TASK_TO_FRONT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+23; |
| 424 | int MOVE_TASK_TO_BACK_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+24; |
| 425 | int MOVE_TASK_BACKWARDS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+25; |
| 426 | int GET_TASK_FOR_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+26; |
| 427 | int REPORT_THUMBNAIL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+27; |
| 428 | int GET_CONTENT_PROVIDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+28; |
| 429 | int PUBLISH_CONTENT_PROVIDERS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+29; |
| 430 | int SET_PERSISTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+30; |
| 431 | int FINISH_SUB_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+31; |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 432 | int GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+32; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 433 | int START_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+33; |
| 434 | int STOP_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+34; |
| 435 | int BIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+35; |
| 436 | int UNBIND_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+36; |
| 437 | int PUBLISH_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+37; |
| 438 | int FINISH_OTHER_INSTANCES_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+38; |
| 439 | int GOING_TO_SLEEP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+39; |
| 440 | int WAKING_UP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+40; |
| 441 | int SET_DEBUG_APP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+41; |
| 442 | int SET_ALWAYS_FINISH_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+42; |
| 443 | int START_INSTRUMENTATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+43; |
| 444 | int FINISH_INSTRUMENTATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+44; |
| 445 | int GET_CONFIGURATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+45; |
| 446 | int UPDATE_CONFIGURATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+46; |
| 447 | int STOP_SERVICE_TOKEN_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+47; |
| 448 | int GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+48; |
| 449 | int GET_PACKAGE_FOR_TOKEN_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+49; |
| 450 | int SET_PROCESS_LIMIT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+50; |
| 451 | int GET_PROCESS_LIMIT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+51; |
| 452 | int CHECK_PERMISSION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+52; |
| 453 | int CHECK_URI_PERMISSION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+53; |
| 454 | int GRANT_URI_PERMISSION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+54; |
| 455 | int REVOKE_URI_PERMISSION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+55; |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 456 | int SET_ACTIVITY_CONTROLLER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+56; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 457 | int SHOW_WAITING_FOR_DEBUGGER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+57; |
| 458 | int SIGNAL_PERSISTENT_PROCESSES_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+58; |
| 459 | int GET_RECENT_TASKS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+59; |
| 460 | int SERVICE_DONE_EXECUTING_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+60; |
| 461 | int ACTIVITY_DESTROYED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+61; |
| 462 | int GET_INTENT_SENDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+62; |
| 463 | int CANCEL_INTENT_SENDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+63; |
| 464 | int GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+64; |
| 465 | int ENTER_SAFE_MODE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+65; |
| 466 | int START_NEXT_MATCHING_ACTIVITY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+66; |
| 467 | int NOTE_WAKEUP_ALARM_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+67; |
| 468 | int REMOVE_CONTENT_PROVIDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+68; |
| 469 | int SET_REQUESTED_ORIENTATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+69; |
| 470 | int GET_REQUESTED_ORIENTATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+70; |
| 471 | int UNBIND_FINISHED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+71; |
| 472 | int SET_PROCESS_FOREGROUND_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+72; |
| 473 | int SET_SERVICE_FOREGROUND_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+73; |
| 474 | int MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+74; |
| 475 | int GET_MEMORY_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+75; |
| 476 | int GET_PROCESSES_IN_ERROR_STATE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+76; |
| 477 | int CLEAR_APP_DATA_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+77; |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 478 | int FORCE_STOP_PACKAGE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+78; |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame^] | 479 | int KILL_PIDS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+79; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 480 | int GET_SERVICES_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+80; |
| 481 | int REPORT_PSS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+81; |
| 482 | int GET_RUNNING_APP_PROCESSES_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+82; |
| 483 | int GET_DEVICE_CONFIGURATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+83; |
| 484 | int PEEK_SERVICE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+84; |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 485 | int PROFILE_CONTROL_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+85; |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 486 | int SHUTDOWN_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+86; |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 487 | int STOP_APP_SWITCHES_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+87; |
| 488 | int RESUME_APP_SWITCHES_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+88; |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 489 | int START_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+89; |
| 490 | int BACKUP_AGENT_CREATED_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+90; |
| 491 | int UNBIND_BACKUP_AGENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+91; |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 492 | int REGISTER_ACTIVITY_WATCHER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+92; |
| 493 | int UNREGISTER_ACTIVITY_WATCHER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+93; |
Dianne Hackborn | 2d91af0 | 2009-07-16 13:34:33 -0700 | [diff] [blame] | 494 | int START_ACTIVITY_IN_PACKAGE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+94; |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 495 | int KILL_APPLICATION_WITH_UID_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+95; |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 496 | int CLOSE_SYSTEM_DIALOGS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+96; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 497 | int GET_PROCESS_MEMORY_INFO_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+97; |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 498 | int KILL_APPLICATION_PROCESS_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+98; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 499 | int START_ACTIVITY_INTENT_SENDER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+99; |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 500 | int OVERRIDE_PENDING_TRANSITION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+100; |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 501 | int HANDLE_APPLICATION_WTF_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+101; |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 502 | int KILL_BACKGROUND_PROCESSES_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+102; |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 503 | int IS_USER_A_MONKEY_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+103; |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 504 | int START_ACTIVITY_AND_WAIT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+104; |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 505 | int WILL_ACTIVITY_BE_VISIBLE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+105; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 506 | } |