blob: 0f38095a0b34f65c37184fe1d2f0a4c2276f6e1b [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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
17package android.app;
18
Craig Mautnerbdc748af2013-12-02 14:08:25 -080019import android.app.ActivityManager.StackInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080020import android.content.ComponentName;
Adam Powelldd8fab22012-03-22 17:47:27 -070021import android.content.IIntentReceiver;
22import android.content.IIntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023import android.content.Intent;
24import android.content.IntentFilter;
Dianne Hackbornfa82f222009-09-17 15:14:12 -070025import android.content.IntentSender;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070026import android.content.UriPermission;
Christopher Tate181fafa2009-05-14 11:12:14 -070027import android.content.pm.ApplicationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080028import android.content.pm.ConfigurationInfo;
29import android.content.pm.IPackageDataObserver;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070030import android.content.pm.ParceledListSlice;
Amith Yamasani52f1d752012-03-28 18:19:29 -070031import android.content.pm.UserInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080032import android.content.res.Configuration;
33import android.graphics.Bitmap;
Craig Mautnerbdc748af2013-12-02 14:08:25 -080034import android.graphics.Rect;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035import android.net.Uri;
36import android.os.Binder;
37import android.os.Bundle;
Dianne Hackborn3025ef32009-08-31 21:31:47 -070038import android.os.Debug;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080039import android.os.IBinder;
40import android.os.Parcel;
Adam Powelldd8fab22012-03-22 17:47:27 -070041import android.os.ParcelFileDescriptor;
42import android.os.Parcelable;
43import android.os.RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080044import android.os.ServiceManager;
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -070045import android.os.StrictMode;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080046import android.text.TextUtils;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080047import android.util.Log;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080048import android.util.Singleton;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080049
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080050import java.util.ArrayList;
51import java.util.List;
52
53/** {@hide} */
54public abstract class ActivityManagerNative extends Binder implements IActivityManager
55{
56 /**
57 * Cast a Binder object into an activity manager interface, generating
58 * a proxy if needed.
59 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080060 static public IActivityManager asInterface(IBinder obj) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080061 if (obj == null) {
62 return null;
63 }
64 IActivityManager in =
65 (IActivityManager)obj.queryLocalInterface(descriptor);
66 if (in != null) {
67 return in;
68 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080069
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080070 return new ActivityManagerProxy(obj);
71 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080072
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080073 /**
74 * Retrieve the system's default/global activity manager.
75 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080076 static public IActivityManager getDefault() {
77 return gDefault.get();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080078 }
79
80 /**
81 * Convenience for checking whether the system is ready. For internal use only.
82 */
83 static public boolean isSystemReady() {
84 if (!sSystemReady) {
85 sSystemReady = getDefault().testIsSystemReady();
86 }
87 return sSystemReady;
88 }
89 static boolean sSystemReady = false;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080090
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080091 /**
92 * Convenience for sending a sticky broadcast. For internal use only.
93 * If you don't care about permission, use null.
94 */
Dianne Hackborn5ac72a22012-08-29 18:32:08 -070095 static public void broadcastStickyIntent(Intent intent, String permission, int userId) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080096 try {
97 getDefault().broadcastIntent(
98 null, intent, null, null, Activity.RESULT_OK, null, null,
Dianne Hackbornf51f6122013-02-04 18:23:34 -080099 null /*permission*/, AppOpsManager.OP_NONE, false, true, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800100 } catch (RemoteException ex) {
101 }
102 }
103
104 static public void noteWakeupAlarm(PendingIntent ps) {
105 try {
106 getDefault().noteWakeupAlarm(ps.getTarget());
107 } catch (RemoteException ex) {
108 }
109 }
110
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -0800111 public ActivityManagerNative() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800112 attachInterface(this, descriptor);
113 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700114
115 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800116 public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
117 throws RemoteException {
118 switch (code) {
119 case START_ACTIVITY_TRANSACTION:
120 {
121 data.enforceInterface(IActivityManager.descriptor);
122 IBinder b = data.readStrongBinder();
123 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800124 String callingPackage = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800125 Intent intent = Intent.CREATOR.createFromParcel(data);
126 String resolvedType = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800127 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800128 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800129 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700130 int startFlags = data.readInt();
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700131 String profileFile = data.readString();
132 ParcelFileDescriptor profileFd = data.readInt() != 0
133 ? data.readFileDescriptor() : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700134 Bundle options = data.readInt() != 0
135 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800136 int result = startActivity(app, callingPackage, intent, resolvedType,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700137 resultTo, resultWho, requestCode, startFlags,
138 profileFile, profileFd, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800139 reply.writeNoException();
140 reply.writeInt(result);
141 return true;
142 }
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700143
Amith Yamasani82644082012-08-03 13:09:11 -0700144 case START_ACTIVITY_AS_USER_TRANSACTION:
145 {
146 data.enforceInterface(IActivityManager.descriptor);
147 IBinder b = data.readStrongBinder();
148 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800149 String callingPackage = data.readString();
Amith Yamasani82644082012-08-03 13:09:11 -0700150 Intent intent = Intent.CREATOR.createFromParcel(data);
151 String resolvedType = data.readString();
152 IBinder resultTo = data.readStrongBinder();
153 String resultWho = data.readString();
154 int requestCode = data.readInt();
155 int startFlags = data.readInt();
156 String profileFile = data.readString();
157 ParcelFileDescriptor profileFd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -0700158 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Amith Yamasani82644082012-08-03 13:09:11 -0700159 Bundle options = data.readInt() != 0
160 ? Bundle.CREATOR.createFromParcel(data) : null;
161 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800162 int result = startActivityAsUser(app, callingPackage, intent, resolvedType,
Amith Yamasani82644082012-08-03 13:09:11 -0700163 resultTo, resultWho, requestCode, startFlags,
164 profileFile, profileFd, options, userId);
165 reply.writeNoException();
166 reply.writeInt(result);
167 return true;
168 }
169
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800170 case START_ACTIVITY_AND_WAIT_TRANSACTION:
171 {
172 data.enforceInterface(IActivityManager.descriptor);
173 IBinder b = data.readStrongBinder();
174 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800175 String callingPackage = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800176 Intent intent = Intent.CREATOR.createFromParcel(data);
177 String resolvedType = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800178 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800179 String resultWho = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800180 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700181 int startFlags = data.readInt();
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700182 String profileFile = data.readString();
183 ParcelFileDescriptor profileFd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -0700184 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700185 Bundle options = data.readInt() != 0
186 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -0700187 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800188 WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700189 resultTo, resultWho, requestCode, startFlags,
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -0700190 profileFile, profileFd, options, userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800191 reply.writeNoException();
192 result.writeToParcel(reply, 0);
193 return true;
194 }
195
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700196 case START_ACTIVITY_WITH_CONFIG_TRANSACTION:
197 {
198 data.enforceInterface(IActivityManager.descriptor);
199 IBinder b = data.readStrongBinder();
200 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800201 String callingPackage = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700202 Intent intent = Intent.CREATOR.createFromParcel(data);
203 String resolvedType = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700204 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700205 String resultWho = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700206 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700207 int startFlags = data.readInt();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700208 Configuration config = Configuration.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700209 Bundle options = data.readInt() != 0
210 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -0700211 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800212 int result = startActivityWithConfig(app, callingPackage, intent, resolvedType,
Dianne Hackborn41203752012-08-31 14:05:51 -0700213 resultTo, resultWho, requestCode, startFlags, config, options, userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700214 reply.writeNoException();
215 reply.writeInt(result);
216 return true;
217 }
218
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700219 case START_ACTIVITY_INTENT_SENDER_TRANSACTION:
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700220 {
221 data.enforceInterface(IActivityManager.descriptor);
222 IBinder b = data.readStrongBinder();
223 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700224 IntentSender intent = IntentSender.CREATOR.createFromParcel(data);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700225 Intent fillInIntent = null;
226 if (data.readInt() != 0) {
227 fillInIntent = Intent.CREATOR.createFromParcel(data);
228 }
229 String resolvedType = data.readString();
230 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700231 String resultWho = data.readString();
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700232 int requestCode = data.readInt();
233 int flagsMask = data.readInt();
234 int flagsValues = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700235 Bundle options = data.readInt() != 0
236 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700237 int result = startActivityIntentSender(app, intent,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700238 fillInIntent, resolvedType, resultTo, resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700239 requestCode, flagsMask, flagsValues, options);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700240 reply.writeNoException();
241 reply.writeInt(result);
242 return true;
243 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700244
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800245 case START_NEXT_MATCHING_ACTIVITY_TRANSACTION:
246 {
247 data.enforceInterface(IActivityManager.descriptor);
248 IBinder callingActivity = data.readStrongBinder();
249 Intent intent = Intent.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700250 Bundle options = data.readInt() != 0
251 ? Bundle.CREATOR.createFromParcel(data) : null;
252 boolean result = startNextMatchingActivity(callingActivity, intent, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800253 reply.writeNoException();
254 reply.writeInt(result ? 1 : 0);
255 return true;
256 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700257
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800258 case FINISH_ACTIVITY_TRANSACTION: {
259 data.enforceInterface(IActivityManager.descriptor);
260 IBinder token = data.readStrongBinder();
261 Intent resultData = null;
262 int resultCode = data.readInt();
263 if (data.readInt() != 0) {
264 resultData = Intent.CREATOR.createFromParcel(data);
265 }
266 boolean res = finishActivity(token, resultCode, resultData);
267 reply.writeNoException();
268 reply.writeInt(res ? 1 : 0);
269 return true;
270 }
271
272 case FINISH_SUB_ACTIVITY_TRANSACTION: {
273 data.enforceInterface(IActivityManager.descriptor);
274 IBinder token = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700275 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800276 int requestCode = data.readInt();
277 finishSubActivity(token, resultWho, requestCode);
278 reply.writeNoException();
279 return true;
280 }
281
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700282 case FINISH_ACTIVITY_AFFINITY_TRANSACTION: {
283 data.enforceInterface(IActivityManager.descriptor);
284 IBinder token = data.readStrongBinder();
285 boolean res = finishActivityAffinity(token);
286 reply.writeNoException();
287 reply.writeInt(res ? 1 : 0);
288 return true;
289 }
290
Dianne Hackborn061d58a2010-03-12 15:07:06 -0800291 case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: {
292 data.enforceInterface(IActivityManager.descriptor);
293 IBinder token = data.readStrongBinder();
294 boolean res = willActivityBeVisible(token);
295 reply.writeNoException();
296 reply.writeInt(res ? 1 : 0);
297 return true;
298 }
299
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800300 case REGISTER_RECEIVER_TRANSACTION:
301 {
302 data.enforceInterface(IActivityManager.descriptor);
303 IBinder b = data.readStrongBinder();
304 IApplicationThread app =
305 b != null ? ApplicationThreadNative.asInterface(b) : null;
Dianne Hackborn6c418d52011-06-29 14:05:33 -0700306 String packageName = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800307 b = data.readStrongBinder();
308 IIntentReceiver rec
309 = b != null ? IIntentReceiver.Stub.asInterface(b) : null;
310 IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data);
311 String perm = data.readString();
Dianne Hackborn20e80982012-08-31 19:00:44 -0700312 int userId = data.readInt();
313 Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800314 reply.writeNoException();
315 if (intent != null) {
316 reply.writeInt(1);
317 intent.writeToParcel(reply, 0);
318 } else {
319 reply.writeInt(0);
320 }
321 return true;
322 }
323
324 case UNREGISTER_RECEIVER_TRANSACTION:
325 {
326 data.enforceInterface(IActivityManager.descriptor);
327 IBinder b = data.readStrongBinder();
328 if (b == null) {
329 return true;
330 }
331 IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b);
332 unregisterReceiver(rec);
333 reply.writeNoException();
334 return true;
335 }
336
337 case BROADCAST_INTENT_TRANSACTION:
338 {
339 data.enforceInterface(IActivityManager.descriptor);
340 IBinder b = data.readStrongBinder();
341 IApplicationThread app =
342 b != null ? ApplicationThreadNative.asInterface(b) : null;
343 Intent intent = Intent.CREATOR.createFromParcel(data);
344 String resolvedType = data.readString();
345 b = data.readStrongBinder();
346 IIntentReceiver resultTo =
347 b != null ? IIntentReceiver.Stub.asInterface(b) : null;
348 int resultCode = data.readInt();
349 String resultData = data.readString();
350 Bundle resultExtras = data.readBundle();
351 String perm = data.readString();
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800352 int appOp = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800353 boolean serialized = data.readInt() != 0;
354 boolean sticky = data.readInt() != 0;
Amith Yamasani742a6712011-05-04 14:49:28 -0700355 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800356 int res = broadcastIntent(app, intent, resolvedType, resultTo,
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800357 resultCode, resultData, resultExtras, perm, appOp,
Amith Yamasani742a6712011-05-04 14:49:28 -0700358 serialized, sticky, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800359 reply.writeNoException();
360 reply.writeInt(res);
361 return true;
362 }
363
364 case UNBROADCAST_INTENT_TRANSACTION:
365 {
366 data.enforceInterface(IActivityManager.descriptor);
367 IBinder b = data.readStrongBinder();
368 IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null;
369 Intent intent = Intent.CREATOR.createFromParcel(data);
Amith Yamasani742a6712011-05-04 14:49:28 -0700370 int userId = data.readInt();
371 unbroadcastIntent(app, intent, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800372 reply.writeNoException();
373 return true;
374 }
375
376 case FINISH_RECEIVER_TRANSACTION: {
377 data.enforceInterface(IActivityManager.descriptor);
378 IBinder who = data.readStrongBinder();
379 int resultCode = data.readInt();
380 String resultData = data.readString();
381 Bundle resultExtras = data.readBundle();
382 boolean resultAbort = data.readInt() != 0;
383 if (who != null) {
384 finishReceiver(who, resultCode, resultData, resultExtras, resultAbort);
385 }
386 reply.writeNoException();
387 return true;
388 }
389
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800390 case ATTACH_APPLICATION_TRANSACTION: {
391 data.enforceInterface(IActivityManager.descriptor);
392 IApplicationThread app = ApplicationThreadNative.asInterface(
393 data.readStrongBinder());
394 if (app != null) {
395 attachApplication(app);
396 }
397 reply.writeNoException();
398 return true;
399 }
400
401 case ACTIVITY_IDLE_TRANSACTION: {
402 data.enforceInterface(IActivityManager.descriptor);
403 IBinder token = data.readStrongBinder();
Dianne Hackborne88846e2009-09-30 21:34:25 -0700404 Configuration config = null;
405 if (data.readInt() != 0) {
406 config = Configuration.CREATOR.createFromParcel(data);
407 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700408 boolean stopProfiling = data.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800409 if (token != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700410 activityIdle(token, config, stopProfiling);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800411 }
412 reply.writeNoException();
413 return true;
414 }
415
Dianne Hackbornad9b32112012-09-17 15:35:01 -0700416 case ACTIVITY_RESUMED_TRANSACTION: {
417 data.enforceInterface(IActivityManager.descriptor);
418 IBinder token = data.readStrongBinder();
419 activityResumed(token);
420 reply.writeNoException();
421 return true;
422 }
423
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800424 case ACTIVITY_PAUSED_TRANSACTION: {
425 data.enforceInterface(IActivityManager.descriptor);
426 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800427 activityPaused(token);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800428 reply.writeNoException();
429 return true;
430 }
431
432 case ACTIVITY_STOPPED_TRANSACTION: {
433 data.enforceInterface(IActivityManager.descriptor);
434 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800435 Bundle map = data.readBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800436 Bitmap thumbnail = data.readInt() != 0
437 ? Bitmap.CREATOR.createFromParcel(data) : null;
438 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800439 activityStopped(token, map, thumbnail, description);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800440 reply.writeNoException();
441 return true;
442 }
443
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800444 case ACTIVITY_SLEPT_TRANSACTION: {
445 data.enforceInterface(IActivityManager.descriptor);
446 IBinder token = data.readStrongBinder();
447 activitySlept(token);
448 reply.writeNoException();
449 return true;
450 }
451
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800452 case ACTIVITY_DESTROYED_TRANSACTION: {
453 data.enforceInterface(IActivityManager.descriptor);
454 IBinder token = data.readStrongBinder();
455 activityDestroyed(token);
456 reply.writeNoException();
457 return true;
458 }
459
460 case GET_CALLING_PACKAGE_TRANSACTION: {
461 data.enforceInterface(IActivityManager.descriptor);
462 IBinder token = data.readStrongBinder();
463 String res = token != null ? getCallingPackage(token) : null;
464 reply.writeNoException();
465 reply.writeString(res);
466 return true;
467 }
468
469 case GET_CALLING_ACTIVITY_TRANSACTION: {
470 data.enforceInterface(IActivityManager.descriptor);
471 IBinder token = data.readStrongBinder();
472 ComponentName cn = getCallingActivity(token);
473 reply.writeNoException();
474 ComponentName.writeToParcel(cn, reply);
475 return true;
476 }
477
478 case GET_TASKS_TRANSACTION: {
479 data.enforceInterface(IActivityManager.descriptor);
480 int maxNum = data.readInt();
481 int fl = data.readInt();
482 IBinder receiverBinder = data.readStrongBinder();
483 IThumbnailReceiver receiver = receiverBinder != null
484 ? IThumbnailReceiver.Stub.asInterface(receiverBinder)
485 : null;
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700486 List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl, receiver);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800487 reply.writeNoException();
488 int N = list != null ? list.size() : -1;
489 reply.writeInt(N);
490 int i;
491 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700492 ActivityManager.RunningTaskInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800493 info.writeToParcel(reply, 0);
494 }
495 return true;
496 }
497
498 case GET_RECENT_TASKS_TRANSACTION: {
499 data.enforceInterface(IActivityManager.descriptor);
500 int maxNum = data.readInt();
501 int fl = data.readInt();
Amith Yamasani82644082012-08-03 13:09:11 -0700502 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800503 List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -0700504 fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800505 reply.writeNoException();
506 reply.writeTypedList(list);
507 return true;
508 }
Dianne Hackborn15491c62012-09-19 10:59:14 -0700509
Dianne Hackbornf26fd992011-04-08 18:14:09 -0700510 case GET_TASK_THUMBNAILS_TRANSACTION: {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800511 data.enforceInterface(IActivityManager.descriptor);
512 int id = data.readInt();
Dianne Hackbornf26fd992011-04-08 18:14:09 -0700513 ActivityManager.TaskThumbnails bm = getTaskThumbnails(id);
Dianne Hackbornd94df452011-02-16 18:53:31 -0800514 reply.writeNoException();
515 if (bm != null) {
516 reply.writeInt(1);
517 bm.writeToParcel(reply, 0);
518 } else {
519 reply.writeInt(0);
520 }
521 return true;
522 }
Dianne Hackborn15491c62012-09-19 10:59:14 -0700523
524 case GET_TASK_TOP_THUMBNAIL_TRANSACTION: {
525 data.enforceInterface(IActivityManager.descriptor);
526 int id = data.readInt();
527 Bitmap bm = getTaskTopThumbnail(id);
528 reply.writeNoException();
529 if (bm != null) {
530 reply.writeInt(1);
531 bm.writeToParcel(reply, 0);
532 } else {
533 reply.writeInt(0);
534 }
535 return true;
536 }
537
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800538 case GET_SERVICES_TRANSACTION: {
539 data.enforceInterface(IActivityManager.descriptor);
540 int maxNum = data.readInt();
541 int fl = data.readInt();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700542 List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800543 reply.writeNoException();
544 int N = list != null ? list.size() : -1;
545 reply.writeInt(N);
546 int i;
547 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700548 ActivityManager.RunningServiceInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800549 info.writeToParcel(reply, 0);
550 }
551 return true;
552 }
553
554 case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: {
555 data.enforceInterface(IActivityManager.descriptor);
556 List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState();
557 reply.writeNoException();
558 reply.writeTypedList(list);
559 return true;
560 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700561
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800562 case GET_RUNNING_APP_PROCESSES_TRANSACTION: {
563 data.enforceInterface(IActivityManager.descriptor);
564 List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses();
565 reply.writeNoException();
566 reply.writeTypedList(list);
567 return true;
568 }
569
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -0700570 case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: {
571 data.enforceInterface(IActivityManager.descriptor);
572 List<ApplicationInfo> list = getRunningExternalApplications();
573 reply.writeNoException();
574 reply.writeTypedList(list);
575 return true;
576 }
577
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800578 case MOVE_TASK_TO_FRONT_TRANSACTION: {
579 data.enforceInterface(IActivityManager.descriptor);
580 int task = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800581 int fl = data.readInt();
Dianne Hackborn8078d8c2012-03-20 11:11:26 -0700582 Bundle options = data.readInt() != 0
583 ? Bundle.CREATOR.createFromParcel(data) : null;
584 moveTaskToFront(task, fl, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800585 reply.writeNoException();
586 return true;
587 }
588
589 case MOVE_TASK_TO_BACK_TRANSACTION: {
590 data.enforceInterface(IActivityManager.descriptor);
591 int task = data.readInt();
592 moveTaskToBack(task);
593 reply.writeNoException();
594 return true;
595 }
596
597 case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: {
598 data.enforceInterface(IActivityManager.descriptor);
599 IBinder token = data.readStrongBinder();
600 boolean nonRoot = data.readInt() != 0;
601 boolean res = moveActivityTaskToBack(token, nonRoot);
602 reply.writeNoException();
603 reply.writeInt(res ? 1 : 0);
604 return true;
605 }
606
607 case MOVE_TASK_BACKWARDS_TRANSACTION: {
608 data.enforceInterface(IActivityManager.descriptor);
609 int task = data.readInt();
610 moveTaskBackwards(task);
611 reply.writeNoException();
612 return true;
613 }
614
Craig Mautnerc00204b2013-03-05 15:02:14 -0800615 case MOVE_TASK_TO_STACK_TRANSACTION: {
616 data.enforceInterface(IActivityManager.descriptor);
617 int taskId = data.readInt();
618 int stackId = data.readInt();
619 boolean toTop = data.readInt() != 0;
620 moveTaskToStack(taskId, stackId, toTop);
621 reply.writeNoException();
622 return true;
623 }
624
625 case RESIZE_STACK_TRANSACTION: {
626 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800627 int stackId = data.readInt();
Craig Mautnerc00204b2013-03-05 15:02:14 -0800628 float weight = data.readFloat();
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800629 Rect r = Rect.CREATOR.createFromParcel(data);
630 resizeStack(stackId, r);
Craig Mautnerc00204b2013-03-05 15:02:14 -0800631 reply.writeNoException();
632 return true;
633 }
634
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800635 case GET_ALL_STACK_INFOS_TRANSACTION: {
Craig Mautner5ff12102013-05-24 12:50:15 -0700636 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800637 List<StackInfo> list = getAllStackInfos();
Craig Mautner5ff12102013-05-24 12:50:15 -0700638 reply.writeNoException();
639 reply.writeTypedList(list);
640 return true;
641 }
642
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800643 case GET_STACK_INFO_TRANSACTION: {
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700644 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800645 int stackId = data.readInt();
646 StackInfo info = getStackInfo(stackId);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700647 reply.writeNoException();
648 if (info != null) {
649 reply.writeInt(1);
650 info.writeToParcel(reply, 0);
651 } else {
652 reply.writeInt(0);
653 }
654 return true;
655 }
656
Craig Mautnercf910b02013-04-23 11:23:27 -0700657 case SET_FOCUSED_STACK_TRANSACTION: {
658 data.enforceInterface(IActivityManager.descriptor);
659 int stackId = data.readInt();
660 setFocusedStack(stackId);
661 reply.writeNoException();
662 return true;
663 }
664
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800665 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
666 data.enforceInterface(IActivityManager.descriptor);
667 IBinder token = data.readStrongBinder();
668 boolean onlyRoot = data.readInt() != 0;
669 int res = token != null
670 ? getTaskForActivity(token, onlyRoot) : -1;
671 reply.writeNoException();
672 reply.writeInt(res);
673 return true;
674 }
675
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800676 case REPORT_THUMBNAIL_TRANSACTION: {
677 data.enforceInterface(IActivityManager.descriptor);
678 IBinder token = data.readStrongBinder();
679 Bitmap thumbnail = data.readInt() != 0
680 ? Bitmap.CREATOR.createFromParcel(data) : null;
681 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
682 reportThumbnail(token, thumbnail, description);
683 reply.writeNoException();
684 return true;
685 }
686
687 case GET_CONTENT_PROVIDER_TRANSACTION: {
688 data.enforceInterface(IActivityManager.descriptor);
689 IBinder b = data.readStrongBinder();
690 IApplicationThread app = ApplicationThreadNative.asInterface(b);
691 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700692 int userId = data.readInt();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700693 boolean stable = data.readInt() != 0;
Jeff Sharkey6d515712012-09-20 16:06:08 -0700694 ContentProviderHolder cph = getContentProvider(app, name, userId, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800695 reply.writeNoException();
696 if (cph != null) {
697 reply.writeInt(1);
698 cph.writeToParcel(reply, 0);
699 } else {
700 reply.writeInt(0);
701 }
702 return true;
703 }
704
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800705 case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
706 data.enforceInterface(IActivityManager.descriptor);
707 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700708 int userId = data.readInt();
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800709 IBinder token = data.readStrongBinder();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700710 ContentProviderHolder cph = getContentProviderExternal(name, userId, token);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800711 reply.writeNoException();
712 if (cph != null) {
713 reply.writeInt(1);
714 cph.writeToParcel(reply, 0);
715 } else {
716 reply.writeInt(0);
717 }
718 return true;
719 }
720
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800721 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
722 data.enforceInterface(IActivityManager.descriptor);
723 IBinder b = data.readStrongBinder();
724 IApplicationThread app = ApplicationThreadNative.asInterface(b);
725 ArrayList<ContentProviderHolder> providers =
726 data.createTypedArrayList(ContentProviderHolder.CREATOR);
727 publishContentProviders(app, providers);
728 reply.writeNoException();
729 return true;
730 }
731
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700732 case REF_CONTENT_PROVIDER_TRANSACTION: {
733 data.enforceInterface(IActivityManager.descriptor);
734 IBinder b = data.readStrongBinder();
735 int stable = data.readInt();
736 int unstable = data.readInt();
737 boolean res = refContentProvider(b, stable, unstable);
738 reply.writeNoException();
739 reply.writeInt(res ? 1 : 0);
740 return true;
741 }
742
743 case UNSTABLE_PROVIDER_DIED_TRANSACTION: {
744 data.enforceInterface(IActivityManager.descriptor);
745 IBinder b = data.readStrongBinder();
746 unstableProviderDied(b);
747 reply.writeNoException();
748 return true;
749 }
750
Jeff Sharkey7aa76012013-09-30 14:26:27 -0700751 case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: {
752 data.enforceInterface(IActivityManager.descriptor);
753 IBinder b = data.readStrongBinder();
754 appNotRespondingViaProvider(b);
755 reply.writeNoException();
756 return true;
757 }
758
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800759 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
760 data.enforceInterface(IActivityManager.descriptor);
761 IBinder b = data.readStrongBinder();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700762 boolean stable = data.readInt() != 0;
763 removeContentProvider(b, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800764 reply.writeNoException();
765 return true;
766 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800767
768 case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
769 data.enforceInterface(IActivityManager.descriptor);
770 String name = data.readString();
771 IBinder token = data.readStrongBinder();
772 removeContentProviderExternal(name, token);
773 reply.writeNoException();
774 return true;
775 }
776
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700777 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
778 data.enforceInterface(IActivityManager.descriptor);
779 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
780 PendingIntent pi = getRunningServiceControlPanel(comp);
781 reply.writeNoException();
782 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
783 return true;
784 }
785
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800786 case START_SERVICE_TRANSACTION: {
787 data.enforceInterface(IActivityManager.descriptor);
788 IBinder b = data.readStrongBinder();
789 IApplicationThread app = ApplicationThreadNative.asInterface(b);
790 Intent service = Intent.CREATOR.createFromParcel(data);
791 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700792 int userId = data.readInt();
793 ComponentName cn = startService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800794 reply.writeNoException();
795 ComponentName.writeToParcel(cn, reply);
796 return true;
797 }
798
799 case STOP_SERVICE_TRANSACTION: {
800 data.enforceInterface(IActivityManager.descriptor);
801 IBinder b = data.readStrongBinder();
802 IApplicationThread app = ApplicationThreadNative.asInterface(b);
803 Intent service = Intent.CREATOR.createFromParcel(data);
804 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700805 int userId = data.readInt();
806 int res = stopService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800807 reply.writeNoException();
808 reply.writeInt(res);
809 return true;
810 }
811
812 case STOP_SERVICE_TOKEN_TRANSACTION: {
813 data.enforceInterface(IActivityManager.descriptor);
814 ComponentName className = ComponentName.readFromParcel(data);
815 IBinder token = data.readStrongBinder();
816 int startId = data.readInt();
817 boolean res = stopServiceToken(className, token, startId);
818 reply.writeNoException();
819 reply.writeInt(res ? 1 : 0);
820 return true;
821 }
822
823 case SET_SERVICE_FOREGROUND_TRANSACTION: {
824 data.enforceInterface(IActivityManager.descriptor);
825 ComponentName className = ComponentName.readFromParcel(data);
826 IBinder token = data.readStrongBinder();
Dianne Hackbornd8a43f62009-08-17 23:33:56 -0700827 int id = data.readInt();
828 Notification notification = null;
829 if (data.readInt() != 0) {
830 notification = Notification.CREATOR.createFromParcel(data);
831 }
832 boolean removeNotification = data.readInt() != 0;
833 setServiceForeground(className, token, id, notification, removeNotification);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800834 reply.writeNoException();
835 return true;
836 }
837
838 case BIND_SERVICE_TRANSACTION: {
839 data.enforceInterface(IActivityManager.descriptor);
840 IBinder b = data.readStrongBinder();
841 IApplicationThread app = ApplicationThreadNative.asInterface(b);
842 IBinder token = data.readStrongBinder();
843 Intent service = Intent.CREATOR.createFromParcel(data);
844 String resolvedType = data.readString();
845 b = data.readStrongBinder();
846 int fl = data.readInt();
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800847 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800848 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800849 int res = bindService(app, token, service, resolvedType, conn, fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800850 reply.writeNoException();
851 reply.writeInt(res);
852 return true;
853 }
854
855 case UNBIND_SERVICE_TRANSACTION: {
856 data.enforceInterface(IActivityManager.descriptor);
857 IBinder b = data.readStrongBinder();
858 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
859 boolean res = unbindService(conn);
860 reply.writeNoException();
861 reply.writeInt(res ? 1 : 0);
862 return true;
863 }
864
865 case PUBLISH_SERVICE_TRANSACTION: {
866 data.enforceInterface(IActivityManager.descriptor);
867 IBinder token = data.readStrongBinder();
868 Intent intent = Intent.CREATOR.createFromParcel(data);
869 IBinder service = data.readStrongBinder();
870 publishService(token, intent, service);
871 reply.writeNoException();
872 return true;
873 }
874
875 case UNBIND_FINISHED_TRANSACTION: {
876 data.enforceInterface(IActivityManager.descriptor);
877 IBinder token = data.readStrongBinder();
878 Intent intent = Intent.CREATOR.createFromParcel(data);
879 boolean doRebind = data.readInt() != 0;
880 unbindFinished(token, intent, doRebind);
881 reply.writeNoException();
882 return true;
883 }
884
885 case SERVICE_DONE_EXECUTING_TRANSACTION: {
886 data.enforceInterface(IActivityManager.descriptor);
887 IBinder token = data.readStrongBinder();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -0700888 int type = data.readInt();
889 int startId = data.readInt();
890 int res = data.readInt();
891 serviceDoneExecuting(token, type, startId, res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800892 reply.writeNoException();
893 return true;
894 }
895
896 case START_INSTRUMENTATION_TRANSACTION: {
897 data.enforceInterface(IActivityManager.descriptor);
898 ComponentName className = ComponentName.readFromParcel(data);
899 String profileFile = data.readString();
900 int fl = data.readInt();
901 Bundle arguments = data.readBundle();
902 IBinder b = data.readStrongBinder();
903 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
Svetoslav Ganov80943d82013-01-02 10:25:37 -0800904 b = data.readStrongBinder();
905 IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -0700906 int userId = data.readInt();
Svetoslav Ganov80943d82013-01-02 10:25:37 -0800907 boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800908 reply.writeNoException();
909 reply.writeInt(res ? 1 : 0);
910 return true;
911 }
912
913
914 case FINISH_INSTRUMENTATION_TRANSACTION: {
915 data.enforceInterface(IActivityManager.descriptor);
916 IBinder b = data.readStrongBinder();
917 IApplicationThread app = ApplicationThreadNative.asInterface(b);
918 int resultCode = data.readInt();
919 Bundle results = data.readBundle();
920 finishInstrumentation(app, resultCode, results);
921 reply.writeNoException();
922 return true;
923 }
924
925 case GET_CONFIGURATION_TRANSACTION: {
926 data.enforceInterface(IActivityManager.descriptor);
927 Configuration config = getConfiguration();
928 reply.writeNoException();
929 config.writeToParcel(reply, 0);
930 return true;
931 }
932
933 case UPDATE_CONFIGURATION_TRANSACTION: {
934 data.enforceInterface(IActivityManager.descriptor);
935 Configuration config = Configuration.CREATOR.createFromParcel(data);
936 updateConfiguration(config);
937 reply.writeNoException();
938 return true;
939 }
940
941 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
942 data.enforceInterface(IActivityManager.descriptor);
943 IBinder token = data.readStrongBinder();
944 int requestedOrientation = data.readInt();
945 setRequestedOrientation(token, requestedOrientation);
946 reply.writeNoException();
947 return true;
948 }
949
950 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
951 data.enforceInterface(IActivityManager.descriptor);
952 IBinder token = data.readStrongBinder();
953 int req = getRequestedOrientation(token);
954 reply.writeNoException();
955 reply.writeInt(req);
956 return true;
957 }
958
959 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
960 data.enforceInterface(IActivityManager.descriptor);
961 IBinder token = data.readStrongBinder();
962 ComponentName cn = getActivityClassForToken(token);
963 reply.writeNoException();
964 ComponentName.writeToParcel(cn, reply);
965 return true;
966 }
967
968 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
969 data.enforceInterface(IActivityManager.descriptor);
970 IBinder token = data.readStrongBinder();
971 reply.writeNoException();
972 reply.writeString(getPackageForToken(token));
973 return true;
974 }
975
976 case GET_INTENT_SENDER_TRANSACTION: {
977 data.enforceInterface(IActivityManager.descriptor);
978 int type = data.readInt();
979 String packageName = data.readString();
980 IBinder token = data.readStrongBinder();
981 String resultWho = data.readString();
982 int requestCode = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800983 Intent[] requestIntents;
984 String[] requestResolvedTypes;
985 if (data.readInt() != 0) {
986 requestIntents = data.createTypedArray(Intent.CREATOR);
987 requestResolvedTypes = data.createStringArray();
988 } else {
989 requestIntents = null;
990 requestResolvedTypes = null;
991 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800992 int fl = data.readInt();
Dianne Hackborn7a2195c2012-03-19 17:38:00 -0700993 Bundle options = data.readInt() != 0
994 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -0700995 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800996 IIntentSender res = getIntentSender(type, packageName, token,
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800997 resultWho, requestCode, requestIntents,
Dianne Hackborn41203752012-08-31 14:05:51 -0700998 requestResolvedTypes, fl, options, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800999 reply.writeNoException();
1000 reply.writeStrongBinder(res != null ? res.asBinder() : null);
1001 return true;
1002 }
1003
1004 case CANCEL_INTENT_SENDER_TRANSACTION: {
1005 data.enforceInterface(IActivityManager.descriptor);
1006 IIntentSender r = IIntentSender.Stub.asInterface(
1007 data.readStrongBinder());
1008 cancelIntentSender(r);
1009 reply.writeNoException();
1010 return true;
1011 }
1012
1013 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
1014 data.enforceInterface(IActivityManager.descriptor);
1015 IIntentSender r = IIntentSender.Stub.asInterface(
1016 data.readStrongBinder());
1017 String res = getPackageForIntentSender(r);
1018 reply.writeNoException();
1019 reply.writeString(res);
1020 return true;
1021 }
1022
Christopher Tatec4a07d12012-04-06 14:19:13 -07001023 case GET_UID_FOR_INTENT_SENDER_TRANSACTION: {
1024 data.enforceInterface(IActivityManager.descriptor);
1025 IIntentSender r = IIntentSender.Stub.asInterface(
1026 data.readStrongBinder());
1027 int res = getUidForIntentSender(r);
1028 reply.writeNoException();
1029 reply.writeInt(res);
1030 return true;
1031 }
1032
Dianne Hackborn41203752012-08-31 14:05:51 -07001033 case HANDLE_INCOMING_USER_TRANSACTION: {
1034 data.enforceInterface(IActivityManager.descriptor);
1035 int callingPid = data.readInt();
1036 int callingUid = data.readInt();
1037 int userId = data.readInt();
1038 boolean allowAll = data.readInt() != 0 ;
1039 boolean requireFull = data.readInt() != 0;
1040 String name = data.readString();
1041 String callerPackage = data.readString();
1042 int res = handleIncomingUser(callingPid, callingUid, userId, allowAll,
1043 requireFull, name, callerPackage);
1044 reply.writeNoException();
1045 reply.writeInt(res);
1046 return true;
1047 }
1048
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001049 case SET_PROCESS_LIMIT_TRANSACTION: {
1050 data.enforceInterface(IActivityManager.descriptor);
1051 int max = data.readInt();
1052 setProcessLimit(max);
1053 reply.writeNoException();
1054 return true;
1055 }
1056
1057 case GET_PROCESS_LIMIT_TRANSACTION: {
1058 data.enforceInterface(IActivityManager.descriptor);
1059 int limit = getProcessLimit();
1060 reply.writeNoException();
1061 reply.writeInt(limit);
1062 return true;
1063 }
1064
1065 case SET_PROCESS_FOREGROUND_TRANSACTION: {
1066 data.enforceInterface(IActivityManager.descriptor);
1067 IBinder token = data.readStrongBinder();
1068 int pid = data.readInt();
1069 boolean isForeground = data.readInt() != 0;
1070 setProcessForeground(token, pid, isForeground);
1071 reply.writeNoException();
1072 return true;
1073 }
1074
1075 case CHECK_PERMISSION_TRANSACTION: {
1076 data.enforceInterface(IActivityManager.descriptor);
1077 String perm = data.readString();
1078 int pid = data.readInt();
1079 int uid = data.readInt();
1080 int res = checkPermission(perm, pid, uid);
1081 reply.writeNoException();
1082 reply.writeInt(res);
1083 return true;
1084 }
1085
1086 case CHECK_URI_PERMISSION_TRANSACTION: {
1087 data.enforceInterface(IActivityManager.descriptor);
1088 Uri uri = Uri.CREATOR.createFromParcel(data);
1089 int pid = data.readInt();
1090 int uid = data.readInt();
1091 int mode = data.readInt();
1092 int res = checkUriPermission(uri, pid, uid, mode);
1093 reply.writeNoException();
1094 reply.writeInt(res);
1095 return true;
1096 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001097
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001098 case CLEAR_APP_DATA_TRANSACTION: {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001099 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001100 String packageName = data.readString();
1101 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
1102 data.readStrongBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -07001103 int userId = data.readInt();
1104 boolean res = clearApplicationUserData(packageName, observer, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001105 reply.writeNoException();
1106 reply.writeInt(res ? 1 : 0);
1107 return true;
1108 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001109
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001110 case GRANT_URI_PERMISSION_TRANSACTION: {
1111 data.enforceInterface(IActivityManager.descriptor);
1112 IBinder b = data.readStrongBinder();
1113 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1114 String targetPkg = data.readString();
1115 Uri uri = Uri.CREATOR.createFromParcel(data);
1116 int mode = data.readInt();
1117 grantUriPermission(app, targetPkg, uri, mode);
1118 reply.writeNoException();
1119 return true;
1120 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001121
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001122 case REVOKE_URI_PERMISSION_TRANSACTION: {
1123 data.enforceInterface(IActivityManager.descriptor);
1124 IBinder b = data.readStrongBinder();
1125 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1126 Uri uri = Uri.CREATOR.createFromParcel(data);
1127 int mode = data.readInt();
1128 revokeUriPermission(app, uri, mode);
1129 reply.writeNoException();
1130 return true;
1131 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001132
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001133 case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1134 data.enforceInterface(IActivityManager.descriptor);
1135 Uri uri = Uri.CREATOR.createFromParcel(data);
1136 int mode = data.readInt();
1137 takePersistableUriPermission(uri, mode);
1138 reply.writeNoException();
1139 return true;
1140 }
1141
1142 case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1143 data.enforceInterface(IActivityManager.descriptor);
1144 Uri uri = Uri.CREATOR.createFromParcel(data);
1145 int mode = data.readInt();
1146 releasePersistableUriPermission(uri, mode);
1147 reply.writeNoException();
1148 return true;
1149 }
1150
1151 case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: {
1152 data.enforceInterface(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07001153 final String packageName = data.readString();
1154 final boolean incoming = data.readInt() != 0;
1155 final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions(
1156 packageName, incoming);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001157 reply.writeNoException();
1158 perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1159 return true;
1160 }
1161
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001162 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
1163 data.enforceInterface(IActivityManager.descriptor);
1164 IBinder b = data.readStrongBinder();
1165 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1166 boolean waiting = data.readInt() != 0;
1167 showWaitingForDebugger(app, waiting);
1168 reply.writeNoException();
1169 return true;
1170 }
1171
1172 case GET_MEMORY_INFO_TRANSACTION: {
1173 data.enforceInterface(IActivityManager.descriptor);
1174 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
1175 getMemoryInfo(mi);
1176 reply.writeNoException();
1177 mi.writeToParcel(reply, 0);
1178 return true;
1179 }
1180
1181 case UNHANDLED_BACK_TRANSACTION: {
1182 data.enforceInterface(IActivityManager.descriptor);
1183 unhandledBack();
1184 reply.writeNoException();
1185 return true;
1186 }
1187
1188 case OPEN_CONTENT_URI_TRANSACTION: {
1189 data.enforceInterface(IActivityManager.descriptor);
1190 Uri uri = Uri.parse(data.readString());
1191 ParcelFileDescriptor pfd = openContentUri(uri);
1192 reply.writeNoException();
1193 if (pfd != null) {
1194 reply.writeInt(1);
1195 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1196 } else {
1197 reply.writeInt(0);
1198 }
1199 return true;
1200 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001201
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001202 case GOING_TO_SLEEP_TRANSACTION: {
1203 data.enforceInterface(IActivityManager.descriptor);
1204 goingToSleep();
1205 reply.writeNoException();
1206 return true;
1207 }
1208
1209 case WAKING_UP_TRANSACTION: {
1210 data.enforceInterface(IActivityManager.descriptor);
1211 wakingUp();
1212 reply.writeNoException();
1213 return true;
1214 }
1215
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001216 case SET_LOCK_SCREEN_SHOWN_TRANSACTION: {
1217 data.enforceInterface(IActivityManager.descriptor);
1218 setLockScreenShown(data.readInt() != 0);
1219 reply.writeNoException();
1220 return true;
1221 }
1222
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001223 case SET_DEBUG_APP_TRANSACTION: {
1224 data.enforceInterface(IActivityManager.descriptor);
1225 String pn = data.readString();
1226 boolean wfd = data.readInt() != 0;
1227 boolean per = data.readInt() != 0;
1228 setDebugApp(pn, wfd, per);
1229 reply.writeNoException();
1230 return true;
1231 }
1232
1233 case SET_ALWAYS_FINISH_TRANSACTION: {
1234 data.enforceInterface(IActivityManager.descriptor);
1235 boolean enabled = data.readInt() != 0;
1236 setAlwaysFinish(enabled);
1237 reply.writeNoException();
1238 return true;
1239 }
1240
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001241 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001242 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001243 IActivityController watcher = IActivityController.Stub.asInterface(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001244 data.readStrongBinder());
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001245 setActivityController(watcher);
Sungmin Choicdb86bb2012-12-20 14:08:59 +09001246 reply.writeNoException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001247 return true;
1248 }
1249
1250 case ENTER_SAFE_MODE_TRANSACTION: {
1251 data.enforceInterface(IActivityManager.descriptor);
1252 enterSafeMode();
1253 reply.writeNoException();
1254 return true;
1255 }
1256
1257 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1258 data.enforceInterface(IActivityManager.descriptor);
1259 IIntentSender is = IIntentSender.Stub.asInterface(
1260 data.readStrongBinder());
1261 noteWakeupAlarm(is);
1262 reply.writeNoException();
1263 return true;
1264 }
1265
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001266 case KILL_PIDS_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001267 data.enforceInterface(IActivityManager.descriptor);
1268 int[] pids = data.createIntArray();
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001269 String reason = data.readString();
Dianne Hackborn64825172011-03-02 21:32:58 -08001270 boolean secure = data.readInt() != 0;
1271 boolean res = killPids(pids, reason, secure);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001272 reply.writeNoException();
1273 reply.writeInt(res ? 1 : 0);
1274 return true;
1275 }
1276
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07001277 case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: {
1278 data.enforceInterface(IActivityManager.descriptor);
1279 String reason = data.readString();
1280 boolean res = killProcessesBelowForeground(reason);
1281 reply.writeNoException();
1282 reply.writeInt(res ? 1 : 0);
1283 return true;
1284 }
1285
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001286 case START_RUNNING_TRANSACTION: {
1287 data.enforceInterface(IActivityManager.descriptor);
1288 String pkg = data.readString();
1289 String cls = data.readString();
1290 String action = data.readString();
1291 String indata = data.readString();
1292 startRunning(pkg, cls, action, indata);
1293 reply.writeNoException();
1294 return true;
1295 }
1296
Dan Egnor60d87622009-12-16 16:32:58 -08001297 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1298 data.enforceInterface(IActivityManager.descriptor);
1299 IBinder app = data.readStrongBinder();
1300 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1301 handleApplicationCrash(app, ci);
1302 reply.writeNoException();
1303 return true;
1304 }
1305
1306 case HANDLE_APPLICATION_WTF_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001307 data.enforceInterface(IActivityManager.descriptor);
1308 IBinder app = data.readStrongBinder();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001309 String tag = data.readString();
Dan Egnorb7f03672009-12-09 16:22:32 -08001310 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
Dan Egnor60d87622009-12-16 16:32:58 -08001311 boolean res = handleApplicationWtf(app, tag, ci);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001312 reply.writeNoException();
Dan Egnor60d87622009-12-16 16:32:58 -08001313 reply.writeInt(res ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001314 return true;
1315 }
Dan Egnorb7f03672009-12-09 16:22:32 -08001316
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001317 case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: {
1318 data.enforceInterface(IActivityManager.descriptor);
1319 IBinder app = data.readStrongBinder();
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07001320 int violationMask = data.readInt();
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07001321 StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data);
1322 handleApplicationStrictModeViolation(app, violationMask, info);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001323 reply.writeNoException();
1324 return true;
1325 }
1326
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001327 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1328 data.enforceInterface(IActivityManager.descriptor);
1329 int sig = data.readInt();
1330 signalPersistentProcesses(sig);
1331 reply.writeNoException();
1332 return true;
1333 }
1334
Dianne Hackborn03abb812010-01-04 18:43:19 -08001335 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1336 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001337 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001338 int userId = data.readInt();
1339 killBackgroundProcesses(packageName, userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08001340 reply.writeNoException();
1341 return true;
1342 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08001343
1344 case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
1345 data.enforceInterface(IActivityManager.descriptor);
1346 killAllBackgroundProcesses();
1347 reply.writeNoException();
1348 return true;
1349 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001350
Dianne Hackborn03abb812010-01-04 18:43:19 -08001351 case FORCE_STOP_PACKAGE_TRANSACTION: {
1352 data.enforceInterface(IActivityManager.descriptor);
1353 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001354 int userId = data.readInt();
1355 forceStopPackage(packageName, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001356 reply.writeNoException();
1357 return true;
1358 }
Dianne Hackborn27ff9132012-03-06 14:57:58 -08001359
1360 case GET_MY_MEMORY_STATE_TRANSACTION: {
1361 data.enforceInterface(IActivityManager.descriptor);
1362 ActivityManager.RunningAppProcessInfo info =
1363 new ActivityManager.RunningAppProcessInfo();
1364 getMyMemoryState(info);
1365 reply.writeNoException();
1366 info.writeToParcel(reply, 0);
1367 return true;
1368 }
1369
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001370 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1371 data.enforceInterface(IActivityManager.descriptor);
1372 ConfigurationInfo config = getDeviceConfigurationInfo();
1373 reply.writeNoException();
1374 config.writeToParcel(reply, 0);
1375 return true;
1376 }
1377
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001378 case PROFILE_CONTROL_TRANSACTION: {
1379 data.enforceInterface(IActivityManager.descriptor);
1380 String process = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001381 int userId = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001382 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001383 int profileType = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001384 String path = data.readString();
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07001385 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -07001386 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborn1676c852012-09-10 14:52:30 -07001387 boolean res = profileControl(process, userId, start, path, fd, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001388 reply.writeNoException();
1389 reply.writeInt(res ? 1 : 0);
1390 return true;
1391 }
1392
Dianne Hackborn55280a92009-05-07 15:53:46 -07001393 case SHUTDOWN_TRANSACTION: {
1394 data.enforceInterface(IActivityManager.descriptor);
1395 boolean res = shutdown(data.readInt());
1396 reply.writeNoException();
1397 reply.writeInt(res ? 1 : 0);
1398 return true;
1399 }
1400
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001401 case STOP_APP_SWITCHES_TRANSACTION: {
1402 data.enforceInterface(IActivityManager.descriptor);
1403 stopAppSwitches();
1404 reply.writeNoException();
1405 return true;
1406 }
1407
1408 case RESUME_APP_SWITCHES_TRANSACTION: {
1409 data.enforceInterface(IActivityManager.descriptor);
1410 resumeAppSwitches();
1411 reply.writeNoException();
1412 return true;
1413 }
1414
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001415 case PEEK_SERVICE_TRANSACTION: {
1416 data.enforceInterface(IActivityManager.descriptor);
1417 Intent service = Intent.CREATOR.createFromParcel(data);
1418 String resolvedType = data.readString();
1419 IBinder binder = peekService(service, resolvedType);
1420 reply.writeNoException();
1421 reply.writeStrongBinder(binder);
1422 return true;
1423 }
Christopher Tate181fafa2009-05-14 11:12:14 -07001424
1425 case START_BACKUP_AGENT_TRANSACTION: {
1426 data.enforceInterface(IActivityManager.descriptor);
1427 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1428 int backupRestoreMode = data.readInt();
1429 boolean success = bindBackupAgent(info, backupRestoreMode);
1430 reply.writeNoException();
1431 reply.writeInt(success ? 1 : 0);
1432 return true;
1433 }
1434
1435 case BACKUP_AGENT_CREATED_TRANSACTION: {
1436 data.enforceInterface(IActivityManager.descriptor);
1437 String packageName = data.readString();
1438 IBinder agent = data.readStrongBinder();
1439 backupAgentCreated(packageName, agent);
1440 reply.writeNoException();
1441 return true;
1442 }
1443
1444 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1445 data.enforceInterface(IActivityManager.descriptor);
1446 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1447 unbindBackupAgent(info);
1448 reply.writeNoException();
1449 return true;
1450 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001451
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001452 case KILL_APPLICATION_WITH_APPID_TRANSACTION: {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001453 data.enforceInterface(IActivityManager.descriptor);
1454 String pkg = data.readString();
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001455 int appid = data.readInt();
Dianne Hackborn21d9b562013-05-28 17:46:59 -07001456 String reason = data.readString();
1457 killApplicationWithAppId(pkg, appid, reason);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001458 reply.writeNoException();
1459 return true;
1460 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001461
1462 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1463 data.enforceInterface(IActivityManager.descriptor);
1464 String reason = data.readString();
1465 closeSystemDialogs(reason);
1466 reply.writeNoException();
1467 return true;
1468 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001469
1470 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1471 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001472 int[] pids = data.createIntArray();
1473 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001474 reply.writeNoException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001475 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001476 return true;
1477 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001478
1479 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1480 data.enforceInterface(IActivityManager.descriptor);
1481 String processName = data.readString();
1482 int uid = data.readInt();
1483 killApplicationProcess(processName, uid);
1484 reply.writeNoException();
1485 return true;
1486 }
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001487
1488 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1489 data.enforceInterface(IActivityManager.descriptor);
1490 IBinder token = data.readStrongBinder();
1491 String packageName = data.readString();
1492 int enterAnim = data.readInt();
1493 int exitAnim = data.readInt();
1494 overridePendingTransition(token, packageName, enterAnim, exitAnim);
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001495 reply.writeNoException();
1496 return true;
1497 }
1498
1499 case IS_USER_A_MONKEY_TRANSACTION: {
1500 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001501 boolean areThey = isUserAMonkey();
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001502 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001503 reply.writeInt(areThey ? 1 : 0);
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001504 return true;
1505 }
Dianne Hackborn860755f2010-06-03 18:47:52 -07001506
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07001507 case SET_USER_IS_MONKEY_TRANSACTION: {
1508 data.enforceInterface(IActivityManager.descriptor);
1509 final boolean monkey = (data.readInt() == 1);
1510 setUserIsMonkey(monkey);
1511 reply.writeNoException();
1512 return true;
1513 }
1514
Dianne Hackborn860755f2010-06-03 18:47:52 -07001515 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1516 data.enforceInterface(IActivityManager.descriptor);
1517 finishHeavyWeightApp();
1518 reply.writeNoException();
1519 return true;
1520 }
Daniel Sandler69a48172010-06-23 16:29:36 -04001521
1522 case IS_IMMERSIVE_TRANSACTION: {
1523 data.enforceInterface(IActivityManager.descriptor);
1524 IBinder token = data.readStrongBinder();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001525 boolean isit = isImmersive(token);
Daniel Sandler69a48172010-06-23 16:29:36 -04001526 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001527 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001528 return true;
1529 }
1530
Craig Mautner5eda9b32013-07-02 11:58:16 -07001531 case CONVERT_FROM_TRANSLUCENT_TRANSACTION: {
Craig Mautner4addfc52013-06-25 08:05:45 -07001532 data.enforceInterface(IActivityManager.descriptor);
1533 IBinder token = data.readStrongBinder();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001534 boolean converted = convertFromTranslucent(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001535 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001536 reply.writeInt(converted ? 1 : 0);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001537 return true;
1538 }
1539
1540 case CONVERT_TO_TRANSLUCENT_TRANSACTION: {
1541 data.enforceInterface(IActivityManager.descriptor);
1542 IBinder token = data.readStrongBinder();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001543 boolean converted = convertToTranslucent(token);
Craig Mautner4addfc52013-06-25 08:05:45 -07001544 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001545 reply.writeInt(converted ? 1 : 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07001546 return true;
1547 }
1548
Daniel Sandler69a48172010-06-23 16:29:36 -04001549 case SET_IMMERSIVE_TRANSACTION: {
1550 data.enforceInterface(IActivityManager.descriptor);
1551 IBinder token = data.readStrongBinder();
1552 boolean imm = data.readInt() == 1;
1553 setImmersive(token, imm);
1554 reply.writeNoException();
1555 return true;
1556 }
1557
1558 case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
1559 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001560 boolean isit = isTopActivityImmersive();
Daniel Sandler69a48172010-06-23 16:29:36 -04001561 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001562 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001563 return true;
1564 }
1565
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001566 case CRASH_APPLICATION_TRANSACTION: {
1567 data.enforceInterface(IActivityManager.descriptor);
1568 int uid = data.readInt();
1569 int initialPid = data.readInt();
1570 String packageName = data.readString();
1571 String message = data.readString();
1572 crashApplication(uid, initialPid, packageName, message);
1573 reply.writeNoException();
1574 return true;
1575 }
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001576
1577 case GET_PROVIDER_MIME_TYPE_TRANSACTION: {
1578 data.enforceInterface(IActivityManager.descriptor);
1579 Uri uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001580 int userId = data.readInt();
1581 String type = getProviderMimeType(uri, userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001582 reply.writeNoException();
1583 reply.writeString(type);
1584 return true;
1585 }
1586
Dianne Hackborn7e269642010-08-25 19:50:20 -07001587 case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
1588 data.enforceInterface(IActivityManager.descriptor);
1589 String name = data.readString();
1590 IBinder perm = newUriPermissionOwner(name);
1591 reply.writeNoException();
1592 reply.writeStrongBinder(perm);
1593 return true;
1594 }
1595
1596 case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1597 data.enforceInterface(IActivityManager.descriptor);
1598 IBinder owner = data.readStrongBinder();
1599 int fromUid = data.readInt();
1600 String targetPkg = data.readString();
1601 Uri uri = Uri.CREATOR.createFromParcel(data);
1602 int mode = data.readInt();
1603 grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode);
1604 reply.writeNoException();
1605 return true;
1606 }
1607
1608 case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1609 data.enforceInterface(IActivityManager.descriptor);
1610 IBinder owner = data.readStrongBinder();
1611 Uri uri = null;
1612 if (data.readInt() != 0) {
1613 Uri.CREATOR.createFromParcel(data);
1614 }
1615 int mode = data.readInt();
1616 revokeUriPermissionFromOwner(owner, uri, mode);
1617 reply.writeNoException();
1618 return true;
1619 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001620
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001621 case CHECK_GRANT_URI_PERMISSION_TRANSACTION: {
1622 data.enforceInterface(IActivityManager.descriptor);
1623 int callingUid = data.readInt();
1624 String targetPkg = data.readString();
1625 Uri uri = Uri.CREATOR.createFromParcel(data);
1626 int modeFlags = data.readInt();
1627 int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags);
1628 reply.writeNoException();
1629 reply.writeInt(res);
1630 return true;
1631 }
1632
Andy McFadden824c5102010-07-09 16:26:57 -07001633 case DUMP_HEAP_TRANSACTION: {
1634 data.enforceInterface(IActivityManager.descriptor);
1635 String process = data.readString();
Dianne Hackbornb12e1352012-09-26 11:39:20 -07001636 int userId = data.readInt();
Andy McFadden824c5102010-07-09 16:26:57 -07001637 boolean managed = data.readInt() != 0;
1638 String path = data.readString();
1639 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -07001640 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborn1676c852012-09-10 14:52:30 -07001641 boolean res = dumpHeap(process, userId, managed, path, fd);
Andy McFadden824c5102010-07-09 16:26:57 -07001642 reply.writeNoException();
1643 reply.writeInt(res ? 1 : 0);
1644 return true;
1645 }
1646
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001647 case START_ACTIVITIES_TRANSACTION:
1648 {
1649 data.enforceInterface(IActivityManager.descriptor);
1650 IBinder b = data.readStrongBinder();
1651 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001652 String callingPackage = data.readString();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001653 Intent[] intents = data.createTypedArray(Intent.CREATOR);
1654 String[] resolvedTypes = data.createStringArray();
1655 IBinder resultTo = data.readStrongBinder();
Dianne Hackborna4972e92012-03-14 10:38:05 -07001656 Bundle options = data.readInt() != 0
1657 ? Bundle.CREATOR.createFromParcel(data) : null;
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001658 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001659 int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001660 options, userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001661 reply.writeNoException();
1662 reply.writeInt(result);
1663 return true;
1664 }
1665
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001666 case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1667 {
1668 data.enforceInterface(IActivityManager.descriptor);
1669 int mode = getFrontActivityScreenCompatMode();
1670 reply.writeNoException();
1671 reply.writeInt(mode);
1672 return true;
1673 }
1674
1675 case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1676 {
1677 data.enforceInterface(IActivityManager.descriptor);
1678 int mode = data.readInt();
1679 setFrontActivityScreenCompatMode(mode);
1680 reply.writeNoException();
1681 reply.writeInt(mode);
1682 return true;
1683 }
1684
1685 case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1686 {
1687 data.enforceInterface(IActivityManager.descriptor);
1688 String pkg = data.readString();
1689 int mode = getPackageScreenCompatMode(pkg);
1690 reply.writeNoException();
1691 reply.writeInt(mode);
1692 return true;
1693 }
1694
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001695 case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1696 {
1697 data.enforceInterface(IActivityManager.descriptor);
1698 String pkg = data.readString();
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001699 int mode = data.readInt();
1700 setPackageScreenCompatMode(pkg, mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001701 reply.writeNoException();
1702 return true;
1703 }
Dianne Hackbornaa9d84c2011-05-09 19:00:59 -07001704
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001705 case SWITCH_USER_TRANSACTION: {
1706 data.enforceInterface(IActivityManager.descriptor);
1707 int userid = data.readInt();
1708 boolean result = switchUser(userid);
1709 reply.writeNoException();
1710 reply.writeInt(result ? 1 : 0);
1711 return true;
1712 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07001713
Dianne Hackborn80a4af22012-08-27 19:18:31 -07001714 case STOP_USER_TRANSACTION: {
1715 data.enforceInterface(IActivityManager.descriptor);
1716 int userid = data.readInt();
1717 IStopUserCallback callback = IStopUserCallback.Stub.asInterface(
1718 data.readStrongBinder());
1719 int result = stopUser(userid, callback);
1720 reply.writeNoException();
1721 reply.writeInt(result);
1722 return true;
1723 }
1724
Amith Yamasani52f1d752012-03-28 18:19:29 -07001725 case GET_CURRENT_USER_TRANSACTION: {
1726 data.enforceInterface(IActivityManager.descriptor);
1727 UserInfo userInfo = getCurrentUser();
1728 reply.writeNoException();
1729 userInfo.writeToParcel(reply, 0);
1730 return true;
1731 }
1732
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001733 case IS_USER_RUNNING_TRANSACTION: {
1734 data.enforceInterface(IActivityManager.descriptor);
1735 int userid = data.readInt();
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07001736 boolean orStopping = data.readInt() != 0;
1737 boolean result = isUserRunning(userid, orStopping);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001738 reply.writeNoException();
1739 reply.writeInt(result ? 1 : 0);
1740 return true;
1741 }
1742
Dianne Hackbornc72fc672012-09-20 13:12:03 -07001743 case GET_RUNNING_USER_IDS_TRANSACTION: {
1744 data.enforceInterface(IActivityManager.descriptor);
1745 int[] result = getRunningUserIds();
1746 reply.writeNoException();
1747 reply.writeIntArray(result);
1748 return true;
1749 }
1750
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001751 case REMOVE_SUB_TASK_TRANSACTION:
1752 {
1753 data.enforceInterface(IActivityManager.descriptor);
1754 int taskId = data.readInt();
1755 int subTaskIndex = data.readInt();
1756 boolean result = removeSubTask(taskId, subTaskIndex);
1757 reply.writeNoException();
1758 reply.writeInt(result ? 1 : 0);
1759 return true;
1760 }
1761
1762 case REMOVE_TASK_TRANSACTION:
1763 {
1764 data.enforceInterface(IActivityManager.descriptor);
1765 int taskId = data.readInt();
1766 int fl = data.readInt();
1767 boolean result = removeTask(taskId, fl);
1768 reply.writeNoException();
1769 reply.writeInt(result ? 1 : 0);
1770 return true;
1771 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001772
Jeff Sharkeya4620792011-05-20 15:29:23 -07001773 case REGISTER_PROCESS_OBSERVER_TRANSACTION: {
1774 data.enforceInterface(IActivityManager.descriptor);
1775 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1776 data.readStrongBinder());
1777 registerProcessObserver(observer);
1778 return true;
1779 }
1780
1781 case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: {
1782 data.enforceInterface(IActivityManager.descriptor);
1783 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1784 data.readStrongBinder());
1785 unregisterProcessObserver(observer);
1786 return true;
1787 }
1788
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07001789 case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1790 {
1791 data.enforceInterface(IActivityManager.descriptor);
1792 String pkg = data.readString();
1793 boolean ask = getPackageAskScreenCompat(pkg);
1794 reply.writeNoException();
1795 reply.writeInt(ask ? 1 : 0);
1796 return true;
1797 }
1798
1799 case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1800 {
1801 data.enforceInterface(IActivityManager.descriptor);
1802 String pkg = data.readString();
1803 boolean ask = data.readInt() != 0;
1804 setPackageAskScreenCompat(pkg, ask);
1805 reply.writeNoException();
1806 return true;
1807 }
1808
Dianne Hackborn6c418d52011-06-29 14:05:33 -07001809 case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: {
1810 data.enforceInterface(IActivityManager.descriptor);
1811 IIntentSender r = IIntentSender.Stub.asInterface(
1812 data.readStrongBinder());
1813 boolean res = isIntentSenderTargetedToPackage(r);
1814 reply.writeNoException();
1815 reply.writeInt(res ? 1 : 0);
1816 return true;
1817 }
1818
Dianne Hackborn1927ae82012-06-22 15:21:36 -07001819 case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: {
1820 data.enforceInterface(IActivityManager.descriptor);
1821 IIntentSender r = IIntentSender.Stub.asInterface(
1822 data.readStrongBinder());
1823 boolean res = isIntentSenderAnActivity(r);
1824 reply.writeNoException();
1825 reply.writeInt(res ? 1 : 0);
1826 return true;
1827 }
1828
Dianne Hackborn81038902012-11-26 17:04:09 -08001829 case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: {
1830 data.enforceInterface(IActivityManager.descriptor);
1831 IIntentSender r = IIntentSender.Stub.asInterface(
1832 data.readStrongBinder());
1833 Intent intent = getIntentForIntentSender(r);
1834 reply.writeNoException();
1835 if (intent != null) {
1836 reply.writeInt(1);
1837 intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1838 } else {
1839 reply.writeInt(0);
1840 }
1841 return true;
1842 }
1843
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001844 case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
1845 data.enforceInterface(IActivityManager.descriptor);
1846 Configuration config = Configuration.CREATOR.createFromParcel(data);
1847 updatePersistentConfiguration(config);
1848 reply.writeNoException();
1849 return true;
1850 }
1851
Dianne Hackbornb437e092011-08-05 17:50:29 -07001852 case GET_PROCESS_PSS_TRANSACTION: {
1853 data.enforceInterface(IActivityManager.descriptor);
1854 int[] pids = data.createIntArray();
1855 long[] pss = getProcessPss(pids);
1856 reply.writeNoException();
1857 reply.writeLongArray(pss);
1858 return true;
1859 }
1860
Dianne Hackborn661cd522011-08-22 00:26:20 -07001861 case SHOW_BOOT_MESSAGE_TRANSACTION: {
1862 data.enforceInterface(IActivityManager.descriptor);
1863 CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
1864 boolean always = data.readInt() != 0;
1865 showBootMessage(msg, always);
1866 reply.writeNoException();
1867 return true;
1868 }
1869
Dianne Hackborn90c52de2011-09-23 12:57:44 -07001870 case DISMISS_KEYGUARD_ON_NEXT_ACTIVITY_TRANSACTION: {
1871 data.enforceInterface(IActivityManager.descriptor);
1872 dismissKeyguardOnNextActivity();
1873 reply.writeNoException();
1874 return true;
1875 }
1876
Adam Powelldd8fab22012-03-22 17:47:27 -07001877 case TARGET_TASK_AFFINITY_MATCHES_ACTIVITY_TRANSACTION: {
1878 data.enforceInterface(IActivityManager.descriptor);
1879 IBinder token = data.readStrongBinder();
1880 String destAffinity = data.readString();
1881 boolean res = targetTaskAffinityMatchesActivity(token, destAffinity);
1882 reply.writeNoException();
1883 reply.writeInt(res ? 1 : 0);
1884 return true;
1885 }
1886
1887 case NAVIGATE_UP_TO_TRANSACTION: {
1888 data.enforceInterface(IActivityManager.descriptor);
1889 IBinder token = data.readStrongBinder();
1890 Intent target = Intent.CREATOR.createFromParcel(data);
1891 int resultCode = data.readInt();
1892 Intent resultData = null;
1893 if (data.readInt() != 0) {
1894 resultData = Intent.CREATOR.createFromParcel(data);
1895 }
1896 boolean res = navigateUpTo(token, target, resultCode, resultData);
1897 reply.writeNoException();
1898 reply.writeInt(res ? 1 : 0);
1899 return true;
1900 }
1901
Dianne Hackborn5320eb82012-05-18 12:05:04 -07001902 case GET_LAUNCHED_FROM_UID_TRANSACTION: {
1903 data.enforceInterface(IActivityManager.descriptor);
1904 IBinder token = data.readStrongBinder();
1905 int res = getLaunchedFromUid(token);
1906 reply.writeNoException();
1907 reply.writeInt(res);
1908 return true;
1909 }
1910
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001911 case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: {
1912 data.enforceInterface(IActivityManager.descriptor);
1913 IBinder token = data.readStrongBinder();
1914 String res = getLaunchedFromPackage(token);
1915 reply.writeNoException();
1916 reply.writeString(res);
1917 return true;
1918 }
1919
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07001920 case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
1921 data.enforceInterface(IActivityManager.descriptor);
1922 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
1923 data.readStrongBinder());
1924 registerUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07001925 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07001926 return true;
1927 }
1928
1929 case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
1930 data.enforceInterface(IActivityManager.descriptor);
1931 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
1932 data.readStrongBinder());
1933 unregisterUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07001934 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07001935 return true;
1936 }
1937
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07001938 case REQUEST_BUG_REPORT_TRANSACTION: {
1939 data.enforceInterface(IActivityManager.descriptor);
1940 requestBugReport();
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07001941 reply.writeNoException();
1942 return true;
1943 }
1944
1945 case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: {
1946 data.enforceInterface(IActivityManager.descriptor);
1947 int pid = data.readInt();
1948 boolean aboveSystem = data.readInt() != 0;
Jeff Brownbd181bb2013-09-10 16:44:24 -07001949 String reason = data.readString();
1950 long res = inputDispatchingTimedOut(pid, aboveSystem, reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07001951 reply.writeNoException();
1952 reply.writeLong(res);
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07001953 return true;
1954 }
1955
Adam Skorydfc7fd72013-08-05 19:23:41 -07001956 case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08001957 data.enforceInterface(IActivityManager.descriptor);
1958 int requestType = data.readInt();
Adam Skorydfc7fd72013-08-05 19:23:41 -07001959 Bundle res = getAssistContextExtras(requestType);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08001960 reply.writeNoException();
1961 reply.writeBundle(res);
1962 return true;
1963 }
1964
Adam Skorydfc7fd72013-08-05 19:23:41 -07001965 case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08001966 data.enforceInterface(IActivityManager.descriptor);
1967 IBinder token = data.readStrongBinder();
1968 Bundle extras = data.readBundle();
Adam Skory7140a252013-09-11 12:04:58 +01001969 reportAssistContextExtras(token, extras);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08001970 reply.writeNoException();
1971 return true;
1972 }
1973
Dianne Hackbornf1b78242013-04-08 22:28:59 -07001974 case KILL_UID_TRANSACTION: {
1975 data.enforceInterface(IActivityManager.descriptor);
1976 int uid = data.readInt();
1977 String reason = data.readString();
1978 killUid(uid, reason);
1979 reply.writeNoException();
1980 return true;
1981 }
1982
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07001983 case HANG_TRANSACTION: {
1984 data.enforceInterface(IActivityManager.descriptor);
1985 IBinder who = data.readStrongBinder();
1986 boolean allowRestart = data.readInt() != 0;
1987 hang(who, allowRestart);
1988 reply.writeNoException();
1989 return true;
1990 }
1991
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07001992 case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: {
1993 data.enforceInterface(IActivityManager.descriptor);
1994 IBinder token = data.readStrongBinder();
1995 reportActivityFullyDrawn(token);
1996 reply.writeNoException();
1997 return true;
1998 }
1999
Craig Mautner5eda9b32013-07-02 11:58:16 -07002000 case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: {
2001 data.enforceInterface(IActivityManager.descriptor);
2002 IBinder token = data.readStrongBinder();
2003 notifyActivityDrawn(token);
2004 reply.writeNoException();
2005 return true;
2006 }
Dianne Hackborn57a7f592013-07-22 18:21:32 -07002007
2008 case RESTART_TRANSACTION: {
2009 data.enforceInterface(IActivityManager.descriptor);
2010 restart();
2011 reply.writeNoException();
2012 return true;
2013 }
Jeff Sharkey08da7a12013-08-11 20:53:18 -07002014
Dianne Hackborn35f72be2013-09-16 10:57:39 -07002015 case PERFORM_IDLE_MAINTENANCE_TRANSACTION: {
2016 data.enforceInterface(IActivityManager.descriptor);
2017 performIdleMaintenance();
2018 reply.writeNoException();
2019 return true;
2020 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002021
2022 case CREATE_ACTIVITY_CONTAINER_TRANSACTION: {
2023 data.enforceInterface(IActivityManager.descriptor);
2024 IBinder parentActivityToken = data.readStrongBinder();
2025 IActivityContainerCallback callback =
2026 (IActivityContainerCallback) data.readStrongBinder();
2027 IActivityContainer activityContainer =
2028 createActivityContainer(parentActivityToken, callback);
2029 reply.writeNoException();
2030 reply.writeStrongBinder(activityContainer.asBinder());
2031 return true;
2032 }
2033
2034 case GET_HOME_ACTIVITY_TOKEN_TRANSACTION: {
2035 data.enforceInterface(IActivityManager.descriptor);
2036 IBinder homeActivityToken = getHomeActivityToken();
2037 reply.writeNoException();
2038 reply.writeStrongBinder(homeActivityToken);
2039 return true;
2040 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002041 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002042
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002043 return super.onTransact(code, data, reply, flags);
2044 }
2045
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002046 public IBinder asBinder() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002047 return this;
2048 }
2049
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002050 private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
2051 protected IActivityManager create() {
2052 IBinder b = ServiceManager.getService("activity");
Joe Onorato43a17652011-04-06 19:22:23 -07002053 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002054 Log.v("ActivityManager", "default service binder = " + b);
2055 }
2056 IActivityManager am = asInterface(b);
Joe Onorato43a17652011-04-06 19:22:23 -07002057 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002058 Log.v("ActivityManager", "default service = " + am);
2059 }
2060 return am;
2061 }
2062 };
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002063}
2064
2065class ActivityManagerProxy implements IActivityManager
2066{
2067 public ActivityManagerProxy(IBinder remote)
2068 {
2069 mRemote = remote;
2070 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002071
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002072 public IBinder asBinder()
2073 {
2074 return mRemote;
2075 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002076
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002077 public int startActivity(IApplicationThread caller, String callingPackage, Intent intent,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002078 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
2079 int startFlags, String profileFile,
2080 ParcelFileDescriptor profileFd, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002081 Parcel data = Parcel.obtain();
2082 Parcel reply = Parcel.obtain();
2083 data.writeInterfaceToken(IActivityManager.descriptor);
2084 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002085 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002086 intent.writeToParcel(data, 0);
2087 data.writeString(resolvedType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002088 data.writeStrongBinder(resultTo);
2089 data.writeString(resultWho);
2090 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002091 data.writeInt(startFlags);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002092 data.writeString(profileFile);
2093 if (profileFd != null) {
2094 data.writeInt(1);
2095 profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2096 } else {
2097 data.writeInt(0);
2098 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002099 if (options != null) {
2100 data.writeInt(1);
2101 options.writeToParcel(data, 0);
2102 } else {
2103 data.writeInt(0);
2104 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002105 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2106 reply.readException();
2107 int result = reply.readInt();
2108 reply.recycle();
2109 data.recycle();
2110 return result;
2111 }
Amith Yamasani82644082012-08-03 13:09:11 -07002112
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002113 public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent,
Amith Yamasani82644082012-08-03 13:09:11 -07002114 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
2115 int startFlags, String profileFile,
2116 ParcelFileDescriptor profileFd, Bundle options, int userId) throws RemoteException {
2117 Parcel data = Parcel.obtain();
2118 Parcel reply = Parcel.obtain();
2119 data.writeInterfaceToken(IActivityManager.descriptor);
2120 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002121 data.writeString(callingPackage);
Amith Yamasani82644082012-08-03 13:09:11 -07002122 intent.writeToParcel(data, 0);
2123 data.writeString(resolvedType);
2124 data.writeStrongBinder(resultTo);
2125 data.writeString(resultWho);
2126 data.writeInt(requestCode);
2127 data.writeInt(startFlags);
2128 data.writeString(profileFile);
2129 if (profileFd != null) {
2130 data.writeInt(1);
2131 profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2132 } else {
2133 data.writeInt(0);
2134 }
2135 if (options != null) {
2136 data.writeInt(1);
2137 options.writeToParcel(data, 0);
2138 } else {
2139 data.writeInt(0);
2140 }
2141 data.writeInt(userId);
2142 mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0);
2143 reply.readException();
2144 int result = reply.readInt();
2145 reply.recycle();
2146 data.recycle();
2147 return result;
2148 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002149 public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage,
2150 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002151 int requestCode, int startFlags, String profileFile,
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002152 ParcelFileDescriptor profileFd, Bundle options, int userId) throws RemoteException {
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002153 Parcel data = Parcel.obtain();
2154 Parcel reply = Parcel.obtain();
2155 data.writeInterfaceToken(IActivityManager.descriptor);
2156 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002157 data.writeString(callingPackage);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002158 intent.writeToParcel(data, 0);
2159 data.writeString(resolvedType);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002160 data.writeStrongBinder(resultTo);
2161 data.writeString(resultWho);
2162 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002163 data.writeInt(startFlags);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002164 data.writeString(profileFile);
2165 if (profileFd != null) {
2166 data.writeInt(1);
2167 profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2168 } else {
2169 data.writeInt(0);
2170 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002171 if (options != null) {
2172 data.writeInt(1);
2173 options.writeToParcel(data, 0);
2174 } else {
2175 data.writeInt(0);
2176 }
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002177 data.writeInt(userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002178 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
2179 reply.readException();
2180 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
2181 reply.recycle();
2182 data.recycle();
2183 return result;
2184 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002185 public int startActivityWithConfig(IApplicationThread caller, String callingPackage,
2186 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002187 int requestCode, int startFlags, Configuration config,
Dianne Hackborn41203752012-08-31 14:05:51 -07002188 Bundle options, int userId) throws RemoteException {
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002189 Parcel data = Parcel.obtain();
2190 Parcel reply = Parcel.obtain();
2191 data.writeInterfaceToken(IActivityManager.descriptor);
2192 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002193 data.writeString(callingPackage);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002194 intent.writeToParcel(data, 0);
2195 data.writeString(resolvedType);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002196 data.writeStrongBinder(resultTo);
2197 data.writeString(resultWho);
2198 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002199 data.writeInt(startFlags);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002200 config.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002201 if (options != null) {
2202 data.writeInt(1);
2203 options.writeToParcel(data, 0);
2204 } else {
2205 data.writeInt(0);
2206 }
Dianne Hackborn41203752012-08-31 14:05:51 -07002207 data.writeInt(userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002208 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2209 reply.readException();
2210 int result = reply.readInt();
2211 reply.recycle();
2212 data.recycle();
2213 return result;
2214 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002215 public int startActivityIntentSender(IApplicationThread caller,
2216 IntentSender intent, Intent fillInIntent, String resolvedType,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002217 IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002218 int flagsMask, int flagsValues, Bundle options) throws RemoteException {
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002219 Parcel data = Parcel.obtain();
2220 Parcel reply = Parcel.obtain();
2221 data.writeInterfaceToken(IActivityManager.descriptor);
2222 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2223 intent.writeToParcel(data, 0);
2224 if (fillInIntent != null) {
2225 data.writeInt(1);
2226 fillInIntent.writeToParcel(data, 0);
2227 } else {
2228 data.writeInt(0);
2229 }
2230 data.writeString(resolvedType);
2231 data.writeStrongBinder(resultTo);
2232 data.writeString(resultWho);
2233 data.writeInt(requestCode);
2234 data.writeInt(flagsMask);
2235 data.writeInt(flagsValues);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002236 if (options != null) {
2237 data.writeInt(1);
2238 options.writeToParcel(data, 0);
2239 } else {
2240 data.writeInt(0);
2241 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002242 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002243 reply.readException();
2244 int result = reply.readInt();
2245 reply.recycle();
2246 data.recycle();
2247 return result;
2248 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002249 public boolean startNextMatchingActivity(IBinder callingActivity,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002250 Intent intent, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002251 Parcel data = Parcel.obtain();
2252 Parcel reply = Parcel.obtain();
2253 data.writeInterfaceToken(IActivityManager.descriptor);
2254 data.writeStrongBinder(callingActivity);
2255 intent.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002256 if (options != null) {
2257 data.writeInt(1);
2258 options.writeToParcel(data, 0);
2259 } else {
2260 data.writeInt(0);
2261 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002262 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
2263 reply.readException();
2264 int result = reply.readInt();
2265 reply.recycle();
2266 data.recycle();
2267 return result != 0;
2268 }
2269 public boolean finishActivity(IBinder token, int resultCode, Intent resultData)
2270 throws RemoteException {
2271 Parcel data = Parcel.obtain();
2272 Parcel reply = Parcel.obtain();
2273 data.writeInterfaceToken(IActivityManager.descriptor);
2274 data.writeStrongBinder(token);
2275 data.writeInt(resultCode);
2276 if (resultData != null) {
2277 data.writeInt(1);
2278 resultData.writeToParcel(data, 0);
2279 } else {
2280 data.writeInt(0);
2281 }
2282 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
2283 reply.readException();
2284 boolean res = reply.readInt() != 0;
2285 data.recycle();
2286 reply.recycle();
2287 return res;
2288 }
2289 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
2290 {
2291 Parcel data = Parcel.obtain();
2292 Parcel reply = Parcel.obtain();
2293 data.writeInterfaceToken(IActivityManager.descriptor);
2294 data.writeStrongBinder(token);
2295 data.writeString(resultWho);
2296 data.writeInt(requestCode);
2297 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
2298 reply.readException();
2299 data.recycle();
2300 reply.recycle();
2301 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -07002302 public boolean finishActivityAffinity(IBinder token) throws RemoteException {
2303 Parcel data = Parcel.obtain();
2304 Parcel reply = Parcel.obtain();
2305 data.writeInterfaceToken(IActivityManager.descriptor);
2306 data.writeStrongBinder(token);
2307 mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0);
2308 reply.readException();
2309 boolean res = reply.readInt() != 0;
2310 data.recycle();
2311 reply.recycle();
2312 return res;
2313 }
Dianne Hackborn061d58a2010-03-12 15:07:06 -08002314 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
2315 Parcel data = Parcel.obtain();
2316 Parcel reply = Parcel.obtain();
2317 data.writeInterfaceToken(IActivityManager.descriptor);
2318 data.writeStrongBinder(token);
2319 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
2320 reply.readException();
2321 boolean res = reply.readInt() != 0;
2322 data.recycle();
2323 reply.recycle();
2324 return res;
2325 }
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002326 public Intent registerReceiver(IApplicationThread caller, String packageName,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002327 IIntentReceiver receiver,
Dianne Hackborn20e80982012-08-31 19:00:44 -07002328 IntentFilter filter, String perm, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002329 {
2330 Parcel data = Parcel.obtain();
2331 Parcel reply = Parcel.obtain();
2332 data.writeInterfaceToken(IActivityManager.descriptor);
2333 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002334 data.writeString(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002335 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
2336 filter.writeToParcel(data, 0);
2337 data.writeString(perm);
Dianne Hackborn20e80982012-08-31 19:00:44 -07002338 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002339 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2340 reply.readException();
2341 Intent intent = null;
2342 int haveIntent = reply.readInt();
2343 if (haveIntent != 0) {
2344 intent = Intent.CREATOR.createFromParcel(reply);
2345 }
2346 reply.recycle();
2347 data.recycle();
2348 return intent;
2349 }
2350 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
2351 {
2352 Parcel data = Parcel.obtain();
2353 Parcel reply = Parcel.obtain();
2354 data.writeInterfaceToken(IActivityManager.descriptor);
2355 data.writeStrongBinder(receiver.asBinder());
2356 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2357 reply.readException();
2358 data.recycle();
2359 reply.recycle();
2360 }
2361 public int broadcastIntent(IApplicationThread caller,
2362 Intent intent, String resolvedType, IIntentReceiver resultTo,
2363 int resultCode, String resultData, Bundle map,
Dianne Hackbornf51f6122013-02-04 18:23:34 -08002364 String requiredPermission, int appOp, boolean serialized,
Amith Yamasani742a6712011-05-04 14:49:28 -07002365 boolean sticky, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002366 {
2367 Parcel data = Parcel.obtain();
2368 Parcel reply = Parcel.obtain();
2369 data.writeInterfaceToken(IActivityManager.descriptor);
2370 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2371 intent.writeToParcel(data, 0);
2372 data.writeString(resolvedType);
2373 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
2374 data.writeInt(resultCode);
2375 data.writeString(resultData);
2376 data.writeBundle(map);
2377 data.writeString(requiredPermission);
Dianne Hackbornf51f6122013-02-04 18:23:34 -08002378 data.writeInt(appOp);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002379 data.writeInt(serialized ? 1 : 0);
2380 data.writeInt(sticky ? 1 : 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07002381 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002382 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
2383 reply.readException();
2384 int res = reply.readInt();
2385 reply.recycle();
2386 data.recycle();
2387 return res;
2388 }
Amith Yamasani742a6712011-05-04 14:49:28 -07002389 public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
2390 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002391 {
2392 Parcel data = Parcel.obtain();
2393 Parcel reply = Parcel.obtain();
2394 data.writeInterfaceToken(IActivityManager.descriptor);
2395 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2396 intent.writeToParcel(data, 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07002397 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002398 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
2399 reply.readException();
2400 data.recycle();
2401 reply.recycle();
2402 }
2403 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, boolean abortBroadcast) throws RemoteException
2404 {
2405 Parcel data = Parcel.obtain();
2406 Parcel reply = Parcel.obtain();
2407 data.writeInterfaceToken(IActivityManager.descriptor);
2408 data.writeStrongBinder(who);
2409 data.writeInt(resultCode);
2410 data.writeString(resultData);
2411 data.writeBundle(map);
2412 data.writeInt(abortBroadcast ? 1 : 0);
2413 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2414 reply.readException();
2415 data.recycle();
2416 reply.recycle();
2417 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002418 public void attachApplication(IApplicationThread app) throws RemoteException
2419 {
2420 Parcel data = Parcel.obtain();
2421 Parcel reply = Parcel.obtain();
2422 data.writeInterfaceToken(IActivityManager.descriptor);
2423 data.writeStrongBinder(app.asBinder());
2424 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
2425 reply.readException();
2426 data.recycle();
2427 reply.recycle();
2428 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002429 public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
2430 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002431 {
2432 Parcel data = Parcel.obtain();
2433 Parcel reply = Parcel.obtain();
2434 data.writeInterfaceToken(IActivityManager.descriptor);
2435 data.writeStrongBinder(token);
Dianne Hackborne88846e2009-09-30 21:34:25 -07002436 if (config != null) {
2437 data.writeInt(1);
2438 config.writeToParcel(data, 0);
2439 } else {
2440 data.writeInt(0);
2441 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002442 data.writeInt(stopProfiling ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002443 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2444 reply.readException();
2445 data.recycle();
2446 reply.recycle();
2447 }
Dianne Hackbornad9b32112012-09-17 15:35:01 -07002448 public void activityResumed(IBinder token) throws RemoteException
2449 {
2450 Parcel data = Parcel.obtain();
2451 Parcel reply = Parcel.obtain();
2452 data.writeInterfaceToken(IActivityManager.descriptor);
2453 data.writeStrongBinder(token);
2454 mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0);
2455 reply.readException();
2456 data.recycle();
2457 reply.recycle();
2458 }
Dianne Hackborn0aae2d42010-12-07 23:51:29 -08002459 public void activityPaused(IBinder token) throws RemoteException
2460 {
2461 Parcel data = Parcel.obtain();
2462 Parcel reply = Parcel.obtain();
2463 data.writeInterfaceToken(IActivityManager.descriptor);
2464 data.writeStrongBinder(token);
2465 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
2466 reply.readException();
2467 data.recycle();
2468 reply.recycle();
2469 }
2470 public void activityStopped(IBinder token, Bundle state,
2471 Bitmap thumbnail, CharSequence description) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002472 {
2473 Parcel data = Parcel.obtain();
2474 Parcel reply = Parcel.obtain();
2475 data.writeInterfaceToken(IActivityManager.descriptor);
2476 data.writeStrongBinder(token);
2477 data.writeBundle(state);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002478 if (thumbnail != null) {
2479 data.writeInt(1);
2480 thumbnail.writeToParcel(data, 0);
2481 } else {
2482 data.writeInt(0);
2483 }
2484 TextUtils.writeToParcel(description, data, 0);
2485 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2486 reply.readException();
2487 data.recycle();
2488 reply.recycle();
2489 }
Dianne Hackborn4eba96b2011-01-21 13:34:36 -08002490 public void activitySlept(IBinder token) throws RemoteException
2491 {
2492 Parcel data = Parcel.obtain();
2493 Parcel reply = Parcel.obtain();
2494 data.writeInterfaceToken(IActivityManager.descriptor);
2495 data.writeStrongBinder(token);
2496 mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2497 reply.readException();
2498 data.recycle();
2499 reply.recycle();
2500 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002501 public void activityDestroyed(IBinder token) throws RemoteException
2502 {
2503 Parcel data = Parcel.obtain();
2504 Parcel reply = Parcel.obtain();
2505 data.writeInterfaceToken(IActivityManager.descriptor);
2506 data.writeStrongBinder(token);
2507 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2508 reply.readException();
2509 data.recycle();
2510 reply.recycle();
2511 }
2512 public String getCallingPackage(IBinder token) throws RemoteException
2513 {
2514 Parcel data = Parcel.obtain();
2515 Parcel reply = Parcel.obtain();
2516 data.writeInterfaceToken(IActivityManager.descriptor);
2517 data.writeStrongBinder(token);
2518 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
2519 reply.readException();
2520 String res = reply.readString();
2521 data.recycle();
2522 reply.recycle();
2523 return res;
2524 }
2525 public ComponentName getCallingActivity(IBinder token)
2526 throws RemoteException {
2527 Parcel data = Parcel.obtain();
2528 Parcel reply = Parcel.obtain();
2529 data.writeInterfaceToken(IActivityManager.descriptor);
2530 data.writeStrongBinder(token);
2531 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
2532 reply.readException();
2533 ComponentName res = ComponentName.readFromParcel(reply);
2534 data.recycle();
2535 reply.recycle();
2536 return res;
2537 }
2538 public List getTasks(int maxNum, int flags,
2539 IThumbnailReceiver receiver) throws RemoteException {
2540 Parcel data = Parcel.obtain();
2541 Parcel reply = Parcel.obtain();
2542 data.writeInterfaceToken(IActivityManager.descriptor);
2543 data.writeInt(maxNum);
2544 data.writeInt(flags);
2545 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
2546 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
2547 reply.readException();
2548 ArrayList list = null;
2549 int N = reply.readInt();
2550 if (N >= 0) {
2551 list = new ArrayList();
2552 while (N > 0) {
2553 ActivityManager.RunningTaskInfo info =
2554 ActivityManager.RunningTaskInfo.CREATOR
2555 .createFromParcel(reply);
2556 list.add(info);
2557 N--;
2558 }
2559 }
2560 data.recycle();
2561 reply.recycle();
2562 return list;
2563 }
2564 public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -07002565 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002566 Parcel data = Parcel.obtain();
2567 Parcel reply = Parcel.obtain();
2568 data.writeInterfaceToken(IActivityManager.descriptor);
2569 data.writeInt(maxNum);
2570 data.writeInt(flags);
Amith Yamasani82644082012-08-03 13:09:11 -07002571 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002572 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
2573 reply.readException();
2574 ArrayList<ActivityManager.RecentTaskInfo> list
2575 = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR);
2576 data.recycle();
2577 reply.recycle();
2578 return list;
2579 }
Dianne Hackbornf26fd992011-04-08 18:14:09 -07002580 public ActivityManager.TaskThumbnails getTaskThumbnails(int id) throws RemoteException {
Dianne Hackbornd94df452011-02-16 18:53:31 -08002581 Parcel data = Parcel.obtain();
2582 Parcel reply = Parcel.obtain();
2583 data.writeInterfaceToken(IActivityManager.descriptor);
2584 data.writeInt(id);
Dianne Hackbornf26fd992011-04-08 18:14:09 -07002585 mRemote.transact(GET_TASK_THUMBNAILS_TRANSACTION, data, reply, 0);
Dianne Hackbornd94df452011-02-16 18:53:31 -08002586 reply.readException();
Dianne Hackbornf26fd992011-04-08 18:14:09 -07002587 ActivityManager.TaskThumbnails bm = null;
Dianne Hackbornd94df452011-02-16 18:53:31 -08002588 if (reply.readInt() != 0) {
Dianne Hackbornf26fd992011-04-08 18:14:09 -07002589 bm = ActivityManager.TaskThumbnails.CREATOR.createFromParcel(reply);
Dianne Hackbornd94df452011-02-16 18:53:31 -08002590 }
2591 data.recycle();
2592 reply.recycle();
2593 return bm;
2594 }
Dianne Hackborn15491c62012-09-19 10:59:14 -07002595 public Bitmap getTaskTopThumbnail(int id) throws RemoteException {
2596 Parcel data = Parcel.obtain();
2597 Parcel reply = Parcel.obtain();
2598 data.writeInterfaceToken(IActivityManager.descriptor);
2599 data.writeInt(id);
2600 mRemote.transact(GET_TASK_TOP_THUMBNAIL_TRANSACTION, data, reply, 0);
2601 reply.readException();
2602 Bitmap bm = null;
2603 if (reply.readInt() != 0) {
2604 bm = Bitmap.CREATOR.createFromParcel(reply);
2605 }
2606 data.recycle();
2607 reply.recycle();
2608 return bm;
2609 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002610 public List getServices(int maxNum, int flags) throws RemoteException {
2611 Parcel data = Parcel.obtain();
2612 Parcel reply = Parcel.obtain();
2613 data.writeInterfaceToken(IActivityManager.descriptor);
2614 data.writeInt(maxNum);
2615 data.writeInt(flags);
2616 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
2617 reply.readException();
2618 ArrayList list = null;
2619 int N = reply.readInt();
2620 if (N >= 0) {
2621 list = new ArrayList();
2622 while (N > 0) {
2623 ActivityManager.RunningServiceInfo info =
2624 ActivityManager.RunningServiceInfo.CREATOR
2625 .createFromParcel(reply);
2626 list.add(info);
2627 N--;
2628 }
2629 }
2630 data.recycle();
2631 reply.recycle();
2632 return list;
2633 }
2634 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
2635 throws RemoteException {
2636 Parcel data = Parcel.obtain();
2637 Parcel reply = Parcel.obtain();
2638 data.writeInterfaceToken(IActivityManager.descriptor);
2639 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
2640 reply.readException();
2641 ArrayList<ActivityManager.ProcessErrorStateInfo> list
2642 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
2643 data.recycle();
2644 reply.recycle();
2645 return list;
2646 }
2647 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
2648 throws RemoteException {
2649 Parcel data = Parcel.obtain();
2650 Parcel reply = Parcel.obtain();
2651 data.writeInterfaceToken(IActivityManager.descriptor);
2652 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
2653 reply.readException();
2654 ArrayList<ActivityManager.RunningAppProcessInfo> list
2655 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
2656 data.recycle();
2657 reply.recycle();
2658 return list;
2659 }
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -07002660 public List<ApplicationInfo> getRunningExternalApplications()
2661 throws RemoteException {
2662 Parcel data = Parcel.obtain();
2663 Parcel reply = Parcel.obtain();
2664 data.writeInterfaceToken(IActivityManager.descriptor);
2665 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
2666 reply.readException();
2667 ArrayList<ApplicationInfo> list
2668 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
2669 data.recycle();
2670 reply.recycle();
2671 return list;
2672 }
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07002673 public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002674 {
2675 Parcel data = Parcel.obtain();
2676 Parcel reply = Parcel.obtain();
2677 data.writeInterfaceToken(IActivityManager.descriptor);
2678 data.writeInt(task);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08002679 data.writeInt(flags);
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07002680 if (options != null) {
2681 data.writeInt(1);
2682 options.writeToParcel(data, 0);
2683 } else {
2684 data.writeInt(0);
2685 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002686 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
2687 reply.readException();
2688 data.recycle();
2689 reply.recycle();
2690 }
2691 public void moveTaskToBack(int task) throws RemoteException
2692 {
2693 Parcel data = Parcel.obtain();
2694 Parcel reply = Parcel.obtain();
2695 data.writeInterfaceToken(IActivityManager.descriptor);
2696 data.writeInt(task);
2697 mRemote.transact(MOVE_TASK_TO_BACK_TRANSACTION, data, reply, 0);
2698 reply.readException();
2699 data.recycle();
2700 reply.recycle();
2701 }
2702 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
2703 throws RemoteException {
2704 Parcel data = Parcel.obtain();
2705 Parcel reply = Parcel.obtain();
2706 data.writeInterfaceToken(IActivityManager.descriptor);
2707 data.writeStrongBinder(token);
2708 data.writeInt(nonRoot ? 1 : 0);
2709 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
2710 reply.readException();
2711 boolean res = reply.readInt() != 0;
2712 data.recycle();
2713 reply.recycle();
2714 return res;
2715 }
2716 public void moveTaskBackwards(int task) throws RemoteException
2717 {
2718 Parcel data = Parcel.obtain();
2719 Parcel reply = Parcel.obtain();
2720 data.writeInterfaceToken(IActivityManager.descriptor);
2721 data.writeInt(task);
2722 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
2723 reply.readException();
2724 data.recycle();
2725 reply.recycle();
2726 }
Craig Mautnerc00204b2013-03-05 15:02:14 -08002727 @Override
Craig Mautnerc00204b2013-03-05 15:02:14 -08002728 public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException
2729 {
2730 Parcel data = Parcel.obtain();
2731 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07002732 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerc00204b2013-03-05 15:02:14 -08002733 data.writeInt(taskId);
2734 data.writeInt(stackId);
2735 data.writeInt(toTop ? 1 : 0);
2736 mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0);
2737 reply.readException();
2738 data.recycle();
2739 reply.recycle();
2740 }
2741 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002742 public void resizeStack(int stackBoxId, Rect r) throws RemoteException
Craig Mautnerc00204b2013-03-05 15:02:14 -08002743 {
2744 Parcel data = Parcel.obtain();
2745 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07002746 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautner5a449152013-05-24 15:49:29 -07002747 data.writeInt(stackBoxId);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002748 r.writeToParcel(data, 0);
Craig Mautnercf910b02013-04-23 11:23:27 -07002749 mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
Craig Mautnerc00204b2013-03-05 15:02:14 -08002750 reply.readException();
2751 data.recycle();
2752 reply.recycle();
2753 }
Craig Mautner967212c2013-04-13 21:10:58 -07002754 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002755 public List<StackInfo> getAllStackInfos() throws RemoteException
Craig Mautner5ff12102013-05-24 12:50:15 -07002756 {
2757 Parcel data = Parcel.obtain();
2758 Parcel reply = Parcel.obtain();
2759 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002760 mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0);
Craig Mautner5ff12102013-05-24 12:50:15 -07002761 reply.readException();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002762 ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR);
Craig Mautner967212c2013-04-13 21:10:58 -07002763 data.recycle();
2764 reply.recycle();
2765 return list;
2766 }
Craig Mautnercf910b02013-04-23 11:23:27 -07002767 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002768 public StackInfo getStackInfo(int stackId) throws RemoteException
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07002769 {
2770 Parcel data = Parcel.obtain();
2771 Parcel reply = Parcel.obtain();
2772 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002773 data.writeInt(stackId);
2774 mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07002775 reply.readException();
2776 int res = reply.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002777 StackInfo info = null;
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07002778 if (res != 0) {
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002779 info = StackInfo.CREATOR.createFromParcel(reply);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07002780 }
2781 data.recycle();
2782 reply.recycle();
2783 return info;
2784 }
2785 @Override
Craig Mautnercf910b02013-04-23 11:23:27 -07002786 public void setFocusedStack(int stackId) throws RemoteException
2787 {
2788 Parcel data = Parcel.obtain();
2789 Parcel reply = Parcel.obtain();
2790 data.writeInterfaceToken(IActivityManager.descriptor);
2791 data.writeInt(stackId);
2792 mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2793 reply.readException();
2794 data.recycle();
2795 reply.recycle();
2796 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002797 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
2798 {
2799 Parcel data = Parcel.obtain();
2800 Parcel reply = Parcel.obtain();
2801 data.writeInterfaceToken(IActivityManager.descriptor);
2802 data.writeStrongBinder(token);
2803 data.writeInt(onlyRoot ? 1 : 0);
2804 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
2805 reply.readException();
2806 int res = reply.readInt();
2807 data.recycle();
2808 reply.recycle();
2809 return res;
2810 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002811 public void reportThumbnail(IBinder token,
2812 Bitmap thumbnail, CharSequence description) throws RemoteException
2813 {
2814 Parcel data = Parcel.obtain();
2815 Parcel reply = Parcel.obtain();
2816 data.writeInterfaceToken(IActivityManager.descriptor);
2817 data.writeStrongBinder(token);
2818 if (thumbnail != null) {
2819 data.writeInt(1);
2820 thumbnail.writeToParcel(data, 0);
2821 } else {
2822 data.writeInt(0);
2823 }
2824 TextUtils.writeToParcel(description, data, 0);
2825 mRemote.transact(REPORT_THUMBNAIL_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2826 reply.readException();
2827 data.recycle();
2828 reply.recycle();
2829 }
2830 public ContentProviderHolder getContentProvider(IApplicationThread caller,
Jeff Sharkey6d515712012-09-20 16:06:08 -07002831 String name, int userId, boolean stable) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002832 Parcel data = Parcel.obtain();
2833 Parcel reply = Parcel.obtain();
2834 data.writeInterfaceToken(IActivityManager.descriptor);
2835 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2836 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07002837 data.writeInt(userId);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002838 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002839 mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
2840 reply.readException();
2841 int res = reply.readInt();
2842 ContentProviderHolder cph = null;
2843 if (res != 0) {
2844 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
2845 }
2846 data.recycle();
2847 reply.recycle();
2848 return cph;
2849 }
Jeff Sharkey6d515712012-09-20 16:06:08 -07002850 public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token)
2851 throws RemoteException {
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08002852 Parcel data = Parcel.obtain();
2853 Parcel reply = Parcel.obtain();
2854 data.writeInterfaceToken(IActivityManager.descriptor);
2855 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07002856 data.writeInt(userId);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08002857 data.writeStrongBinder(token);
2858 mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
2859 reply.readException();
2860 int res = reply.readInt();
2861 ContentProviderHolder cph = null;
2862 if (res != 0) {
2863 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
2864 }
2865 data.recycle();
2866 reply.recycle();
2867 return cph;
2868 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002869 public void publishContentProviders(IApplicationThread caller,
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002870 List<ContentProviderHolder> providers) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002871 {
2872 Parcel data = Parcel.obtain();
2873 Parcel reply = Parcel.obtain();
2874 data.writeInterfaceToken(IActivityManager.descriptor);
2875 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2876 data.writeTypedList(providers);
2877 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
2878 reply.readException();
2879 data.recycle();
2880 reply.recycle();
2881 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002882 public boolean refContentProvider(IBinder connection, int stable, int unstable)
2883 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002884 Parcel data = Parcel.obtain();
2885 Parcel reply = Parcel.obtain();
2886 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002887 data.writeStrongBinder(connection);
2888 data.writeInt(stable);
2889 data.writeInt(unstable);
2890 mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
2891 reply.readException();
2892 boolean res = reply.readInt() != 0;
2893 data.recycle();
2894 reply.recycle();
2895 return res;
2896 }
Jeff Sharkey7aa76012013-09-30 14:26:27 -07002897
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002898 public void unstableProviderDied(IBinder connection) throws RemoteException {
2899 Parcel data = Parcel.obtain();
2900 Parcel reply = Parcel.obtain();
2901 data.writeInterfaceToken(IActivityManager.descriptor);
2902 data.writeStrongBinder(connection);
2903 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0);
2904 reply.readException();
2905 data.recycle();
2906 reply.recycle();
2907 }
2908
Jeff Sharkey7aa76012013-09-30 14:26:27 -07002909 @Override
2910 public void appNotRespondingViaProvider(IBinder connection) throws RemoteException {
2911 Parcel data = Parcel.obtain();
2912 Parcel reply = Parcel.obtain();
2913 data.writeInterfaceToken(IActivityManager.descriptor);
2914 data.writeStrongBinder(connection);
2915 mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0);
2916 reply.readException();
2917 data.recycle();
2918 reply.recycle();
2919 }
2920
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002921 public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException {
2922 Parcel data = Parcel.obtain();
2923 Parcel reply = Parcel.obtain();
2924 data.writeInterfaceToken(IActivityManager.descriptor);
2925 data.writeStrongBinder(connection);
2926 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002927 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
2928 reply.readException();
2929 data.recycle();
2930 reply.recycle();
2931 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08002932
2933 public void removeContentProviderExternal(String name, IBinder token) throws RemoteException {
2934 Parcel data = Parcel.obtain();
2935 Parcel reply = Parcel.obtain();
2936 data.writeInterfaceToken(IActivityManager.descriptor);
2937 data.writeString(name);
2938 data.writeStrongBinder(token);
2939 mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
2940 reply.readException();
2941 data.recycle();
2942 reply.recycle();
2943 }
2944
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07002945 public PendingIntent getRunningServiceControlPanel(ComponentName service)
2946 throws RemoteException
2947 {
2948 Parcel data = Parcel.obtain();
2949 Parcel reply = Parcel.obtain();
2950 data.writeInterfaceToken(IActivityManager.descriptor);
2951 service.writeToParcel(data, 0);
2952 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
2953 reply.readException();
2954 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
2955 data.recycle();
2956 reply.recycle();
2957 return res;
2958 }
2959
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002960 public ComponentName startService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07002961 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002962 {
2963 Parcel data = Parcel.obtain();
2964 Parcel reply = Parcel.obtain();
2965 data.writeInterfaceToken(IActivityManager.descriptor);
2966 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2967 service.writeToParcel(data, 0);
2968 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07002969 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002970 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
2971 reply.readException();
2972 ComponentName res = ComponentName.readFromParcel(reply);
2973 data.recycle();
2974 reply.recycle();
2975 return res;
2976 }
2977 public int stopService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07002978 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002979 {
2980 Parcel data = Parcel.obtain();
2981 Parcel reply = Parcel.obtain();
2982 data.writeInterfaceToken(IActivityManager.descriptor);
2983 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2984 service.writeToParcel(data, 0);
2985 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07002986 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002987 mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0);
2988 reply.readException();
2989 int res = reply.readInt();
2990 reply.recycle();
2991 data.recycle();
2992 return res;
2993 }
2994 public boolean stopServiceToken(ComponentName className, IBinder token,
2995 int startId) throws RemoteException {
2996 Parcel data = Parcel.obtain();
2997 Parcel reply = Parcel.obtain();
2998 data.writeInterfaceToken(IActivityManager.descriptor);
2999 ComponentName.writeToParcel(className, data);
3000 data.writeStrongBinder(token);
3001 data.writeInt(startId);
3002 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
3003 reply.readException();
3004 boolean res = reply.readInt() != 0;
3005 data.recycle();
3006 reply.recycle();
3007 return res;
3008 }
3009 public void setServiceForeground(ComponentName className, IBinder token,
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003010 int id, Notification notification, boolean removeNotification) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003011 Parcel data = Parcel.obtain();
3012 Parcel reply = Parcel.obtain();
3013 data.writeInterfaceToken(IActivityManager.descriptor);
3014 ComponentName.writeToParcel(className, data);
3015 data.writeStrongBinder(token);
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003016 data.writeInt(id);
3017 if (notification != null) {
3018 data.writeInt(1);
3019 notification.writeToParcel(data, 0);
3020 } else {
3021 data.writeInt(0);
3022 }
3023 data.writeInt(removeNotification ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003024 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
3025 reply.readException();
3026 data.recycle();
3027 reply.recycle();
3028 }
3029 public int bindService(IApplicationThread caller, IBinder token,
3030 Intent service, String resolvedType, IServiceConnection connection,
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003031 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003032 Parcel data = Parcel.obtain();
3033 Parcel reply = Parcel.obtain();
3034 data.writeInterfaceToken(IActivityManager.descriptor);
3035 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3036 data.writeStrongBinder(token);
3037 service.writeToParcel(data, 0);
3038 data.writeString(resolvedType);
3039 data.writeStrongBinder(connection.asBinder());
3040 data.writeInt(flags);
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003041 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003042 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
3043 reply.readException();
3044 int res = reply.readInt();
3045 data.recycle();
3046 reply.recycle();
3047 return res;
3048 }
3049 public boolean unbindService(IServiceConnection connection) throws RemoteException
3050 {
3051 Parcel data = Parcel.obtain();
3052 Parcel reply = Parcel.obtain();
3053 data.writeInterfaceToken(IActivityManager.descriptor);
3054 data.writeStrongBinder(connection.asBinder());
3055 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
3056 reply.readException();
3057 boolean res = reply.readInt() != 0;
3058 data.recycle();
3059 reply.recycle();
3060 return res;
3061 }
3062
3063 public void publishService(IBinder token,
3064 Intent intent, IBinder service) throws RemoteException {
3065 Parcel data = Parcel.obtain();
3066 Parcel reply = Parcel.obtain();
3067 data.writeInterfaceToken(IActivityManager.descriptor);
3068 data.writeStrongBinder(token);
3069 intent.writeToParcel(data, 0);
3070 data.writeStrongBinder(service);
3071 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
3072 reply.readException();
3073 data.recycle();
3074 reply.recycle();
3075 }
3076
3077 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
3078 throws RemoteException {
3079 Parcel data = Parcel.obtain();
3080 Parcel reply = Parcel.obtain();
3081 data.writeInterfaceToken(IActivityManager.descriptor);
3082 data.writeStrongBinder(token);
3083 intent.writeToParcel(data, 0);
3084 data.writeInt(doRebind ? 1 : 0);
3085 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
3086 reply.readException();
3087 data.recycle();
3088 reply.recycle();
3089 }
3090
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003091 public void serviceDoneExecuting(IBinder token, int type, int startId,
3092 int res) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003093 Parcel data = Parcel.obtain();
3094 Parcel reply = Parcel.obtain();
3095 data.writeInterfaceToken(IActivityManager.descriptor);
3096 data.writeStrongBinder(token);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003097 data.writeInt(type);
3098 data.writeInt(startId);
3099 data.writeInt(res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003100 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3101 reply.readException();
3102 data.recycle();
3103 reply.recycle();
3104 }
3105
3106 public IBinder peekService(Intent service, String resolvedType) throws RemoteException {
3107 Parcel data = Parcel.obtain();
3108 Parcel reply = Parcel.obtain();
3109 data.writeInterfaceToken(IActivityManager.descriptor);
3110 service.writeToParcel(data, 0);
3111 data.writeString(resolvedType);
3112 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
3113 reply.readException();
3114 IBinder binder = reply.readStrongBinder();
3115 reply.recycle();
3116 data.recycle();
3117 return binder;
3118 }
3119
Christopher Tate181fafa2009-05-14 11:12:14 -07003120 public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
3121 throws RemoteException {
3122 Parcel data = Parcel.obtain();
3123 Parcel reply = Parcel.obtain();
3124 data.writeInterfaceToken(IActivityManager.descriptor);
3125 app.writeToParcel(data, 0);
3126 data.writeInt(backupRestoreMode);
3127 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3128 reply.readException();
3129 boolean success = reply.readInt() != 0;
3130 reply.recycle();
3131 data.recycle();
3132 return success;
3133 }
3134
Christopher Tate346acb12012-10-15 19:20:25 -07003135 public void clearPendingBackup() throws RemoteException {
3136 Parcel data = Parcel.obtain();
3137 Parcel reply = Parcel.obtain();
3138 data.writeInterfaceToken(IActivityManager.descriptor);
3139 mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0);
3140 reply.recycle();
3141 data.recycle();
3142 }
3143
Christopher Tate181fafa2009-05-14 11:12:14 -07003144 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
3145 Parcel data = Parcel.obtain();
3146 Parcel reply = Parcel.obtain();
3147 data.writeInterfaceToken(IActivityManager.descriptor);
3148 data.writeString(packageName);
3149 data.writeStrongBinder(agent);
3150 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
3151 reply.recycle();
3152 data.recycle();
3153 }
3154
3155 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
3156 Parcel data = Parcel.obtain();
3157 Parcel reply = Parcel.obtain();
3158 data.writeInterfaceToken(IActivityManager.descriptor);
3159 app.writeToParcel(data, 0);
3160 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3161 reply.readException();
3162 reply.recycle();
3163 data.recycle();
3164 }
3165
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003166 public boolean startInstrumentation(ComponentName className, String profileFile,
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003167 int flags, Bundle arguments, IInstrumentationWatcher watcher,
3168 IUiAutomationConnection connection, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003169 Parcel data = Parcel.obtain();
3170 Parcel reply = Parcel.obtain();
3171 data.writeInterfaceToken(IActivityManager.descriptor);
3172 ComponentName.writeToParcel(className, data);
3173 data.writeString(profileFile);
3174 data.writeInt(flags);
3175 data.writeBundle(arguments);
3176 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003177 data.writeStrongBinder(connection != null ? connection.asBinder() : null);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07003178 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003179 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3180 reply.readException();
3181 boolean res = reply.readInt() != 0;
3182 reply.recycle();
3183 data.recycle();
3184 return res;
3185 }
3186
3187 public void finishInstrumentation(IApplicationThread target,
3188 int resultCode, Bundle results) throws RemoteException {
3189 Parcel data = Parcel.obtain();
3190 Parcel reply = Parcel.obtain();
3191 data.writeInterfaceToken(IActivityManager.descriptor);
3192 data.writeStrongBinder(target != null ? target.asBinder() : null);
3193 data.writeInt(resultCode);
3194 data.writeBundle(results);
3195 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3196 reply.readException();
3197 data.recycle();
3198 reply.recycle();
3199 }
3200 public Configuration getConfiguration() throws RemoteException
3201 {
3202 Parcel data = Parcel.obtain();
3203 Parcel reply = Parcel.obtain();
3204 data.writeInterfaceToken(IActivityManager.descriptor);
3205 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
3206 reply.readException();
3207 Configuration res = Configuration.CREATOR.createFromParcel(reply);
3208 reply.recycle();
3209 data.recycle();
3210 return res;
3211 }
3212 public void updateConfiguration(Configuration values) throws RemoteException
3213 {
3214 Parcel data = Parcel.obtain();
3215 Parcel reply = Parcel.obtain();
3216 data.writeInterfaceToken(IActivityManager.descriptor);
3217 values.writeToParcel(data, 0);
3218 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
3219 reply.readException();
3220 data.recycle();
3221 reply.recycle();
3222 }
3223 public void setRequestedOrientation(IBinder token, int requestedOrientation)
3224 throws RemoteException {
3225 Parcel data = Parcel.obtain();
3226 Parcel reply = Parcel.obtain();
3227 data.writeInterfaceToken(IActivityManager.descriptor);
3228 data.writeStrongBinder(token);
3229 data.writeInt(requestedOrientation);
3230 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3231 reply.readException();
3232 data.recycle();
3233 reply.recycle();
3234 }
3235 public int getRequestedOrientation(IBinder token) throws RemoteException {
3236 Parcel data = Parcel.obtain();
3237 Parcel reply = Parcel.obtain();
3238 data.writeInterfaceToken(IActivityManager.descriptor);
3239 data.writeStrongBinder(token);
3240 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3241 reply.readException();
3242 int res = reply.readInt();
3243 data.recycle();
3244 reply.recycle();
3245 return res;
3246 }
3247 public ComponentName getActivityClassForToken(IBinder token)
3248 throws RemoteException {
3249 Parcel data = Parcel.obtain();
3250 Parcel reply = Parcel.obtain();
3251 data.writeInterfaceToken(IActivityManager.descriptor);
3252 data.writeStrongBinder(token);
3253 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
3254 reply.readException();
3255 ComponentName res = ComponentName.readFromParcel(reply);
3256 data.recycle();
3257 reply.recycle();
3258 return res;
3259 }
3260 public String getPackageForToken(IBinder token) throws RemoteException
3261 {
3262 Parcel data = Parcel.obtain();
3263 Parcel reply = Parcel.obtain();
3264 data.writeInterfaceToken(IActivityManager.descriptor);
3265 data.writeStrongBinder(token);
3266 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
3267 reply.readException();
3268 String res = reply.readString();
3269 data.recycle();
3270 reply.recycle();
3271 return res;
3272 }
3273 public IIntentSender getIntentSender(int type,
3274 String packageName, IBinder token, String resultWho,
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003275 int requestCode, Intent[] intents, String[] resolvedTypes, int flags,
Dianne Hackborn41203752012-08-31 14:05:51 -07003276 Bundle options, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003277 Parcel data = Parcel.obtain();
3278 Parcel reply = Parcel.obtain();
3279 data.writeInterfaceToken(IActivityManager.descriptor);
3280 data.writeInt(type);
3281 data.writeString(packageName);
3282 data.writeStrongBinder(token);
3283 data.writeString(resultWho);
3284 data.writeInt(requestCode);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003285 if (intents != null) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003286 data.writeInt(1);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003287 data.writeTypedArray(intents, 0);
3288 data.writeStringArray(resolvedTypes);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003289 } else {
3290 data.writeInt(0);
3291 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003292 data.writeInt(flags);
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003293 if (options != null) {
3294 data.writeInt(1);
3295 options.writeToParcel(data, 0);
3296 } else {
3297 data.writeInt(0);
3298 }
Dianne Hackborn41203752012-08-31 14:05:51 -07003299 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003300 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
3301 reply.readException();
3302 IIntentSender res = IIntentSender.Stub.asInterface(
3303 reply.readStrongBinder());
3304 data.recycle();
3305 reply.recycle();
3306 return res;
3307 }
3308 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
3309 Parcel data = Parcel.obtain();
3310 Parcel reply = Parcel.obtain();
3311 data.writeInterfaceToken(IActivityManager.descriptor);
3312 data.writeStrongBinder(sender.asBinder());
3313 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
3314 reply.readException();
3315 data.recycle();
3316 reply.recycle();
3317 }
3318 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
3319 Parcel data = Parcel.obtain();
3320 Parcel reply = Parcel.obtain();
3321 data.writeInterfaceToken(IActivityManager.descriptor);
3322 data.writeStrongBinder(sender.asBinder());
3323 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
3324 reply.readException();
3325 String res = reply.readString();
3326 data.recycle();
3327 reply.recycle();
3328 return res;
3329 }
Christopher Tatec4a07d12012-04-06 14:19:13 -07003330 public int getUidForIntentSender(IIntentSender sender) throws RemoteException {
3331 Parcel data = Parcel.obtain();
3332 Parcel reply = Parcel.obtain();
3333 data.writeInterfaceToken(IActivityManager.descriptor);
3334 data.writeStrongBinder(sender.asBinder());
3335 mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
3336 reply.readException();
3337 int res = reply.readInt();
3338 data.recycle();
3339 reply.recycle();
3340 return res;
3341 }
Dianne Hackborn41203752012-08-31 14:05:51 -07003342 public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
3343 boolean requireFull, String name, String callerPackage) throws RemoteException {
3344 Parcel data = Parcel.obtain();
3345 Parcel reply = Parcel.obtain();
3346 data.writeInterfaceToken(IActivityManager.descriptor);
3347 data.writeInt(callingPid);
3348 data.writeInt(callingUid);
3349 data.writeInt(userId);
3350 data.writeInt(allowAll ? 1 : 0);
3351 data.writeInt(requireFull ? 1 : 0);
3352 data.writeString(name);
3353 data.writeString(callerPackage);
3354 mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0);
3355 reply.readException();
3356 int res = reply.readInt();
3357 data.recycle();
3358 reply.recycle();
3359 return res;
3360 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003361 public void setProcessLimit(int max) throws RemoteException
3362 {
3363 Parcel data = Parcel.obtain();
3364 Parcel reply = Parcel.obtain();
3365 data.writeInterfaceToken(IActivityManager.descriptor);
3366 data.writeInt(max);
3367 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
3368 reply.readException();
3369 data.recycle();
3370 reply.recycle();
3371 }
3372 public int getProcessLimit() throws RemoteException
3373 {
3374 Parcel data = Parcel.obtain();
3375 Parcel reply = Parcel.obtain();
3376 data.writeInterfaceToken(IActivityManager.descriptor);
3377 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
3378 reply.readException();
3379 int res = reply.readInt();
3380 data.recycle();
3381 reply.recycle();
3382 return res;
3383 }
3384 public void setProcessForeground(IBinder token, int pid,
3385 boolean isForeground) throws RemoteException {
3386 Parcel data = Parcel.obtain();
3387 Parcel reply = Parcel.obtain();
3388 data.writeInterfaceToken(IActivityManager.descriptor);
3389 data.writeStrongBinder(token);
3390 data.writeInt(pid);
3391 data.writeInt(isForeground ? 1 : 0);
3392 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
3393 reply.readException();
3394 data.recycle();
3395 reply.recycle();
3396 }
3397 public int checkPermission(String permission, int pid, int uid)
3398 throws RemoteException {
3399 Parcel data = Parcel.obtain();
3400 Parcel reply = Parcel.obtain();
3401 data.writeInterfaceToken(IActivityManager.descriptor);
3402 data.writeString(permission);
3403 data.writeInt(pid);
3404 data.writeInt(uid);
3405 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
3406 reply.readException();
3407 int res = reply.readInt();
3408 data.recycle();
3409 reply.recycle();
3410 return res;
3411 }
3412 public boolean clearApplicationUserData(final String packageName,
Amith Yamasani742a6712011-05-04 14:49:28 -07003413 final IPackageDataObserver observer, final int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003414 Parcel data = Parcel.obtain();
3415 Parcel reply = Parcel.obtain();
3416 data.writeInterfaceToken(IActivityManager.descriptor);
3417 data.writeString(packageName);
Christopher Tate31b65f92013-09-09 14:17:27 -07003418 data.writeStrongBinder((observer != null) ? observer.asBinder() : null);
Amith Yamasani742a6712011-05-04 14:49:28 -07003419 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003420 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
3421 reply.readException();
3422 boolean res = reply.readInt() != 0;
3423 data.recycle();
3424 reply.recycle();
3425 return res;
3426 }
3427 public int checkUriPermission(Uri uri, int pid, int uid, int mode)
3428 throws RemoteException {
3429 Parcel data = Parcel.obtain();
3430 Parcel reply = Parcel.obtain();
3431 data.writeInterfaceToken(IActivityManager.descriptor);
3432 uri.writeToParcel(data, 0);
3433 data.writeInt(pid);
3434 data.writeInt(uid);
3435 data.writeInt(mode);
3436 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
3437 reply.readException();
3438 int res = reply.readInt();
3439 data.recycle();
3440 reply.recycle();
3441 return res;
3442 }
3443 public void grantUriPermission(IApplicationThread caller, String targetPkg,
3444 Uri uri, int mode) throws RemoteException {
3445 Parcel data = Parcel.obtain();
3446 Parcel reply = Parcel.obtain();
3447 data.writeInterfaceToken(IActivityManager.descriptor);
3448 data.writeStrongBinder(caller.asBinder());
3449 data.writeString(targetPkg);
3450 uri.writeToParcel(data, 0);
3451 data.writeInt(mode);
3452 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
3453 reply.readException();
3454 data.recycle();
3455 reply.recycle();
3456 }
3457 public void revokeUriPermission(IApplicationThread caller, Uri uri,
3458 int mode) throws RemoteException {
3459 Parcel data = Parcel.obtain();
3460 Parcel reply = Parcel.obtain();
3461 data.writeInterfaceToken(IActivityManager.descriptor);
3462 data.writeStrongBinder(caller.asBinder());
3463 uri.writeToParcel(data, 0);
3464 data.writeInt(mode);
3465 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
3466 reply.readException();
3467 data.recycle();
3468 reply.recycle();
3469 }
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003470
3471 @Override
3472 public void takePersistableUriPermission(Uri uri, int mode) throws RemoteException {
3473 Parcel data = Parcel.obtain();
3474 Parcel reply = Parcel.obtain();
3475 data.writeInterfaceToken(IActivityManager.descriptor);
3476 uri.writeToParcel(data, 0);
3477 data.writeInt(mode);
3478 mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
3479 reply.readException();
3480 data.recycle();
3481 reply.recycle();
3482 }
3483
3484 @Override
3485 public void releasePersistableUriPermission(Uri uri, int mode) throws RemoteException {
3486 Parcel data = Parcel.obtain();
3487 Parcel reply = Parcel.obtain();
3488 data.writeInterfaceToken(IActivityManager.descriptor);
3489 uri.writeToParcel(data, 0);
3490 data.writeInt(mode);
3491 mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
3492 reply.readException();
3493 data.recycle();
3494 reply.recycle();
3495 }
3496
3497 @Override
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07003498 public ParceledListSlice<UriPermission> getPersistedUriPermissions(
3499 String packageName, boolean incoming) throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003500 Parcel data = Parcel.obtain();
3501 Parcel reply = Parcel.obtain();
3502 data.writeInterfaceToken(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07003503 data.writeString(packageName);
3504 data.writeInt(incoming ? 1 : 0);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003505 mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
3506 reply.readException();
3507 final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel(
3508 reply);
3509 data.recycle();
3510 reply.recycle();
3511 return perms;
3512 }
3513
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003514 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
3515 throws RemoteException {
3516 Parcel data = Parcel.obtain();
3517 Parcel reply = Parcel.obtain();
3518 data.writeInterfaceToken(IActivityManager.descriptor);
3519 data.writeStrongBinder(who.asBinder());
3520 data.writeInt(waiting ? 1 : 0);
3521 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
3522 reply.readException();
3523 data.recycle();
3524 reply.recycle();
3525 }
3526 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
3527 Parcel data = Parcel.obtain();
3528 Parcel reply = Parcel.obtain();
3529 data.writeInterfaceToken(IActivityManager.descriptor);
3530 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
3531 reply.readException();
3532 outInfo.readFromParcel(reply);
3533 data.recycle();
3534 reply.recycle();
3535 }
3536 public void unhandledBack() throws RemoteException
3537 {
3538 Parcel data = Parcel.obtain();
3539 Parcel reply = Parcel.obtain();
3540 data.writeInterfaceToken(IActivityManager.descriptor);
3541 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
3542 reply.readException();
3543 data.recycle();
3544 reply.recycle();
3545 }
3546 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
3547 {
3548 Parcel data = Parcel.obtain();
3549 Parcel reply = Parcel.obtain();
3550 data.writeInterfaceToken(IActivityManager.descriptor);
3551 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
3552 reply.readException();
3553 ParcelFileDescriptor pfd = null;
3554 if (reply.readInt() != 0) {
3555 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
3556 }
3557 data.recycle();
3558 reply.recycle();
3559 return pfd;
3560 }
3561 public void goingToSleep() throws RemoteException
3562 {
3563 Parcel data = Parcel.obtain();
3564 Parcel reply = Parcel.obtain();
3565 data.writeInterfaceToken(IActivityManager.descriptor);
3566 mRemote.transact(GOING_TO_SLEEP_TRANSACTION, data, reply, 0);
3567 reply.readException();
3568 data.recycle();
3569 reply.recycle();
3570 }
3571 public void wakingUp() throws RemoteException
3572 {
3573 Parcel data = Parcel.obtain();
3574 Parcel reply = Parcel.obtain();
3575 data.writeInterfaceToken(IActivityManager.descriptor);
3576 mRemote.transact(WAKING_UP_TRANSACTION, data, reply, 0);
3577 reply.readException();
3578 data.recycle();
3579 reply.recycle();
3580 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07003581 public void setLockScreenShown(boolean shown) throws RemoteException
3582 {
3583 Parcel data = Parcel.obtain();
3584 Parcel reply = Parcel.obtain();
3585 data.writeInterfaceToken(IActivityManager.descriptor);
3586 data.writeInt(shown ? 1 : 0);
3587 mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0);
3588 reply.readException();
3589 data.recycle();
3590 reply.recycle();
3591 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003592 public void setDebugApp(
3593 String packageName, boolean waitForDebugger, boolean persistent)
3594 throws RemoteException
3595 {
3596 Parcel data = Parcel.obtain();
3597 Parcel reply = Parcel.obtain();
3598 data.writeInterfaceToken(IActivityManager.descriptor);
3599 data.writeString(packageName);
3600 data.writeInt(waitForDebugger ? 1 : 0);
3601 data.writeInt(persistent ? 1 : 0);
3602 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
3603 reply.readException();
3604 data.recycle();
3605 reply.recycle();
3606 }
3607 public void setAlwaysFinish(boolean enabled) throws RemoteException
3608 {
3609 Parcel data = Parcel.obtain();
3610 Parcel reply = Parcel.obtain();
3611 data.writeInterfaceToken(IActivityManager.descriptor);
3612 data.writeInt(enabled ? 1 : 0);
3613 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
3614 reply.readException();
3615 data.recycle();
3616 reply.recycle();
3617 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07003618 public void setActivityController(IActivityController watcher) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003619 {
3620 Parcel data = Parcel.obtain();
3621 Parcel reply = Parcel.obtain();
3622 data.writeInterfaceToken(IActivityManager.descriptor);
3623 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07003624 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003625 reply.readException();
3626 data.recycle();
3627 reply.recycle();
3628 }
3629 public void enterSafeMode() throws RemoteException {
3630 Parcel data = Parcel.obtain();
3631 data.writeInterfaceToken(IActivityManager.descriptor);
3632 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
3633 data.recycle();
3634 }
3635 public void noteWakeupAlarm(IIntentSender sender) throws RemoteException {
3636 Parcel data = Parcel.obtain();
3637 data.writeStrongBinder(sender.asBinder());
3638 data.writeInterfaceToken(IActivityManager.descriptor);
3639 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
3640 data.recycle();
3641 }
Dianne Hackborn64825172011-03-02 21:32:58 -08003642 public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003643 Parcel data = Parcel.obtain();
3644 Parcel reply = Parcel.obtain();
3645 data.writeInterfaceToken(IActivityManager.descriptor);
3646 data.writeIntArray(pids);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07003647 data.writeString(reason);
Dianne Hackborn64825172011-03-02 21:32:58 -08003648 data.writeInt(secure ? 1 : 0);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07003649 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07003650 reply.readException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003651 boolean res = reply.readInt() != 0;
3652 data.recycle();
3653 reply.recycle();
3654 return res;
3655 }
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07003656 @Override
3657 public boolean killProcessesBelowForeground(String reason) throws RemoteException {
3658 Parcel data = Parcel.obtain();
3659 Parcel reply = Parcel.obtain();
3660 data.writeInterfaceToken(IActivityManager.descriptor);
3661 data.writeString(reason);
3662 mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0);
3663 boolean res = reply.readInt() != 0;
3664 data.recycle();
3665 reply.recycle();
3666 return res;
3667 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003668 public void startRunning(String pkg, String cls, String action,
3669 String indata) throws RemoteException {
3670 Parcel data = Parcel.obtain();
3671 Parcel reply = Parcel.obtain();
3672 data.writeInterfaceToken(IActivityManager.descriptor);
3673 data.writeString(pkg);
3674 data.writeString(cls);
3675 data.writeString(action);
3676 data.writeString(indata);
3677 mRemote.transact(START_RUNNING_TRANSACTION, data, reply, 0);
3678 reply.readException();
3679 data.recycle();
3680 reply.recycle();
3681 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003682 public boolean testIsSystemReady()
3683 {
3684 /* this base class version is never called */
3685 return true;
3686 }
Dan Egnor60d87622009-12-16 16:32:58 -08003687 public void handleApplicationCrash(IBinder app,
3688 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
3689 {
3690 Parcel data = Parcel.obtain();
3691 Parcel reply = Parcel.obtain();
3692 data.writeInterfaceToken(IActivityManager.descriptor);
3693 data.writeStrongBinder(app);
3694 crashInfo.writeToParcel(data, 0);
3695 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
3696 reply.readException();
3697 reply.recycle();
3698 data.recycle();
3699 }
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07003700
Dan Egnor60d87622009-12-16 16:32:58 -08003701 public boolean handleApplicationWtf(IBinder app, String tag,
Dan Egnorb7f03672009-12-09 16:22:32 -08003702 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003703 {
3704 Parcel data = Parcel.obtain();
3705 Parcel reply = Parcel.obtain();
3706 data.writeInterfaceToken(IActivityManager.descriptor);
3707 data.writeStrongBinder(app);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003708 data.writeString(tag);
Dan Egnorb7f03672009-12-09 16:22:32 -08003709 crashInfo.writeToParcel(data, 0);
Dan Egnor60d87622009-12-16 16:32:58 -08003710 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003711 reply.readException();
Dan Egnor60d87622009-12-16 16:32:58 -08003712 boolean res = reply.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003713 reply.recycle();
3714 data.recycle();
Dan Egnor60d87622009-12-16 16:32:58 -08003715 return res;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003716 }
Dan Egnorb7f03672009-12-09 16:22:32 -08003717
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07003718 public void handleApplicationStrictModeViolation(IBinder app,
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07003719 int violationMask,
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07003720 StrictMode.ViolationInfo info) throws RemoteException
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07003721 {
3722 Parcel data = Parcel.obtain();
3723 Parcel reply = Parcel.obtain();
3724 data.writeInterfaceToken(IActivityManager.descriptor);
3725 data.writeStrongBinder(app);
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07003726 data.writeInt(violationMask);
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07003727 info.writeToParcel(data, 0);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07003728 mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0);
3729 reply.readException();
3730 reply.recycle();
3731 data.recycle();
3732 }
3733
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003734 public void signalPersistentProcesses(int sig) throws RemoteException {
3735 Parcel data = Parcel.obtain();
3736 Parcel reply = Parcel.obtain();
3737 data.writeInterfaceToken(IActivityManager.descriptor);
3738 data.writeInt(sig);
3739 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
3740 reply.readException();
3741 data.recycle();
3742 reply.recycle();
3743 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08003744
Dianne Hackborn1676c852012-09-10 14:52:30 -07003745 public void killBackgroundProcesses(String packageName, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003746 Parcel data = Parcel.obtain();
3747 Parcel reply = Parcel.obtain();
3748 data.writeInterfaceToken(IActivityManager.descriptor);
3749 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07003750 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08003751 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
3752 reply.readException();
3753 data.recycle();
3754 reply.recycle();
3755 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08003756
3757 public void killAllBackgroundProcesses() throws RemoteException {
3758 Parcel data = Parcel.obtain();
3759 Parcel reply = Parcel.obtain();
3760 data.writeInterfaceToken(IActivityManager.descriptor);
3761 mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
3762 reply.readException();
3763 data.recycle();
3764 reply.recycle();
3765 }
3766
Dianne Hackborn1676c852012-09-10 14:52:30 -07003767 public void forceStopPackage(String packageName, int userId) throws RemoteException {
Dianne Hackborn03abb812010-01-04 18:43:19 -08003768 Parcel data = Parcel.obtain();
3769 Parcel reply = Parcel.obtain();
3770 data.writeInterfaceToken(IActivityManager.descriptor);
3771 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07003772 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08003773 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003774 reply.readException();
3775 data.recycle();
3776 reply.recycle();
3777 }
3778
Dianne Hackborn27ff9132012-03-06 14:57:58 -08003779 public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
3780 throws RemoteException
3781 {
3782 Parcel data = Parcel.obtain();
3783 Parcel reply = Parcel.obtain();
3784 data.writeInterfaceToken(IActivityManager.descriptor);
3785 mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0);
3786 reply.readException();
3787 outInfo.readFromParcel(reply);
3788 reply.recycle();
3789 data.recycle();
3790 }
3791
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003792 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
3793 {
3794 Parcel data = Parcel.obtain();
3795 Parcel reply = Parcel.obtain();
3796 data.writeInterfaceToken(IActivityManager.descriptor);
3797 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
3798 reply.readException();
3799 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
3800 reply.recycle();
3801 data.recycle();
3802 return res;
3803 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003804
Dianne Hackborn1676c852012-09-10 14:52:30 -07003805 public boolean profileControl(String process, int userId, boolean start,
Romain Guy7eabe552011-07-21 14:56:34 -07003806 String path, ParcelFileDescriptor fd, int profileType) throws RemoteException
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003807 {
3808 Parcel data = Parcel.obtain();
3809 Parcel reply = Parcel.obtain();
3810 data.writeInterfaceToken(IActivityManager.descriptor);
3811 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07003812 data.writeInt(userId);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003813 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07003814 data.writeInt(profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003815 data.writeString(path);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07003816 if (fd != null) {
3817 data.writeInt(1);
3818 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
3819 } else {
3820 data.writeInt(0);
3821 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003822 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
3823 reply.readException();
3824 boolean res = reply.readInt() != 0;
3825 reply.recycle();
3826 data.recycle();
3827 return res;
3828 }
3829
Dianne Hackborn55280a92009-05-07 15:53:46 -07003830 public boolean shutdown(int timeout) throws RemoteException
3831 {
3832 Parcel data = Parcel.obtain();
3833 Parcel reply = Parcel.obtain();
3834 data.writeInterfaceToken(IActivityManager.descriptor);
3835 data.writeInt(timeout);
3836 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
3837 reply.readException();
3838 boolean res = reply.readInt() != 0;
3839 reply.recycle();
3840 data.recycle();
3841 return res;
3842 }
3843
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07003844 public void stopAppSwitches() throws RemoteException {
3845 Parcel data = Parcel.obtain();
3846 Parcel reply = Parcel.obtain();
3847 data.writeInterfaceToken(IActivityManager.descriptor);
3848 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
3849 reply.readException();
3850 reply.recycle();
3851 data.recycle();
3852 }
3853
3854 public void resumeAppSwitches() throws RemoteException {
3855 Parcel data = Parcel.obtain();
3856 Parcel reply = Parcel.obtain();
3857 data.writeInterfaceToken(IActivityManager.descriptor);
3858 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
3859 reply.readException();
3860 reply.recycle();
3861 data.recycle();
3862 }
3863
Dianne Hackborn21d9b562013-05-28 17:46:59 -07003864 public void killApplicationWithAppId(String pkg, int appid, String reason)
3865 throws RemoteException {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07003866 Parcel data = Parcel.obtain();
3867 Parcel reply = Parcel.obtain();
3868 data.writeInterfaceToken(IActivityManager.descriptor);
3869 data.writeString(pkg);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07003870 data.writeInt(appid);
Dianne Hackborn21d9b562013-05-28 17:46:59 -07003871 data.writeString(reason);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07003872 mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07003873 reply.readException();
3874 data.recycle();
3875 reply.recycle();
3876 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07003877
3878 public void closeSystemDialogs(String reason) throws RemoteException {
3879 Parcel data = Parcel.obtain();
3880 Parcel reply = Parcel.obtain();
3881 data.writeInterfaceToken(IActivityManager.descriptor);
3882 data.writeString(reason);
3883 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
3884 reply.readException();
3885 data.recycle();
3886 reply.recycle();
3887 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003888
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07003889 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003890 throws RemoteException {
3891 Parcel data = Parcel.obtain();
3892 Parcel reply = Parcel.obtain();
3893 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07003894 data.writeIntArray(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003895 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
3896 reply.readException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07003897 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003898 data.recycle();
3899 reply.recycle();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07003900 return res;
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003901 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07003902
3903 public void killApplicationProcess(String processName, int uid) throws RemoteException {
3904 Parcel data = Parcel.obtain();
3905 Parcel reply = Parcel.obtain();
3906 data.writeInterfaceToken(IActivityManager.descriptor);
3907 data.writeString(processName);
3908 data.writeInt(uid);
3909 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
3910 reply.readException();
3911 data.recycle();
3912 reply.recycle();
3913 }
3914
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07003915 public void overridePendingTransition(IBinder token, String packageName,
3916 int enterAnim, int exitAnim) throws RemoteException {
3917 Parcel data = Parcel.obtain();
3918 Parcel reply = Parcel.obtain();
3919 data.writeInterfaceToken(IActivityManager.descriptor);
3920 data.writeStrongBinder(token);
3921 data.writeString(packageName);
3922 data.writeInt(enterAnim);
3923 data.writeInt(exitAnim);
3924 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
3925 reply.readException();
3926 data.recycle();
3927 reply.recycle();
3928 }
3929
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08003930 public boolean isUserAMonkey() throws RemoteException {
3931 Parcel data = Parcel.obtain();
3932 Parcel reply = Parcel.obtain();
3933 data.writeInterfaceToken(IActivityManager.descriptor);
3934 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
3935 reply.readException();
3936 boolean res = reply.readInt() != 0;
3937 data.recycle();
3938 reply.recycle();
3939 return res;
3940 }
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07003941
3942 public void setUserIsMonkey(boolean monkey) throws RemoteException {
3943 Parcel data = Parcel.obtain();
3944 Parcel reply = Parcel.obtain();
3945 data.writeInterfaceToken(IActivityManager.descriptor);
3946 data.writeInt(monkey ? 1 : 0);
3947 mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0);
3948 reply.readException();
3949 data.recycle();
3950 reply.recycle();
3951 }
3952
Dianne Hackborn860755f2010-06-03 18:47:52 -07003953 public void finishHeavyWeightApp() throws RemoteException {
3954 Parcel data = Parcel.obtain();
3955 Parcel reply = Parcel.obtain();
3956 data.writeInterfaceToken(IActivityManager.descriptor);
3957 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
3958 reply.readException();
3959 data.recycle();
3960 reply.recycle();
3961 }
Craig Mautner4addfc52013-06-25 08:05:45 -07003962
Craig Mautnerbc57cd12013-08-19 15:47:42 -07003963 public boolean convertFromTranslucent(IBinder token)
Craig Mautner4addfc52013-06-25 08:05:45 -07003964 throws RemoteException {
3965 Parcel data = Parcel.obtain();
3966 Parcel reply = Parcel.obtain();
3967 data.writeInterfaceToken(IActivityManager.descriptor);
3968 data.writeStrongBinder(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07003969 mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0);
3970 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07003971 boolean res = reply.readInt() != 0;
Craig Mautner5eda9b32013-07-02 11:58:16 -07003972 data.recycle();
3973 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07003974 return res;
Craig Mautner5eda9b32013-07-02 11:58:16 -07003975 }
3976
Craig Mautnerbc57cd12013-08-19 15:47:42 -07003977 public boolean convertToTranslucent(IBinder token)
Craig Mautner5eda9b32013-07-02 11:58:16 -07003978 throws RemoteException {
3979 Parcel data = Parcel.obtain();
3980 Parcel reply = Parcel.obtain();
3981 data.writeInterfaceToken(IActivityManager.descriptor);
3982 data.writeStrongBinder(token);
3983 mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07003984 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07003985 boolean res = reply.readInt() != 0;
Craig Mautner4addfc52013-06-25 08:05:45 -07003986 data.recycle();
3987 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07003988 return res;
Craig Mautner4addfc52013-06-25 08:05:45 -07003989 }
3990
Daniel Sandler69a48172010-06-23 16:29:36 -04003991 public void setImmersive(IBinder token, boolean immersive)
3992 throws RemoteException {
3993 Parcel data = Parcel.obtain();
3994 Parcel reply = Parcel.obtain();
3995 data.writeInterfaceToken(IActivityManager.descriptor);
3996 data.writeStrongBinder(token);
3997 data.writeInt(immersive ? 1 : 0);
3998 mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
3999 reply.readException();
4000 data.recycle();
4001 reply.recycle();
4002 }
4003
4004 public boolean isImmersive(IBinder token)
4005 throws RemoteException {
4006 Parcel data = Parcel.obtain();
4007 Parcel reply = Parcel.obtain();
4008 data.writeInterfaceToken(IActivityManager.descriptor);
4009 data.writeStrongBinder(token);
4010 mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004011 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004012 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004013 data.recycle();
4014 reply.recycle();
4015 return res;
4016 }
4017
4018 public boolean isTopActivityImmersive()
4019 throws RemoteException {
4020 Parcel data = Parcel.obtain();
4021 Parcel reply = Parcel.obtain();
4022 data.writeInterfaceToken(IActivityManager.descriptor);
4023 mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004024 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004025 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004026 data.recycle();
4027 reply.recycle();
4028 return res;
4029 }
4030
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004031 public void crashApplication(int uid, int initialPid, String packageName,
4032 String message) throws RemoteException {
4033 Parcel data = Parcel.obtain();
4034 Parcel reply = Parcel.obtain();
4035 data.writeInterfaceToken(IActivityManager.descriptor);
4036 data.writeInt(uid);
4037 data.writeInt(initialPid);
4038 data.writeString(packageName);
4039 data.writeString(message);
4040 mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0);
4041 reply.readException();
4042 data.recycle();
4043 reply.recycle();
4044 }
Andy McFadden824c5102010-07-09 16:26:57 -07004045
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004046 public String getProviderMimeType(Uri uri, int userId) throws RemoteException {
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004047 Parcel data = Parcel.obtain();
4048 Parcel reply = Parcel.obtain();
4049 data.writeInterfaceToken(IActivityManager.descriptor);
4050 uri.writeToParcel(data, 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004051 data.writeInt(userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004052 mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0);
4053 reply.readException();
4054 String res = reply.readString();
4055 data.recycle();
4056 reply.recycle();
4057 return res;
4058 }
4059
Dianne Hackborn7e269642010-08-25 19:50:20 -07004060 public IBinder newUriPermissionOwner(String name)
4061 throws RemoteException {
4062 Parcel data = Parcel.obtain();
4063 Parcel reply = Parcel.obtain();
4064 data.writeInterfaceToken(IActivityManager.descriptor);
4065 data.writeString(name);
4066 mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
4067 reply.readException();
4068 IBinder res = reply.readStrongBinder();
4069 data.recycle();
4070 reply.recycle();
4071 return res;
4072 }
4073
4074 public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
4075 Uri uri, int mode) throws RemoteException {
4076 Parcel data = Parcel.obtain();
4077 Parcel reply = Parcel.obtain();
4078 data.writeInterfaceToken(IActivityManager.descriptor);
4079 data.writeStrongBinder(owner);
4080 data.writeInt(fromUid);
4081 data.writeString(targetPkg);
4082 uri.writeToParcel(data, 0);
4083 data.writeInt(mode);
4084 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4085 reply.readException();
4086 data.recycle();
4087 reply.recycle();
4088 }
4089
4090 public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
4091 int mode) throws RemoteException {
4092 Parcel data = Parcel.obtain();
4093 Parcel reply = Parcel.obtain();
4094 data.writeInterfaceToken(IActivityManager.descriptor);
4095 data.writeStrongBinder(owner);
4096 if (uri != null) {
4097 data.writeInt(1);
4098 uri.writeToParcel(data, 0);
4099 } else {
4100 data.writeInt(0);
4101 }
4102 data.writeInt(mode);
4103 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4104 reply.readException();
4105 data.recycle();
4106 reply.recycle();
4107 }
Dianne Hackbornc8f84972010-08-25 23:14:44 -07004108
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004109 public int checkGrantUriPermission(int callingUid, String targetPkg,
4110 Uri uri, int modeFlags) throws RemoteException {
4111 Parcel data = Parcel.obtain();
4112 Parcel reply = Parcel.obtain();
4113 data.writeInterfaceToken(IActivityManager.descriptor);
4114 data.writeInt(callingUid);
4115 data.writeString(targetPkg);
4116 uri.writeToParcel(data, 0);
4117 data.writeInt(modeFlags);
4118 mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4119 reply.readException();
4120 int res = reply.readInt();
4121 data.recycle();
4122 reply.recycle();
4123 return res;
4124 }
4125
Dianne Hackborn1676c852012-09-10 14:52:30 -07004126 public boolean dumpHeap(String process, int userId, boolean managed,
Andy McFadden824c5102010-07-09 16:26:57 -07004127 String path, ParcelFileDescriptor fd) throws RemoteException {
4128 Parcel data = Parcel.obtain();
4129 Parcel reply = Parcel.obtain();
4130 data.writeInterfaceToken(IActivityManager.descriptor);
4131 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004132 data.writeInt(userId);
Andy McFadden824c5102010-07-09 16:26:57 -07004133 data.writeInt(managed ? 1 : 0);
4134 data.writeString(path);
4135 if (fd != null) {
4136 data.writeInt(1);
4137 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
4138 } else {
4139 data.writeInt(0);
4140 }
4141 mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
4142 reply.readException();
4143 boolean res = reply.readInt() != 0;
4144 reply.recycle();
4145 data.recycle();
4146 return res;
4147 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004148
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004149 public int startActivities(IApplicationThread caller, String callingPackage,
Dianne Hackborna4972e92012-03-14 10:38:05 -07004150 Intent[] intents, String[] resolvedTypes, IBinder resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004151 Bundle options, int userId) throws RemoteException {
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004152 Parcel data = Parcel.obtain();
4153 Parcel reply = Parcel.obtain();
4154 data.writeInterfaceToken(IActivityManager.descriptor);
4155 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004156 data.writeString(callingPackage);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004157 data.writeTypedArray(intents, 0);
4158 data.writeStringArray(resolvedTypes);
4159 data.writeStrongBinder(resultTo);
Dianne Hackborna4972e92012-03-14 10:38:05 -07004160 if (options != null) {
4161 data.writeInt(1);
4162 options.writeToParcel(data, 0);
4163 } else {
4164 data.writeInt(0);
4165 }
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004166 data.writeInt(userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004167 mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0);
4168 reply.readException();
4169 int result = reply.readInt();
4170 reply.recycle();
4171 data.recycle();
4172 return result;
4173 }
4174
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004175 public int getFrontActivityScreenCompatMode() throws RemoteException {
4176 Parcel data = Parcel.obtain();
4177 Parcel reply = Parcel.obtain();
4178 data.writeInterfaceToken(IActivityManager.descriptor);
4179 mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4180 reply.readException();
4181 int mode = reply.readInt();
4182 reply.recycle();
4183 data.recycle();
4184 return mode;
4185 }
4186
4187 public void setFrontActivityScreenCompatMode(int mode) throws RemoteException {
4188 Parcel data = Parcel.obtain();
4189 Parcel reply = Parcel.obtain();
4190 data.writeInterfaceToken(IActivityManager.descriptor);
4191 data.writeInt(mode);
4192 mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4193 reply.readException();
4194 reply.recycle();
4195 data.recycle();
4196 }
4197
4198 public int getPackageScreenCompatMode(String packageName) throws RemoteException {
4199 Parcel data = Parcel.obtain();
4200 Parcel reply = Parcel.obtain();
4201 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004202 data.writeString(packageName);
4203 mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004204 reply.readException();
4205 int mode = reply.readInt();
4206 reply.recycle();
4207 data.recycle();
4208 return mode;
4209 }
4210
4211 public void setPackageScreenCompatMode(String packageName, int mode)
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004212 throws RemoteException {
4213 Parcel data = Parcel.obtain();
4214 Parcel reply = Parcel.obtain();
4215 data.writeInterfaceToken(IActivityManager.descriptor);
4216 data.writeString(packageName);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004217 data.writeInt(mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004218 mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4219 reply.readException();
4220 reply.recycle();
4221 data.recycle();
4222 }
4223
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004224 public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
4225 Parcel data = Parcel.obtain();
4226 Parcel reply = Parcel.obtain();
4227 data.writeInterfaceToken(IActivityManager.descriptor);
4228 data.writeString(packageName);
4229 mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4230 reply.readException();
4231 boolean ask = reply.readInt() != 0;
4232 reply.recycle();
4233 data.recycle();
4234 return ask;
4235 }
4236
4237 public void setPackageAskScreenCompat(String packageName, boolean ask)
4238 throws RemoteException {
4239 Parcel data = Parcel.obtain();
4240 Parcel reply = Parcel.obtain();
4241 data.writeInterfaceToken(IActivityManager.descriptor);
4242 data.writeString(packageName);
4243 data.writeInt(ask ? 1 : 0);
4244 mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4245 reply.readException();
4246 reply.recycle();
4247 data.recycle();
4248 }
4249
Amith Yamasani4b2e9342011-03-31 12:38:53 -07004250 public boolean switchUser(int userid) throws RemoteException {
4251 Parcel data = Parcel.obtain();
4252 Parcel reply = Parcel.obtain();
4253 data.writeInterfaceToken(IActivityManager.descriptor);
4254 data.writeInt(userid);
4255 mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0);
4256 reply.readException();
4257 boolean result = reply.readInt() != 0;
4258 reply.recycle();
4259 data.recycle();
4260 return result;
4261 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07004262
Dianne Hackborn80a4af22012-08-27 19:18:31 -07004263 public int stopUser(int userid, IStopUserCallback callback) throws RemoteException {
4264 Parcel data = Parcel.obtain();
4265 Parcel reply = Parcel.obtain();
4266 data.writeInterfaceToken(IActivityManager.descriptor);
4267 data.writeInt(userid);
4268 data.writeStrongInterface(callback);
4269 mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0);
4270 reply.readException();
4271 int result = reply.readInt();
4272 reply.recycle();
4273 data.recycle();
4274 return result;
4275 }
4276
Amith Yamasani52f1d752012-03-28 18:19:29 -07004277 public UserInfo getCurrentUser() throws RemoteException {
4278 Parcel data = Parcel.obtain();
4279 Parcel reply = Parcel.obtain();
4280 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn80a4af22012-08-27 19:18:31 -07004281 mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0);
Amith Yamasani52f1d752012-03-28 18:19:29 -07004282 reply.readException();
4283 UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply);
4284 reply.recycle();
4285 data.recycle();
4286 return userInfo;
4287 }
4288
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07004289 public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException {
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004290 Parcel data = Parcel.obtain();
4291 Parcel reply = Parcel.obtain();
4292 data.writeInterfaceToken(IActivityManager.descriptor);
4293 data.writeInt(userid);
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07004294 data.writeInt(orStopping ? 1 : 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004295 mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0);
4296 reply.readException();
4297 boolean result = reply.readInt() != 0;
4298 reply.recycle();
4299 data.recycle();
4300 return result;
4301 }
4302
Dianne Hackbornc72fc672012-09-20 13:12:03 -07004303 public int[] getRunningUserIds() throws RemoteException {
4304 Parcel data = Parcel.obtain();
4305 Parcel reply = Parcel.obtain();
4306 data.writeInterfaceToken(IActivityManager.descriptor);
4307 mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0);
4308 reply.readException();
4309 int[] result = reply.createIntArray();
4310 reply.recycle();
4311 data.recycle();
4312 return result;
4313 }
4314
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07004315 public boolean removeSubTask(int taskId, int subTaskIndex) throws RemoteException {
4316 Parcel data = Parcel.obtain();
4317 Parcel reply = Parcel.obtain();
4318 data.writeInterfaceToken(IActivityManager.descriptor);
4319 data.writeInt(taskId);
4320 data.writeInt(subTaskIndex);
4321 mRemote.transact(REMOVE_SUB_TASK_TRANSACTION, data, reply, 0);
4322 reply.readException();
4323 boolean result = reply.readInt() != 0;
4324 reply.recycle();
4325 data.recycle();
4326 return result;
4327 }
4328
4329 public boolean removeTask(int taskId, int flags) throws RemoteException {
4330 Parcel data = Parcel.obtain();
4331 Parcel reply = Parcel.obtain();
4332 data.writeInterfaceToken(IActivityManager.descriptor);
4333 data.writeInt(taskId);
4334 data.writeInt(flags);
4335 mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
4336 reply.readException();
4337 boolean result = reply.readInt() != 0;
4338 reply.recycle();
4339 data.recycle();
4340 return result;
4341 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07004342
Jeff Sharkeya4620792011-05-20 15:29:23 -07004343 public void registerProcessObserver(IProcessObserver observer) throws RemoteException {
4344 Parcel data = Parcel.obtain();
4345 Parcel reply = Parcel.obtain();
4346 data.writeInterfaceToken(IActivityManager.descriptor);
4347 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
4348 mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
4349 reply.readException();
4350 data.recycle();
4351 reply.recycle();
4352 }
4353
4354 public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException {
4355 Parcel data = Parcel.obtain();
4356 Parcel reply = Parcel.obtain();
4357 data.writeInterfaceToken(IActivityManager.descriptor);
4358 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
4359 mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
4360 reply.readException();
4361 data.recycle();
4362 reply.recycle();
4363 }
4364
Dianne Hackborn6c418d52011-06-29 14:05:33 -07004365 public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException {
4366 Parcel data = Parcel.obtain();
4367 Parcel reply = Parcel.obtain();
4368 data.writeInterfaceToken(IActivityManager.descriptor);
4369 data.writeStrongBinder(sender.asBinder());
4370 mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0);
4371 reply.readException();
4372 boolean res = reply.readInt() != 0;
4373 data.recycle();
4374 reply.recycle();
4375 return res;
4376 }
4377
Dianne Hackborn1927ae82012-06-22 15:21:36 -07004378 public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException {
4379 Parcel data = Parcel.obtain();
4380 Parcel reply = Parcel.obtain();
4381 data.writeInterfaceToken(IActivityManager.descriptor);
4382 data.writeStrongBinder(sender.asBinder());
4383 mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0);
4384 reply.readException();
4385 boolean res = reply.readInt() != 0;
4386 data.recycle();
4387 reply.recycle();
4388 return res;
4389 }
4390
Dianne Hackborn81038902012-11-26 17:04:09 -08004391 public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException {
4392 Parcel data = Parcel.obtain();
4393 Parcel reply = Parcel.obtain();
4394 data.writeInterfaceToken(IActivityManager.descriptor);
4395 data.writeStrongBinder(sender.asBinder());
4396 mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4397 reply.readException();
4398 Intent res = reply.readInt() != 0
4399 ? Intent.CREATOR.createFromParcel(reply) : null;
4400 data.recycle();
4401 reply.recycle();
4402 return res;
4403 }
4404
Dianne Hackborn31ca8542011-07-19 14:58:28 -07004405 public void updatePersistentConfiguration(Configuration values) throws RemoteException
4406 {
4407 Parcel data = Parcel.obtain();
4408 Parcel reply = Parcel.obtain();
4409 data.writeInterfaceToken(IActivityManager.descriptor);
4410 values.writeToParcel(data, 0);
4411 mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0);
4412 reply.readException();
4413 data.recycle();
4414 reply.recycle();
4415 }
4416
Dianne Hackbornb437e092011-08-05 17:50:29 -07004417 public long[] getProcessPss(int[] pids) throws RemoteException {
4418 Parcel data = Parcel.obtain();
4419 Parcel reply = Parcel.obtain();
4420 data.writeInterfaceToken(IActivityManager.descriptor);
4421 data.writeIntArray(pids);
4422 mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0);
4423 reply.readException();
4424 long[] res = reply.createLongArray();
4425 data.recycle();
4426 reply.recycle();
4427 return res;
4428 }
4429
Dianne Hackborn661cd522011-08-22 00:26:20 -07004430 public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
4431 Parcel data = Parcel.obtain();
4432 Parcel reply = Parcel.obtain();
4433 data.writeInterfaceToken(IActivityManager.descriptor);
4434 TextUtils.writeToParcel(msg, data, 0);
4435 data.writeInt(always ? 1 : 0);
4436 mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
4437 reply.readException();
4438 data.recycle();
4439 reply.recycle();
4440 }
4441
Dianne Hackborn90c52de2011-09-23 12:57:44 -07004442 public void dismissKeyguardOnNextActivity() throws RemoteException {
4443 Parcel data = Parcel.obtain();
4444 Parcel reply = Parcel.obtain();
4445 data.writeInterfaceToken(IActivityManager.descriptor);
4446 mRemote.transact(DISMISS_KEYGUARD_ON_NEXT_ACTIVITY_TRANSACTION, data, reply, 0);
4447 reply.readException();
4448 data.recycle();
4449 reply.recycle();
4450 }
4451
Adam Powelldd8fab22012-03-22 17:47:27 -07004452 public boolean targetTaskAffinityMatchesActivity(IBinder token, String destAffinity)
4453 throws RemoteException {
4454 Parcel data = Parcel.obtain();
4455 Parcel reply = Parcel.obtain();
4456 data.writeInterfaceToken(IActivityManager.descriptor);
4457 data.writeStrongBinder(token);
4458 data.writeString(destAffinity);
4459 mRemote.transact(TARGET_TASK_AFFINITY_MATCHES_ACTIVITY_TRANSACTION, data, reply, 0);
4460 reply.readException();
4461 boolean result = reply.readInt() != 0;
4462 data.recycle();
4463 reply.recycle();
4464 return result;
4465 }
4466
4467 public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData)
4468 throws RemoteException {
4469 Parcel data = Parcel.obtain();
4470 Parcel reply = Parcel.obtain();
4471 data.writeInterfaceToken(IActivityManager.descriptor);
4472 data.writeStrongBinder(token);
4473 target.writeToParcel(data, 0);
4474 data.writeInt(resultCode);
4475 if (resultData != null) {
4476 data.writeInt(1);
4477 resultData.writeToParcel(data, 0);
4478 } else {
4479 data.writeInt(0);
4480 }
4481 mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0);
4482 reply.readException();
4483 boolean result = reply.readInt() != 0;
4484 data.recycle();
4485 reply.recycle();
4486 return result;
4487 }
4488
Dianne Hackborn5320eb82012-05-18 12:05:04 -07004489 public int getLaunchedFromUid(IBinder activityToken) throws RemoteException {
4490 Parcel data = Parcel.obtain();
4491 Parcel reply = Parcel.obtain();
4492 data.writeInterfaceToken(IActivityManager.descriptor);
4493 data.writeStrongBinder(activityToken);
4494 mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0);
4495 reply.readException();
4496 int result = reply.readInt();
4497 data.recycle();
4498 reply.recycle();
4499 return result;
4500 }
4501
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004502 public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException {
4503 Parcel data = Parcel.obtain();
4504 Parcel reply = Parcel.obtain();
4505 data.writeInterfaceToken(IActivityManager.descriptor);
4506 data.writeStrongBinder(activityToken);
4507 mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0);
4508 reply.readException();
4509 String result = reply.readString();
4510 data.recycle();
4511 reply.recycle();
4512 return result;
4513 }
4514
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07004515 public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
4516 Parcel data = Parcel.obtain();
4517 Parcel reply = Parcel.obtain();
4518 data.writeInterfaceToken(IActivityManager.descriptor);
4519 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
4520 mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
4521 reply.readException();
4522 data.recycle();
4523 reply.recycle();
4524 }
4525
4526 public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
4527 Parcel data = Parcel.obtain();
4528 Parcel reply = Parcel.obtain();
4529 data.writeInterfaceToken(IActivityManager.descriptor);
4530 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
4531 mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
4532 reply.readException();
4533 data.recycle();
4534 reply.recycle();
4535 }
4536
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07004537 public void requestBugReport() throws RemoteException {
4538 Parcel data = Parcel.obtain();
4539 Parcel reply = Parcel.obtain();
4540 data.writeInterfaceToken(IActivityManager.descriptor);
4541 mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0);
4542 reply.readException();
4543 data.recycle();
4544 reply.recycle();
4545 }
4546
Jeff Brownbd181bb2013-09-10 16:44:24 -07004547 public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason)
4548 throws RemoteException {
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07004549 Parcel data = Parcel.obtain();
4550 Parcel reply = Parcel.obtain();
4551 data.writeInterfaceToken(IActivityManager.descriptor);
4552 data.writeInt(pid);
4553 data.writeInt(aboveSystem ? 1 : 0);
Jeff Brownbd181bb2013-09-10 16:44:24 -07004554 data.writeString(reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07004555 mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0);
4556 reply.readException();
4557 long res = reply.readInt();
4558 data.recycle();
4559 reply.recycle();
4560 return res;
4561 }
4562
Adam Skorydfc7fd72013-08-05 19:23:41 -07004563 public Bundle getAssistContextExtras(int requestType) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08004564 Parcel data = Parcel.obtain();
4565 Parcel reply = Parcel.obtain();
4566 data.writeInterfaceToken(IActivityManager.descriptor);
4567 data.writeInt(requestType);
Adam Skorydfc7fd72013-08-05 19:23:41 -07004568 mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08004569 reply.readException();
4570 Bundle res = reply.readBundle();
4571 data.recycle();
4572 reply.recycle();
4573 return res;
4574 }
4575
Adam Skory7140a252013-09-11 12:04:58 +01004576 public void reportAssistContextExtras(IBinder token, Bundle extras)
Adam Skorydfc7fd72013-08-05 19:23:41 -07004577 throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08004578 Parcel data = Parcel.obtain();
4579 Parcel reply = Parcel.obtain();
4580 data.writeInterfaceToken(IActivityManager.descriptor);
4581 data.writeStrongBinder(token);
4582 data.writeBundle(extras);
Adam Skorydfc7fd72013-08-05 19:23:41 -07004583 mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08004584 reply.readException();
4585 data.recycle();
4586 reply.recycle();
4587 }
4588
Dianne Hackbornf1b78242013-04-08 22:28:59 -07004589 public void killUid(int uid, String reason) throws RemoteException {
4590 Parcel data = Parcel.obtain();
4591 Parcel reply = Parcel.obtain();
4592 data.writeInterfaceToken(IActivityManager.descriptor);
4593 data.writeInt(uid);
4594 data.writeString(reason);
4595 mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0);
4596 reply.readException();
4597 data.recycle();
4598 reply.recycle();
4599 }
4600
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07004601 public void hang(IBinder who, boolean allowRestart) throws RemoteException {
4602 Parcel data = Parcel.obtain();
4603 Parcel reply = Parcel.obtain();
4604 data.writeInterfaceToken(IActivityManager.descriptor);
4605 data.writeStrongBinder(who);
4606 data.writeInt(allowRestart ? 1 : 0);
4607 mRemote.transact(HANG_TRANSACTION, data, reply, 0);
4608 reply.readException();
4609 data.recycle();
4610 reply.recycle();
4611 }
4612
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07004613 public void reportActivityFullyDrawn(IBinder token) throws RemoteException {
4614 Parcel data = Parcel.obtain();
4615 Parcel reply = Parcel.obtain();
4616 data.writeInterfaceToken(IActivityManager.descriptor);
4617 data.writeStrongBinder(token);
4618 mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0);
4619 reply.readException();
4620 data.recycle();
4621 reply.recycle();
4622 }
4623
Craig Mautner5eda9b32013-07-02 11:58:16 -07004624 public void notifyActivityDrawn(IBinder token) throws RemoteException {
4625 Parcel data = Parcel.obtain();
4626 Parcel reply = Parcel.obtain();
4627 data.writeInterfaceToken(IActivityManager.descriptor);
4628 data.writeStrongBinder(token);
4629 mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
4630 reply.readException();
4631 data.recycle();
4632 reply.recycle();
4633 }
4634
Dianne Hackborn57a7f592013-07-22 18:21:32 -07004635 public void restart() throws RemoteException {
4636 Parcel data = Parcel.obtain();
4637 Parcel reply = Parcel.obtain();
4638 data.writeInterfaceToken(IActivityManager.descriptor);
4639 mRemote.transact(RESTART_TRANSACTION, data, reply, 0);
4640 reply.readException();
4641 data.recycle();
4642 reply.recycle();
4643 }
4644
Dianne Hackborn35f72be2013-09-16 10:57:39 -07004645 public void performIdleMaintenance() throws RemoteException {
4646 Parcel data = Parcel.obtain();
4647 Parcel reply = Parcel.obtain();
4648 data.writeInterfaceToken(IActivityManager.descriptor);
4649 mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0);
4650 reply.readException();
4651 data.recycle();
4652 reply.recycle();
4653 }
4654
Craig Mautner4a1cb222013-12-04 16:14:06 -08004655 public IActivityContainer createActivityContainer(IBinder parentActivityToken,
4656 IActivityContainerCallback callback) throws RemoteException {
4657 Parcel data = Parcel.obtain();
4658 Parcel reply = Parcel.obtain();
4659 data.writeInterfaceToken(IActivityManager.descriptor);
4660 data.writeStrongBinder(parentActivityToken);
4661 data.writeStrongBinder((IBinder)callback);
4662 mRemote.transact(CREATE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
4663 reply.readException();
4664 IActivityContainer res =
4665 IActivityContainer.Stub.asInterface(reply.readStrongBinder());
4666 data.recycle();
4667 reply.recycle();
4668 return res;
4669 }
4670
4671 public IBinder getHomeActivityToken() throws RemoteException {
4672 Parcel data = Parcel.obtain();
4673 Parcel reply = Parcel.obtain();
4674 data.writeInterfaceToken(IActivityManager.descriptor);
4675 mRemote.transact(GET_HOME_ACTIVITY_TOKEN_TRANSACTION, data, reply, 0);
4676 reply.readException();
4677 IBinder res = reply.readStrongBinder();
4678 data.recycle();
4679 reply.recycle();
4680 return res;
4681 }
4682
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004683 private IBinder mRemote;
4684}