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