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