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 | |
| 19 | import android.content.ComponentName; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 20 | import android.content.IIntentReceiver; |
| 21 | import android.content.IIntentSender; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 22 | import android.content.Intent; |
| 23 | import android.content.IntentFilter; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 24 | import android.content.IntentSender; |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 25 | import android.content.pm.ApplicationInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 26 | import android.content.pm.ConfigurationInfo; |
| 27 | import android.content.pm.IPackageDataObserver; |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 28 | import android.content.pm.UserInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 29 | import android.content.res.Configuration; |
| 30 | import android.graphics.Bitmap; |
| 31 | import android.net.Uri; |
| 32 | import android.os.Binder; |
| 33 | import android.os.Bundle; |
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.IBinder; |
| 36 | import android.os.Parcel; |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 37 | import android.os.ParcelFileDescriptor; |
| 38 | import android.os.Parcelable; |
| 39 | import android.os.RemoteException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 40 | import android.os.ServiceManager; |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 41 | import android.os.StrictMode; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 42 | import android.text.TextUtils; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 43 | import android.util.Log; |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 44 | import android.util.Singleton; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 46 | import java.util.ArrayList; |
| 47 | import java.util.List; |
| 48 | |
| 49 | /** {@hide} */ |
| 50 | public abstract class ActivityManagerNative extends Binder implements IActivityManager |
| 51 | { |
| 52 | /** |
| 53 | * Cast a Binder object into an activity manager interface, generating |
| 54 | * a proxy if needed. |
| 55 | */ |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 56 | static public IActivityManager asInterface(IBinder obj) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | if (obj == null) { |
| 58 | return null; |
| 59 | } |
| 60 | IActivityManager in = |
| 61 | (IActivityManager)obj.queryLocalInterface(descriptor); |
| 62 | if (in != null) { |
| 63 | return in; |
| 64 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 65 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 66 | return new ActivityManagerProxy(obj); |
| 67 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 68 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 69 | /** |
| 70 | * Retrieve the system's default/global activity manager. |
| 71 | */ |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 72 | static public IActivityManager getDefault() { |
| 73 | return gDefault.get(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Convenience for checking whether the system is ready. For internal use only. |
| 78 | */ |
| 79 | static public boolean isSystemReady() { |
| 80 | if (!sSystemReady) { |
| 81 | sSystemReady = getDefault().testIsSystemReady(); |
| 82 | } |
| 83 | return sSystemReady; |
| 84 | } |
| 85 | static boolean sSystemReady = false; |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 86 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 87 | /** |
| 88 | * Convenience for sending a sticky broadcast. For internal use only. |
| 89 | * If you don't care about permission, use null. |
| 90 | */ |
Dianne Hackborn | 5ac72a2 | 2012-08-29 18:32:08 -0700 | [diff] [blame] | 91 | static public void broadcastStickyIntent(Intent intent, String permission, int userId) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 92 | try { |
| 93 | getDefault().broadcastIntent( |
| 94 | null, intent, null, null, Activity.RESULT_OK, null, null, |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 95 | null /*permission*/, AppOpsManager.OP_NONE, false, true, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 96 | } catch (RemoteException ex) { |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | static public void noteWakeupAlarm(PendingIntent ps) { |
| 101 | try { |
| 102 | getDefault().noteWakeupAlarm(ps.getTarget()); |
| 103 | } catch (RemoteException ex) { |
| 104 | } |
| 105 | } |
| 106 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 107 | public ActivityManagerNative() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 108 | attachInterface(this, descriptor); |
| 109 | } |
| 110 | |
| 111 | public boolean onTransact(int code, Parcel data, Parcel reply, int flags) |
| 112 | throws RemoteException { |
| 113 | switch (code) { |
| 114 | case START_ACTIVITY_TRANSACTION: |
| 115 | { |
| 116 | data.enforceInterface(IActivityManager.descriptor); |
| 117 | IBinder b = data.readStrongBinder(); |
| 118 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 119 | String callingPackage = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 120 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 121 | String resolvedType = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 122 | IBinder resultTo = data.readStrongBinder(); |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 123 | String resultWho = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 124 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 125 | int startFlags = data.readInt(); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 126 | String profileFile = data.readString(); |
| 127 | ParcelFileDescriptor profileFd = data.readInt() != 0 |
| 128 | ? data.readFileDescriptor() : null; |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 129 | Bundle options = data.readInt() != 0 |
| 130 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 131 | int result = startActivity(app, callingPackage, intent, resolvedType, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 132 | resultTo, resultWho, requestCode, startFlags, |
| 133 | profileFile, profileFd, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 134 | reply.writeNoException(); |
| 135 | reply.writeInt(result); |
| 136 | return true; |
| 137 | } |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 138 | |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 139 | case START_ACTIVITY_AS_USER_TRANSACTION: |
| 140 | { |
| 141 | data.enforceInterface(IActivityManager.descriptor); |
| 142 | IBinder b = data.readStrongBinder(); |
| 143 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 144 | String callingPackage = data.readString(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 145 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 146 | String resolvedType = data.readString(); |
| 147 | IBinder resultTo = data.readStrongBinder(); |
| 148 | String resultWho = data.readString(); |
| 149 | int requestCode = data.readInt(); |
| 150 | int startFlags = data.readInt(); |
| 151 | String profileFile = data.readString(); |
| 152 | ParcelFileDescriptor profileFd = data.readInt() != 0 |
| 153 | ? data.readFileDescriptor() : null; |
| 154 | Bundle options = data.readInt() != 0 |
| 155 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 156 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 157 | int result = startActivityAsUser(app, callingPackage, intent, resolvedType, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 158 | resultTo, resultWho, requestCode, startFlags, |
| 159 | profileFile, profileFd, options, userId); |
| 160 | reply.writeNoException(); |
| 161 | reply.writeInt(result); |
| 162 | return true; |
| 163 | } |
| 164 | |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 165 | case START_ACTIVITY_AND_WAIT_TRANSACTION: |
| 166 | { |
| 167 | data.enforceInterface(IActivityManager.descriptor); |
| 168 | IBinder b = data.readStrongBinder(); |
| 169 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 170 | String callingPackage = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 171 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 172 | String resolvedType = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 173 | IBinder resultTo = data.readStrongBinder(); |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 174 | String resultWho = data.readString(); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 175 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 176 | int startFlags = data.readInt(); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 177 | String profileFile = data.readString(); |
| 178 | ParcelFileDescriptor profileFd = data.readInt() != 0 |
| 179 | ? data.readFileDescriptor() : null; |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 180 | Bundle options = data.readInt() != 0 |
| 181 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 182 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 183 | WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 184 | resultTo, resultWho, requestCode, startFlags, |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 185 | profileFile, profileFd, options, userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 186 | reply.writeNoException(); |
| 187 | result.writeToParcel(reply, 0); |
| 188 | return true; |
| 189 | } |
| 190 | |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 191 | case START_ACTIVITY_WITH_CONFIG_TRANSACTION: |
| 192 | { |
| 193 | data.enforceInterface(IActivityManager.descriptor); |
| 194 | IBinder b = data.readStrongBinder(); |
| 195 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 196 | String callingPackage = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 197 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 198 | String resolvedType = data.readString(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 199 | IBinder resultTo = data.readStrongBinder(); |
| 200 | String resultWho = data.readString(); |
| 201 | int requestCode = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 202 | int startFlags = data.readInt(); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 203 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 204 | Bundle options = data.readInt() != 0 |
| 205 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 206 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 207 | int result = startActivityWithConfig(app, callingPackage, intent, resolvedType, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 208 | resultTo, resultWho, requestCode, startFlags, config, options, userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 209 | reply.writeNoException(); |
| 210 | reply.writeInt(result); |
| 211 | return true; |
| 212 | } |
| 213 | |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 214 | case START_ACTIVITY_INTENT_SENDER_TRANSACTION: |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 215 | { |
| 216 | data.enforceInterface(IActivityManager.descriptor); |
| 217 | IBinder b = data.readStrongBinder(); |
| 218 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 219 | IntentSender intent = IntentSender.CREATOR.createFromParcel(data); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 220 | Intent fillInIntent = null; |
| 221 | if (data.readInt() != 0) { |
| 222 | fillInIntent = Intent.CREATOR.createFromParcel(data); |
| 223 | } |
| 224 | String resolvedType = data.readString(); |
| 225 | IBinder resultTo = data.readStrongBinder(); |
| 226 | String resultWho = data.readString(); |
| 227 | int requestCode = data.readInt(); |
| 228 | int flagsMask = data.readInt(); |
| 229 | int flagsValues = data.readInt(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 230 | Bundle options = data.readInt() != 0 |
| 231 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 232 | int result = startActivityIntentSender(app, intent, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 233 | fillInIntent, resolvedType, resultTo, resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 234 | requestCode, flagsMask, flagsValues, options); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 235 | reply.writeNoException(); |
| 236 | reply.writeInt(result); |
| 237 | return true; |
| 238 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 239 | |
| 240 | case START_NEXT_MATCHING_ACTIVITY_TRANSACTION: |
| 241 | { |
| 242 | data.enforceInterface(IActivityManager.descriptor); |
| 243 | IBinder callingActivity = data.readStrongBinder(); |
| 244 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 245 | Bundle options = data.readInt() != 0 |
| 246 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 247 | boolean result = startNextMatchingActivity(callingActivity, intent, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 248 | reply.writeNoException(); |
| 249 | reply.writeInt(result ? 1 : 0); |
| 250 | return true; |
| 251 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 252 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 253 | case FINISH_ACTIVITY_TRANSACTION: { |
| 254 | data.enforceInterface(IActivityManager.descriptor); |
| 255 | IBinder token = data.readStrongBinder(); |
| 256 | Intent resultData = null; |
| 257 | int resultCode = data.readInt(); |
| 258 | if (data.readInt() != 0) { |
| 259 | resultData = Intent.CREATOR.createFromParcel(data); |
| 260 | } |
| 261 | boolean res = finishActivity(token, resultCode, resultData); |
| 262 | reply.writeNoException(); |
| 263 | reply.writeInt(res ? 1 : 0); |
| 264 | return true; |
| 265 | } |
| 266 | |
| 267 | case FINISH_SUB_ACTIVITY_TRANSACTION: { |
| 268 | data.enforceInterface(IActivityManager.descriptor); |
| 269 | IBinder token = data.readStrongBinder(); |
| 270 | String resultWho = data.readString(); |
| 271 | int requestCode = data.readInt(); |
| 272 | finishSubActivity(token, resultWho, requestCode); |
| 273 | reply.writeNoException(); |
| 274 | return true; |
| 275 | } |
| 276 | |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 277 | case FINISH_ACTIVITY_AFFINITY_TRANSACTION: { |
| 278 | data.enforceInterface(IActivityManager.descriptor); |
| 279 | IBinder token = data.readStrongBinder(); |
| 280 | boolean res = finishActivityAffinity(token); |
| 281 | reply.writeNoException(); |
| 282 | reply.writeInt(res ? 1 : 0); |
| 283 | return true; |
| 284 | } |
| 285 | |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 286 | case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: { |
| 287 | data.enforceInterface(IActivityManager.descriptor); |
| 288 | IBinder token = data.readStrongBinder(); |
| 289 | boolean res = willActivityBeVisible(token); |
| 290 | reply.writeNoException(); |
| 291 | reply.writeInt(res ? 1 : 0); |
| 292 | return true; |
| 293 | } |
| 294 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 295 | case REGISTER_RECEIVER_TRANSACTION: |
| 296 | { |
| 297 | data.enforceInterface(IActivityManager.descriptor); |
| 298 | IBinder b = data.readStrongBinder(); |
| 299 | IApplicationThread app = |
| 300 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 301 | String packageName = data.readString(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 302 | b = data.readStrongBinder(); |
| 303 | IIntentReceiver rec |
| 304 | = b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 305 | IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data); |
| 306 | String perm = data.readString(); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 307 | int userId = data.readInt(); |
| 308 | Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 309 | reply.writeNoException(); |
| 310 | if (intent != null) { |
| 311 | reply.writeInt(1); |
| 312 | intent.writeToParcel(reply, 0); |
| 313 | } else { |
| 314 | reply.writeInt(0); |
| 315 | } |
| 316 | return true; |
| 317 | } |
| 318 | |
| 319 | case UNREGISTER_RECEIVER_TRANSACTION: |
| 320 | { |
| 321 | data.enforceInterface(IActivityManager.descriptor); |
| 322 | IBinder b = data.readStrongBinder(); |
| 323 | if (b == null) { |
| 324 | return true; |
| 325 | } |
| 326 | IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b); |
| 327 | unregisterReceiver(rec); |
| 328 | reply.writeNoException(); |
| 329 | return true; |
| 330 | } |
| 331 | |
| 332 | case BROADCAST_INTENT_TRANSACTION: |
| 333 | { |
| 334 | data.enforceInterface(IActivityManager.descriptor); |
| 335 | IBinder b = data.readStrongBinder(); |
| 336 | IApplicationThread app = |
| 337 | b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 338 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 339 | String resolvedType = data.readString(); |
| 340 | b = data.readStrongBinder(); |
| 341 | IIntentReceiver resultTo = |
| 342 | b != null ? IIntentReceiver.Stub.asInterface(b) : null; |
| 343 | int resultCode = data.readInt(); |
| 344 | String resultData = data.readString(); |
| 345 | Bundle resultExtras = data.readBundle(); |
| 346 | String perm = data.readString(); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 347 | int appOp = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 348 | boolean serialized = data.readInt() != 0; |
| 349 | boolean sticky = data.readInt() != 0; |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 350 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 351 | int res = broadcastIntent(app, intent, resolvedType, resultTo, |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 352 | resultCode, resultData, resultExtras, perm, appOp, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 353 | serialized, sticky, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 354 | reply.writeNoException(); |
| 355 | reply.writeInt(res); |
| 356 | return true; |
| 357 | } |
| 358 | |
| 359 | case UNBROADCAST_INTENT_TRANSACTION: |
| 360 | { |
| 361 | data.enforceInterface(IActivityManager.descriptor); |
| 362 | IBinder b = data.readStrongBinder(); |
| 363 | IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null; |
| 364 | Intent intent = Intent.CREATOR.createFromParcel(data); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 365 | int userId = data.readInt(); |
| 366 | unbroadcastIntent(app, intent, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 367 | reply.writeNoException(); |
| 368 | return true; |
| 369 | } |
| 370 | |
| 371 | case FINISH_RECEIVER_TRANSACTION: { |
| 372 | data.enforceInterface(IActivityManager.descriptor); |
| 373 | IBinder who = data.readStrongBinder(); |
| 374 | int resultCode = data.readInt(); |
| 375 | String resultData = data.readString(); |
| 376 | Bundle resultExtras = data.readBundle(); |
| 377 | boolean resultAbort = data.readInt() != 0; |
| 378 | if (who != null) { |
| 379 | finishReceiver(who, resultCode, resultData, resultExtras, resultAbort); |
| 380 | } |
| 381 | reply.writeNoException(); |
| 382 | return true; |
| 383 | } |
| 384 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 385 | case ATTACH_APPLICATION_TRANSACTION: { |
| 386 | data.enforceInterface(IActivityManager.descriptor); |
| 387 | IApplicationThread app = ApplicationThreadNative.asInterface( |
| 388 | data.readStrongBinder()); |
| 389 | if (app != null) { |
| 390 | attachApplication(app); |
| 391 | } |
| 392 | reply.writeNoException(); |
| 393 | return true; |
| 394 | } |
| 395 | |
| 396 | case ACTIVITY_IDLE_TRANSACTION: { |
| 397 | data.enforceInterface(IActivityManager.descriptor); |
| 398 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 399 | Configuration config = null; |
| 400 | if (data.readInt() != 0) { |
| 401 | config = Configuration.CREATOR.createFromParcel(data); |
| 402 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 403 | boolean stopProfiling = data.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 404 | if (token != null) { |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 405 | activityIdle(token, config, stopProfiling); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 406 | } |
| 407 | reply.writeNoException(); |
| 408 | return true; |
| 409 | } |
| 410 | |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 411 | case ACTIVITY_RESUMED_TRANSACTION: { |
| 412 | data.enforceInterface(IActivityManager.descriptor); |
| 413 | IBinder token = data.readStrongBinder(); |
| 414 | activityResumed(token); |
| 415 | reply.writeNoException(); |
| 416 | return true; |
| 417 | } |
| 418 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 419 | case ACTIVITY_PAUSED_TRANSACTION: { |
| 420 | data.enforceInterface(IActivityManager.descriptor); |
| 421 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 422 | activityPaused(token); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 423 | reply.writeNoException(); |
| 424 | return true; |
| 425 | } |
| 426 | |
| 427 | case ACTIVITY_STOPPED_TRANSACTION: { |
| 428 | data.enforceInterface(IActivityManager.descriptor); |
| 429 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 430 | Bundle map = data.readBundle(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 431 | Bitmap thumbnail = data.readInt() != 0 |
| 432 | ? Bitmap.CREATOR.createFromParcel(data) : null; |
| 433 | CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 434 | activityStopped(token, map, thumbnail, description); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 435 | reply.writeNoException(); |
| 436 | return true; |
| 437 | } |
| 438 | |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 439 | case ACTIVITY_SLEPT_TRANSACTION: { |
| 440 | data.enforceInterface(IActivityManager.descriptor); |
| 441 | IBinder token = data.readStrongBinder(); |
| 442 | activitySlept(token); |
| 443 | reply.writeNoException(); |
| 444 | return true; |
| 445 | } |
| 446 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 447 | case ACTIVITY_DESTROYED_TRANSACTION: { |
| 448 | data.enforceInterface(IActivityManager.descriptor); |
| 449 | IBinder token = data.readStrongBinder(); |
| 450 | activityDestroyed(token); |
| 451 | reply.writeNoException(); |
| 452 | return true; |
| 453 | } |
| 454 | |
| 455 | case GET_CALLING_PACKAGE_TRANSACTION: { |
| 456 | data.enforceInterface(IActivityManager.descriptor); |
| 457 | IBinder token = data.readStrongBinder(); |
| 458 | String res = token != null ? getCallingPackage(token) : null; |
| 459 | reply.writeNoException(); |
| 460 | reply.writeString(res); |
| 461 | return true; |
| 462 | } |
| 463 | |
| 464 | case GET_CALLING_ACTIVITY_TRANSACTION: { |
| 465 | data.enforceInterface(IActivityManager.descriptor); |
| 466 | IBinder token = data.readStrongBinder(); |
| 467 | ComponentName cn = getCallingActivity(token); |
| 468 | reply.writeNoException(); |
| 469 | ComponentName.writeToParcel(cn, reply); |
| 470 | return true; |
| 471 | } |
| 472 | |
| 473 | case GET_TASKS_TRANSACTION: { |
| 474 | data.enforceInterface(IActivityManager.descriptor); |
| 475 | int maxNum = data.readInt(); |
| 476 | int fl = data.readInt(); |
| 477 | IBinder receiverBinder = data.readStrongBinder(); |
| 478 | IThumbnailReceiver receiver = receiverBinder != null |
| 479 | ? IThumbnailReceiver.Stub.asInterface(receiverBinder) |
| 480 | : null; |
| 481 | List list = getTasks(maxNum, fl, receiver); |
| 482 | reply.writeNoException(); |
| 483 | int N = list != null ? list.size() : -1; |
| 484 | reply.writeInt(N); |
| 485 | int i; |
| 486 | for (i=0; i<N; i++) { |
| 487 | ActivityManager.RunningTaskInfo info = |
| 488 | (ActivityManager.RunningTaskInfo)list.get(i); |
| 489 | info.writeToParcel(reply, 0); |
| 490 | } |
| 491 | return true; |
| 492 | } |
| 493 | |
| 494 | case GET_RECENT_TASKS_TRANSACTION: { |
| 495 | data.enforceInterface(IActivityManager.descriptor); |
| 496 | int maxNum = data.readInt(); |
| 497 | int fl = data.readInt(); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 498 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 499 | List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 500 | fl, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 501 | reply.writeNoException(); |
| 502 | reply.writeTypedList(list); |
| 503 | return true; |
| 504 | } |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 505 | |
Dianne Hackborn | f26fd99 | 2011-04-08 18:14:09 -0700 | [diff] [blame] | 506 | case GET_TASK_THUMBNAILS_TRANSACTION: { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 507 | data.enforceInterface(IActivityManager.descriptor); |
| 508 | int id = data.readInt(); |
Dianne Hackborn | f26fd99 | 2011-04-08 18:14:09 -0700 | [diff] [blame] | 509 | ActivityManager.TaskThumbnails bm = getTaskThumbnails(id); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 510 | reply.writeNoException(); |
| 511 | if (bm != null) { |
| 512 | reply.writeInt(1); |
| 513 | bm.writeToParcel(reply, 0); |
| 514 | } else { |
| 515 | reply.writeInt(0); |
| 516 | } |
| 517 | return true; |
| 518 | } |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 519 | |
| 520 | case GET_TASK_TOP_THUMBNAIL_TRANSACTION: { |
| 521 | data.enforceInterface(IActivityManager.descriptor); |
| 522 | int id = data.readInt(); |
| 523 | Bitmap bm = getTaskTopThumbnail(id); |
| 524 | reply.writeNoException(); |
| 525 | if (bm != null) { |
| 526 | reply.writeInt(1); |
| 527 | bm.writeToParcel(reply, 0); |
| 528 | } else { |
| 529 | reply.writeInt(0); |
| 530 | } |
| 531 | return true; |
| 532 | } |
| 533 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 534 | case GET_SERVICES_TRANSACTION: { |
| 535 | data.enforceInterface(IActivityManager.descriptor); |
| 536 | int maxNum = data.readInt(); |
| 537 | int fl = data.readInt(); |
| 538 | List list = getServices(maxNum, fl); |
| 539 | reply.writeNoException(); |
| 540 | int N = list != null ? list.size() : -1; |
| 541 | reply.writeInt(N); |
| 542 | int i; |
| 543 | for (i=0; i<N; i++) { |
| 544 | ActivityManager.RunningServiceInfo info = |
| 545 | (ActivityManager.RunningServiceInfo)list.get(i); |
| 546 | info.writeToParcel(reply, 0); |
| 547 | } |
| 548 | return true; |
| 549 | } |
| 550 | |
| 551 | case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: { |
| 552 | data.enforceInterface(IActivityManager.descriptor); |
| 553 | List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState(); |
| 554 | reply.writeNoException(); |
| 555 | reply.writeTypedList(list); |
| 556 | return true; |
| 557 | } |
| 558 | |
| 559 | case GET_RUNNING_APP_PROCESSES_TRANSACTION: { |
| 560 | data.enforceInterface(IActivityManager.descriptor); |
| 561 | List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses(); |
| 562 | reply.writeNoException(); |
| 563 | reply.writeTypedList(list); |
| 564 | return true; |
| 565 | } |
| 566 | |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 567 | case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: { |
| 568 | data.enforceInterface(IActivityManager.descriptor); |
| 569 | List<ApplicationInfo> list = getRunningExternalApplications(); |
| 570 | reply.writeNoException(); |
| 571 | reply.writeTypedList(list); |
| 572 | return true; |
| 573 | } |
| 574 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 575 | case MOVE_TASK_TO_FRONT_TRANSACTION: { |
| 576 | data.enforceInterface(IActivityManager.descriptor); |
| 577 | int task = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 578 | int fl = data.readInt(); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 579 | Bundle options = data.readInt() != 0 |
| 580 | ? Bundle.CREATOR.createFromParcel(data) : null; |
| 581 | moveTaskToFront(task, fl, options); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 582 | reply.writeNoException(); |
| 583 | return true; |
| 584 | } |
| 585 | |
| 586 | case MOVE_TASK_TO_BACK_TRANSACTION: { |
| 587 | data.enforceInterface(IActivityManager.descriptor); |
| 588 | int task = data.readInt(); |
| 589 | moveTaskToBack(task); |
| 590 | reply.writeNoException(); |
| 591 | return true; |
| 592 | } |
| 593 | |
| 594 | case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: { |
| 595 | data.enforceInterface(IActivityManager.descriptor); |
| 596 | IBinder token = data.readStrongBinder(); |
| 597 | boolean nonRoot = data.readInt() != 0; |
| 598 | boolean res = moveActivityTaskToBack(token, nonRoot); |
| 599 | reply.writeNoException(); |
| 600 | reply.writeInt(res ? 1 : 0); |
| 601 | return true; |
| 602 | } |
| 603 | |
| 604 | case MOVE_TASK_BACKWARDS_TRANSACTION: { |
| 605 | data.enforceInterface(IActivityManager.descriptor); |
| 606 | int task = data.readInt(); |
| 607 | moveTaskBackwards(task); |
| 608 | reply.writeNoException(); |
| 609 | return true; |
| 610 | } |
| 611 | |
| 612 | case GET_TASK_FOR_ACTIVITY_TRANSACTION: { |
| 613 | data.enforceInterface(IActivityManager.descriptor); |
| 614 | IBinder token = data.readStrongBinder(); |
| 615 | boolean onlyRoot = data.readInt() != 0; |
| 616 | int res = token != null |
| 617 | ? getTaskForActivity(token, onlyRoot) : -1; |
| 618 | reply.writeNoException(); |
| 619 | reply.writeInt(res); |
| 620 | return true; |
| 621 | } |
| 622 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 623 | case REPORT_THUMBNAIL_TRANSACTION: { |
| 624 | data.enforceInterface(IActivityManager.descriptor); |
| 625 | IBinder token = data.readStrongBinder(); |
| 626 | Bitmap thumbnail = data.readInt() != 0 |
| 627 | ? Bitmap.CREATOR.createFromParcel(data) : null; |
| 628 | CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
| 629 | reportThumbnail(token, thumbnail, description); |
| 630 | reply.writeNoException(); |
| 631 | return true; |
| 632 | } |
| 633 | |
| 634 | case GET_CONTENT_PROVIDER_TRANSACTION: { |
| 635 | data.enforceInterface(IActivityManager.descriptor); |
| 636 | IBinder b = data.readStrongBinder(); |
| 637 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 638 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 639 | int userId = data.readInt(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 640 | boolean stable = data.readInt() != 0; |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 641 | ContentProviderHolder cph = getContentProvider(app, name, userId, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 642 | reply.writeNoException(); |
| 643 | if (cph != null) { |
| 644 | reply.writeInt(1); |
| 645 | cph.writeToParcel(reply, 0); |
| 646 | } else { |
| 647 | reply.writeInt(0); |
| 648 | } |
| 649 | return true; |
| 650 | } |
| 651 | |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 652 | case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 653 | data.enforceInterface(IActivityManager.descriptor); |
| 654 | String name = data.readString(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 655 | int userId = data.readInt(); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 656 | IBinder token = data.readStrongBinder(); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 657 | ContentProviderHolder cph = getContentProviderExternal(name, userId, token); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 658 | reply.writeNoException(); |
| 659 | if (cph != null) { |
| 660 | reply.writeInt(1); |
| 661 | cph.writeToParcel(reply, 0); |
| 662 | } else { |
| 663 | reply.writeInt(0); |
| 664 | } |
| 665 | return true; |
| 666 | } |
| 667 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 668 | case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: { |
| 669 | data.enforceInterface(IActivityManager.descriptor); |
| 670 | IBinder b = data.readStrongBinder(); |
| 671 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 672 | ArrayList<ContentProviderHolder> providers = |
| 673 | data.createTypedArrayList(ContentProviderHolder.CREATOR); |
| 674 | publishContentProviders(app, providers); |
| 675 | reply.writeNoException(); |
| 676 | return true; |
| 677 | } |
| 678 | |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 679 | case REF_CONTENT_PROVIDER_TRANSACTION: { |
| 680 | data.enforceInterface(IActivityManager.descriptor); |
| 681 | IBinder b = data.readStrongBinder(); |
| 682 | int stable = data.readInt(); |
| 683 | int unstable = data.readInt(); |
| 684 | boolean res = refContentProvider(b, stable, unstable); |
| 685 | reply.writeNoException(); |
| 686 | reply.writeInt(res ? 1 : 0); |
| 687 | return true; |
| 688 | } |
| 689 | |
| 690 | case UNSTABLE_PROVIDER_DIED_TRANSACTION: { |
| 691 | data.enforceInterface(IActivityManager.descriptor); |
| 692 | IBinder b = data.readStrongBinder(); |
| 693 | unstableProviderDied(b); |
| 694 | reply.writeNoException(); |
| 695 | return true; |
| 696 | } |
| 697 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 698 | case REMOVE_CONTENT_PROVIDER_TRANSACTION: { |
| 699 | data.enforceInterface(IActivityManager.descriptor); |
| 700 | IBinder b = data.readStrongBinder(); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 701 | boolean stable = data.readInt() != 0; |
| 702 | removeContentProvider(b, stable); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 703 | reply.writeNoException(); |
| 704 | return true; |
| 705 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 706 | |
| 707 | case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: { |
| 708 | data.enforceInterface(IActivityManager.descriptor); |
| 709 | String name = data.readString(); |
| 710 | IBinder token = data.readStrongBinder(); |
| 711 | removeContentProviderExternal(name, token); |
| 712 | reply.writeNoException(); |
| 713 | return true; |
| 714 | } |
| 715 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 716 | case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: { |
| 717 | data.enforceInterface(IActivityManager.descriptor); |
| 718 | ComponentName comp = ComponentName.CREATOR.createFromParcel(data); |
| 719 | PendingIntent pi = getRunningServiceControlPanel(comp); |
| 720 | reply.writeNoException(); |
| 721 | PendingIntent.writePendingIntentOrNullToParcel(pi, reply); |
| 722 | return true; |
| 723 | } |
| 724 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 725 | case START_SERVICE_TRANSACTION: { |
| 726 | data.enforceInterface(IActivityManager.descriptor); |
| 727 | IBinder b = data.readStrongBinder(); |
| 728 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 729 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 730 | String resolvedType = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 731 | int userId = data.readInt(); |
| 732 | ComponentName cn = startService(app, service, resolvedType, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 733 | reply.writeNoException(); |
| 734 | ComponentName.writeToParcel(cn, reply); |
| 735 | return true; |
| 736 | } |
| 737 | |
| 738 | case STOP_SERVICE_TRANSACTION: { |
| 739 | data.enforceInterface(IActivityManager.descriptor); |
| 740 | IBinder b = data.readStrongBinder(); |
| 741 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 742 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 743 | String resolvedType = data.readString(); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 744 | int userId = data.readInt(); |
| 745 | int res = stopService(app, service, resolvedType, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 746 | reply.writeNoException(); |
| 747 | reply.writeInt(res); |
| 748 | return true; |
| 749 | } |
| 750 | |
| 751 | case STOP_SERVICE_TOKEN_TRANSACTION: { |
| 752 | data.enforceInterface(IActivityManager.descriptor); |
| 753 | ComponentName className = ComponentName.readFromParcel(data); |
| 754 | IBinder token = data.readStrongBinder(); |
| 755 | int startId = data.readInt(); |
| 756 | boolean res = stopServiceToken(className, token, startId); |
| 757 | reply.writeNoException(); |
| 758 | reply.writeInt(res ? 1 : 0); |
| 759 | return true; |
| 760 | } |
| 761 | |
| 762 | case SET_SERVICE_FOREGROUND_TRANSACTION: { |
| 763 | data.enforceInterface(IActivityManager.descriptor); |
| 764 | ComponentName className = ComponentName.readFromParcel(data); |
| 765 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 766 | int id = data.readInt(); |
| 767 | Notification notification = null; |
| 768 | if (data.readInt() != 0) { |
| 769 | notification = Notification.CREATOR.createFromParcel(data); |
| 770 | } |
| 771 | boolean removeNotification = data.readInt() != 0; |
| 772 | setServiceForeground(className, token, id, notification, removeNotification); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 773 | reply.writeNoException(); |
| 774 | return true; |
| 775 | } |
| 776 | |
| 777 | case BIND_SERVICE_TRANSACTION: { |
| 778 | data.enforceInterface(IActivityManager.descriptor); |
| 779 | IBinder b = data.readStrongBinder(); |
| 780 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 781 | IBinder token = data.readStrongBinder(); |
| 782 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 783 | String resolvedType = data.readString(); |
| 784 | b = data.readStrongBinder(); |
| 785 | int fl = data.readInt(); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 786 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 787 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 788 | int res = bindService(app, token, service, resolvedType, conn, fl, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 789 | reply.writeNoException(); |
| 790 | reply.writeInt(res); |
| 791 | return true; |
| 792 | } |
| 793 | |
| 794 | case UNBIND_SERVICE_TRANSACTION: { |
| 795 | data.enforceInterface(IActivityManager.descriptor); |
| 796 | IBinder b = data.readStrongBinder(); |
| 797 | IServiceConnection conn = IServiceConnection.Stub.asInterface(b); |
| 798 | boolean res = unbindService(conn); |
| 799 | reply.writeNoException(); |
| 800 | reply.writeInt(res ? 1 : 0); |
| 801 | return true; |
| 802 | } |
| 803 | |
| 804 | case PUBLISH_SERVICE_TRANSACTION: { |
| 805 | data.enforceInterface(IActivityManager.descriptor); |
| 806 | IBinder token = data.readStrongBinder(); |
| 807 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 808 | IBinder service = data.readStrongBinder(); |
| 809 | publishService(token, intent, service); |
| 810 | reply.writeNoException(); |
| 811 | return true; |
| 812 | } |
| 813 | |
| 814 | case UNBIND_FINISHED_TRANSACTION: { |
| 815 | data.enforceInterface(IActivityManager.descriptor); |
| 816 | IBinder token = data.readStrongBinder(); |
| 817 | Intent intent = Intent.CREATOR.createFromParcel(data); |
| 818 | boolean doRebind = data.readInt() != 0; |
| 819 | unbindFinished(token, intent, doRebind); |
| 820 | reply.writeNoException(); |
| 821 | return true; |
| 822 | } |
| 823 | |
| 824 | case SERVICE_DONE_EXECUTING_TRANSACTION: { |
| 825 | data.enforceInterface(IActivityManager.descriptor); |
| 826 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 827 | int type = data.readInt(); |
| 828 | int startId = data.readInt(); |
| 829 | int res = data.readInt(); |
| 830 | serviceDoneExecuting(token, type, startId, res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 831 | reply.writeNoException(); |
| 832 | return true; |
| 833 | } |
| 834 | |
| 835 | case START_INSTRUMENTATION_TRANSACTION: { |
| 836 | data.enforceInterface(IActivityManager.descriptor); |
| 837 | ComponentName className = ComponentName.readFromParcel(data); |
| 838 | String profileFile = data.readString(); |
| 839 | int fl = data.readInt(); |
| 840 | Bundle arguments = data.readBundle(); |
| 841 | IBinder b = data.readStrongBinder(); |
| 842 | IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 843 | b = data.readStrongBinder(); |
| 844 | IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 845 | int userId = data.readInt(); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 846 | boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 847 | reply.writeNoException(); |
| 848 | reply.writeInt(res ? 1 : 0); |
| 849 | return true; |
| 850 | } |
| 851 | |
| 852 | |
| 853 | case FINISH_INSTRUMENTATION_TRANSACTION: { |
| 854 | data.enforceInterface(IActivityManager.descriptor); |
| 855 | IBinder b = data.readStrongBinder(); |
| 856 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 857 | int resultCode = data.readInt(); |
| 858 | Bundle results = data.readBundle(); |
| 859 | finishInstrumentation(app, resultCode, results); |
| 860 | reply.writeNoException(); |
| 861 | return true; |
| 862 | } |
| 863 | |
| 864 | case GET_CONFIGURATION_TRANSACTION: { |
| 865 | data.enforceInterface(IActivityManager.descriptor); |
| 866 | Configuration config = getConfiguration(); |
| 867 | reply.writeNoException(); |
| 868 | config.writeToParcel(reply, 0); |
| 869 | return true; |
| 870 | } |
| 871 | |
| 872 | case UPDATE_CONFIGURATION_TRANSACTION: { |
| 873 | data.enforceInterface(IActivityManager.descriptor); |
| 874 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 875 | updateConfiguration(config); |
| 876 | reply.writeNoException(); |
| 877 | return true; |
| 878 | } |
| 879 | |
| 880 | case SET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 881 | data.enforceInterface(IActivityManager.descriptor); |
| 882 | IBinder token = data.readStrongBinder(); |
| 883 | int requestedOrientation = data.readInt(); |
| 884 | setRequestedOrientation(token, requestedOrientation); |
| 885 | reply.writeNoException(); |
| 886 | return true; |
| 887 | } |
| 888 | |
| 889 | case GET_REQUESTED_ORIENTATION_TRANSACTION: { |
| 890 | data.enforceInterface(IActivityManager.descriptor); |
| 891 | IBinder token = data.readStrongBinder(); |
| 892 | int req = getRequestedOrientation(token); |
| 893 | reply.writeNoException(); |
| 894 | reply.writeInt(req); |
| 895 | return true; |
| 896 | } |
| 897 | |
| 898 | case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: { |
| 899 | data.enforceInterface(IActivityManager.descriptor); |
| 900 | IBinder token = data.readStrongBinder(); |
| 901 | ComponentName cn = getActivityClassForToken(token); |
| 902 | reply.writeNoException(); |
| 903 | ComponentName.writeToParcel(cn, reply); |
| 904 | return true; |
| 905 | } |
| 906 | |
| 907 | case GET_PACKAGE_FOR_TOKEN_TRANSACTION: { |
| 908 | data.enforceInterface(IActivityManager.descriptor); |
| 909 | IBinder token = data.readStrongBinder(); |
| 910 | reply.writeNoException(); |
| 911 | reply.writeString(getPackageForToken(token)); |
| 912 | return true; |
| 913 | } |
| 914 | |
| 915 | case GET_INTENT_SENDER_TRANSACTION: { |
| 916 | data.enforceInterface(IActivityManager.descriptor); |
| 917 | int type = data.readInt(); |
| 918 | String packageName = data.readString(); |
| 919 | IBinder token = data.readStrongBinder(); |
| 920 | String resultWho = data.readString(); |
| 921 | int requestCode = data.readInt(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 922 | Intent[] requestIntents; |
| 923 | String[] requestResolvedTypes; |
| 924 | if (data.readInt() != 0) { |
| 925 | requestIntents = data.createTypedArray(Intent.CREATOR); |
| 926 | requestResolvedTypes = data.createStringArray(); |
| 927 | } else { |
| 928 | requestIntents = null; |
| 929 | requestResolvedTypes = null; |
| 930 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 931 | int fl = data.readInt(); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 932 | Bundle options = data.readInt() != 0 |
| 933 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 934 | int userId = data.readInt(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 935 | IIntentSender res = getIntentSender(type, packageName, token, |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 936 | resultWho, requestCode, requestIntents, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 937 | requestResolvedTypes, fl, options, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 938 | reply.writeNoException(); |
| 939 | reply.writeStrongBinder(res != null ? res.asBinder() : null); |
| 940 | return true; |
| 941 | } |
| 942 | |
| 943 | case CANCEL_INTENT_SENDER_TRANSACTION: { |
| 944 | data.enforceInterface(IActivityManager.descriptor); |
| 945 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 946 | data.readStrongBinder()); |
| 947 | cancelIntentSender(r); |
| 948 | reply.writeNoException(); |
| 949 | return true; |
| 950 | } |
| 951 | |
| 952 | case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: { |
| 953 | data.enforceInterface(IActivityManager.descriptor); |
| 954 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 955 | data.readStrongBinder()); |
| 956 | String res = getPackageForIntentSender(r); |
| 957 | reply.writeNoException(); |
| 958 | reply.writeString(res); |
| 959 | return true; |
| 960 | } |
| 961 | |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 962 | case GET_UID_FOR_INTENT_SENDER_TRANSACTION: { |
| 963 | data.enforceInterface(IActivityManager.descriptor); |
| 964 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 965 | data.readStrongBinder()); |
| 966 | int res = getUidForIntentSender(r); |
| 967 | reply.writeNoException(); |
| 968 | reply.writeInt(res); |
| 969 | return true; |
| 970 | } |
| 971 | |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 972 | case HANDLE_INCOMING_USER_TRANSACTION: { |
| 973 | data.enforceInterface(IActivityManager.descriptor); |
| 974 | int callingPid = data.readInt(); |
| 975 | int callingUid = data.readInt(); |
| 976 | int userId = data.readInt(); |
| 977 | boolean allowAll = data.readInt() != 0 ; |
| 978 | boolean requireFull = data.readInt() != 0; |
| 979 | String name = data.readString(); |
| 980 | String callerPackage = data.readString(); |
| 981 | int res = handleIncomingUser(callingPid, callingUid, userId, allowAll, |
| 982 | requireFull, name, callerPackage); |
| 983 | reply.writeNoException(); |
| 984 | reply.writeInt(res); |
| 985 | return true; |
| 986 | } |
| 987 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 988 | case SET_PROCESS_LIMIT_TRANSACTION: { |
| 989 | data.enforceInterface(IActivityManager.descriptor); |
| 990 | int max = data.readInt(); |
| 991 | setProcessLimit(max); |
| 992 | reply.writeNoException(); |
| 993 | return true; |
| 994 | } |
| 995 | |
| 996 | case GET_PROCESS_LIMIT_TRANSACTION: { |
| 997 | data.enforceInterface(IActivityManager.descriptor); |
| 998 | int limit = getProcessLimit(); |
| 999 | reply.writeNoException(); |
| 1000 | reply.writeInt(limit); |
| 1001 | return true; |
| 1002 | } |
| 1003 | |
| 1004 | case SET_PROCESS_FOREGROUND_TRANSACTION: { |
| 1005 | data.enforceInterface(IActivityManager.descriptor); |
| 1006 | IBinder token = data.readStrongBinder(); |
| 1007 | int pid = data.readInt(); |
| 1008 | boolean isForeground = data.readInt() != 0; |
| 1009 | setProcessForeground(token, pid, isForeground); |
| 1010 | reply.writeNoException(); |
| 1011 | return true; |
| 1012 | } |
| 1013 | |
| 1014 | case CHECK_PERMISSION_TRANSACTION: { |
| 1015 | data.enforceInterface(IActivityManager.descriptor); |
| 1016 | String perm = data.readString(); |
| 1017 | int pid = data.readInt(); |
| 1018 | int uid = data.readInt(); |
| 1019 | int res = checkPermission(perm, pid, uid); |
| 1020 | reply.writeNoException(); |
| 1021 | reply.writeInt(res); |
| 1022 | return true; |
| 1023 | } |
| 1024 | |
| 1025 | case CHECK_URI_PERMISSION_TRANSACTION: { |
| 1026 | data.enforceInterface(IActivityManager.descriptor); |
| 1027 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1028 | int pid = data.readInt(); |
| 1029 | int uid = data.readInt(); |
| 1030 | int mode = data.readInt(); |
| 1031 | int res = checkUriPermission(uri, pid, uid, mode); |
| 1032 | reply.writeNoException(); |
| 1033 | reply.writeInt(res); |
| 1034 | return true; |
| 1035 | } |
| 1036 | |
| 1037 | case CLEAR_APP_DATA_TRANSACTION: { |
| 1038 | data.enforceInterface(IActivityManager.descriptor); |
| 1039 | String packageName = data.readString(); |
| 1040 | IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface( |
| 1041 | data.readStrongBinder()); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 1042 | int userId = data.readInt(); |
| 1043 | boolean res = clearApplicationUserData(packageName, observer, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1044 | reply.writeNoException(); |
| 1045 | reply.writeInt(res ? 1 : 0); |
| 1046 | return true; |
| 1047 | } |
| 1048 | |
| 1049 | case GRANT_URI_PERMISSION_TRANSACTION: { |
| 1050 | data.enforceInterface(IActivityManager.descriptor); |
| 1051 | IBinder b = data.readStrongBinder(); |
| 1052 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1053 | String targetPkg = data.readString(); |
| 1054 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1055 | int mode = data.readInt(); |
| 1056 | grantUriPermission(app, targetPkg, uri, mode); |
| 1057 | reply.writeNoException(); |
| 1058 | return true; |
| 1059 | } |
| 1060 | |
| 1061 | case REVOKE_URI_PERMISSION_TRANSACTION: { |
| 1062 | data.enforceInterface(IActivityManager.descriptor); |
| 1063 | IBinder b = data.readStrongBinder(); |
| 1064 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1065 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1066 | int mode = data.readInt(); |
| 1067 | revokeUriPermission(app, uri, mode); |
| 1068 | reply.writeNoException(); |
| 1069 | return true; |
| 1070 | } |
| 1071 | |
| 1072 | case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: { |
| 1073 | data.enforceInterface(IActivityManager.descriptor); |
| 1074 | IBinder b = data.readStrongBinder(); |
| 1075 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
| 1076 | boolean waiting = data.readInt() != 0; |
| 1077 | showWaitingForDebugger(app, waiting); |
| 1078 | reply.writeNoException(); |
| 1079 | return true; |
| 1080 | } |
| 1081 | |
| 1082 | case GET_MEMORY_INFO_TRANSACTION: { |
| 1083 | data.enforceInterface(IActivityManager.descriptor); |
| 1084 | ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo(); |
| 1085 | getMemoryInfo(mi); |
| 1086 | reply.writeNoException(); |
| 1087 | mi.writeToParcel(reply, 0); |
| 1088 | return true; |
| 1089 | } |
| 1090 | |
| 1091 | case UNHANDLED_BACK_TRANSACTION: { |
| 1092 | data.enforceInterface(IActivityManager.descriptor); |
| 1093 | unhandledBack(); |
| 1094 | reply.writeNoException(); |
| 1095 | return true; |
| 1096 | } |
| 1097 | |
| 1098 | case OPEN_CONTENT_URI_TRANSACTION: { |
| 1099 | data.enforceInterface(IActivityManager.descriptor); |
| 1100 | Uri uri = Uri.parse(data.readString()); |
| 1101 | ParcelFileDescriptor pfd = openContentUri(uri); |
| 1102 | reply.writeNoException(); |
| 1103 | if (pfd != null) { |
| 1104 | reply.writeInt(1); |
| 1105 | pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1106 | } else { |
| 1107 | reply.writeInt(0); |
| 1108 | } |
| 1109 | return true; |
| 1110 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1111 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1112 | case GOING_TO_SLEEP_TRANSACTION: { |
| 1113 | data.enforceInterface(IActivityManager.descriptor); |
| 1114 | goingToSleep(); |
| 1115 | reply.writeNoException(); |
| 1116 | return true; |
| 1117 | } |
| 1118 | |
| 1119 | case WAKING_UP_TRANSACTION: { |
| 1120 | data.enforceInterface(IActivityManager.descriptor); |
| 1121 | wakingUp(); |
| 1122 | reply.writeNoException(); |
| 1123 | return true; |
| 1124 | } |
| 1125 | |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 1126 | case SET_LOCK_SCREEN_SHOWN_TRANSACTION: { |
| 1127 | data.enforceInterface(IActivityManager.descriptor); |
| 1128 | setLockScreenShown(data.readInt() != 0); |
| 1129 | reply.writeNoException(); |
| 1130 | return true; |
| 1131 | } |
| 1132 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1133 | case SET_DEBUG_APP_TRANSACTION: { |
| 1134 | data.enforceInterface(IActivityManager.descriptor); |
| 1135 | String pn = data.readString(); |
| 1136 | boolean wfd = data.readInt() != 0; |
| 1137 | boolean per = data.readInt() != 0; |
| 1138 | setDebugApp(pn, wfd, per); |
| 1139 | reply.writeNoException(); |
| 1140 | return true; |
| 1141 | } |
| 1142 | |
| 1143 | case SET_ALWAYS_FINISH_TRANSACTION: { |
| 1144 | data.enforceInterface(IActivityManager.descriptor); |
| 1145 | boolean enabled = data.readInt() != 0; |
| 1146 | setAlwaysFinish(enabled); |
| 1147 | reply.writeNoException(); |
| 1148 | return true; |
| 1149 | } |
| 1150 | |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1151 | case SET_ACTIVITY_CONTROLLER_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1152 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1153 | IActivityController watcher = IActivityController.Stub.asInterface( |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1154 | data.readStrongBinder()); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1155 | setActivityController(watcher); |
Sungmin Choi | cdb86bb | 2012-12-20 14:08:59 +0900 | [diff] [blame] | 1156 | reply.writeNoException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1157 | return true; |
| 1158 | } |
| 1159 | |
| 1160 | case ENTER_SAFE_MODE_TRANSACTION: { |
| 1161 | data.enforceInterface(IActivityManager.descriptor); |
| 1162 | enterSafeMode(); |
| 1163 | reply.writeNoException(); |
| 1164 | return true; |
| 1165 | } |
| 1166 | |
| 1167 | case NOTE_WAKEUP_ALARM_TRANSACTION: { |
| 1168 | data.enforceInterface(IActivityManager.descriptor); |
| 1169 | IIntentSender is = IIntentSender.Stub.asInterface( |
| 1170 | data.readStrongBinder()); |
| 1171 | noteWakeupAlarm(is); |
| 1172 | reply.writeNoException(); |
| 1173 | return true; |
| 1174 | } |
| 1175 | |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1176 | case KILL_PIDS_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1177 | data.enforceInterface(IActivityManager.descriptor); |
| 1178 | int[] pids = data.createIntArray(); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 1179 | String reason = data.readString(); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 1180 | boolean secure = data.readInt() != 0; |
| 1181 | boolean res = killPids(pids, reason, secure); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1182 | reply.writeNoException(); |
| 1183 | reply.writeInt(res ? 1 : 0); |
| 1184 | return true; |
| 1185 | } |
| 1186 | |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 1187 | case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: { |
| 1188 | data.enforceInterface(IActivityManager.descriptor); |
| 1189 | String reason = data.readString(); |
| 1190 | boolean res = killProcessesBelowForeground(reason); |
| 1191 | reply.writeNoException(); |
| 1192 | reply.writeInt(res ? 1 : 0); |
| 1193 | return true; |
| 1194 | } |
| 1195 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1196 | case START_RUNNING_TRANSACTION: { |
| 1197 | data.enforceInterface(IActivityManager.descriptor); |
| 1198 | String pkg = data.readString(); |
| 1199 | String cls = data.readString(); |
| 1200 | String action = data.readString(); |
| 1201 | String indata = data.readString(); |
| 1202 | startRunning(pkg, cls, action, indata); |
| 1203 | reply.writeNoException(); |
| 1204 | return true; |
| 1205 | } |
| 1206 | |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1207 | case HANDLE_APPLICATION_CRASH_TRANSACTION: { |
| 1208 | data.enforceInterface(IActivityManager.descriptor); |
| 1209 | IBinder app = data.readStrongBinder(); |
| 1210 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
| 1211 | handleApplicationCrash(app, ci); |
| 1212 | reply.writeNoException(); |
| 1213 | return true; |
| 1214 | } |
| 1215 | |
| 1216 | case HANDLE_APPLICATION_WTF_TRANSACTION: { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1217 | data.enforceInterface(IActivityManager.descriptor); |
| 1218 | IBinder app = data.readStrongBinder(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1219 | String tag = data.readString(); |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1220 | ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1221 | boolean res = handleApplicationWtf(app, tag, ci); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1222 | reply.writeNoException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 1223 | reply.writeInt(res ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1224 | return true; |
| 1225 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 1226 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1227 | case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: { |
| 1228 | data.enforceInterface(IActivityManager.descriptor); |
| 1229 | IBinder app = data.readStrongBinder(); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 1230 | int violationMask = data.readInt(); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 1231 | StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data); |
| 1232 | handleApplicationStrictModeViolation(app, violationMask, info); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 1233 | reply.writeNoException(); |
| 1234 | return true; |
| 1235 | } |
| 1236 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1237 | case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: { |
| 1238 | data.enforceInterface(IActivityManager.descriptor); |
| 1239 | int sig = data.readInt(); |
| 1240 | signalPersistentProcesses(sig); |
| 1241 | reply.writeNoException(); |
| 1242 | return true; |
| 1243 | } |
| 1244 | |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1245 | case KILL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1246 | data.enforceInterface(IActivityManager.descriptor); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1247 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1248 | int userId = data.readInt(); |
| 1249 | killBackgroundProcesses(packageName, userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1250 | reply.writeNoException(); |
| 1251 | return true; |
| 1252 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 1253 | |
| 1254 | case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: { |
| 1255 | data.enforceInterface(IActivityManager.descriptor); |
| 1256 | killAllBackgroundProcesses(); |
| 1257 | reply.writeNoException(); |
| 1258 | return true; |
| 1259 | } |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 1260 | |
| 1261 | case FORCE_STOP_PACKAGE_TRANSACTION: { |
| 1262 | data.enforceInterface(IActivityManager.descriptor); |
| 1263 | String packageName = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1264 | int userId = data.readInt(); |
| 1265 | forceStopPackage(packageName, userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1266 | reply.writeNoException(); |
| 1267 | return true; |
| 1268 | } |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 1269 | |
| 1270 | case GET_MY_MEMORY_STATE_TRANSACTION: { |
| 1271 | data.enforceInterface(IActivityManager.descriptor); |
| 1272 | ActivityManager.RunningAppProcessInfo info = |
| 1273 | new ActivityManager.RunningAppProcessInfo(); |
| 1274 | getMyMemoryState(info); |
| 1275 | reply.writeNoException(); |
| 1276 | info.writeToParcel(reply, 0); |
| 1277 | return true; |
| 1278 | } |
| 1279 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1280 | case GET_DEVICE_CONFIGURATION_TRANSACTION: { |
| 1281 | data.enforceInterface(IActivityManager.descriptor); |
| 1282 | ConfigurationInfo config = getDeviceConfigurationInfo(); |
| 1283 | reply.writeNoException(); |
| 1284 | config.writeToParcel(reply, 0); |
| 1285 | return true; |
| 1286 | } |
| 1287 | |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1288 | case PROFILE_CONTROL_TRANSACTION: { |
| 1289 | data.enforceInterface(IActivityManager.descriptor); |
| 1290 | String process = data.readString(); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1291 | int userId = data.readInt(); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1292 | boolean start = data.readInt() != 0; |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 1293 | int profileType = data.readInt(); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1294 | String path = data.readString(); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 1295 | ParcelFileDescriptor fd = data.readInt() != 0 |
| 1296 | ? data.readFileDescriptor() : null; |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1297 | boolean res = profileControl(process, userId, start, path, fd, profileType); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 1298 | reply.writeNoException(); |
| 1299 | reply.writeInt(res ? 1 : 0); |
| 1300 | return true; |
| 1301 | } |
| 1302 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 1303 | case SHUTDOWN_TRANSACTION: { |
| 1304 | data.enforceInterface(IActivityManager.descriptor); |
| 1305 | boolean res = shutdown(data.readInt()); |
| 1306 | reply.writeNoException(); |
| 1307 | reply.writeInt(res ? 1 : 0); |
| 1308 | return true; |
| 1309 | } |
| 1310 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 1311 | case STOP_APP_SWITCHES_TRANSACTION: { |
| 1312 | data.enforceInterface(IActivityManager.descriptor); |
| 1313 | stopAppSwitches(); |
| 1314 | reply.writeNoException(); |
| 1315 | return true; |
| 1316 | } |
| 1317 | |
| 1318 | case RESUME_APP_SWITCHES_TRANSACTION: { |
| 1319 | data.enforceInterface(IActivityManager.descriptor); |
| 1320 | resumeAppSwitches(); |
| 1321 | reply.writeNoException(); |
| 1322 | return true; |
| 1323 | } |
| 1324 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1325 | case PEEK_SERVICE_TRANSACTION: { |
| 1326 | data.enforceInterface(IActivityManager.descriptor); |
| 1327 | Intent service = Intent.CREATOR.createFromParcel(data); |
| 1328 | String resolvedType = data.readString(); |
| 1329 | IBinder binder = peekService(service, resolvedType); |
| 1330 | reply.writeNoException(); |
| 1331 | reply.writeStrongBinder(binder); |
| 1332 | return true; |
| 1333 | } |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 1334 | |
| 1335 | case START_BACKUP_AGENT_TRANSACTION: { |
| 1336 | data.enforceInterface(IActivityManager.descriptor); |
| 1337 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1338 | int backupRestoreMode = data.readInt(); |
| 1339 | boolean success = bindBackupAgent(info, backupRestoreMode); |
| 1340 | reply.writeNoException(); |
| 1341 | reply.writeInt(success ? 1 : 0); |
| 1342 | return true; |
| 1343 | } |
| 1344 | |
| 1345 | case BACKUP_AGENT_CREATED_TRANSACTION: { |
| 1346 | data.enforceInterface(IActivityManager.descriptor); |
| 1347 | String packageName = data.readString(); |
| 1348 | IBinder agent = data.readStrongBinder(); |
| 1349 | backupAgentCreated(packageName, agent); |
| 1350 | reply.writeNoException(); |
| 1351 | return true; |
| 1352 | } |
| 1353 | |
| 1354 | case UNBIND_BACKUP_AGENT_TRANSACTION: { |
| 1355 | data.enforceInterface(IActivityManager.descriptor); |
| 1356 | ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data); |
| 1357 | unbindBackupAgent(info); |
| 1358 | reply.writeNoException(); |
| 1359 | return true; |
| 1360 | } |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1361 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1362 | case KILL_APPLICATION_WITH_APPID_TRANSACTION: { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1363 | data.enforceInterface(IActivityManager.descriptor); |
| 1364 | String pkg = data.readString(); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1365 | int appid = data.readInt(); |
| 1366 | killApplicationWithAppId(pkg, appid); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 1367 | reply.writeNoException(); |
| 1368 | return true; |
| 1369 | } |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 1370 | |
| 1371 | case CLOSE_SYSTEM_DIALOGS_TRANSACTION: { |
| 1372 | data.enforceInterface(IActivityManager.descriptor); |
| 1373 | String reason = data.readString(); |
| 1374 | closeSystemDialogs(reason); |
| 1375 | reply.writeNoException(); |
| 1376 | return true; |
| 1377 | } |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1378 | |
| 1379 | case GET_PROCESS_MEMORY_INFO_TRANSACTION: { |
| 1380 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1381 | int[] pids = data.createIntArray(); |
| 1382 | Debug.MemoryInfo[] res = getProcessMemoryInfo(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1383 | reply.writeNoException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 1384 | reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 1385 | return true; |
| 1386 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 1387 | |
| 1388 | case KILL_APPLICATION_PROCESS_TRANSACTION: { |
| 1389 | data.enforceInterface(IActivityManager.descriptor); |
| 1390 | String processName = data.readString(); |
| 1391 | int uid = data.readInt(); |
| 1392 | killApplicationProcess(processName, uid); |
| 1393 | reply.writeNoException(); |
| 1394 | return true; |
| 1395 | } |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1396 | |
| 1397 | case OVERRIDE_PENDING_TRANSITION_TRANSACTION: { |
| 1398 | data.enforceInterface(IActivityManager.descriptor); |
| 1399 | IBinder token = data.readStrongBinder(); |
| 1400 | String packageName = data.readString(); |
| 1401 | int enterAnim = data.readInt(); |
| 1402 | int exitAnim = data.readInt(); |
| 1403 | overridePendingTransition(token, packageName, enterAnim, exitAnim); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1404 | reply.writeNoException(); |
| 1405 | return true; |
| 1406 | } |
| 1407 | |
| 1408 | case IS_USER_A_MONKEY_TRANSACTION: { |
| 1409 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1410 | boolean areThey = isUserAMonkey(); |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 1411 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1412 | reply.writeInt(areThey ? 1 : 0); |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 1413 | return true; |
| 1414 | } |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 1415 | |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 1416 | case SET_USER_IS_MONKEY_TRANSACTION: { |
| 1417 | data.enforceInterface(IActivityManager.descriptor); |
| 1418 | final boolean monkey = (data.readInt() == 1); |
| 1419 | setUserIsMonkey(monkey); |
| 1420 | reply.writeNoException(); |
| 1421 | return true; |
| 1422 | } |
| 1423 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 1424 | case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: { |
| 1425 | data.enforceInterface(IActivityManager.descriptor); |
| 1426 | finishHeavyWeightApp(); |
| 1427 | reply.writeNoException(); |
| 1428 | return true; |
| 1429 | } |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1430 | |
| 1431 | case IS_IMMERSIVE_TRANSACTION: { |
| 1432 | data.enforceInterface(IActivityManager.descriptor); |
| 1433 | IBinder token = data.readStrongBinder(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1434 | boolean isit = isImmersive(token); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1435 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1436 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1437 | return true; |
| 1438 | } |
| 1439 | |
| 1440 | case SET_IMMERSIVE_TRANSACTION: { |
| 1441 | data.enforceInterface(IActivityManager.descriptor); |
| 1442 | IBinder token = data.readStrongBinder(); |
| 1443 | boolean imm = data.readInt() == 1; |
| 1444 | setImmersive(token, imm); |
| 1445 | reply.writeNoException(); |
| 1446 | return true; |
| 1447 | } |
| 1448 | |
| 1449 | case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: { |
| 1450 | data.enforceInterface(IActivityManager.descriptor); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1451 | boolean isit = isTopActivityImmersive(); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1452 | reply.writeNoException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1453 | reply.writeInt(isit ? 1 : 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 1454 | return true; |
| 1455 | } |
| 1456 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1457 | case CRASH_APPLICATION_TRANSACTION: { |
| 1458 | data.enforceInterface(IActivityManager.descriptor); |
| 1459 | int uid = data.readInt(); |
| 1460 | int initialPid = data.readInt(); |
| 1461 | String packageName = data.readString(); |
| 1462 | String message = data.readString(); |
| 1463 | crashApplication(uid, initialPid, packageName, message); |
| 1464 | reply.writeNoException(); |
| 1465 | return true; |
| 1466 | } |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1467 | |
| 1468 | case GET_PROVIDER_MIME_TYPE_TRANSACTION: { |
| 1469 | data.enforceInterface(IActivityManager.descriptor); |
| 1470 | Uri uri = Uri.CREATOR.createFromParcel(data); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1471 | int userId = data.readInt(); |
| 1472 | String type = getProviderMimeType(uri, userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 1473 | reply.writeNoException(); |
| 1474 | reply.writeString(type); |
| 1475 | return true; |
| 1476 | } |
| 1477 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 1478 | case NEW_URI_PERMISSION_OWNER_TRANSACTION: { |
| 1479 | data.enforceInterface(IActivityManager.descriptor); |
| 1480 | String name = data.readString(); |
| 1481 | IBinder perm = newUriPermissionOwner(name); |
| 1482 | reply.writeNoException(); |
| 1483 | reply.writeStrongBinder(perm); |
| 1484 | return true; |
| 1485 | } |
| 1486 | |
| 1487 | case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1488 | data.enforceInterface(IActivityManager.descriptor); |
| 1489 | IBinder owner = data.readStrongBinder(); |
| 1490 | int fromUid = data.readInt(); |
| 1491 | String targetPkg = data.readString(); |
| 1492 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1493 | int mode = data.readInt(); |
| 1494 | grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode); |
| 1495 | reply.writeNoException(); |
| 1496 | return true; |
| 1497 | } |
| 1498 | |
| 1499 | case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: { |
| 1500 | data.enforceInterface(IActivityManager.descriptor); |
| 1501 | IBinder owner = data.readStrongBinder(); |
| 1502 | Uri uri = null; |
| 1503 | if (data.readInt() != 0) { |
| 1504 | Uri.CREATOR.createFromParcel(data); |
| 1505 | } |
| 1506 | int mode = data.readInt(); |
| 1507 | revokeUriPermissionFromOwner(owner, uri, mode); |
| 1508 | reply.writeNoException(); |
| 1509 | return true; |
| 1510 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 1511 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 1512 | case CHECK_GRANT_URI_PERMISSION_TRANSACTION: { |
| 1513 | data.enforceInterface(IActivityManager.descriptor); |
| 1514 | int callingUid = data.readInt(); |
| 1515 | String targetPkg = data.readString(); |
| 1516 | Uri uri = Uri.CREATOR.createFromParcel(data); |
| 1517 | int modeFlags = data.readInt(); |
| 1518 | int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags); |
| 1519 | reply.writeNoException(); |
| 1520 | reply.writeInt(res); |
| 1521 | return true; |
| 1522 | } |
| 1523 | |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1524 | case DUMP_HEAP_TRANSACTION: { |
| 1525 | data.enforceInterface(IActivityManager.descriptor); |
| 1526 | String process = data.readString(); |
Dianne Hackborn | b12e135 | 2012-09-26 11:39:20 -0700 | [diff] [blame] | 1527 | int userId = data.readInt(); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1528 | boolean managed = data.readInt() != 0; |
| 1529 | String path = data.readString(); |
| 1530 | ParcelFileDescriptor fd = data.readInt() != 0 |
| 1531 | ? data.readFileDescriptor() : null; |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 1532 | boolean res = dumpHeap(process, userId, managed, path, fd); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 1533 | reply.writeNoException(); |
| 1534 | reply.writeInt(res ? 1 : 0); |
| 1535 | return true; |
| 1536 | } |
| 1537 | |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1538 | case START_ACTIVITIES_TRANSACTION: |
| 1539 | { |
| 1540 | data.enforceInterface(IActivityManager.descriptor); |
| 1541 | IBinder b = data.readStrongBinder(); |
| 1542 | IApplicationThread app = ApplicationThreadNative.asInterface(b); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 1543 | String callingPackage = data.readString(); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1544 | Intent[] intents = data.createTypedArray(Intent.CREATOR); |
| 1545 | String[] resolvedTypes = data.createStringArray(); |
| 1546 | IBinder resultTo = data.readStrongBinder(); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 1547 | Bundle options = data.readInt() != 0 |
| 1548 | ? Bundle.CREATOR.createFromParcel(data) : null; |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 1549 | int userId = data.readInt(); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 1550 | int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 1551 | options, userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 1552 | reply.writeNoException(); |
| 1553 | reply.writeInt(result); |
| 1554 | return true; |
| 1555 | } |
| 1556 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 1557 | case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 1558 | { |
| 1559 | data.enforceInterface(IActivityManager.descriptor); |
| 1560 | int mode = getFrontActivityScreenCompatMode(); |
| 1561 | reply.writeNoException(); |
| 1562 | reply.writeInt(mode); |
| 1563 | return true; |
| 1564 | } |
| 1565 | |
| 1566 | case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION: |
| 1567 | { |
| 1568 | data.enforceInterface(IActivityManager.descriptor); |
| 1569 | int mode = data.readInt(); |
| 1570 | setFrontActivityScreenCompatMode(mode); |
| 1571 | reply.writeNoException(); |
| 1572 | reply.writeInt(mode); |
| 1573 | return true; |
| 1574 | } |
| 1575 | |
| 1576 | case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 1577 | { |
| 1578 | data.enforceInterface(IActivityManager.descriptor); |
| 1579 | String pkg = data.readString(); |
| 1580 | int mode = getPackageScreenCompatMode(pkg); |
| 1581 | reply.writeNoException(); |
| 1582 | reply.writeInt(mode); |
| 1583 | return true; |
| 1584 | } |
| 1585 | |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 1586 | case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION: |
| 1587 | { |
| 1588 | data.enforceInterface(IActivityManager.descriptor); |
| 1589 | String pkg = data.readString(); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 1590 | int mode = data.readInt(); |
| 1591 | setPackageScreenCompatMode(pkg, mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 1592 | reply.writeNoException(); |
| 1593 | return true; |
| 1594 | } |
Dianne Hackborn | aa9d84c | 2011-05-09 19:00:59 -0700 | [diff] [blame] | 1595 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1596 | case SWITCH_USER_TRANSACTION: { |
| 1597 | data.enforceInterface(IActivityManager.descriptor); |
| 1598 | int userid = data.readInt(); |
| 1599 | boolean result = switchUser(userid); |
| 1600 | reply.writeNoException(); |
| 1601 | reply.writeInt(result ? 1 : 0); |
| 1602 | return true; |
| 1603 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 1604 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 1605 | case STOP_USER_TRANSACTION: { |
| 1606 | data.enforceInterface(IActivityManager.descriptor); |
| 1607 | int userid = data.readInt(); |
| 1608 | IStopUserCallback callback = IStopUserCallback.Stub.asInterface( |
| 1609 | data.readStrongBinder()); |
| 1610 | int result = stopUser(userid, callback); |
| 1611 | reply.writeNoException(); |
| 1612 | reply.writeInt(result); |
| 1613 | return true; |
| 1614 | } |
| 1615 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 1616 | case GET_CURRENT_USER_TRANSACTION: { |
| 1617 | data.enforceInterface(IActivityManager.descriptor); |
| 1618 | UserInfo userInfo = getCurrentUser(); |
| 1619 | reply.writeNoException(); |
| 1620 | userInfo.writeToParcel(reply, 0); |
| 1621 | return true; |
| 1622 | } |
| 1623 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1624 | case IS_USER_RUNNING_TRANSACTION: { |
| 1625 | data.enforceInterface(IActivityManager.descriptor); |
| 1626 | int userid = data.readInt(); |
Dianne Hackborn | a8a9bd6 | 2012-10-09 15:36:59 -0700 | [diff] [blame] | 1627 | boolean orStopping = data.readInt() != 0; |
| 1628 | boolean result = isUserRunning(userid, orStopping); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1629 | reply.writeNoException(); |
| 1630 | reply.writeInt(result ? 1 : 0); |
| 1631 | return true; |
| 1632 | } |
| 1633 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 1634 | case GET_RUNNING_USER_IDS_TRANSACTION: { |
| 1635 | data.enforceInterface(IActivityManager.descriptor); |
| 1636 | int[] result = getRunningUserIds(); |
| 1637 | reply.writeNoException(); |
| 1638 | reply.writeIntArray(result); |
| 1639 | return true; |
| 1640 | } |
| 1641 | |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 1642 | case REMOVE_SUB_TASK_TRANSACTION: |
| 1643 | { |
| 1644 | data.enforceInterface(IActivityManager.descriptor); |
| 1645 | int taskId = data.readInt(); |
| 1646 | int subTaskIndex = data.readInt(); |
| 1647 | boolean result = removeSubTask(taskId, subTaskIndex); |
| 1648 | reply.writeNoException(); |
| 1649 | reply.writeInt(result ? 1 : 0); |
| 1650 | return true; |
| 1651 | } |
| 1652 | |
| 1653 | case REMOVE_TASK_TRANSACTION: |
| 1654 | { |
| 1655 | data.enforceInterface(IActivityManager.descriptor); |
| 1656 | int taskId = data.readInt(); |
| 1657 | int fl = data.readInt(); |
| 1658 | boolean result = removeTask(taskId, fl); |
| 1659 | reply.writeNoException(); |
| 1660 | reply.writeInt(result ? 1 : 0); |
| 1661 | return true; |
| 1662 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1663 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 1664 | case REGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 1665 | data.enforceInterface(IActivityManager.descriptor); |
| 1666 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 1667 | data.readStrongBinder()); |
| 1668 | registerProcessObserver(observer); |
| 1669 | return true; |
| 1670 | } |
| 1671 | |
| 1672 | case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: { |
| 1673 | data.enforceInterface(IActivityManager.descriptor); |
| 1674 | IProcessObserver observer = IProcessObserver.Stub.asInterface( |
| 1675 | data.readStrongBinder()); |
| 1676 | unregisterProcessObserver(observer); |
| 1677 | return true; |
| 1678 | } |
| 1679 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 1680 | case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 1681 | { |
| 1682 | data.enforceInterface(IActivityManager.descriptor); |
| 1683 | String pkg = data.readString(); |
| 1684 | boolean ask = getPackageAskScreenCompat(pkg); |
| 1685 | reply.writeNoException(); |
| 1686 | reply.writeInt(ask ? 1 : 0); |
| 1687 | return true; |
| 1688 | } |
| 1689 | |
| 1690 | case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION: |
| 1691 | { |
| 1692 | data.enforceInterface(IActivityManager.descriptor); |
| 1693 | String pkg = data.readString(); |
| 1694 | boolean ask = data.readInt() != 0; |
| 1695 | setPackageAskScreenCompat(pkg, ask); |
| 1696 | reply.writeNoException(); |
| 1697 | return true; |
| 1698 | } |
| 1699 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 1700 | case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: { |
| 1701 | data.enforceInterface(IActivityManager.descriptor); |
| 1702 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1703 | data.readStrongBinder()); |
| 1704 | boolean res = isIntentSenderTargetedToPackage(r); |
| 1705 | reply.writeNoException(); |
| 1706 | reply.writeInt(res ? 1 : 0); |
| 1707 | return true; |
| 1708 | } |
| 1709 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 1710 | case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: { |
| 1711 | data.enforceInterface(IActivityManager.descriptor); |
| 1712 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1713 | data.readStrongBinder()); |
| 1714 | boolean res = isIntentSenderAnActivity(r); |
| 1715 | reply.writeNoException(); |
| 1716 | reply.writeInt(res ? 1 : 0); |
| 1717 | return true; |
| 1718 | } |
| 1719 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 1720 | case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: { |
| 1721 | data.enforceInterface(IActivityManager.descriptor); |
| 1722 | IIntentSender r = IIntentSender.Stub.asInterface( |
| 1723 | data.readStrongBinder()); |
| 1724 | Intent intent = getIntentForIntentSender(r); |
| 1725 | reply.writeNoException(); |
| 1726 | if (intent != null) { |
| 1727 | reply.writeInt(1); |
| 1728 | intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1729 | } else { |
| 1730 | reply.writeInt(0); |
| 1731 | } |
| 1732 | return true; |
| 1733 | } |
| 1734 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 1735 | case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: { |
| 1736 | data.enforceInterface(IActivityManager.descriptor); |
| 1737 | Configuration config = Configuration.CREATOR.createFromParcel(data); |
| 1738 | updatePersistentConfiguration(config); |
| 1739 | reply.writeNoException(); |
| 1740 | return true; |
| 1741 | } |
| 1742 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 1743 | case GET_PROCESS_PSS_TRANSACTION: { |
| 1744 | data.enforceInterface(IActivityManager.descriptor); |
| 1745 | int[] pids = data.createIntArray(); |
| 1746 | long[] pss = getProcessPss(pids); |
| 1747 | reply.writeNoException(); |
| 1748 | reply.writeLongArray(pss); |
| 1749 | return true; |
| 1750 | } |
| 1751 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 1752 | case SHOW_BOOT_MESSAGE_TRANSACTION: { |
| 1753 | data.enforceInterface(IActivityManager.descriptor); |
| 1754 | CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data); |
| 1755 | boolean always = data.readInt() != 0; |
| 1756 | showBootMessage(msg, always); |
| 1757 | reply.writeNoException(); |
| 1758 | return true; |
| 1759 | } |
| 1760 | |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 1761 | case DISMISS_KEYGUARD_ON_NEXT_ACTIVITY_TRANSACTION: { |
| 1762 | data.enforceInterface(IActivityManager.descriptor); |
| 1763 | dismissKeyguardOnNextActivity(); |
| 1764 | reply.writeNoException(); |
| 1765 | return true; |
| 1766 | } |
| 1767 | |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 1768 | case TARGET_TASK_AFFINITY_MATCHES_ACTIVITY_TRANSACTION: { |
| 1769 | data.enforceInterface(IActivityManager.descriptor); |
| 1770 | IBinder token = data.readStrongBinder(); |
| 1771 | String destAffinity = data.readString(); |
| 1772 | boolean res = targetTaskAffinityMatchesActivity(token, destAffinity); |
| 1773 | reply.writeNoException(); |
| 1774 | reply.writeInt(res ? 1 : 0); |
| 1775 | return true; |
| 1776 | } |
| 1777 | |
| 1778 | case NAVIGATE_UP_TO_TRANSACTION: { |
| 1779 | data.enforceInterface(IActivityManager.descriptor); |
| 1780 | IBinder token = data.readStrongBinder(); |
| 1781 | Intent target = Intent.CREATOR.createFromParcel(data); |
| 1782 | int resultCode = data.readInt(); |
| 1783 | Intent resultData = null; |
| 1784 | if (data.readInt() != 0) { |
| 1785 | resultData = Intent.CREATOR.createFromParcel(data); |
| 1786 | } |
| 1787 | boolean res = navigateUpTo(token, target, resultCode, resultData); |
| 1788 | reply.writeNoException(); |
| 1789 | reply.writeInt(res ? 1 : 0); |
| 1790 | return true; |
| 1791 | } |
| 1792 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 1793 | case GET_LAUNCHED_FROM_UID_TRANSACTION: { |
| 1794 | data.enforceInterface(IActivityManager.descriptor); |
| 1795 | IBinder token = data.readStrongBinder(); |
| 1796 | int res = getLaunchedFromUid(token); |
| 1797 | reply.writeNoException(); |
| 1798 | reply.writeInt(res); |
| 1799 | return true; |
| 1800 | } |
| 1801 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 1802 | case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: { |
| 1803 | data.enforceInterface(IActivityManager.descriptor); |
| 1804 | IBinder token = data.readStrongBinder(); |
| 1805 | String res = getLaunchedFromPackage(token); |
| 1806 | reply.writeNoException(); |
| 1807 | reply.writeString(res); |
| 1808 | return true; |
| 1809 | } |
| 1810 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 1811 | case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 1812 | data.enforceInterface(IActivityManager.descriptor); |
| 1813 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 1814 | data.readStrongBinder()); |
| 1815 | registerUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 1816 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 1817 | return true; |
| 1818 | } |
| 1819 | |
| 1820 | case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: { |
| 1821 | data.enforceInterface(IActivityManager.descriptor); |
| 1822 | IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface( |
| 1823 | data.readStrongBinder()); |
| 1824 | unregisterUserSwitchObserver(observer); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 1825 | reply.writeNoException(); |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 1826 | return true; |
| 1827 | } |
| 1828 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 1829 | case REQUEST_BUG_REPORT_TRANSACTION: { |
| 1830 | data.enforceInterface(IActivityManager.descriptor); |
| 1831 | requestBugReport(); |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 1832 | reply.writeNoException(); |
| 1833 | return true; |
| 1834 | } |
| 1835 | |
| 1836 | case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: { |
| 1837 | data.enforceInterface(IActivityManager.descriptor); |
| 1838 | int pid = data.readInt(); |
| 1839 | boolean aboveSystem = data.readInt() != 0; |
| 1840 | long res = inputDispatchingTimedOut(pid, aboveSystem); |
| 1841 | reply.writeNoException(); |
| 1842 | reply.writeLong(res); |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 1843 | return true; |
| 1844 | } |
| 1845 | |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 1846 | case GET_TOP_ACTIVITY_EXTRAS_TRANSACTION: { |
| 1847 | data.enforceInterface(IActivityManager.descriptor); |
| 1848 | int requestType = data.readInt(); |
| 1849 | Bundle res = getTopActivityExtras(requestType); |
| 1850 | reply.writeNoException(); |
| 1851 | reply.writeBundle(res); |
| 1852 | return true; |
| 1853 | } |
| 1854 | |
| 1855 | case REPORT_TOP_ACTIVITY_EXTRAS_TRANSACTION: { |
| 1856 | data.enforceInterface(IActivityManager.descriptor); |
| 1857 | IBinder token = data.readStrongBinder(); |
| 1858 | Bundle extras = data.readBundle(); |
| 1859 | reportTopActivityExtras(token, extras); |
| 1860 | reply.writeNoException(); |
| 1861 | return true; |
| 1862 | } |
| 1863 | |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 1864 | case KILL_UID_TRANSACTION: { |
| 1865 | data.enforceInterface(IActivityManager.descriptor); |
| 1866 | int uid = data.readInt(); |
| 1867 | String reason = data.readString(); |
| 1868 | killUid(uid, reason); |
| 1869 | reply.writeNoException(); |
| 1870 | return true; |
| 1871 | } |
| 1872 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 1873 | case HANG_TRANSACTION: { |
| 1874 | data.enforceInterface(IActivityManager.descriptor); |
| 1875 | IBinder who = data.readStrongBinder(); |
| 1876 | boolean allowRestart = data.readInt() != 0; |
| 1877 | hang(who, allowRestart); |
| 1878 | reply.writeNoException(); |
| 1879 | return true; |
| 1880 | } |
| 1881 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1882 | } |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 1883 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1884 | return super.onTransact(code, data, reply, flags); |
| 1885 | } |
| 1886 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 1887 | public IBinder asBinder() { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1888 | return this; |
| 1889 | } |
| 1890 | |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 1891 | private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() { |
| 1892 | protected IActivityManager create() { |
| 1893 | IBinder b = ServiceManager.getService("activity"); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 1894 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 1895 | Log.v("ActivityManager", "default service binder = " + b); |
| 1896 | } |
| 1897 | IActivityManager am = asInterface(b); |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 1898 | if (false) { |
Brad Fitzpatrick | 663f4f3 | 2010-11-23 19:15:24 -0800 | [diff] [blame] | 1899 | Log.v("ActivityManager", "default service = " + am); |
| 1900 | } |
| 1901 | return am; |
| 1902 | } |
| 1903 | }; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1904 | } |
| 1905 | |
| 1906 | class ActivityManagerProxy implements IActivityManager |
| 1907 | { |
| 1908 | public ActivityManagerProxy(IBinder remote) |
| 1909 | { |
| 1910 | mRemote = remote; |
| 1911 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 1912 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1913 | public IBinder asBinder() |
| 1914 | { |
| 1915 | return mRemote; |
| 1916 | } |
Siva Velusamy | 92a8b22 | 2012-03-09 16:24:04 -0800 | [diff] [blame] | 1917 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 1918 | public int startActivity(IApplicationThread caller, String callingPackage, Intent intent, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 1919 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
| 1920 | int startFlags, String profileFile, |
| 1921 | ParcelFileDescriptor profileFd, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1922 | Parcel data = Parcel.obtain(); |
| 1923 | Parcel reply = Parcel.obtain(); |
| 1924 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 1925 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 1926 | data.writeString(callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1927 | intent.writeToParcel(data, 0); |
| 1928 | data.writeString(resolvedType); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1929 | data.writeStrongBinder(resultTo); |
| 1930 | data.writeString(resultWho); |
| 1931 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 1932 | data.writeInt(startFlags); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 1933 | data.writeString(profileFile); |
| 1934 | if (profileFd != null) { |
| 1935 | data.writeInt(1); |
| 1936 | profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1937 | } else { |
| 1938 | data.writeInt(0); |
| 1939 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 1940 | if (options != null) { |
| 1941 | data.writeInt(1); |
| 1942 | options.writeToParcel(data, 0); |
| 1943 | } else { |
| 1944 | data.writeInt(0); |
| 1945 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1946 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 1947 | reply.readException(); |
| 1948 | int result = reply.readInt(); |
| 1949 | reply.recycle(); |
| 1950 | data.recycle(); |
| 1951 | return result; |
| 1952 | } |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 1953 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 1954 | public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 1955 | String resolvedType, IBinder resultTo, String resultWho, int requestCode, |
| 1956 | int startFlags, String profileFile, |
| 1957 | ParcelFileDescriptor profileFd, Bundle options, int userId) throws RemoteException { |
| 1958 | Parcel data = Parcel.obtain(); |
| 1959 | Parcel reply = Parcel.obtain(); |
| 1960 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 1961 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 1962 | data.writeString(callingPackage); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 1963 | intent.writeToParcel(data, 0); |
| 1964 | data.writeString(resolvedType); |
| 1965 | data.writeStrongBinder(resultTo); |
| 1966 | data.writeString(resultWho); |
| 1967 | data.writeInt(requestCode); |
| 1968 | data.writeInt(startFlags); |
| 1969 | data.writeString(profileFile); |
| 1970 | if (profileFd != null) { |
| 1971 | data.writeInt(1); |
| 1972 | profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 1973 | } else { |
| 1974 | data.writeInt(0); |
| 1975 | } |
| 1976 | if (options != null) { |
| 1977 | data.writeInt(1); |
| 1978 | options.writeToParcel(data, 0); |
| 1979 | } else { |
| 1980 | data.writeInt(0); |
| 1981 | } |
| 1982 | data.writeInt(userId); |
| 1983 | mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0); |
| 1984 | reply.readException(); |
| 1985 | int result = reply.readInt(); |
| 1986 | reply.recycle(); |
| 1987 | data.recycle(); |
| 1988 | return result; |
| 1989 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 1990 | public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage, |
| 1991 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 1992 | int requestCode, int startFlags, String profileFile, |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 1993 | ParcelFileDescriptor profileFd, Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 1994 | Parcel data = Parcel.obtain(); |
| 1995 | Parcel reply = Parcel.obtain(); |
| 1996 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 1997 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 1998 | data.writeString(callingPackage); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 1999 | intent.writeToParcel(data, 0); |
| 2000 | data.writeString(resolvedType); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2001 | data.writeStrongBinder(resultTo); |
| 2002 | data.writeString(resultWho); |
| 2003 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2004 | data.writeInt(startFlags); |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2005 | data.writeString(profileFile); |
| 2006 | if (profileFd != null) { |
| 2007 | data.writeInt(1); |
| 2008 | profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 2009 | } else { |
| 2010 | data.writeInt(0); |
| 2011 | } |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2012 | if (options != null) { |
| 2013 | data.writeInt(1); |
| 2014 | options.writeToParcel(data, 0); |
| 2015 | } else { |
| 2016 | data.writeInt(0); |
| 2017 | } |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2018 | data.writeInt(userId); |
Dianne Hackborn | 8f7f35e | 2010-02-25 18:48:12 -0800 | [diff] [blame] | 2019 | mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0); |
| 2020 | reply.readException(); |
| 2021 | WaitResult result = WaitResult.CREATOR.createFromParcel(reply); |
| 2022 | reply.recycle(); |
| 2023 | data.recycle(); |
| 2024 | return result; |
| 2025 | } |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2026 | public int startActivityWithConfig(IApplicationThread caller, String callingPackage, |
| 2027 | Intent intent, String resolvedType, IBinder resultTo, String resultWho, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2028 | int requestCode, int startFlags, Configuration config, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 2029 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2030 | Parcel data = Parcel.obtain(); |
| 2031 | Parcel reply = Parcel.obtain(); |
| 2032 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2033 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 2034 | data.writeString(callingPackage); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2035 | intent.writeToParcel(data, 0); |
| 2036 | data.writeString(resolvedType); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2037 | data.writeStrongBinder(resultTo); |
| 2038 | data.writeString(resultWho); |
| 2039 | data.writeInt(requestCode); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2040 | data.writeInt(startFlags); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2041 | config.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2042 | if (options != null) { |
| 2043 | data.writeInt(1); |
| 2044 | options.writeToParcel(data, 0); |
| 2045 | } else { |
| 2046 | data.writeInt(0); |
| 2047 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 2048 | data.writeInt(userId); |
Dianne Hackborn | 2ccda4d | 2010-03-22 21:49:15 -0700 | [diff] [blame] | 2049 | mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2050 | reply.readException(); |
| 2051 | int result = reply.readInt(); |
| 2052 | reply.recycle(); |
| 2053 | data.recycle(); |
| 2054 | return result; |
| 2055 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 2056 | public int startActivityIntentSender(IApplicationThread caller, |
| 2057 | IntentSender intent, Intent fillInIntent, String resolvedType, |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2058 | IBinder resultTo, String resultWho, int requestCode, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2059 | int flagsMask, int flagsValues, Bundle options) throws RemoteException { |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2060 | Parcel data = Parcel.obtain(); |
| 2061 | Parcel reply = Parcel.obtain(); |
| 2062 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2063 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2064 | intent.writeToParcel(data, 0); |
| 2065 | if (fillInIntent != null) { |
| 2066 | data.writeInt(1); |
| 2067 | fillInIntent.writeToParcel(data, 0); |
| 2068 | } else { |
| 2069 | data.writeInt(0); |
| 2070 | } |
| 2071 | data.writeString(resolvedType); |
| 2072 | data.writeStrongBinder(resultTo); |
| 2073 | data.writeString(resultWho); |
| 2074 | data.writeInt(requestCode); |
| 2075 | data.writeInt(flagsMask); |
| 2076 | data.writeInt(flagsValues); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2077 | if (options != null) { |
| 2078 | data.writeInt(1); |
| 2079 | options.writeToParcel(data, 0); |
| 2080 | } else { |
| 2081 | data.writeInt(0); |
| 2082 | } |
Dianne Hackborn | fa82f22 | 2009-09-17 15:14:12 -0700 | [diff] [blame] | 2083 | mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0); |
Dianne Hackborn | bcbcaa7 | 2009-09-10 10:54:46 -0700 | [diff] [blame] | 2084 | reply.readException(); |
| 2085 | int result = reply.readInt(); |
| 2086 | reply.recycle(); |
| 2087 | data.recycle(); |
| 2088 | return result; |
| 2089 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2090 | public boolean startNextMatchingActivity(IBinder callingActivity, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2091 | Intent intent, Bundle options) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2092 | Parcel data = Parcel.obtain(); |
| 2093 | Parcel reply = Parcel.obtain(); |
| 2094 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2095 | data.writeStrongBinder(callingActivity); |
| 2096 | intent.writeToParcel(data, 0); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 2097 | if (options != null) { |
| 2098 | data.writeInt(1); |
| 2099 | options.writeToParcel(data, 0); |
| 2100 | } else { |
| 2101 | data.writeInt(0); |
| 2102 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2103 | mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2104 | reply.readException(); |
| 2105 | int result = reply.readInt(); |
| 2106 | reply.recycle(); |
| 2107 | data.recycle(); |
| 2108 | return result != 0; |
| 2109 | } |
| 2110 | public boolean finishActivity(IBinder token, int resultCode, Intent resultData) |
| 2111 | throws RemoteException { |
| 2112 | Parcel data = Parcel.obtain(); |
| 2113 | Parcel reply = Parcel.obtain(); |
| 2114 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2115 | data.writeStrongBinder(token); |
| 2116 | data.writeInt(resultCode); |
| 2117 | if (resultData != null) { |
| 2118 | data.writeInt(1); |
| 2119 | resultData.writeToParcel(data, 0); |
| 2120 | } else { |
| 2121 | data.writeInt(0); |
| 2122 | } |
| 2123 | mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2124 | reply.readException(); |
| 2125 | boolean res = reply.readInt() != 0; |
| 2126 | data.recycle(); |
| 2127 | reply.recycle(); |
| 2128 | return res; |
| 2129 | } |
| 2130 | public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException |
| 2131 | { |
| 2132 | Parcel data = Parcel.obtain(); |
| 2133 | Parcel reply = Parcel.obtain(); |
| 2134 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2135 | data.writeStrongBinder(token); |
| 2136 | data.writeString(resultWho); |
| 2137 | data.writeInt(requestCode); |
| 2138 | mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2139 | reply.readException(); |
| 2140 | data.recycle(); |
| 2141 | reply.recycle(); |
| 2142 | } |
Dianne Hackborn | ecc5a9c | 2012-04-26 18:56:09 -0700 | [diff] [blame] | 2143 | public boolean finishActivityAffinity(IBinder token) throws RemoteException { |
| 2144 | Parcel data = Parcel.obtain(); |
| 2145 | Parcel reply = Parcel.obtain(); |
| 2146 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2147 | data.writeStrongBinder(token); |
| 2148 | mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0); |
| 2149 | reply.readException(); |
| 2150 | boolean res = reply.readInt() != 0; |
| 2151 | data.recycle(); |
| 2152 | reply.recycle(); |
| 2153 | return res; |
| 2154 | } |
Dianne Hackborn | 061d58a | 2010-03-12 15:07:06 -0800 | [diff] [blame] | 2155 | public boolean willActivityBeVisible(IBinder token) throws RemoteException { |
| 2156 | Parcel data = Parcel.obtain(); |
| 2157 | Parcel reply = Parcel.obtain(); |
| 2158 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2159 | data.writeStrongBinder(token); |
| 2160 | mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0); |
| 2161 | reply.readException(); |
| 2162 | boolean res = reply.readInt() != 0; |
| 2163 | data.recycle(); |
| 2164 | reply.recycle(); |
| 2165 | return res; |
| 2166 | } |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2167 | public Intent registerReceiver(IApplicationThread caller, String packageName, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2168 | IIntentReceiver receiver, |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 2169 | IntentFilter filter, String perm, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2170 | { |
| 2171 | Parcel data = Parcel.obtain(); |
| 2172 | Parcel reply = Parcel.obtain(); |
| 2173 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2174 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 2175 | data.writeString(packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2176 | data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); |
| 2177 | filter.writeToParcel(data, 0); |
| 2178 | data.writeString(perm); |
Dianne Hackborn | 20e8098 | 2012-08-31 19:00:44 -0700 | [diff] [blame] | 2179 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2180 | mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 2181 | reply.readException(); |
| 2182 | Intent intent = null; |
| 2183 | int haveIntent = reply.readInt(); |
| 2184 | if (haveIntent != 0) { |
| 2185 | intent = Intent.CREATOR.createFromParcel(reply); |
| 2186 | } |
| 2187 | reply.recycle(); |
| 2188 | data.recycle(); |
| 2189 | return intent; |
| 2190 | } |
| 2191 | public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException |
| 2192 | { |
| 2193 | Parcel data = Parcel.obtain(); |
| 2194 | Parcel reply = Parcel.obtain(); |
| 2195 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2196 | data.writeStrongBinder(receiver.asBinder()); |
| 2197 | mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0); |
| 2198 | reply.readException(); |
| 2199 | data.recycle(); |
| 2200 | reply.recycle(); |
| 2201 | } |
| 2202 | public int broadcastIntent(IApplicationThread caller, |
| 2203 | Intent intent, String resolvedType, IIntentReceiver resultTo, |
| 2204 | int resultCode, String resultData, Bundle map, |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 2205 | String requiredPermission, int appOp, boolean serialized, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 2206 | boolean sticky, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2207 | { |
| 2208 | Parcel data = Parcel.obtain(); |
| 2209 | Parcel reply = Parcel.obtain(); |
| 2210 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2211 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2212 | intent.writeToParcel(data, 0); |
| 2213 | data.writeString(resolvedType); |
| 2214 | data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null); |
| 2215 | data.writeInt(resultCode); |
| 2216 | data.writeString(resultData); |
| 2217 | data.writeBundle(map); |
| 2218 | data.writeString(requiredPermission); |
Dianne Hackborn | f51f612 | 2013-02-04 18:23:34 -0800 | [diff] [blame] | 2219 | data.writeInt(appOp); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2220 | data.writeInt(serialized ? 1 : 0); |
| 2221 | data.writeInt(sticky ? 1 : 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 2222 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2223 | mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 2224 | reply.readException(); |
| 2225 | int res = reply.readInt(); |
| 2226 | reply.recycle(); |
| 2227 | data.recycle(); |
| 2228 | return res; |
| 2229 | } |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 2230 | public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId) |
| 2231 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2232 | { |
| 2233 | Parcel data = Parcel.obtain(); |
| 2234 | Parcel reply = Parcel.obtain(); |
| 2235 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2236 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2237 | intent.writeToParcel(data, 0); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 2238 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2239 | mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0); |
| 2240 | reply.readException(); |
| 2241 | data.recycle(); |
| 2242 | reply.recycle(); |
| 2243 | } |
| 2244 | public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, boolean abortBroadcast) throws RemoteException |
| 2245 | { |
| 2246 | Parcel data = Parcel.obtain(); |
| 2247 | Parcel reply = Parcel.obtain(); |
| 2248 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2249 | data.writeStrongBinder(who); |
| 2250 | data.writeInt(resultCode); |
| 2251 | data.writeString(resultData); |
| 2252 | data.writeBundle(map); |
| 2253 | data.writeInt(abortBroadcast ? 1 : 0); |
| 2254 | mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2255 | reply.readException(); |
| 2256 | data.recycle(); |
| 2257 | reply.recycle(); |
| 2258 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2259 | public void attachApplication(IApplicationThread app) throws RemoteException |
| 2260 | { |
| 2261 | Parcel data = Parcel.obtain(); |
| 2262 | Parcel reply = Parcel.obtain(); |
| 2263 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2264 | data.writeStrongBinder(app.asBinder()); |
| 2265 | mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0); |
| 2266 | reply.readException(); |
| 2267 | data.recycle(); |
| 2268 | reply.recycle(); |
| 2269 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2270 | public void activityIdle(IBinder token, Configuration config, boolean stopProfiling) |
| 2271 | throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2272 | { |
| 2273 | Parcel data = Parcel.obtain(); |
| 2274 | Parcel reply = Parcel.obtain(); |
| 2275 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2276 | data.writeStrongBinder(token); |
Dianne Hackborn | e88846e | 2009-09-30 21:34:25 -0700 | [diff] [blame] | 2277 | if (config != null) { |
| 2278 | data.writeInt(1); |
| 2279 | config.writeToParcel(data, 0); |
| 2280 | } else { |
| 2281 | data.writeInt(0); |
| 2282 | } |
Dianne Hackborn | 62f20ec | 2011-08-15 17:40:28 -0700 | [diff] [blame] | 2283 | data.writeInt(stopProfiling ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2284 | mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2285 | reply.readException(); |
| 2286 | data.recycle(); |
| 2287 | reply.recycle(); |
| 2288 | } |
Dianne Hackborn | ad9b3211 | 2012-09-17 15:35:01 -0700 | [diff] [blame] | 2289 | public void activityResumed(IBinder token) throws RemoteException |
| 2290 | { |
| 2291 | Parcel data = Parcel.obtain(); |
| 2292 | Parcel reply = Parcel.obtain(); |
| 2293 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2294 | data.writeStrongBinder(token); |
| 2295 | mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0); |
| 2296 | reply.readException(); |
| 2297 | data.recycle(); |
| 2298 | reply.recycle(); |
| 2299 | } |
Dianne Hackborn | 0aae2d4 | 2010-12-07 23:51:29 -0800 | [diff] [blame] | 2300 | public void activityPaused(IBinder token) throws RemoteException |
| 2301 | { |
| 2302 | Parcel data = Parcel.obtain(); |
| 2303 | Parcel reply = Parcel.obtain(); |
| 2304 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2305 | data.writeStrongBinder(token); |
| 2306 | mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0); |
| 2307 | reply.readException(); |
| 2308 | data.recycle(); |
| 2309 | reply.recycle(); |
| 2310 | } |
| 2311 | public void activityStopped(IBinder token, Bundle state, |
| 2312 | Bitmap thumbnail, CharSequence description) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2313 | { |
| 2314 | Parcel data = Parcel.obtain(); |
| 2315 | Parcel reply = Parcel.obtain(); |
| 2316 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2317 | data.writeStrongBinder(token); |
| 2318 | data.writeBundle(state); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2319 | if (thumbnail != null) { |
| 2320 | data.writeInt(1); |
| 2321 | thumbnail.writeToParcel(data, 0); |
| 2322 | } else { |
| 2323 | data.writeInt(0); |
| 2324 | } |
| 2325 | TextUtils.writeToParcel(description, data, 0); |
| 2326 | mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2327 | reply.readException(); |
| 2328 | data.recycle(); |
| 2329 | reply.recycle(); |
| 2330 | } |
Dianne Hackborn | 4eba96b | 2011-01-21 13:34:36 -0800 | [diff] [blame] | 2331 | public void activitySlept(IBinder token) throws RemoteException |
| 2332 | { |
| 2333 | Parcel data = Parcel.obtain(); |
| 2334 | Parcel reply = Parcel.obtain(); |
| 2335 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2336 | data.writeStrongBinder(token); |
| 2337 | mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2338 | reply.readException(); |
| 2339 | data.recycle(); |
| 2340 | reply.recycle(); |
| 2341 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2342 | public void activityDestroyed(IBinder token) throws RemoteException |
| 2343 | { |
| 2344 | Parcel data = Parcel.obtain(); |
| 2345 | Parcel reply = Parcel.obtain(); |
| 2346 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2347 | data.writeStrongBinder(token); |
| 2348 | mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2349 | reply.readException(); |
| 2350 | data.recycle(); |
| 2351 | reply.recycle(); |
| 2352 | } |
| 2353 | public String getCallingPackage(IBinder token) throws RemoteException |
| 2354 | { |
| 2355 | Parcel data = Parcel.obtain(); |
| 2356 | Parcel reply = Parcel.obtain(); |
| 2357 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2358 | data.writeStrongBinder(token); |
| 2359 | mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0); |
| 2360 | reply.readException(); |
| 2361 | String res = reply.readString(); |
| 2362 | data.recycle(); |
| 2363 | reply.recycle(); |
| 2364 | return res; |
| 2365 | } |
| 2366 | public ComponentName getCallingActivity(IBinder token) |
| 2367 | throws RemoteException { |
| 2368 | Parcel data = Parcel.obtain(); |
| 2369 | Parcel reply = Parcel.obtain(); |
| 2370 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2371 | data.writeStrongBinder(token); |
| 2372 | mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2373 | reply.readException(); |
| 2374 | ComponentName res = ComponentName.readFromParcel(reply); |
| 2375 | data.recycle(); |
| 2376 | reply.recycle(); |
| 2377 | return res; |
| 2378 | } |
| 2379 | public List getTasks(int maxNum, int flags, |
| 2380 | IThumbnailReceiver receiver) throws RemoteException { |
| 2381 | Parcel data = Parcel.obtain(); |
| 2382 | Parcel reply = Parcel.obtain(); |
| 2383 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2384 | data.writeInt(maxNum); |
| 2385 | data.writeInt(flags); |
| 2386 | data.writeStrongBinder(receiver != null ? receiver.asBinder() : null); |
| 2387 | mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0); |
| 2388 | reply.readException(); |
| 2389 | ArrayList list = null; |
| 2390 | int N = reply.readInt(); |
| 2391 | if (N >= 0) { |
| 2392 | list = new ArrayList(); |
| 2393 | while (N > 0) { |
| 2394 | ActivityManager.RunningTaskInfo info = |
| 2395 | ActivityManager.RunningTaskInfo.CREATOR |
| 2396 | .createFromParcel(reply); |
| 2397 | list.add(info); |
| 2398 | N--; |
| 2399 | } |
| 2400 | } |
| 2401 | data.recycle(); |
| 2402 | reply.recycle(); |
| 2403 | return list; |
| 2404 | } |
| 2405 | public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum, |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2406 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2407 | Parcel data = Parcel.obtain(); |
| 2408 | Parcel reply = Parcel.obtain(); |
| 2409 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2410 | data.writeInt(maxNum); |
| 2411 | data.writeInt(flags); |
Amith Yamasani | 8264408 | 2012-08-03 13:09:11 -0700 | [diff] [blame] | 2412 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2413 | mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0); |
| 2414 | reply.readException(); |
| 2415 | ArrayList<ActivityManager.RecentTaskInfo> list |
| 2416 | = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR); |
| 2417 | data.recycle(); |
| 2418 | reply.recycle(); |
| 2419 | return list; |
| 2420 | } |
Dianne Hackborn | f26fd99 | 2011-04-08 18:14:09 -0700 | [diff] [blame] | 2421 | public ActivityManager.TaskThumbnails getTaskThumbnails(int id) throws RemoteException { |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 2422 | Parcel data = Parcel.obtain(); |
| 2423 | Parcel reply = Parcel.obtain(); |
| 2424 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2425 | data.writeInt(id); |
Dianne Hackborn | f26fd99 | 2011-04-08 18:14:09 -0700 | [diff] [blame] | 2426 | mRemote.transact(GET_TASK_THUMBNAILS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 2427 | reply.readException(); |
Dianne Hackborn | f26fd99 | 2011-04-08 18:14:09 -0700 | [diff] [blame] | 2428 | ActivityManager.TaskThumbnails bm = null; |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 2429 | if (reply.readInt() != 0) { |
Dianne Hackborn | f26fd99 | 2011-04-08 18:14:09 -0700 | [diff] [blame] | 2430 | bm = ActivityManager.TaskThumbnails.CREATOR.createFromParcel(reply); |
Dianne Hackborn | d94df45 | 2011-02-16 18:53:31 -0800 | [diff] [blame] | 2431 | } |
| 2432 | data.recycle(); |
| 2433 | reply.recycle(); |
| 2434 | return bm; |
| 2435 | } |
Dianne Hackborn | 15491c6 | 2012-09-19 10:59:14 -0700 | [diff] [blame] | 2436 | public Bitmap getTaskTopThumbnail(int id) throws RemoteException { |
| 2437 | Parcel data = Parcel.obtain(); |
| 2438 | Parcel reply = Parcel.obtain(); |
| 2439 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2440 | data.writeInt(id); |
| 2441 | mRemote.transact(GET_TASK_TOP_THUMBNAIL_TRANSACTION, data, reply, 0); |
| 2442 | reply.readException(); |
| 2443 | Bitmap bm = null; |
| 2444 | if (reply.readInt() != 0) { |
| 2445 | bm = Bitmap.CREATOR.createFromParcel(reply); |
| 2446 | } |
| 2447 | data.recycle(); |
| 2448 | reply.recycle(); |
| 2449 | return bm; |
| 2450 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2451 | public List getServices(int maxNum, int flags) throws RemoteException { |
| 2452 | Parcel data = Parcel.obtain(); |
| 2453 | Parcel reply = Parcel.obtain(); |
| 2454 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2455 | data.writeInt(maxNum); |
| 2456 | data.writeInt(flags); |
| 2457 | mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0); |
| 2458 | reply.readException(); |
| 2459 | ArrayList list = null; |
| 2460 | int N = reply.readInt(); |
| 2461 | if (N >= 0) { |
| 2462 | list = new ArrayList(); |
| 2463 | while (N > 0) { |
| 2464 | ActivityManager.RunningServiceInfo info = |
| 2465 | ActivityManager.RunningServiceInfo.CREATOR |
| 2466 | .createFromParcel(reply); |
| 2467 | list.add(info); |
| 2468 | N--; |
| 2469 | } |
| 2470 | } |
| 2471 | data.recycle(); |
| 2472 | reply.recycle(); |
| 2473 | return list; |
| 2474 | } |
| 2475 | public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState() |
| 2476 | throws RemoteException { |
| 2477 | Parcel data = Parcel.obtain(); |
| 2478 | Parcel reply = Parcel.obtain(); |
| 2479 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2480 | mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0); |
| 2481 | reply.readException(); |
| 2482 | ArrayList<ActivityManager.ProcessErrorStateInfo> list |
| 2483 | = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR); |
| 2484 | data.recycle(); |
| 2485 | reply.recycle(); |
| 2486 | return list; |
| 2487 | } |
| 2488 | public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses() |
| 2489 | throws RemoteException { |
| 2490 | Parcel data = Parcel.obtain(); |
| 2491 | Parcel reply = Parcel.obtain(); |
| 2492 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2493 | mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0); |
| 2494 | reply.readException(); |
| 2495 | ArrayList<ActivityManager.RunningAppProcessInfo> list |
| 2496 | = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR); |
| 2497 | data.recycle(); |
| 2498 | reply.recycle(); |
| 2499 | return list; |
| 2500 | } |
Suchi Amalapurapu | f7f5dda | 2010-03-23 10:34:28 -0700 | [diff] [blame] | 2501 | public List<ApplicationInfo> getRunningExternalApplications() |
| 2502 | throws RemoteException { |
| 2503 | Parcel data = Parcel.obtain(); |
| 2504 | Parcel reply = Parcel.obtain(); |
| 2505 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2506 | mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0); |
| 2507 | reply.readException(); |
| 2508 | ArrayList<ApplicationInfo> list |
| 2509 | = reply.createTypedArrayList(ApplicationInfo.CREATOR); |
| 2510 | data.recycle(); |
| 2511 | reply.recycle(); |
| 2512 | return list; |
| 2513 | } |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 2514 | public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2515 | { |
| 2516 | Parcel data = Parcel.obtain(); |
| 2517 | Parcel reply = Parcel.obtain(); |
| 2518 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2519 | data.writeInt(task); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 2520 | data.writeInt(flags); |
Dianne Hackborn | 8078d8c | 2012-03-20 11:11:26 -0700 | [diff] [blame] | 2521 | if (options != null) { |
| 2522 | data.writeInt(1); |
| 2523 | options.writeToParcel(data, 0); |
| 2524 | } else { |
| 2525 | data.writeInt(0); |
| 2526 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2527 | mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0); |
| 2528 | reply.readException(); |
| 2529 | data.recycle(); |
| 2530 | reply.recycle(); |
| 2531 | } |
| 2532 | public void moveTaskToBack(int task) throws RemoteException |
| 2533 | { |
| 2534 | Parcel data = Parcel.obtain(); |
| 2535 | Parcel reply = Parcel.obtain(); |
| 2536 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2537 | data.writeInt(task); |
| 2538 | mRemote.transact(MOVE_TASK_TO_BACK_TRANSACTION, data, reply, 0); |
| 2539 | reply.readException(); |
| 2540 | data.recycle(); |
| 2541 | reply.recycle(); |
| 2542 | } |
| 2543 | public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot) |
| 2544 | throws RemoteException { |
| 2545 | Parcel data = Parcel.obtain(); |
| 2546 | Parcel reply = Parcel.obtain(); |
| 2547 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2548 | data.writeStrongBinder(token); |
| 2549 | data.writeInt(nonRoot ? 1 : 0); |
| 2550 | mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0); |
| 2551 | reply.readException(); |
| 2552 | boolean res = reply.readInt() != 0; |
| 2553 | data.recycle(); |
| 2554 | reply.recycle(); |
| 2555 | return res; |
| 2556 | } |
| 2557 | public void moveTaskBackwards(int task) throws RemoteException |
| 2558 | { |
| 2559 | Parcel data = Parcel.obtain(); |
| 2560 | Parcel reply = Parcel.obtain(); |
| 2561 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2562 | data.writeInt(task); |
| 2563 | mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0); |
| 2564 | reply.readException(); |
| 2565 | data.recycle(); |
| 2566 | reply.recycle(); |
| 2567 | } |
| 2568 | public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException |
| 2569 | { |
| 2570 | Parcel data = Parcel.obtain(); |
| 2571 | Parcel reply = Parcel.obtain(); |
| 2572 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2573 | data.writeStrongBinder(token); |
| 2574 | data.writeInt(onlyRoot ? 1 : 0); |
| 2575 | mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0); |
| 2576 | reply.readException(); |
| 2577 | int res = reply.readInt(); |
| 2578 | data.recycle(); |
| 2579 | reply.recycle(); |
| 2580 | return res; |
| 2581 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2582 | public void reportThumbnail(IBinder token, |
| 2583 | Bitmap thumbnail, CharSequence description) throws RemoteException |
| 2584 | { |
| 2585 | Parcel data = Parcel.obtain(); |
| 2586 | Parcel reply = Parcel.obtain(); |
| 2587 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2588 | data.writeStrongBinder(token); |
| 2589 | if (thumbnail != null) { |
| 2590 | data.writeInt(1); |
| 2591 | thumbnail.writeToParcel(data, 0); |
| 2592 | } else { |
| 2593 | data.writeInt(0); |
| 2594 | } |
| 2595 | TextUtils.writeToParcel(description, data, 0); |
| 2596 | mRemote.transact(REPORT_THUMBNAIL_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2597 | reply.readException(); |
| 2598 | data.recycle(); |
| 2599 | reply.recycle(); |
| 2600 | } |
| 2601 | public ContentProviderHolder getContentProvider(IApplicationThread caller, |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 2602 | String name, int userId, boolean stable) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2603 | Parcel data = Parcel.obtain(); |
| 2604 | Parcel reply = Parcel.obtain(); |
| 2605 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2606 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2607 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 2608 | data.writeInt(userId); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 2609 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2610 | mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 2611 | reply.readException(); |
| 2612 | int res = reply.readInt(); |
| 2613 | ContentProviderHolder cph = null; |
| 2614 | if (res != 0) { |
| 2615 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 2616 | } |
| 2617 | data.recycle(); |
| 2618 | reply.recycle(); |
| 2619 | return cph; |
| 2620 | } |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 2621 | public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token) |
| 2622 | throws RemoteException { |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 2623 | Parcel data = Parcel.obtain(); |
| 2624 | Parcel reply = Parcel.obtain(); |
| 2625 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2626 | data.writeString(name); |
Jeff Sharkey | 6d51571 | 2012-09-20 16:06:08 -0700 | [diff] [blame] | 2627 | data.writeInt(userId); |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 2628 | data.writeStrongBinder(token); |
| 2629 | mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 2630 | reply.readException(); |
| 2631 | int res = reply.readInt(); |
| 2632 | ContentProviderHolder cph = null; |
| 2633 | if (res != 0) { |
| 2634 | cph = ContentProviderHolder.CREATOR.createFromParcel(reply); |
| 2635 | } |
| 2636 | data.recycle(); |
| 2637 | reply.recycle(); |
| 2638 | return cph; |
| 2639 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2640 | public void publishContentProviders(IApplicationThread caller, |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 2641 | List<ContentProviderHolder> providers) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2642 | { |
| 2643 | Parcel data = Parcel.obtain(); |
| 2644 | Parcel reply = Parcel.obtain(); |
| 2645 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2646 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2647 | data.writeTypedList(providers); |
| 2648 | mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0); |
| 2649 | reply.readException(); |
| 2650 | data.recycle(); |
| 2651 | reply.recycle(); |
| 2652 | } |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 2653 | public boolean refContentProvider(IBinder connection, int stable, int unstable) |
| 2654 | throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2655 | Parcel data = Parcel.obtain(); |
| 2656 | Parcel reply = Parcel.obtain(); |
| 2657 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 6ae8d18 | 2012-05-23 13:12:42 -0700 | [diff] [blame] | 2658 | data.writeStrongBinder(connection); |
| 2659 | data.writeInt(stable); |
| 2660 | data.writeInt(unstable); |
| 2661 | mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 2662 | reply.readException(); |
| 2663 | boolean res = reply.readInt() != 0; |
| 2664 | data.recycle(); |
| 2665 | reply.recycle(); |
| 2666 | return res; |
| 2667 | } |
| 2668 | public void unstableProviderDied(IBinder connection) throws RemoteException { |
| 2669 | Parcel data = Parcel.obtain(); |
| 2670 | Parcel reply = Parcel.obtain(); |
| 2671 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2672 | data.writeStrongBinder(connection); |
| 2673 | mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0); |
| 2674 | reply.readException(); |
| 2675 | data.recycle(); |
| 2676 | reply.recycle(); |
| 2677 | } |
| 2678 | |
| 2679 | public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException { |
| 2680 | Parcel data = Parcel.obtain(); |
| 2681 | Parcel reply = Parcel.obtain(); |
| 2682 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2683 | data.writeStrongBinder(connection); |
| 2684 | data.writeInt(stable ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2685 | mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0); |
| 2686 | reply.readException(); |
| 2687 | data.recycle(); |
| 2688 | reply.recycle(); |
| 2689 | } |
Svetoslav Ganov | 25872aa | 2012-02-03 19:19:09 -0800 | [diff] [blame] | 2690 | |
| 2691 | public void removeContentProviderExternal(String name, IBinder token) throws RemoteException { |
| 2692 | Parcel data = Parcel.obtain(); |
| 2693 | Parcel reply = Parcel.obtain(); |
| 2694 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2695 | data.writeString(name); |
| 2696 | data.writeStrongBinder(token); |
| 2697 | mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0); |
| 2698 | reply.readException(); |
| 2699 | data.recycle(); |
| 2700 | reply.recycle(); |
| 2701 | } |
| 2702 | |
Dianne Hackborn | dd9b82c | 2009-09-03 00:18:47 -0700 | [diff] [blame] | 2703 | public PendingIntent getRunningServiceControlPanel(ComponentName service) |
| 2704 | throws RemoteException |
| 2705 | { |
| 2706 | Parcel data = Parcel.obtain(); |
| 2707 | Parcel reply = Parcel.obtain(); |
| 2708 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2709 | service.writeToParcel(data, 0); |
| 2710 | mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0); |
| 2711 | reply.readException(); |
| 2712 | PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply); |
| 2713 | data.recycle(); |
| 2714 | reply.recycle(); |
| 2715 | return res; |
| 2716 | } |
| 2717 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2718 | public ComponentName startService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 2719 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2720 | { |
| 2721 | Parcel data = Parcel.obtain(); |
| 2722 | Parcel reply = Parcel.obtain(); |
| 2723 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2724 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2725 | service.writeToParcel(data, 0); |
| 2726 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 2727 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2728 | mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0); |
| 2729 | reply.readException(); |
| 2730 | ComponentName res = ComponentName.readFromParcel(reply); |
| 2731 | data.recycle(); |
| 2732 | reply.recycle(); |
| 2733 | return res; |
| 2734 | } |
| 2735 | public int stopService(IApplicationThread caller, Intent service, |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 2736 | String resolvedType, int userId) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2737 | { |
| 2738 | Parcel data = Parcel.obtain(); |
| 2739 | Parcel reply = Parcel.obtain(); |
| 2740 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2741 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2742 | service.writeToParcel(data, 0); |
| 2743 | data.writeString(resolvedType); |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 2744 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2745 | mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0); |
| 2746 | reply.readException(); |
| 2747 | int res = reply.readInt(); |
| 2748 | reply.recycle(); |
| 2749 | data.recycle(); |
| 2750 | return res; |
| 2751 | } |
| 2752 | public boolean stopServiceToken(ComponentName className, IBinder token, |
| 2753 | int startId) throws RemoteException { |
| 2754 | Parcel data = Parcel.obtain(); |
| 2755 | Parcel reply = Parcel.obtain(); |
| 2756 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2757 | ComponentName.writeToParcel(className, data); |
| 2758 | data.writeStrongBinder(token); |
| 2759 | data.writeInt(startId); |
| 2760 | mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0); |
| 2761 | reply.readException(); |
| 2762 | boolean res = reply.readInt() != 0; |
| 2763 | data.recycle(); |
| 2764 | reply.recycle(); |
| 2765 | return res; |
| 2766 | } |
| 2767 | public void setServiceForeground(ComponentName className, IBinder token, |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 2768 | int id, Notification notification, boolean removeNotification) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2769 | Parcel data = Parcel.obtain(); |
| 2770 | Parcel reply = Parcel.obtain(); |
| 2771 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2772 | ComponentName.writeToParcel(className, data); |
| 2773 | data.writeStrongBinder(token); |
Dianne Hackborn | d8a43f6 | 2009-08-17 23:33:56 -0700 | [diff] [blame] | 2774 | data.writeInt(id); |
| 2775 | if (notification != null) { |
| 2776 | data.writeInt(1); |
| 2777 | notification.writeToParcel(data, 0); |
| 2778 | } else { |
| 2779 | data.writeInt(0); |
| 2780 | } |
| 2781 | data.writeInt(removeNotification ? 1 : 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2782 | mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0); |
| 2783 | reply.readException(); |
| 2784 | data.recycle(); |
| 2785 | reply.recycle(); |
| 2786 | } |
| 2787 | public int bindService(IApplicationThread caller, IBinder token, |
| 2788 | Intent service, String resolvedType, IServiceConnection connection, |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 2789 | int flags, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2790 | Parcel data = Parcel.obtain(); |
| 2791 | Parcel reply = Parcel.obtain(); |
| 2792 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2793 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
| 2794 | data.writeStrongBinder(token); |
| 2795 | service.writeToParcel(data, 0); |
| 2796 | data.writeString(resolvedType); |
| 2797 | data.writeStrongBinder(connection.asBinder()); |
| 2798 | data.writeInt(flags); |
Amith Yamasani | 37ce3a8 | 2012-02-06 12:04:42 -0800 | [diff] [blame] | 2799 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2800 | mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0); |
| 2801 | reply.readException(); |
| 2802 | int res = reply.readInt(); |
| 2803 | data.recycle(); |
| 2804 | reply.recycle(); |
| 2805 | return res; |
| 2806 | } |
| 2807 | public boolean unbindService(IServiceConnection connection) throws RemoteException |
| 2808 | { |
| 2809 | Parcel data = Parcel.obtain(); |
| 2810 | Parcel reply = Parcel.obtain(); |
| 2811 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2812 | data.writeStrongBinder(connection.asBinder()); |
| 2813 | mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0); |
| 2814 | reply.readException(); |
| 2815 | boolean res = reply.readInt() != 0; |
| 2816 | data.recycle(); |
| 2817 | reply.recycle(); |
| 2818 | return res; |
| 2819 | } |
| 2820 | |
| 2821 | public void publishService(IBinder token, |
| 2822 | Intent intent, IBinder service) throws RemoteException { |
| 2823 | Parcel data = Parcel.obtain(); |
| 2824 | Parcel reply = Parcel.obtain(); |
| 2825 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2826 | data.writeStrongBinder(token); |
| 2827 | intent.writeToParcel(data, 0); |
| 2828 | data.writeStrongBinder(service); |
| 2829 | mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0); |
| 2830 | reply.readException(); |
| 2831 | data.recycle(); |
| 2832 | reply.recycle(); |
| 2833 | } |
| 2834 | |
| 2835 | public void unbindFinished(IBinder token, Intent intent, boolean doRebind) |
| 2836 | throws RemoteException { |
| 2837 | Parcel data = Parcel.obtain(); |
| 2838 | Parcel reply = Parcel.obtain(); |
| 2839 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2840 | data.writeStrongBinder(token); |
| 2841 | intent.writeToParcel(data, 0); |
| 2842 | data.writeInt(doRebind ? 1 : 0); |
| 2843 | mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0); |
| 2844 | reply.readException(); |
| 2845 | data.recycle(); |
| 2846 | reply.recycle(); |
| 2847 | } |
| 2848 | |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 2849 | public void serviceDoneExecuting(IBinder token, int type, int startId, |
| 2850 | int res) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2851 | Parcel data = Parcel.obtain(); |
| 2852 | Parcel reply = Parcel.obtain(); |
| 2853 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2854 | data.writeStrongBinder(token); |
Dianne Hackborn | f6f9f2d | 2009-08-21 16:26:03 -0700 | [diff] [blame] | 2855 | data.writeInt(type); |
| 2856 | data.writeInt(startId); |
| 2857 | data.writeInt(res); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2858 | mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY); |
| 2859 | reply.readException(); |
| 2860 | data.recycle(); |
| 2861 | reply.recycle(); |
| 2862 | } |
| 2863 | |
| 2864 | public IBinder peekService(Intent service, String resolvedType) throws RemoteException { |
| 2865 | Parcel data = Parcel.obtain(); |
| 2866 | Parcel reply = Parcel.obtain(); |
| 2867 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2868 | service.writeToParcel(data, 0); |
| 2869 | data.writeString(resolvedType); |
| 2870 | mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0); |
| 2871 | reply.readException(); |
| 2872 | IBinder binder = reply.readStrongBinder(); |
| 2873 | reply.recycle(); |
| 2874 | data.recycle(); |
| 2875 | return binder; |
| 2876 | } |
| 2877 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 2878 | public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode) |
| 2879 | throws RemoteException { |
| 2880 | Parcel data = Parcel.obtain(); |
| 2881 | Parcel reply = Parcel.obtain(); |
| 2882 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2883 | app.writeToParcel(data, 0); |
| 2884 | data.writeInt(backupRestoreMode); |
| 2885 | mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 2886 | reply.readException(); |
| 2887 | boolean success = reply.readInt() != 0; |
| 2888 | reply.recycle(); |
| 2889 | data.recycle(); |
| 2890 | return success; |
| 2891 | } |
| 2892 | |
Christopher Tate | 346acb1 | 2012-10-15 19:20:25 -0700 | [diff] [blame] | 2893 | public void clearPendingBackup() throws RemoteException { |
| 2894 | Parcel data = Parcel.obtain(); |
| 2895 | Parcel reply = Parcel.obtain(); |
| 2896 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2897 | mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0); |
| 2898 | reply.recycle(); |
| 2899 | data.recycle(); |
| 2900 | } |
| 2901 | |
Christopher Tate | 181fafa | 2009-05-14 11:12:14 -0700 | [diff] [blame] | 2902 | public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException { |
| 2903 | Parcel data = Parcel.obtain(); |
| 2904 | Parcel reply = Parcel.obtain(); |
| 2905 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2906 | data.writeString(packageName); |
| 2907 | data.writeStrongBinder(agent); |
| 2908 | mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0); |
| 2909 | reply.recycle(); |
| 2910 | data.recycle(); |
| 2911 | } |
| 2912 | |
| 2913 | public void unbindBackupAgent(ApplicationInfo app) throws RemoteException { |
| 2914 | Parcel data = Parcel.obtain(); |
| 2915 | Parcel reply = Parcel.obtain(); |
| 2916 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2917 | app.writeToParcel(data, 0); |
| 2918 | mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0); |
| 2919 | reply.readException(); |
| 2920 | reply.recycle(); |
| 2921 | data.recycle(); |
| 2922 | } |
| 2923 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2924 | public boolean startInstrumentation(ComponentName className, String profileFile, |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 2925 | int flags, Bundle arguments, IInstrumentationWatcher watcher, |
| 2926 | IUiAutomationConnection connection, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2927 | Parcel data = Parcel.obtain(); |
| 2928 | Parcel reply = Parcel.obtain(); |
| 2929 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2930 | ComponentName.writeToParcel(className, data); |
| 2931 | data.writeString(profileFile); |
| 2932 | data.writeInt(flags); |
| 2933 | data.writeBundle(arguments); |
| 2934 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Svetoslav Ganov | 80943d8 | 2013-01-02 10:25:37 -0800 | [diff] [blame] | 2935 | data.writeStrongBinder(connection != null ? connection.asBinder() : null); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 2936 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2937 | mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 2938 | reply.readException(); |
| 2939 | boolean res = reply.readInt() != 0; |
| 2940 | reply.recycle(); |
| 2941 | data.recycle(); |
| 2942 | return res; |
| 2943 | } |
| 2944 | |
| 2945 | public void finishInstrumentation(IApplicationThread target, |
| 2946 | int resultCode, Bundle results) throws RemoteException { |
| 2947 | Parcel data = Parcel.obtain(); |
| 2948 | Parcel reply = Parcel.obtain(); |
| 2949 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2950 | data.writeStrongBinder(target != null ? target.asBinder() : null); |
| 2951 | data.writeInt(resultCode); |
| 2952 | data.writeBundle(results); |
| 2953 | mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0); |
| 2954 | reply.readException(); |
| 2955 | data.recycle(); |
| 2956 | reply.recycle(); |
| 2957 | } |
| 2958 | public Configuration getConfiguration() throws RemoteException |
| 2959 | { |
| 2960 | Parcel data = Parcel.obtain(); |
| 2961 | Parcel reply = Parcel.obtain(); |
| 2962 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2963 | mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 2964 | reply.readException(); |
| 2965 | Configuration res = Configuration.CREATOR.createFromParcel(reply); |
| 2966 | reply.recycle(); |
| 2967 | data.recycle(); |
| 2968 | return res; |
| 2969 | } |
| 2970 | public void updateConfiguration(Configuration values) throws RemoteException |
| 2971 | { |
| 2972 | Parcel data = Parcel.obtain(); |
| 2973 | Parcel reply = Parcel.obtain(); |
| 2974 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2975 | values.writeToParcel(data, 0); |
| 2976 | mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 2977 | reply.readException(); |
| 2978 | data.recycle(); |
| 2979 | reply.recycle(); |
| 2980 | } |
| 2981 | public void setRequestedOrientation(IBinder token, int requestedOrientation) |
| 2982 | throws RemoteException { |
| 2983 | Parcel data = Parcel.obtain(); |
| 2984 | Parcel reply = Parcel.obtain(); |
| 2985 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2986 | data.writeStrongBinder(token); |
| 2987 | data.writeInt(requestedOrientation); |
| 2988 | mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 2989 | reply.readException(); |
| 2990 | data.recycle(); |
| 2991 | reply.recycle(); |
| 2992 | } |
| 2993 | public int getRequestedOrientation(IBinder token) throws RemoteException { |
| 2994 | Parcel data = Parcel.obtain(); |
| 2995 | Parcel reply = Parcel.obtain(); |
| 2996 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 2997 | data.writeStrongBinder(token); |
| 2998 | mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0); |
| 2999 | reply.readException(); |
| 3000 | int res = reply.readInt(); |
| 3001 | data.recycle(); |
| 3002 | reply.recycle(); |
| 3003 | return res; |
| 3004 | } |
| 3005 | public ComponentName getActivityClassForToken(IBinder token) |
| 3006 | throws RemoteException { |
| 3007 | Parcel data = Parcel.obtain(); |
| 3008 | Parcel reply = Parcel.obtain(); |
| 3009 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3010 | data.writeStrongBinder(token); |
| 3011 | mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 3012 | reply.readException(); |
| 3013 | ComponentName res = ComponentName.readFromParcel(reply); |
| 3014 | data.recycle(); |
| 3015 | reply.recycle(); |
| 3016 | return res; |
| 3017 | } |
| 3018 | public String getPackageForToken(IBinder token) throws RemoteException |
| 3019 | { |
| 3020 | Parcel data = Parcel.obtain(); |
| 3021 | Parcel reply = Parcel.obtain(); |
| 3022 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3023 | data.writeStrongBinder(token); |
| 3024 | mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0); |
| 3025 | reply.readException(); |
| 3026 | String res = reply.readString(); |
| 3027 | data.recycle(); |
| 3028 | reply.recycle(); |
| 3029 | return res; |
| 3030 | } |
| 3031 | public IIntentSender getIntentSender(int type, |
| 3032 | String packageName, IBinder token, String resultWho, |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 3033 | int requestCode, Intent[] intents, String[] resolvedTypes, int flags, |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3034 | Bundle options, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3035 | Parcel data = Parcel.obtain(); |
| 3036 | Parcel reply = Parcel.obtain(); |
| 3037 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3038 | data.writeInt(type); |
| 3039 | data.writeString(packageName); |
| 3040 | data.writeStrongBinder(token); |
| 3041 | data.writeString(resultWho); |
| 3042 | data.writeInt(requestCode); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3043 | if (intents != null) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3044 | data.writeInt(1); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3045 | data.writeTypedArray(intents, 0); |
| 3046 | data.writeStringArray(resolvedTypes); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3047 | } else { |
| 3048 | data.writeInt(0); |
| 3049 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3050 | data.writeInt(flags); |
Dianne Hackborn | 7a2195c | 2012-03-19 17:38:00 -0700 | [diff] [blame] | 3051 | if (options != null) { |
| 3052 | data.writeInt(1); |
| 3053 | options.writeToParcel(data, 0); |
| 3054 | } else { |
| 3055 | data.writeInt(0); |
| 3056 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3057 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3058 | mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 3059 | reply.readException(); |
| 3060 | IIntentSender res = IIntentSender.Stub.asInterface( |
| 3061 | reply.readStrongBinder()); |
| 3062 | data.recycle(); |
| 3063 | reply.recycle(); |
| 3064 | return res; |
| 3065 | } |
| 3066 | public void cancelIntentSender(IIntentSender sender) throws RemoteException { |
| 3067 | Parcel data = Parcel.obtain(); |
| 3068 | Parcel reply = Parcel.obtain(); |
| 3069 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3070 | data.writeStrongBinder(sender.asBinder()); |
| 3071 | mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 3072 | reply.readException(); |
| 3073 | data.recycle(); |
| 3074 | reply.recycle(); |
| 3075 | } |
| 3076 | public String getPackageForIntentSender(IIntentSender sender) throws RemoteException { |
| 3077 | Parcel data = Parcel.obtain(); |
| 3078 | Parcel reply = Parcel.obtain(); |
| 3079 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3080 | data.writeStrongBinder(sender.asBinder()); |
| 3081 | mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 3082 | reply.readException(); |
| 3083 | String res = reply.readString(); |
| 3084 | data.recycle(); |
| 3085 | reply.recycle(); |
| 3086 | return res; |
| 3087 | } |
Christopher Tate | c4a07d1 | 2012-04-06 14:19:13 -0700 | [diff] [blame] | 3088 | public int getUidForIntentSender(IIntentSender sender) throws RemoteException { |
| 3089 | Parcel data = Parcel.obtain(); |
| 3090 | Parcel reply = Parcel.obtain(); |
| 3091 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3092 | data.writeStrongBinder(sender.asBinder()); |
| 3093 | mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 3094 | reply.readException(); |
| 3095 | int res = reply.readInt(); |
| 3096 | data.recycle(); |
| 3097 | reply.recycle(); |
| 3098 | return res; |
| 3099 | } |
Dianne Hackborn | 4120375 | 2012-08-31 14:05:51 -0700 | [diff] [blame] | 3100 | public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll, |
| 3101 | boolean requireFull, String name, String callerPackage) throws RemoteException { |
| 3102 | Parcel data = Parcel.obtain(); |
| 3103 | Parcel reply = Parcel.obtain(); |
| 3104 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3105 | data.writeInt(callingPid); |
| 3106 | data.writeInt(callingUid); |
| 3107 | data.writeInt(userId); |
| 3108 | data.writeInt(allowAll ? 1 : 0); |
| 3109 | data.writeInt(requireFull ? 1 : 0); |
| 3110 | data.writeString(name); |
| 3111 | data.writeString(callerPackage); |
| 3112 | mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0); |
| 3113 | reply.readException(); |
| 3114 | int res = reply.readInt(); |
| 3115 | data.recycle(); |
| 3116 | reply.recycle(); |
| 3117 | return res; |
| 3118 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3119 | public void setProcessLimit(int max) throws RemoteException |
| 3120 | { |
| 3121 | Parcel data = Parcel.obtain(); |
| 3122 | Parcel reply = Parcel.obtain(); |
| 3123 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3124 | data.writeInt(max); |
| 3125 | mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 3126 | reply.readException(); |
| 3127 | data.recycle(); |
| 3128 | reply.recycle(); |
| 3129 | } |
| 3130 | public int getProcessLimit() throws RemoteException |
| 3131 | { |
| 3132 | Parcel data = Parcel.obtain(); |
| 3133 | Parcel reply = Parcel.obtain(); |
| 3134 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3135 | mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0); |
| 3136 | reply.readException(); |
| 3137 | int res = reply.readInt(); |
| 3138 | data.recycle(); |
| 3139 | reply.recycle(); |
| 3140 | return res; |
| 3141 | } |
| 3142 | public void setProcessForeground(IBinder token, int pid, |
| 3143 | boolean isForeground) throws RemoteException { |
| 3144 | Parcel data = Parcel.obtain(); |
| 3145 | Parcel reply = Parcel.obtain(); |
| 3146 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3147 | data.writeStrongBinder(token); |
| 3148 | data.writeInt(pid); |
| 3149 | data.writeInt(isForeground ? 1 : 0); |
| 3150 | mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0); |
| 3151 | reply.readException(); |
| 3152 | data.recycle(); |
| 3153 | reply.recycle(); |
| 3154 | } |
| 3155 | public int checkPermission(String permission, int pid, int uid) |
| 3156 | throws RemoteException { |
| 3157 | Parcel data = Parcel.obtain(); |
| 3158 | Parcel reply = Parcel.obtain(); |
| 3159 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3160 | data.writeString(permission); |
| 3161 | data.writeInt(pid); |
| 3162 | data.writeInt(uid); |
| 3163 | mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0); |
| 3164 | reply.readException(); |
| 3165 | int res = reply.readInt(); |
| 3166 | data.recycle(); |
| 3167 | reply.recycle(); |
| 3168 | return res; |
| 3169 | } |
| 3170 | public boolean clearApplicationUserData(final String packageName, |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3171 | final IPackageDataObserver observer, final int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3172 | Parcel data = Parcel.obtain(); |
| 3173 | Parcel reply = Parcel.obtain(); |
| 3174 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3175 | data.writeString(packageName); |
| 3176 | data.writeStrongBinder(observer.asBinder()); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3177 | data.writeInt(userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3178 | mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0); |
| 3179 | reply.readException(); |
| 3180 | boolean res = reply.readInt() != 0; |
| 3181 | data.recycle(); |
| 3182 | reply.recycle(); |
| 3183 | return res; |
| 3184 | } |
| 3185 | public int checkUriPermission(Uri uri, int pid, int uid, int mode) |
| 3186 | throws RemoteException { |
| 3187 | Parcel data = Parcel.obtain(); |
| 3188 | Parcel reply = Parcel.obtain(); |
| 3189 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3190 | uri.writeToParcel(data, 0); |
| 3191 | data.writeInt(pid); |
| 3192 | data.writeInt(uid); |
| 3193 | data.writeInt(mode); |
| 3194 | mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 3195 | reply.readException(); |
| 3196 | int res = reply.readInt(); |
| 3197 | data.recycle(); |
| 3198 | reply.recycle(); |
| 3199 | return res; |
| 3200 | } |
| 3201 | public void grantUriPermission(IApplicationThread caller, String targetPkg, |
| 3202 | Uri uri, int mode) throws RemoteException { |
| 3203 | Parcel data = Parcel.obtain(); |
| 3204 | Parcel reply = Parcel.obtain(); |
| 3205 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3206 | data.writeStrongBinder(caller.asBinder()); |
| 3207 | data.writeString(targetPkg); |
| 3208 | uri.writeToParcel(data, 0); |
| 3209 | data.writeInt(mode); |
| 3210 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 3211 | reply.readException(); |
| 3212 | data.recycle(); |
| 3213 | reply.recycle(); |
| 3214 | } |
| 3215 | public void revokeUriPermission(IApplicationThread caller, Uri uri, |
| 3216 | int mode) throws RemoteException { |
| 3217 | Parcel data = Parcel.obtain(); |
| 3218 | Parcel reply = Parcel.obtain(); |
| 3219 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3220 | data.writeStrongBinder(caller.asBinder()); |
| 3221 | uri.writeToParcel(data, 0); |
| 3222 | data.writeInt(mode); |
| 3223 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 3224 | reply.readException(); |
| 3225 | data.recycle(); |
| 3226 | reply.recycle(); |
| 3227 | } |
| 3228 | public void showWaitingForDebugger(IApplicationThread who, boolean waiting) |
| 3229 | throws RemoteException { |
| 3230 | Parcel data = Parcel.obtain(); |
| 3231 | Parcel reply = Parcel.obtain(); |
| 3232 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3233 | data.writeStrongBinder(who.asBinder()); |
| 3234 | data.writeInt(waiting ? 1 : 0); |
| 3235 | mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0); |
| 3236 | reply.readException(); |
| 3237 | data.recycle(); |
| 3238 | reply.recycle(); |
| 3239 | } |
| 3240 | public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException { |
| 3241 | Parcel data = Parcel.obtain(); |
| 3242 | Parcel reply = Parcel.obtain(); |
| 3243 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3244 | mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 3245 | reply.readException(); |
| 3246 | outInfo.readFromParcel(reply); |
| 3247 | data.recycle(); |
| 3248 | reply.recycle(); |
| 3249 | } |
| 3250 | public void unhandledBack() throws RemoteException |
| 3251 | { |
| 3252 | Parcel data = Parcel.obtain(); |
| 3253 | Parcel reply = Parcel.obtain(); |
| 3254 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3255 | mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0); |
| 3256 | reply.readException(); |
| 3257 | data.recycle(); |
| 3258 | reply.recycle(); |
| 3259 | } |
| 3260 | public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException |
| 3261 | { |
| 3262 | Parcel data = Parcel.obtain(); |
| 3263 | Parcel reply = Parcel.obtain(); |
| 3264 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3265 | mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0); |
| 3266 | reply.readException(); |
| 3267 | ParcelFileDescriptor pfd = null; |
| 3268 | if (reply.readInt() != 0) { |
| 3269 | pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply); |
| 3270 | } |
| 3271 | data.recycle(); |
| 3272 | reply.recycle(); |
| 3273 | return pfd; |
| 3274 | } |
| 3275 | public void goingToSleep() throws RemoteException |
| 3276 | { |
| 3277 | Parcel data = Parcel.obtain(); |
| 3278 | Parcel reply = Parcel.obtain(); |
| 3279 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3280 | mRemote.transact(GOING_TO_SLEEP_TRANSACTION, data, reply, 0); |
| 3281 | reply.readException(); |
| 3282 | data.recycle(); |
| 3283 | reply.recycle(); |
| 3284 | } |
| 3285 | public void wakingUp() throws RemoteException |
| 3286 | { |
| 3287 | Parcel data = Parcel.obtain(); |
| 3288 | Parcel reply = Parcel.obtain(); |
| 3289 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3290 | mRemote.transact(WAKING_UP_TRANSACTION, data, reply, 0); |
| 3291 | reply.readException(); |
| 3292 | data.recycle(); |
| 3293 | reply.recycle(); |
| 3294 | } |
Dianne Hackborn | ff5b158 | 2012-04-12 17:24:07 -0700 | [diff] [blame] | 3295 | public void setLockScreenShown(boolean shown) throws RemoteException |
| 3296 | { |
| 3297 | Parcel data = Parcel.obtain(); |
| 3298 | Parcel reply = Parcel.obtain(); |
| 3299 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3300 | data.writeInt(shown ? 1 : 0); |
| 3301 | mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0); |
| 3302 | reply.readException(); |
| 3303 | data.recycle(); |
| 3304 | reply.recycle(); |
| 3305 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3306 | public void setDebugApp( |
| 3307 | String packageName, boolean waitForDebugger, boolean persistent) |
| 3308 | throws RemoteException |
| 3309 | { |
| 3310 | Parcel data = Parcel.obtain(); |
| 3311 | Parcel reply = Parcel.obtain(); |
| 3312 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3313 | data.writeString(packageName); |
| 3314 | data.writeInt(waitForDebugger ? 1 : 0); |
| 3315 | data.writeInt(persistent ? 1 : 0); |
| 3316 | mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0); |
| 3317 | reply.readException(); |
| 3318 | data.recycle(); |
| 3319 | reply.recycle(); |
| 3320 | } |
| 3321 | public void setAlwaysFinish(boolean enabled) throws RemoteException |
| 3322 | { |
| 3323 | Parcel data = Parcel.obtain(); |
| 3324 | Parcel reply = Parcel.obtain(); |
| 3325 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3326 | data.writeInt(enabled ? 1 : 0); |
| 3327 | mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0); |
| 3328 | reply.readException(); |
| 3329 | data.recycle(); |
| 3330 | reply.recycle(); |
| 3331 | } |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 3332 | public void setActivityController(IActivityController watcher) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3333 | { |
| 3334 | Parcel data = Parcel.obtain(); |
| 3335 | Parcel reply = Parcel.obtain(); |
| 3336 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3337 | data.writeStrongBinder(watcher != null ? watcher.asBinder() : null); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 3338 | mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3339 | reply.readException(); |
| 3340 | data.recycle(); |
| 3341 | reply.recycle(); |
| 3342 | } |
| 3343 | public void enterSafeMode() throws RemoteException { |
| 3344 | Parcel data = Parcel.obtain(); |
| 3345 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3346 | mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0); |
| 3347 | data.recycle(); |
| 3348 | } |
| 3349 | public void noteWakeupAlarm(IIntentSender sender) throws RemoteException { |
| 3350 | Parcel data = Parcel.obtain(); |
| 3351 | data.writeStrongBinder(sender.asBinder()); |
| 3352 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3353 | mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0); |
| 3354 | data.recycle(); |
| 3355 | } |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 3356 | public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3357 | Parcel data = Parcel.obtain(); |
| 3358 | Parcel reply = Parcel.obtain(); |
| 3359 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3360 | data.writeIntArray(pids); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 3361 | data.writeString(reason); |
Dianne Hackborn | 6482517 | 2011-03-02 21:32:58 -0800 | [diff] [blame] | 3362 | data.writeInt(secure ? 1 : 0); |
Suchi Amalapurapu | e99bb5f | 2010-03-19 14:36:49 -0700 | [diff] [blame] | 3363 | mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0); |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 3364 | reply.readException(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3365 | boolean res = reply.readInt() != 0; |
| 3366 | data.recycle(); |
| 3367 | reply.recycle(); |
| 3368 | return res; |
| 3369 | } |
Jeff Sharkey | b9a0701 | 2012-03-22 17:00:04 -0700 | [diff] [blame] | 3370 | @Override |
| 3371 | public boolean killProcessesBelowForeground(String reason) throws RemoteException { |
| 3372 | Parcel data = Parcel.obtain(); |
| 3373 | Parcel reply = Parcel.obtain(); |
| 3374 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3375 | data.writeString(reason); |
| 3376 | mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0); |
| 3377 | boolean res = reply.readInt() != 0; |
| 3378 | data.recycle(); |
| 3379 | reply.recycle(); |
| 3380 | return res; |
| 3381 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3382 | public void startRunning(String pkg, String cls, String action, |
| 3383 | String indata) throws RemoteException { |
| 3384 | Parcel data = Parcel.obtain(); |
| 3385 | Parcel reply = Parcel.obtain(); |
| 3386 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3387 | data.writeString(pkg); |
| 3388 | data.writeString(cls); |
| 3389 | data.writeString(action); |
| 3390 | data.writeString(indata); |
| 3391 | mRemote.transact(START_RUNNING_TRANSACTION, data, reply, 0); |
| 3392 | reply.readException(); |
| 3393 | data.recycle(); |
| 3394 | reply.recycle(); |
| 3395 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3396 | public boolean testIsSystemReady() |
| 3397 | { |
| 3398 | /* this base class version is never called */ |
| 3399 | return true; |
| 3400 | } |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 3401 | public void handleApplicationCrash(IBinder app, |
| 3402 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
| 3403 | { |
| 3404 | Parcel data = Parcel.obtain(); |
| 3405 | Parcel reply = Parcel.obtain(); |
| 3406 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3407 | data.writeStrongBinder(app); |
| 3408 | crashInfo.writeToParcel(data, 0); |
| 3409 | mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0); |
| 3410 | reply.readException(); |
| 3411 | reply.recycle(); |
| 3412 | data.recycle(); |
| 3413 | } |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 3414 | |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 3415 | public boolean handleApplicationWtf(IBinder app, String tag, |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 3416 | ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3417 | { |
| 3418 | Parcel data = Parcel.obtain(); |
| 3419 | Parcel reply = Parcel.obtain(); |
| 3420 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3421 | data.writeStrongBinder(app); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3422 | data.writeString(tag); |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 3423 | crashInfo.writeToParcel(data, 0); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 3424 | mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3425 | reply.readException(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 3426 | boolean res = reply.readInt() != 0; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3427 | reply.recycle(); |
| 3428 | data.recycle(); |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 3429 | return res; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3430 | } |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 3431 | |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 3432 | public void handleApplicationStrictModeViolation(IBinder app, |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 3433 | int violationMask, |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 3434 | StrictMode.ViolationInfo info) throws RemoteException |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 3435 | { |
| 3436 | Parcel data = Parcel.obtain(); |
| 3437 | Parcel reply = Parcel.obtain(); |
| 3438 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3439 | data.writeStrongBinder(app); |
Brad Fitzpatrick | 46d4238 | 2010-06-11 13:57:58 -0700 | [diff] [blame] | 3440 | data.writeInt(violationMask); |
Brad Fitzpatrick | cb9ceb1 | 2010-07-29 14:29:02 -0700 | [diff] [blame] | 3441 | info.writeToParcel(data, 0); |
Brad Fitzpatrick | 438d059 | 2010-06-10 12:19:19 -0700 | [diff] [blame] | 3442 | mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0); |
| 3443 | reply.readException(); |
| 3444 | reply.recycle(); |
| 3445 | data.recycle(); |
| 3446 | } |
| 3447 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3448 | public void signalPersistentProcesses(int sig) throws RemoteException { |
| 3449 | Parcel data = Parcel.obtain(); |
| 3450 | Parcel reply = Parcel.obtain(); |
| 3451 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3452 | data.writeInt(sig); |
| 3453 | mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0); |
| 3454 | reply.readException(); |
| 3455 | data.recycle(); |
| 3456 | reply.recycle(); |
| 3457 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 3458 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 3459 | public void killBackgroundProcesses(String packageName, int userId) throws RemoteException { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3460 | Parcel data = Parcel.obtain(); |
| 3461 | Parcel reply = Parcel.obtain(); |
| 3462 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3463 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 3464 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 3465 | mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 3466 | reply.readException(); |
| 3467 | data.recycle(); |
| 3468 | reply.recycle(); |
| 3469 | } |
Dianne Hackborn | e4d4fbc | 2011-11-08 11:53:28 -0800 | [diff] [blame] | 3470 | |
| 3471 | public void killAllBackgroundProcesses() throws RemoteException { |
| 3472 | Parcel data = Parcel.obtain(); |
| 3473 | Parcel reply = Parcel.obtain(); |
| 3474 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3475 | mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0); |
| 3476 | reply.readException(); |
| 3477 | data.recycle(); |
| 3478 | reply.recycle(); |
| 3479 | } |
| 3480 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 3481 | public void forceStopPackage(String packageName, int userId) throws RemoteException { |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 3482 | Parcel data = Parcel.obtain(); |
| 3483 | Parcel reply = Parcel.obtain(); |
| 3484 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3485 | data.writeString(packageName); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 3486 | data.writeInt(userId); |
Dianne Hackborn | 03abb81 | 2010-01-04 18:43:19 -0800 | [diff] [blame] | 3487 | mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3488 | reply.readException(); |
| 3489 | data.recycle(); |
| 3490 | reply.recycle(); |
| 3491 | } |
| 3492 | |
Dianne Hackborn | 27ff913 | 2012-03-06 14:57:58 -0800 | [diff] [blame] | 3493 | public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo) |
| 3494 | throws RemoteException |
| 3495 | { |
| 3496 | Parcel data = Parcel.obtain(); |
| 3497 | Parcel reply = Parcel.obtain(); |
| 3498 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3499 | mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0); |
| 3500 | reply.readException(); |
| 3501 | outInfo.readFromParcel(reply); |
| 3502 | reply.recycle(); |
| 3503 | data.recycle(); |
| 3504 | } |
| 3505 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3506 | public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException |
| 3507 | { |
| 3508 | Parcel data = Parcel.obtain(); |
| 3509 | Parcel reply = Parcel.obtain(); |
| 3510 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3511 | mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 3512 | reply.readException(); |
| 3513 | ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply); |
| 3514 | reply.recycle(); |
| 3515 | data.recycle(); |
| 3516 | return res; |
| 3517 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 3518 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 3519 | public boolean profileControl(String process, int userId, boolean start, |
Romain Guy | 7eabe55 | 2011-07-21 14:56:34 -0700 | [diff] [blame] | 3520 | String path, ParcelFileDescriptor fd, int profileType) throws RemoteException |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 3521 | { |
| 3522 | Parcel data = Parcel.obtain(); |
| 3523 | Parcel reply = Parcel.obtain(); |
| 3524 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3525 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 3526 | data.writeInt(userId); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 3527 | data.writeInt(start ? 1 : 0); |
Romain Guy | 9a8c5ce | 2011-07-21 18:04:29 -0700 | [diff] [blame] | 3528 | data.writeInt(profileType); |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 3529 | data.writeString(path); |
Dianne Hackborn | 9c8dd55 | 2009-06-23 19:22:52 -0700 | [diff] [blame] | 3530 | if (fd != null) { |
| 3531 | data.writeInt(1); |
| 3532 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 3533 | } else { |
| 3534 | data.writeInt(0); |
| 3535 | } |
The Android Open Source Project | f5b4b98 | 2009-03-05 20:00:43 -0800 | [diff] [blame] | 3536 | mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0); |
| 3537 | reply.readException(); |
| 3538 | boolean res = reply.readInt() != 0; |
| 3539 | reply.recycle(); |
| 3540 | data.recycle(); |
| 3541 | return res; |
| 3542 | } |
| 3543 | |
Dianne Hackborn | 55280a9 | 2009-05-07 15:53:46 -0700 | [diff] [blame] | 3544 | public boolean shutdown(int timeout) throws RemoteException |
| 3545 | { |
| 3546 | Parcel data = Parcel.obtain(); |
| 3547 | Parcel reply = Parcel.obtain(); |
| 3548 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3549 | data.writeInt(timeout); |
| 3550 | mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0); |
| 3551 | reply.readException(); |
| 3552 | boolean res = reply.readInt() != 0; |
| 3553 | reply.recycle(); |
| 3554 | data.recycle(); |
| 3555 | return res; |
| 3556 | } |
| 3557 | |
Dianne Hackborn | 95fc68f | 2009-05-19 18:37:45 -0700 | [diff] [blame] | 3558 | public void stopAppSwitches() throws RemoteException { |
| 3559 | Parcel data = Parcel.obtain(); |
| 3560 | Parcel reply = Parcel.obtain(); |
| 3561 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3562 | mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 3563 | reply.readException(); |
| 3564 | reply.recycle(); |
| 3565 | data.recycle(); |
| 3566 | } |
| 3567 | |
| 3568 | public void resumeAppSwitches() throws RemoteException { |
| 3569 | Parcel data = Parcel.obtain(); |
| 3570 | Parcel reply = Parcel.obtain(); |
| 3571 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3572 | mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0); |
| 3573 | reply.readException(); |
| 3574 | reply.recycle(); |
| 3575 | data.recycle(); |
| 3576 | } |
| 3577 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3578 | public void killApplicationWithAppId(String pkg, int appid) throws RemoteException { |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 3579 | Parcel data = Parcel.obtain(); |
| 3580 | Parcel reply = Parcel.obtain(); |
| 3581 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3582 | data.writeString(pkg); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3583 | data.writeInt(appid); |
| 3584 | mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0); |
Suchi Amalapurapu | 261e66a | 2009-07-27 15:21:34 -0700 | [diff] [blame] | 3585 | reply.readException(); |
| 3586 | data.recycle(); |
| 3587 | reply.recycle(); |
| 3588 | } |
Dianne Hackborn | a6ddc8a | 2009-07-28 17:49:55 -0700 | [diff] [blame] | 3589 | |
| 3590 | public void closeSystemDialogs(String reason) throws RemoteException { |
| 3591 | Parcel data = Parcel.obtain(); |
| 3592 | Parcel reply = Parcel.obtain(); |
| 3593 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3594 | data.writeString(reason); |
| 3595 | mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0); |
| 3596 | reply.readException(); |
| 3597 | data.recycle(); |
| 3598 | reply.recycle(); |
| 3599 | } |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 3600 | |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 3601 | public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids) |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 3602 | throws RemoteException { |
| 3603 | Parcel data = Parcel.obtain(); |
| 3604 | Parcel reply = Parcel.obtain(); |
| 3605 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 3606 | data.writeIntArray(pids); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 3607 | mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0); |
| 3608 | reply.readException(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 3609 | Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR); |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 3610 | data.recycle(); |
| 3611 | reply.recycle(); |
Dianne Hackborn | 4f21c4c | 2009-09-17 10:24:05 -0700 | [diff] [blame] | 3612 | return res; |
Dianne Hackborn | 3025ef3 | 2009-08-31 21:31:47 -0700 | [diff] [blame] | 3613 | } |
Christopher Tate | 5e1ab33 | 2009-09-01 20:32:49 -0700 | [diff] [blame] | 3614 | |
| 3615 | public void killApplicationProcess(String processName, int uid) throws RemoteException { |
| 3616 | Parcel data = Parcel.obtain(); |
| 3617 | Parcel reply = Parcel.obtain(); |
| 3618 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3619 | data.writeString(processName); |
| 3620 | data.writeInt(uid); |
| 3621 | mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0); |
| 3622 | reply.readException(); |
| 3623 | data.recycle(); |
| 3624 | reply.recycle(); |
| 3625 | } |
| 3626 | |
Dianne Hackborn | 3b3e145 | 2009-09-24 19:22:12 -0700 | [diff] [blame] | 3627 | public void overridePendingTransition(IBinder token, String packageName, |
| 3628 | int enterAnim, int exitAnim) throws RemoteException { |
| 3629 | Parcel data = Parcel.obtain(); |
| 3630 | Parcel reply = Parcel.obtain(); |
| 3631 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3632 | data.writeStrongBinder(token); |
| 3633 | data.writeString(packageName); |
| 3634 | data.writeInt(enterAnim); |
| 3635 | data.writeInt(exitAnim); |
| 3636 | mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0); |
| 3637 | reply.readException(); |
| 3638 | data.recycle(); |
| 3639 | reply.recycle(); |
| 3640 | } |
| 3641 | |
Dianne Hackborn | 9327f4f | 2010-01-29 10:38:29 -0800 | [diff] [blame] | 3642 | public boolean isUserAMonkey() throws RemoteException { |
| 3643 | Parcel data = Parcel.obtain(); |
| 3644 | Parcel reply = Parcel.obtain(); |
| 3645 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3646 | mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0); |
| 3647 | reply.readException(); |
| 3648 | boolean res = reply.readInt() != 0; |
| 3649 | data.recycle(); |
| 3650 | reply.recycle(); |
| 3651 | return res; |
| 3652 | } |
Adam Momtaz | 8f6f1f4 | 2013-04-10 12:42:58 -0700 | [diff] [blame] | 3653 | |
| 3654 | public void setUserIsMonkey(boolean monkey) throws RemoteException { |
| 3655 | Parcel data = Parcel.obtain(); |
| 3656 | Parcel reply = Parcel.obtain(); |
| 3657 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3658 | data.writeInt(monkey ? 1 : 0); |
| 3659 | mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0); |
| 3660 | reply.readException(); |
| 3661 | data.recycle(); |
| 3662 | reply.recycle(); |
| 3663 | } |
| 3664 | |
Dianne Hackborn | 860755f | 2010-06-03 18:47:52 -0700 | [diff] [blame] | 3665 | public void finishHeavyWeightApp() throws RemoteException { |
| 3666 | Parcel data = Parcel.obtain(); |
| 3667 | Parcel reply = Parcel.obtain(); |
| 3668 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3669 | mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0); |
| 3670 | reply.readException(); |
| 3671 | data.recycle(); |
| 3672 | reply.recycle(); |
| 3673 | } |
| 3674 | |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 3675 | public void setImmersive(IBinder token, boolean immersive) |
| 3676 | throws RemoteException { |
| 3677 | Parcel data = Parcel.obtain(); |
| 3678 | Parcel reply = Parcel.obtain(); |
| 3679 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3680 | data.writeStrongBinder(token); |
| 3681 | data.writeInt(immersive ? 1 : 0); |
| 3682 | mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0); |
| 3683 | reply.readException(); |
| 3684 | data.recycle(); |
| 3685 | reply.recycle(); |
| 3686 | } |
| 3687 | |
| 3688 | public boolean isImmersive(IBinder token) |
| 3689 | throws RemoteException { |
| 3690 | Parcel data = Parcel.obtain(); |
| 3691 | Parcel reply = Parcel.obtain(); |
| 3692 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3693 | data.writeStrongBinder(token); |
| 3694 | mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 3695 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 3696 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 3697 | data.recycle(); |
| 3698 | reply.recycle(); |
| 3699 | return res; |
| 3700 | } |
| 3701 | |
| 3702 | public boolean isTopActivityImmersive() |
| 3703 | throws RemoteException { |
| 3704 | Parcel data = Parcel.obtain(); |
| 3705 | Parcel reply = Parcel.obtain(); |
| 3706 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3707 | mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0); |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 3708 | reply.readException(); |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 3709 | boolean res = reply.readInt() == 1; |
Daniel Sandler | 69a4817 | 2010-06-23 16:29:36 -0400 | [diff] [blame] | 3710 | data.recycle(); |
| 3711 | reply.recycle(); |
| 3712 | return res; |
| 3713 | } |
| 3714 | |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 3715 | public void crashApplication(int uid, int initialPid, String packageName, |
| 3716 | String message) throws RemoteException { |
| 3717 | Parcel data = Parcel.obtain(); |
| 3718 | Parcel reply = Parcel.obtain(); |
| 3719 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3720 | data.writeInt(uid); |
| 3721 | data.writeInt(initialPid); |
| 3722 | data.writeString(packageName); |
| 3723 | data.writeString(message); |
| 3724 | mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0); |
| 3725 | reply.readException(); |
| 3726 | data.recycle(); |
| 3727 | reply.recycle(); |
| 3728 | } |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 3729 | |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3730 | public String getProviderMimeType(Uri uri, int userId) throws RemoteException { |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 3731 | Parcel data = Parcel.obtain(); |
| 3732 | Parcel reply = Parcel.obtain(); |
| 3733 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3734 | uri.writeToParcel(data, 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3735 | data.writeInt(userId); |
Dianne Hackborn | cca1f0e | 2010-09-26 18:34:53 -0700 | [diff] [blame] | 3736 | mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0); |
| 3737 | reply.readException(); |
| 3738 | String res = reply.readString(); |
| 3739 | data.recycle(); |
| 3740 | reply.recycle(); |
| 3741 | return res; |
| 3742 | } |
| 3743 | |
Dianne Hackborn | 7e26964 | 2010-08-25 19:50:20 -0700 | [diff] [blame] | 3744 | public IBinder newUriPermissionOwner(String name) |
| 3745 | throws RemoteException { |
| 3746 | Parcel data = Parcel.obtain(); |
| 3747 | Parcel reply = Parcel.obtain(); |
| 3748 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3749 | data.writeString(name); |
| 3750 | mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0); |
| 3751 | reply.readException(); |
| 3752 | IBinder res = reply.readStrongBinder(); |
| 3753 | data.recycle(); |
| 3754 | reply.recycle(); |
| 3755 | return res; |
| 3756 | } |
| 3757 | |
| 3758 | public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg, |
| 3759 | Uri uri, int mode) throws RemoteException { |
| 3760 | Parcel data = Parcel.obtain(); |
| 3761 | Parcel reply = Parcel.obtain(); |
| 3762 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3763 | data.writeStrongBinder(owner); |
| 3764 | data.writeInt(fromUid); |
| 3765 | data.writeString(targetPkg); |
| 3766 | uri.writeToParcel(data, 0); |
| 3767 | data.writeInt(mode); |
| 3768 | mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 3769 | reply.readException(); |
| 3770 | data.recycle(); |
| 3771 | reply.recycle(); |
| 3772 | } |
| 3773 | |
| 3774 | public void revokeUriPermissionFromOwner(IBinder owner, Uri uri, |
| 3775 | int mode) throws RemoteException { |
| 3776 | Parcel data = Parcel.obtain(); |
| 3777 | Parcel reply = Parcel.obtain(); |
| 3778 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3779 | data.writeStrongBinder(owner); |
| 3780 | if (uri != null) { |
| 3781 | data.writeInt(1); |
| 3782 | uri.writeToParcel(data, 0); |
| 3783 | } else { |
| 3784 | data.writeInt(0); |
| 3785 | } |
| 3786 | data.writeInt(mode); |
| 3787 | mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 3788 | reply.readException(); |
| 3789 | data.recycle(); |
| 3790 | reply.recycle(); |
| 3791 | } |
Dianne Hackborn | c8f8497 | 2010-08-25 23:14:44 -0700 | [diff] [blame] | 3792 | |
Dianne Hackborn | 90f4aaf | 2010-09-27 14:58:44 -0700 | [diff] [blame] | 3793 | public int checkGrantUriPermission(int callingUid, String targetPkg, |
| 3794 | Uri uri, int modeFlags) throws RemoteException { |
| 3795 | Parcel data = Parcel.obtain(); |
| 3796 | Parcel reply = Parcel.obtain(); |
| 3797 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3798 | data.writeInt(callingUid); |
| 3799 | data.writeString(targetPkg); |
| 3800 | uri.writeToParcel(data, 0); |
| 3801 | data.writeInt(modeFlags); |
| 3802 | mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); |
| 3803 | reply.readException(); |
| 3804 | int res = reply.readInt(); |
| 3805 | data.recycle(); |
| 3806 | reply.recycle(); |
| 3807 | return res; |
| 3808 | } |
| 3809 | |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 3810 | public boolean dumpHeap(String process, int userId, boolean managed, |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 3811 | String path, ParcelFileDescriptor fd) throws RemoteException { |
| 3812 | Parcel data = Parcel.obtain(); |
| 3813 | Parcel reply = Parcel.obtain(); |
| 3814 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3815 | data.writeString(process); |
Dianne Hackborn | 1676c85 | 2012-09-10 14:52:30 -0700 | [diff] [blame] | 3816 | data.writeInt(userId); |
Andy McFadden | 824c510 | 2010-07-09 16:26:57 -0700 | [diff] [blame] | 3817 | data.writeInt(managed ? 1 : 0); |
| 3818 | data.writeString(path); |
| 3819 | if (fd != null) { |
| 3820 | data.writeInt(1); |
| 3821 | fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); |
| 3822 | } else { |
| 3823 | data.writeInt(0); |
| 3824 | } |
| 3825 | mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0); |
| 3826 | reply.readException(); |
| 3827 | boolean res = reply.readInt() != 0; |
| 3828 | reply.recycle(); |
| 3829 | data.recycle(); |
| 3830 | return res; |
| 3831 | } |
Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 3832 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3833 | public int startActivities(IApplicationThread caller, String callingPackage, |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3834 | Intent[] intents, String[] resolvedTypes, IBinder resultTo, |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 3835 | Bundle options, int userId) throws RemoteException { |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3836 | Parcel data = Parcel.obtain(); |
| 3837 | Parcel reply = Parcel.obtain(); |
| 3838 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3839 | data.writeStrongBinder(caller != null ? caller.asBinder() : null); |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 3840 | data.writeString(callingPackage); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3841 | data.writeTypedArray(intents, 0); |
| 3842 | data.writeStringArray(resolvedTypes); |
| 3843 | data.writeStrongBinder(resultTo); |
Dianne Hackborn | a4972e9 | 2012-03-14 10:38:05 -0700 | [diff] [blame] | 3844 | if (options != null) { |
| 3845 | data.writeInt(1); |
| 3846 | options.writeToParcel(data, 0); |
| 3847 | } else { |
| 3848 | data.writeInt(0); |
| 3849 | } |
Amith Yamasani | ea7e915 | 2012-09-24 16:11:18 -0700 | [diff] [blame] | 3850 | data.writeInt(userId); |
Dianne Hackborn | 621e17d | 2010-11-22 15:59:56 -0800 | [diff] [blame] | 3851 | mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0); |
| 3852 | reply.readException(); |
| 3853 | int result = reply.readInt(); |
| 3854 | reply.recycle(); |
| 3855 | data.recycle(); |
| 3856 | return result; |
| 3857 | } |
| 3858 | |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 3859 | public int getFrontActivityScreenCompatMode() throws RemoteException { |
| 3860 | Parcel data = Parcel.obtain(); |
| 3861 | Parcel reply = Parcel.obtain(); |
| 3862 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3863 | mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 3864 | reply.readException(); |
| 3865 | int mode = reply.readInt(); |
| 3866 | reply.recycle(); |
| 3867 | data.recycle(); |
| 3868 | return mode; |
| 3869 | } |
| 3870 | |
| 3871 | public void setFrontActivityScreenCompatMode(int mode) throws RemoteException { |
| 3872 | Parcel data = Parcel.obtain(); |
| 3873 | Parcel reply = Parcel.obtain(); |
| 3874 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3875 | data.writeInt(mode); |
| 3876 | mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 3877 | reply.readException(); |
| 3878 | reply.recycle(); |
| 3879 | data.recycle(); |
| 3880 | } |
| 3881 | |
| 3882 | public int getPackageScreenCompatMode(String packageName) throws RemoteException { |
| 3883 | Parcel data = Parcel.obtain(); |
| 3884 | Parcel reply = Parcel.obtain(); |
| 3885 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 3886 | data.writeString(packageName); |
| 3887 | mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 3888 | reply.readException(); |
| 3889 | int mode = reply.readInt(); |
| 3890 | reply.recycle(); |
| 3891 | data.recycle(); |
| 3892 | return mode; |
| 3893 | } |
| 3894 | |
| 3895 | public void setPackageScreenCompatMode(String packageName, int mode) |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 3896 | throws RemoteException { |
| 3897 | Parcel data = Parcel.obtain(); |
| 3898 | Parcel reply = Parcel.obtain(); |
| 3899 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3900 | data.writeString(packageName); |
Dianne Hackborn | 0f1de9a | 2011-05-11 17:34:49 -0700 | [diff] [blame] | 3901 | data.writeInt(mode); |
Dianne Hackborn | e2515ee | 2011-04-27 18:52:56 -0400 | [diff] [blame] | 3902 | mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0); |
| 3903 | reply.readException(); |
| 3904 | reply.recycle(); |
| 3905 | data.recycle(); |
| 3906 | } |
| 3907 | |
Dianne Hackborn | 36cd41f | 2011-05-25 21:00:46 -0700 | [diff] [blame] | 3908 | public boolean getPackageAskScreenCompat(String packageName) throws RemoteException { |
| 3909 | Parcel data = Parcel.obtain(); |
| 3910 | Parcel reply = Parcel.obtain(); |
| 3911 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3912 | data.writeString(packageName); |
| 3913 | mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 3914 | reply.readException(); |
| 3915 | boolean ask = reply.readInt() != 0; |
| 3916 | reply.recycle(); |
| 3917 | data.recycle(); |
| 3918 | return ask; |
| 3919 | } |
| 3920 | |
| 3921 | public void setPackageAskScreenCompat(String packageName, boolean ask) |
| 3922 | throws RemoteException { |
| 3923 | Parcel data = Parcel.obtain(); |
| 3924 | Parcel reply = Parcel.obtain(); |
| 3925 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3926 | data.writeString(packageName); |
| 3927 | data.writeInt(ask ? 1 : 0); |
| 3928 | mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0); |
| 3929 | reply.readException(); |
| 3930 | reply.recycle(); |
| 3931 | data.recycle(); |
| 3932 | } |
| 3933 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3934 | public boolean switchUser(int userid) throws RemoteException { |
| 3935 | Parcel data = Parcel.obtain(); |
| 3936 | Parcel reply = Parcel.obtain(); |
| 3937 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3938 | data.writeInt(userid); |
| 3939 | mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0); |
| 3940 | reply.readException(); |
| 3941 | boolean result = reply.readInt() != 0; |
| 3942 | reply.recycle(); |
| 3943 | data.recycle(); |
| 3944 | return result; |
| 3945 | } |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 3946 | |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 3947 | public int stopUser(int userid, IStopUserCallback callback) throws RemoteException { |
| 3948 | Parcel data = Parcel.obtain(); |
| 3949 | Parcel reply = Parcel.obtain(); |
| 3950 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3951 | data.writeInt(userid); |
| 3952 | data.writeStrongInterface(callback); |
| 3953 | mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0); |
| 3954 | reply.readException(); |
| 3955 | int result = reply.readInt(); |
| 3956 | reply.recycle(); |
| 3957 | data.recycle(); |
| 3958 | return result; |
| 3959 | } |
| 3960 | |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 3961 | public UserInfo getCurrentUser() throws RemoteException { |
| 3962 | Parcel data = Parcel.obtain(); |
| 3963 | Parcel reply = Parcel.obtain(); |
| 3964 | data.writeInterfaceToken(IActivityManager.descriptor); |
Dianne Hackborn | 80a4af2 | 2012-08-27 19:18:31 -0700 | [diff] [blame] | 3965 | mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0); |
Amith Yamasani | 52f1d75 | 2012-03-28 18:19:29 -0700 | [diff] [blame] | 3966 | reply.readException(); |
| 3967 | UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply); |
| 3968 | reply.recycle(); |
| 3969 | data.recycle(); |
| 3970 | return userInfo; |
| 3971 | } |
| 3972 | |
Dianne Hackborn | a8a9bd6 | 2012-10-09 15:36:59 -0700 | [diff] [blame] | 3973 | public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException { |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3974 | Parcel data = Parcel.obtain(); |
| 3975 | Parcel reply = Parcel.obtain(); |
| 3976 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3977 | data.writeInt(userid); |
Dianne Hackborn | a8a9bd6 | 2012-10-09 15:36:59 -0700 | [diff] [blame] | 3978 | data.writeInt(orStopping ? 1 : 0); |
Dianne Hackborn | 5e03e2c | 2012-09-06 14:21:19 -0700 | [diff] [blame] | 3979 | mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0); |
| 3980 | reply.readException(); |
| 3981 | boolean result = reply.readInt() != 0; |
| 3982 | reply.recycle(); |
| 3983 | data.recycle(); |
| 3984 | return result; |
| 3985 | } |
| 3986 | |
Dianne Hackborn | c72fc67 | 2012-09-20 13:12:03 -0700 | [diff] [blame] | 3987 | public int[] getRunningUserIds() throws RemoteException { |
| 3988 | Parcel data = Parcel.obtain(); |
| 3989 | Parcel reply = Parcel.obtain(); |
| 3990 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 3991 | mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0); |
| 3992 | reply.readException(); |
| 3993 | int[] result = reply.createIntArray(); |
| 3994 | reply.recycle(); |
| 3995 | data.recycle(); |
| 3996 | return result; |
| 3997 | } |
| 3998 | |
Dianne Hackborn | 0c5001d | 2011-04-12 18:16:08 -0700 | [diff] [blame] | 3999 | public boolean removeSubTask(int taskId, int subTaskIndex) throws RemoteException { |
| 4000 | Parcel data = Parcel.obtain(); |
| 4001 | Parcel reply = Parcel.obtain(); |
| 4002 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4003 | data.writeInt(taskId); |
| 4004 | data.writeInt(subTaskIndex); |
| 4005 | mRemote.transact(REMOVE_SUB_TASK_TRANSACTION, data, reply, 0); |
| 4006 | reply.readException(); |
| 4007 | boolean result = reply.readInt() != 0; |
| 4008 | reply.recycle(); |
| 4009 | data.recycle(); |
| 4010 | return result; |
| 4011 | } |
| 4012 | |
| 4013 | public boolean removeTask(int taskId, int flags) throws RemoteException { |
| 4014 | Parcel data = Parcel.obtain(); |
| 4015 | Parcel reply = Parcel.obtain(); |
| 4016 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4017 | data.writeInt(taskId); |
| 4018 | data.writeInt(flags); |
| 4019 | mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0); |
| 4020 | reply.readException(); |
| 4021 | boolean result = reply.readInt() != 0; |
| 4022 | reply.recycle(); |
| 4023 | data.recycle(); |
| 4024 | return result; |
| 4025 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4026 | |
Jeff Sharkey | a462079 | 2011-05-20 15:29:23 -0700 | [diff] [blame] | 4027 | public void registerProcessObserver(IProcessObserver observer) throws RemoteException { |
| 4028 | Parcel data = Parcel.obtain(); |
| 4029 | Parcel reply = Parcel.obtain(); |
| 4030 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4031 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 4032 | mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 4033 | reply.readException(); |
| 4034 | data.recycle(); |
| 4035 | reply.recycle(); |
| 4036 | } |
| 4037 | |
| 4038 | public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException { |
| 4039 | Parcel data = Parcel.obtain(); |
| 4040 | Parcel reply = Parcel.obtain(); |
| 4041 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4042 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 4043 | mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0); |
| 4044 | reply.readException(); |
| 4045 | data.recycle(); |
| 4046 | reply.recycle(); |
| 4047 | } |
| 4048 | |
Dianne Hackborn | 6c418d5 | 2011-06-29 14:05:33 -0700 | [diff] [blame] | 4049 | public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException { |
| 4050 | Parcel data = Parcel.obtain(); |
| 4051 | Parcel reply = Parcel.obtain(); |
| 4052 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4053 | data.writeStrongBinder(sender.asBinder()); |
| 4054 | mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0); |
| 4055 | reply.readException(); |
| 4056 | boolean res = reply.readInt() != 0; |
| 4057 | data.recycle(); |
| 4058 | reply.recycle(); |
| 4059 | return res; |
| 4060 | } |
| 4061 | |
Dianne Hackborn | 1927ae8 | 2012-06-22 15:21:36 -0700 | [diff] [blame] | 4062 | public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException { |
| 4063 | Parcel data = Parcel.obtain(); |
| 4064 | Parcel reply = Parcel.obtain(); |
| 4065 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4066 | data.writeStrongBinder(sender.asBinder()); |
| 4067 | mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0); |
| 4068 | reply.readException(); |
| 4069 | boolean res = reply.readInt() != 0; |
| 4070 | data.recycle(); |
| 4071 | reply.recycle(); |
| 4072 | return res; |
| 4073 | } |
| 4074 | |
Dianne Hackborn | 8103890 | 2012-11-26 17:04:09 -0800 | [diff] [blame] | 4075 | public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException { |
| 4076 | Parcel data = Parcel.obtain(); |
| 4077 | Parcel reply = Parcel.obtain(); |
| 4078 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4079 | data.writeStrongBinder(sender.asBinder()); |
| 4080 | mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0); |
| 4081 | reply.readException(); |
| 4082 | Intent res = reply.readInt() != 0 |
| 4083 | ? Intent.CREATOR.createFromParcel(reply) : null; |
| 4084 | data.recycle(); |
| 4085 | reply.recycle(); |
| 4086 | return res; |
| 4087 | } |
| 4088 | |
Dianne Hackborn | 31ca854 | 2011-07-19 14:58:28 -0700 | [diff] [blame] | 4089 | public void updatePersistentConfiguration(Configuration values) throws RemoteException |
| 4090 | { |
| 4091 | Parcel data = Parcel.obtain(); |
| 4092 | Parcel reply = Parcel.obtain(); |
| 4093 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4094 | values.writeToParcel(data, 0); |
| 4095 | mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0); |
| 4096 | reply.readException(); |
| 4097 | data.recycle(); |
| 4098 | reply.recycle(); |
| 4099 | } |
| 4100 | |
Dianne Hackborn | b437e09 | 2011-08-05 17:50:29 -0700 | [diff] [blame] | 4101 | public long[] getProcessPss(int[] pids) throws RemoteException { |
| 4102 | Parcel data = Parcel.obtain(); |
| 4103 | Parcel reply = Parcel.obtain(); |
| 4104 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4105 | data.writeIntArray(pids); |
| 4106 | mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0); |
| 4107 | reply.readException(); |
| 4108 | long[] res = reply.createLongArray(); |
| 4109 | data.recycle(); |
| 4110 | reply.recycle(); |
| 4111 | return res; |
| 4112 | } |
| 4113 | |
Dianne Hackborn | 661cd52 | 2011-08-22 00:26:20 -0700 | [diff] [blame] | 4114 | public void showBootMessage(CharSequence msg, boolean always) throws RemoteException { |
| 4115 | Parcel data = Parcel.obtain(); |
| 4116 | Parcel reply = Parcel.obtain(); |
| 4117 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4118 | TextUtils.writeToParcel(msg, data, 0); |
| 4119 | data.writeInt(always ? 1 : 0); |
| 4120 | mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0); |
| 4121 | reply.readException(); |
| 4122 | data.recycle(); |
| 4123 | reply.recycle(); |
| 4124 | } |
| 4125 | |
Dianne Hackborn | 90c52de | 2011-09-23 12:57:44 -0700 | [diff] [blame] | 4126 | public void dismissKeyguardOnNextActivity() throws RemoteException { |
| 4127 | Parcel data = Parcel.obtain(); |
| 4128 | Parcel reply = Parcel.obtain(); |
| 4129 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4130 | mRemote.transact(DISMISS_KEYGUARD_ON_NEXT_ACTIVITY_TRANSACTION, data, reply, 0); |
| 4131 | reply.readException(); |
| 4132 | data.recycle(); |
| 4133 | reply.recycle(); |
| 4134 | } |
| 4135 | |
Adam Powell | dd8fab2 | 2012-03-22 17:47:27 -0700 | [diff] [blame] | 4136 | public boolean targetTaskAffinityMatchesActivity(IBinder token, String destAffinity) |
| 4137 | throws RemoteException { |
| 4138 | Parcel data = Parcel.obtain(); |
| 4139 | Parcel reply = Parcel.obtain(); |
| 4140 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4141 | data.writeStrongBinder(token); |
| 4142 | data.writeString(destAffinity); |
| 4143 | mRemote.transact(TARGET_TASK_AFFINITY_MATCHES_ACTIVITY_TRANSACTION, data, reply, 0); |
| 4144 | reply.readException(); |
| 4145 | boolean result = reply.readInt() != 0; |
| 4146 | data.recycle(); |
| 4147 | reply.recycle(); |
| 4148 | return result; |
| 4149 | } |
| 4150 | |
| 4151 | public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData) |
| 4152 | throws RemoteException { |
| 4153 | Parcel data = Parcel.obtain(); |
| 4154 | Parcel reply = Parcel.obtain(); |
| 4155 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4156 | data.writeStrongBinder(token); |
| 4157 | target.writeToParcel(data, 0); |
| 4158 | data.writeInt(resultCode); |
| 4159 | if (resultData != null) { |
| 4160 | data.writeInt(1); |
| 4161 | resultData.writeToParcel(data, 0); |
| 4162 | } else { |
| 4163 | data.writeInt(0); |
| 4164 | } |
| 4165 | mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0); |
| 4166 | reply.readException(); |
| 4167 | boolean result = reply.readInt() != 0; |
| 4168 | data.recycle(); |
| 4169 | reply.recycle(); |
| 4170 | return result; |
| 4171 | } |
| 4172 | |
Dianne Hackborn | 5320eb8 | 2012-05-18 12:05:04 -0700 | [diff] [blame] | 4173 | public int getLaunchedFromUid(IBinder activityToken) throws RemoteException { |
| 4174 | Parcel data = Parcel.obtain(); |
| 4175 | Parcel reply = Parcel.obtain(); |
| 4176 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4177 | data.writeStrongBinder(activityToken); |
| 4178 | mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0); |
| 4179 | reply.readException(); |
| 4180 | int result = reply.readInt(); |
| 4181 | data.recycle(); |
| 4182 | reply.recycle(); |
| 4183 | return result; |
| 4184 | } |
| 4185 | |
Dianne Hackborn | f265ea9 | 2013-01-31 15:00:51 -0800 | [diff] [blame] | 4186 | public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException { |
| 4187 | Parcel data = Parcel.obtain(); |
| 4188 | Parcel reply = Parcel.obtain(); |
| 4189 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4190 | data.writeStrongBinder(activityToken); |
| 4191 | mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0); |
| 4192 | reply.readException(); |
| 4193 | String result = reply.readString(); |
| 4194 | data.recycle(); |
| 4195 | reply.recycle(); |
| 4196 | return result; |
| 4197 | } |
| 4198 | |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 4199 | public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 4200 | Parcel data = Parcel.obtain(); |
| 4201 | Parcel reply = Parcel.obtain(); |
| 4202 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4203 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 4204 | mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 4205 | reply.readException(); |
| 4206 | data.recycle(); |
| 4207 | reply.recycle(); |
| 4208 | } |
| 4209 | |
| 4210 | public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException { |
| 4211 | Parcel data = Parcel.obtain(); |
| 4212 | Parcel reply = Parcel.obtain(); |
| 4213 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4214 | data.writeStrongBinder(observer != null ? observer.asBinder() : null); |
| 4215 | mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0); |
| 4216 | reply.readException(); |
| 4217 | data.recycle(); |
| 4218 | reply.recycle(); |
| 4219 | } |
| 4220 | |
Dianne Hackborn | d4ac8d7 | 2012-09-27 23:20:10 -0700 | [diff] [blame] | 4221 | public void requestBugReport() throws RemoteException { |
| 4222 | Parcel data = Parcel.obtain(); |
| 4223 | Parcel reply = Parcel.obtain(); |
| 4224 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4225 | mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0); |
| 4226 | reply.readException(); |
| 4227 | data.recycle(); |
| 4228 | reply.recycle(); |
| 4229 | } |
| 4230 | |
Dianne Hackborn | 5fe7e2a | 2012-10-04 11:58:16 -0700 | [diff] [blame] | 4231 | public long inputDispatchingTimedOut(int pid, boolean aboveSystem) throws RemoteException { |
| 4232 | Parcel data = Parcel.obtain(); |
| 4233 | Parcel reply = Parcel.obtain(); |
| 4234 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4235 | data.writeInt(pid); |
| 4236 | data.writeInt(aboveSystem ? 1 : 0); |
| 4237 | mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0); |
| 4238 | reply.readException(); |
| 4239 | long res = reply.readInt(); |
| 4240 | data.recycle(); |
| 4241 | reply.recycle(); |
| 4242 | return res; |
| 4243 | } |
| 4244 | |
Dianne Hackborn | f9c5e0f | 2013-01-23 14:39:13 -0800 | [diff] [blame] | 4245 | public Bundle getTopActivityExtras(int requestType) throws RemoteException { |
| 4246 | Parcel data = Parcel.obtain(); |
| 4247 | Parcel reply = Parcel.obtain(); |
| 4248 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4249 | data.writeInt(requestType); |
| 4250 | mRemote.transact(GET_TOP_ACTIVITY_EXTRAS_TRANSACTION, data, reply, 0); |
| 4251 | reply.readException(); |
| 4252 | Bundle res = reply.readBundle(); |
| 4253 | data.recycle(); |
| 4254 | reply.recycle(); |
| 4255 | return res; |
| 4256 | } |
| 4257 | |
| 4258 | public void reportTopActivityExtras(IBinder token, Bundle extras) throws RemoteException { |
| 4259 | Parcel data = Parcel.obtain(); |
| 4260 | Parcel reply = Parcel.obtain(); |
| 4261 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4262 | data.writeStrongBinder(token); |
| 4263 | data.writeBundle(extras); |
| 4264 | mRemote.transact(REPORT_TOP_ACTIVITY_EXTRAS_TRANSACTION, data, reply, 0); |
| 4265 | reply.readException(); |
| 4266 | data.recycle(); |
| 4267 | reply.recycle(); |
| 4268 | } |
| 4269 | |
Dianne Hackborn | f1b7824 | 2013-04-08 22:28:59 -0700 | [diff] [blame] | 4270 | public void killUid(int uid, String reason) throws RemoteException { |
| 4271 | Parcel data = Parcel.obtain(); |
| 4272 | Parcel reply = Parcel.obtain(); |
| 4273 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4274 | data.writeInt(uid); |
| 4275 | data.writeString(reason); |
| 4276 | mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0); |
| 4277 | reply.readException(); |
| 4278 | data.recycle(); |
| 4279 | reply.recycle(); |
| 4280 | } |
| 4281 | |
Dianne Hackborn | 8bd64df | 2013-05-06 16:07:26 -0700 | [diff] [blame] | 4282 | public void hang(IBinder who, boolean allowRestart) throws RemoteException { |
| 4283 | Parcel data = Parcel.obtain(); |
| 4284 | Parcel reply = Parcel.obtain(); |
| 4285 | data.writeInterfaceToken(IActivityManager.descriptor); |
| 4286 | data.writeStrongBinder(who); |
| 4287 | data.writeInt(allowRestart ? 1 : 0); |
| 4288 | mRemote.transact(HANG_TRANSACTION, data, reply, 0); |
| 4289 | reply.readException(); |
| 4290 | data.recycle(); |
| 4291 | reply.recycle(); |
| 4292 | } |
| 4293 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4294 | private IBinder mRemote; |
| 4295 | } |