blob: 05c009fff98929f5add1739b8b5d889b07164194 [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
19import android.content.ComponentName;
Adam Powelldd8fab22012-03-22 17:47:27 -070020import android.content.IIntentReceiver;
21import android.content.IIntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080022import android.content.Intent;
23import android.content.IntentFilter;
Dianne Hackbornfa82f222009-09-17 15:14:12 -070024import android.content.IntentSender;
Christopher Tate181fafa2009-05-14 11:12:14 -070025import android.content.pm.ApplicationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080026import android.content.pm.ConfigurationInfo;
27import android.content.pm.IPackageDataObserver;
Amith Yamasani52f1d752012-03-28 18:19:29 -070028import android.content.pm.UserInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080029import android.content.res.Configuration;
30import android.graphics.Bitmap;
31import android.net.Uri;
32import android.os.Binder;
33import android.os.Bundle;
Dianne Hackborn3025ef32009-08-31 21:31:47 -070034import android.os.Debug;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035import android.os.IBinder;
36import android.os.Parcel;
Adam Powelldd8fab22012-03-22 17:47:27 -070037import android.os.ParcelFileDescriptor;
38import android.os.Parcelable;
39import android.os.RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080040import android.os.ServiceManager;
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -070041import android.os.StrictMode;
Dianne Hackbornf02b60a2012-08-16 10:48:27 -070042import android.os.UserHandle;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080043import android.text.TextUtils;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080044import android.util.Log;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080045import android.util.Singleton;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080046
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080047import java.util.ArrayList;
48import java.util.List;
49
50/** {@hide} */
51public abstract class ActivityManagerNative extends Binder implements IActivityManager
52{
53 /**
54 * Cast a Binder object into an activity manager interface, generating
55 * a proxy if needed.
56 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080057 static public IActivityManager asInterface(IBinder obj) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080058 if (obj == null) {
59 return null;
60 }
61 IActivityManager in =
62 (IActivityManager)obj.queryLocalInterface(descriptor);
63 if (in != null) {
64 return in;
65 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080066
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080067 return new ActivityManagerProxy(obj);
68 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080069
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080070 /**
71 * Retrieve the system's default/global activity manager.
72 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080073 static public IActivityManager getDefault() {
74 return gDefault.get();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080075 }
76
77 /**
78 * Convenience for checking whether the system is ready. For internal use only.
79 */
80 static public boolean isSystemReady() {
81 if (!sSystemReady) {
82 sSystemReady = getDefault().testIsSystemReady();
83 }
84 return sSystemReady;
85 }
86 static boolean sSystemReady = false;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080087
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080088 /**
89 * Convenience for sending a sticky broadcast. For internal use only.
90 * If you don't care about permission, use null.
91 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080092 static public void broadcastStickyIntent(Intent intent, String permission) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080093 try {
94 getDefault().broadcastIntent(
95 null, intent, null, null, Activity.RESULT_OK, null, null,
Amith Yamasani742a6712011-05-04 14:49:28 -070096 null /*permission*/, false, true, Binder.getOrigCallingUser());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080097 } catch (RemoteException ex) {
98 }
99 }
100
101 static public void noteWakeupAlarm(PendingIntent ps) {
102 try {
103 getDefault().noteWakeupAlarm(ps.getTarget());
104 } catch (RemoteException ex) {
105 }
106 }
107
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -0800108 public ActivityManagerNative() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800109 attachInterface(this, descriptor);
110 }
111
112 public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
113 throws RemoteException {
114 switch (code) {
115 case START_ACTIVITY_TRANSACTION:
116 {
117 data.enforceInterface(IActivityManager.descriptor);
118 IBinder b = data.readStrongBinder();
119 IApplicationThread app = ApplicationThreadNative.asInterface(b);
120 Intent intent = Intent.CREATOR.createFromParcel(data);
121 String resolvedType = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800122 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800123 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800124 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700125 int startFlags = data.readInt();
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700126 String profileFile = data.readString();
127 ParcelFileDescriptor profileFd = data.readInt() != 0
128 ? data.readFileDescriptor() : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700129 Bundle options = data.readInt() != 0
130 ? Bundle.CREATOR.createFromParcel(data) : null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800131 int result = startActivity(app, intent, resolvedType,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700132 resultTo, resultWho, requestCode, startFlags,
133 profileFile, profileFd, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800134 reply.writeNoException();
135 reply.writeInt(result);
136 return true;
137 }
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700138
Amith Yamasani82644082012-08-03 13:09:11 -0700139 case START_ACTIVITY_AS_USER_TRANSACTION:
140 {
141 data.enforceInterface(IActivityManager.descriptor);
142 IBinder b = data.readStrongBinder();
143 IApplicationThread app = ApplicationThreadNative.asInterface(b);
144 Intent intent = Intent.CREATOR.createFromParcel(data);
145 String resolvedType = data.readString();
146 IBinder resultTo = data.readStrongBinder();
147 String resultWho = data.readString();
148 int requestCode = data.readInt();
149 int startFlags = data.readInt();
150 String profileFile = data.readString();
151 ParcelFileDescriptor profileFd = data.readInt() != 0
152 ? data.readFileDescriptor() : null;
153 Bundle options = data.readInt() != 0
154 ? Bundle.CREATOR.createFromParcel(data) : null;
155 int userId = data.readInt();
156 int result = startActivityAsUser(app, intent, resolvedType,
157 resultTo, resultWho, requestCode, startFlags,
158 profileFile, profileFd, options, userId);
159 reply.writeNoException();
160 reply.writeInt(result);
161 return true;
162 }
163
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800164 case START_ACTIVITY_AND_WAIT_TRANSACTION:
165 {
166 data.enforceInterface(IActivityManager.descriptor);
167 IBinder b = data.readStrongBinder();
168 IApplicationThread app = ApplicationThreadNative.asInterface(b);
169 Intent intent = Intent.CREATOR.createFromParcel(data);
170 String resolvedType = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800171 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800172 String resultWho = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800173 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700174 int startFlags = data.readInt();
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700175 String profileFile = data.readString();
176 ParcelFileDescriptor profileFd = data.readInt() != 0
177 ? data.readFileDescriptor() : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700178 Bundle options = data.readInt() != 0
179 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800180 WaitResult result = startActivityAndWait(app, intent, resolvedType,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700181 resultTo, resultWho, requestCode, startFlags,
182 profileFile, profileFd, options);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800183 reply.writeNoException();
184 result.writeToParcel(reply, 0);
185 return true;
186 }
187
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700188 case START_ACTIVITY_WITH_CONFIG_TRANSACTION:
189 {
190 data.enforceInterface(IActivityManager.descriptor);
191 IBinder b = data.readStrongBinder();
192 IApplicationThread app = ApplicationThreadNative.asInterface(b);
193 Intent intent = Intent.CREATOR.createFromParcel(data);
194 String resolvedType = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700195 IBinder resultTo = data.readStrongBinder();
196 String resultWho = data.readString();
197 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700198 int startFlags = data.readInt();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700199 Configuration config = Configuration.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700200 Bundle options = data.readInt() != 0
201 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700202 int result = startActivityWithConfig(app, intent, resolvedType,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700203 resultTo, resultWho, requestCode, startFlags, config, options);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700204 reply.writeNoException();
205 reply.writeInt(result);
206 return true;
207 }
208
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700209 case START_ACTIVITY_INTENT_SENDER_TRANSACTION:
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700210 {
211 data.enforceInterface(IActivityManager.descriptor);
212 IBinder b = data.readStrongBinder();
213 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700214 IntentSender intent = IntentSender.CREATOR.createFromParcel(data);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700215 Intent fillInIntent = null;
216 if (data.readInt() != 0) {
217 fillInIntent = Intent.CREATOR.createFromParcel(data);
218 }
219 String resolvedType = data.readString();
220 IBinder resultTo = data.readStrongBinder();
221 String resultWho = data.readString();
222 int requestCode = data.readInt();
223 int flagsMask = data.readInt();
224 int flagsValues = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700225 Bundle options = data.readInt() != 0
226 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700227 int result = startActivityIntentSender(app, intent,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700228 fillInIntent, resolvedType, resultTo, resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700229 requestCode, flagsMask, flagsValues, options);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700230 reply.writeNoException();
231 reply.writeInt(result);
232 return true;
233 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800234
235 case START_NEXT_MATCHING_ACTIVITY_TRANSACTION:
236 {
237 data.enforceInterface(IActivityManager.descriptor);
238 IBinder callingActivity = data.readStrongBinder();
239 Intent intent = Intent.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700240 Bundle options = data.readInt() != 0
241 ? Bundle.CREATOR.createFromParcel(data) : null;
242 boolean result = startNextMatchingActivity(callingActivity, intent, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800243 reply.writeNoException();
244 reply.writeInt(result ? 1 : 0);
245 return true;
246 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700247
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800248 case FINISH_ACTIVITY_TRANSACTION: {
249 data.enforceInterface(IActivityManager.descriptor);
250 IBinder token = data.readStrongBinder();
251 Intent resultData = null;
252 int resultCode = data.readInt();
253 if (data.readInt() != 0) {
254 resultData = Intent.CREATOR.createFromParcel(data);
255 }
256 boolean res = finishActivity(token, resultCode, resultData);
257 reply.writeNoException();
258 reply.writeInt(res ? 1 : 0);
259 return true;
260 }
261
262 case FINISH_SUB_ACTIVITY_TRANSACTION: {
263 data.enforceInterface(IActivityManager.descriptor);
264 IBinder token = data.readStrongBinder();
265 String resultWho = data.readString();
266 int requestCode = data.readInt();
267 finishSubActivity(token, resultWho, requestCode);
268 reply.writeNoException();
269 return true;
270 }
271
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700272 case FINISH_ACTIVITY_AFFINITY_TRANSACTION: {
273 data.enforceInterface(IActivityManager.descriptor);
274 IBinder token = data.readStrongBinder();
275 boolean res = finishActivityAffinity(token);
276 reply.writeNoException();
277 reply.writeInt(res ? 1 : 0);
278 return true;
279 }
280
Dianne Hackborn061d58a2010-03-12 15:07:06 -0800281 case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: {
282 data.enforceInterface(IActivityManager.descriptor);
283 IBinder token = data.readStrongBinder();
284 boolean res = willActivityBeVisible(token);
285 reply.writeNoException();
286 reply.writeInt(res ? 1 : 0);
287 return true;
288 }
289
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800290 case REGISTER_RECEIVER_TRANSACTION:
291 {
292 data.enforceInterface(IActivityManager.descriptor);
293 IBinder b = data.readStrongBinder();
294 IApplicationThread app =
295 b != null ? ApplicationThreadNative.asInterface(b) : null;
Dianne Hackborn6c418d52011-06-29 14:05:33 -0700296 String packageName = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800297 b = data.readStrongBinder();
298 IIntentReceiver rec
299 = b != null ? IIntentReceiver.Stub.asInterface(b) : null;
300 IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data);
301 String perm = data.readString();
Dianne Hackborn6c418d52011-06-29 14:05:33 -0700302 Intent intent = registerReceiver(app, packageName, rec, filter, perm);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800303 reply.writeNoException();
304 if (intent != null) {
305 reply.writeInt(1);
306 intent.writeToParcel(reply, 0);
307 } else {
308 reply.writeInt(0);
309 }
310 return true;
311 }
312
313 case UNREGISTER_RECEIVER_TRANSACTION:
314 {
315 data.enforceInterface(IActivityManager.descriptor);
316 IBinder b = data.readStrongBinder();
317 if (b == null) {
318 return true;
319 }
320 IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b);
321 unregisterReceiver(rec);
322 reply.writeNoException();
323 return true;
324 }
325
326 case BROADCAST_INTENT_TRANSACTION:
327 {
328 data.enforceInterface(IActivityManager.descriptor);
329 IBinder b = data.readStrongBinder();
330 IApplicationThread app =
331 b != null ? ApplicationThreadNative.asInterface(b) : null;
332 Intent intent = Intent.CREATOR.createFromParcel(data);
333 String resolvedType = data.readString();
334 b = data.readStrongBinder();
335 IIntentReceiver resultTo =
336 b != null ? IIntentReceiver.Stub.asInterface(b) : null;
337 int resultCode = data.readInt();
338 String resultData = data.readString();
339 Bundle resultExtras = data.readBundle();
340 String perm = data.readString();
341 boolean serialized = data.readInt() != 0;
342 boolean sticky = data.readInt() != 0;
Amith Yamasani742a6712011-05-04 14:49:28 -0700343 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800344 int res = broadcastIntent(app, intent, resolvedType, resultTo,
345 resultCode, resultData, resultExtras, perm,
Amith Yamasani742a6712011-05-04 14:49:28 -0700346 serialized, sticky, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800347 reply.writeNoException();
348 reply.writeInt(res);
349 return true;
350 }
351
352 case UNBROADCAST_INTENT_TRANSACTION:
353 {
354 data.enforceInterface(IActivityManager.descriptor);
355 IBinder b = data.readStrongBinder();
356 IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null;
357 Intent intent = Intent.CREATOR.createFromParcel(data);
Amith Yamasani742a6712011-05-04 14:49:28 -0700358 int userId = data.readInt();
359 unbroadcastIntent(app, intent, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800360 reply.writeNoException();
361 return true;
362 }
363
364 case FINISH_RECEIVER_TRANSACTION: {
365 data.enforceInterface(IActivityManager.descriptor);
366 IBinder who = data.readStrongBinder();
367 int resultCode = data.readInt();
368 String resultData = data.readString();
369 Bundle resultExtras = data.readBundle();
370 boolean resultAbort = data.readInt() != 0;
371 if (who != null) {
372 finishReceiver(who, resultCode, resultData, resultExtras, resultAbort);
373 }
374 reply.writeNoException();
375 return true;
376 }
377
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800378 case ATTACH_APPLICATION_TRANSACTION: {
379 data.enforceInterface(IActivityManager.descriptor);
380 IApplicationThread app = ApplicationThreadNative.asInterface(
381 data.readStrongBinder());
382 if (app != null) {
383 attachApplication(app);
384 }
385 reply.writeNoException();
386 return true;
387 }
388
389 case ACTIVITY_IDLE_TRANSACTION: {
390 data.enforceInterface(IActivityManager.descriptor);
391 IBinder token = data.readStrongBinder();
Dianne Hackborne88846e2009-09-30 21:34:25 -0700392 Configuration config = null;
393 if (data.readInt() != 0) {
394 config = Configuration.CREATOR.createFromParcel(data);
395 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700396 boolean stopProfiling = data.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800397 if (token != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700398 activityIdle(token, config, stopProfiling);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800399 }
400 reply.writeNoException();
401 return true;
402 }
403
404 case ACTIVITY_PAUSED_TRANSACTION: {
405 data.enforceInterface(IActivityManager.descriptor);
406 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800407 activityPaused(token);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800408 reply.writeNoException();
409 return true;
410 }
411
412 case ACTIVITY_STOPPED_TRANSACTION: {
413 data.enforceInterface(IActivityManager.descriptor);
414 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800415 Bundle map = data.readBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800416 Bitmap thumbnail = data.readInt() != 0
417 ? Bitmap.CREATOR.createFromParcel(data) : null;
418 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800419 activityStopped(token, map, thumbnail, description);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800420 reply.writeNoException();
421 return true;
422 }
423
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800424 case ACTIVITY_SLEPT_TRANSACTION: {
425 data.enforceInterface(IActivityManager.descriptor);
426 IBinder token = data.readStrongBinder();
427 activitySlept(token);
428 reply.writeNoException();
429 return true;
430 }
431
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800432 case ACTIVITY_DESTROYED_TRANSACTION: {
433 data.enforceInterface(IActivityManager.descriptor);
434 IBinder token = data.readStrongBinder();
435 activityDestroyed(token);
436 reply.writeNoException();
437 return true;
438 }
439
440 case GET_CALLING_PACKAGE_TRANSACTION: {
441 data.enforceInterface(IActivityManager.descriptor);
442 IBinder token = data.readStrongBinder();
443 String res = token != null ? getCallingPackage(token) : null;
444 reply.writeNoException();
445 reply.writeString(res);
446 return true;
447 }
448
449 case GET_CALLING_ACTIVITY_TRANSACTION: {
450 data.enforceInterface(IActivityManager.descriptor);
451 IBinder token = data.readStrongBinder();
452 ComponentName cn = getCallingActivity(token);
453 reply.writeNoException();
454 ComponentName.writeToParcel(cn, reply);
455 return true;
456 }
457
458 case GET_TASKS_TRANSACTION: {
459 data.enforceInterface(IActivityManager.descriptor);
460 int maxNum = data.readInt();
461 int fl = data.readInt();
462 IBinder receiverBinder = data.readStrongBinder();
463 IThumbnailReceiver receiver = receiverBinder != null
464 ? IThumbnailReceiver.Stub.asInterface(receiverBinder)
465 : null;
466 List list = getTasks(maxNum, fl, receiver);
467 reply.writeNoException();
468 int N = list != null ? list.size() : -1;
469 reply.writeInt(N);
470 int i;
471 for (i=0; i<N; i++) {
472 ActivityManager.RunningTaskInfo info =
473 (ActivityManager.RunningTaskInfo)list.get(i);
474 info.writeToParcel(reply, 0);
475 }
476 return true;
477 }
478
479 case GET_RECENT_TASKS_TRANSACTION: {
480 data.enforceInterface(IActivityManager.descriptor);
481 int maxNum = data.readInt();
482 int fl = data.readInt();
Amith Yamasani82644082012-08-03 13:09:11 -0700483 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800484 List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -0700485 fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800486 reply.writeNoException();
487 reply.writeTypedList(list);
488 return true;
489 }
490
Dianne Hackbornf26fd992011-04-08 18:14:09 -0700491 case GET_TASK_THUMBNAILS_TRANSACTION: {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800492 data.enforceInterface(IActivityManager.descriptor);
493 int id = data.readInt();
Dianne Hackbornf26fd992011-04-08 18:14:09 -0700494 ActivityManager.TaskThumbnails bm = getTaskThumbnails(id);
Dianne Hackbornd94df452011-02-16 18:53:31 -0800495 reply.writeNoException();
496 if (bm != null) {
497 reply.writeInt(1);
498 bm.writeToParcel(reply, 0);
499 } else {
500 reply.writeInt(0);
501 }
502 return true;
503 }
504
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800505 case GET_SERVICES_TRANSACTION: {
506 data.enforceInterface(IActivityManager.descriptor);
507 int maxNum = data.readInt();
508 int fl = data.readInt();
509 List list = getServices(maxNum, fl);
510 reply.writeNoException();
511 int N = list != null ? list.size() : -1;
512 reply.writeInt(N);
513 int i;
514 for (i=0; i<N; i++) {
515 ActivityManager.RunningServiceInfo info =
516 (ActivityManager.RunningServiceInfo)list.get(i);
517 info.writeToParcel(reply, 0);
518 }
519 return true;
520 }
521
522 case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: {
523 data.enforceInterface(IActivityManager.descriptor);
524 List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState();
525 reply.writeNoException();
526 reply.writeTypedList(list);
527 return true;
528 }
529
530 case GET_RUNNING_APP_PROCESSES_TRANSACTION: {
531 data.enforceInterface(IActivityManager.descriptor);
532 List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses();
533 reply.writeNoException();
534 reply.writeTypedList(list);
535 return true;
536 }
537
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -0700538 case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: {
539 data.enforceInterface(IActivityManager.descriptor);
540 List<ApplicationInfo> list = getRunningExternalApplications();
541 reply.writeNoException();
542 reply.writeTypedList(list);
543 return true;
544 }
545
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800546 case MOVE_TASK_TO_FRONT_TRANSACTION: {
547 data.enforceInterface(IActivityManager.descriptor);
548 int task = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800549 int fl = data.readInt();
Dianne Hackborn8078d8c2012-03-20 11:11:26 -0700550 Bundle options = data.readInt() != 0
551 ? Bundle.CREATOR.createFromParcel(data) : null;
552 moveTaskToFront(task, fl, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800553 reply.writeNoException();
554 return true;
555 }
556
557 case MOVE_TASK_TO_BACK_TRANSACTION: {
558 data.enforceInterface(IActivityManager.descriptor);
559 int task = data.readInt();
560 moveTaskToBack(task);
561 reply.writeNoException();
562 return true;
563 }
564
565 case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: {
566 data.enforceInterface(IActivityManager.descriptor);
567 IBinder token = data.readStrongBinder();
568 boolean nonRoot = data.readInt() != 0;
569 boolean res = moveActivityTaskToBack(token, nonRoot);
570 reply.writeNoException();
571 reply.writeInt(res ? 1 : 0);
572 return true;
573 }
574
575 case MOVE_TASK_BACKWARDS_TRANSACTION: {
576 data.enforceInterface(IActivityManager.descriptor);
577 int task = data.readInt();
578 moveTaskBackwards(task);
579 reply.writeNoException();
580 return true;
581 }
582
583 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
584 data.enforceInterface(IActivityManager.descriptor);
585 IBinder token = data.readStrongBinder();
586 boolean onlyRoot = data.readInt() != 0;
587 int res = token != null
588 ? getTaskForActivity(token, onlyRoot) : -1;
589 reply.writeNoException();
590 reply.writeInt(res);
591 return true;
592 }
593
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800594 case REPORT_THUMBNAIL_TRANSACTION: {
595 data.enforceInterface(IActivityManager.descriptor);
596 IBinder token = data.readStrongBinder();
597 Bitmap thumbnail = data.readInt() != 0
598 ? Bitmap.CREATOR.createFromParcel(data) : null;
599 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
600 reportThumbnail(token, thumbnail, description);
601 reply.writeNoException();
602 return true;
603 }
604
605 case GET_CONTENT_PROVIDER_TRANSACTION: {
606 data.enforceInterface(IActivityManager.descriptor);
607 IBinder b = data.readStrongBinder();
608 IApplicationThread app = ApplicationThreadNative.asInterface(b);
609 String name = data.readString();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700610 boolean stable = data.readInt() != 0;
611 ContentProviderHolder cph = getContentProvider(app, name, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800612 reply.writeNoException();
613 if (cph != null) {
614 reply.writeInt(1);
615 cph.writeToParcel(reply, 0);
616 } else {
617 reply.writeInt(0);
618 }
619 return true;
620 }
621
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800622 case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
623 data.enforceInterface(IActivityManager.descriptor);
624 String name = data.readString();
625 IBinder token = data.readStrongBinder();
626 ContentProviderHolder cph = getContentProviderExternal(name, token);
627 reply.writeNoException();
628 if (cph != null) {
629 reply.writeInt(1);
630 cph.writeToParcel(reply, 0);
631 } else {
632 reply.writeInt(0);
633 }
634 return true;
635 }
636
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800637 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
638 data.enforceInterface(IActivityManager.descriptor);
639 IBinder b = data.readStrongBinder();
640 IApplicationThread app = ApplicationThreadNative.asInterface(b);
641 ArrayList<ContentProviderHolder> providers =
642 data.createTypedArrayList(ContentProviderHolder.CREATOR);
643 publishContentProviders(app, providers);
644 reply.writeNoException();
645 return true;
646 }
647
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700648 case REF_CONTENT_PROVIDER_TRANSACTION: {
649 data.enforceInterface(IActivityManager.descriptor);
650 IBinder b = data.readStrongBinder();
651 int stable = data.readInt();
652 int unstable = data.readInt();
653 boolean res = refContentProvider(b, stable, unstable);
654 reply.writeNoException();
655 reply.writeInt(res ? 1 : 0);
656 return true;
657 }
658
659 case UNSTABLE_PROVIDER_DIED_TRANSACTION: {
660 data.enforceInterface(IActivityManager.descriptor);
661 IBinder b = data.readStrongBinder();
662 unstableProviderDied(b);
663 reply.writeNoException();
664 return true;
665 }
666
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800667 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
668 data.enforceInterface(IActivityManager.descriptor);
669 IBinder b = data.readStrongBinder();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700670 boolean stable = data.readInt() != 0;
671 removeContentProvider(b, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800672 reply.writeNoException();
673 return true;
674 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800675
676 case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
677 data.enforceInterface(IActivityManager.descriptor);
678 String name = data.readString();
679 IBinder token = data.readStrongBinder();
680 removeContentProviderExternal(name, token);
681 reply.writeNoException();
682 return true;
683 }
684
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700685 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
686 data.enforceInterface(IActivityManager.descriptor);
687 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
688 PendingIntent pi = getRunningServiceControlPanel(comp);
689 reply.writeNoException();
690 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
691 return true;
692 }
693
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800694 case START_SERVICE_TRANSACTION: {
695 data.enforceInterface(IActivityManager.descriptor);
696 IBinder b = data.readStrongBinder();
697 IApplicationThread app = ApplicationThreadNative.asInterface(b);
698 Intent service = Intent.CREATOR.createFromParcel(data);
699 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700700 int userId = data.readInt();
701 ComponentName cn = startService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800702 reply.writeNoException();
703 ComponentName.writeToParcel(cn, reply);
704 return true;
705 }
706
707 case STOP_SERVICE_TRANSACTION: {
708 data.enforceInterface(IActivityManager.descriptor);
709 IBinder b = data.readStrongBinder();
710 IApplicationThread app = ApplicationThreadNative.asInterface(b);
711 Intent service = Intent.CREATOR.createFromParcel(data);
712 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700713 int userId = data.readInt();
714 int res = stopService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800715 reply.writeNoException();
716 reply.writeInt(res);
717 return true;
718 }
719
720 case STOP_SERVICE_TOKEN_TRANSACTION: {
721 data.enforceInterface(IActivityManager.descriptor);
722 ComponentName className = ComponentName.readFromParcel(data);
723 IBinder token = data.readStrongBinder();
724 int startId = data.readInt();
725 boolean res = stopServiceToken(className, token, startId);
726 reply.writeNoException();
727 reply.writeInt(res ? 1 : 0);
728 return true;
729 }
730
731 case SET_SERVICE_FOREGROUND_TRANSACTION: {
732 data.enforceInterface(IActivityManager.descriptor);
733 ComponentName className = ComponentName.readFromParcel(data);
734 IBinder token = data.readStrongBinder();
Dianne Hackbornd8a43f62009-08-17 23:33:56 -0700735 int id = data.readInt();
736 Notification notification = null;
737 if (data.readInt() != 0) {
738 notification = Notification.CREATOR.createFromParcel(data);
739 }
740 boolean removeNotification = data.readInt() != 0;
741 setServiceForeground(className, token, id, notification, removeNotification);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800742 reply.writeNoException();
743 return true;
744 }
745
746 case BIND_SERVICE_TRANSACTION: {
747 data.enforceInterface(IActivityManager.descriptor);
748 IBinder b = data.readStrongBinder();
749 IApplicationThread app = ApplicationThreadNative.asInterface(b);
750 IBinder token = data.readStrongBinder();
751 Intent service = Intent.CREATOR.createFromParcel(data);
752 String resolvedType = data.readString();
753 b = data.readStrongBinder();
754 int fl = data.readInt();
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800755 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800756 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800757 int res = bindService(app, token, service, resolvedType, conn, fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800758 reply.writeNoException();
759 reply.writeInt(res);
760 return true;
761 }
762
763 case UNBIND_SERVICE_TRANSACTION: {
764 data.enforceInterface(IActivityManager.descriptor);
765 IBinder b = data.readStrongBinder();
766 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
767 boolean res = unbindService(conn);
768 reply.writeNoException();
769 reply.writeInt(res ? 1 : 0);
770 return true;
771 }
772
773 case PUBLISH_SERVICE_TRANSACTION: {
774 data.enforceInterface(IActivityManager.descriptor);
775 IBinder token = data.readStrongBinder();
776 Intent intent = Intent.CREATOR.createFromParcel(data);
777 IBinder service = data.readStrongBinder();
778 publishService(token, intent, service);
779 reply.writeNoException();
780 return true;
781 }
782
783 case UNBIND_FINISHED_TRANSACTION: {
784 data.enforceInterface(IActivityManager.descriptor);
785 IBinder token = data.readStrongBinder();
786 Intent intent = Intent.CREATOR.createFromParcel(data);
787 boolean doRebind = data.readInt() != 0;
788 unbindFinished(token, intent, doRebind);
789 reply.writeNoException();
790 return true;
791 }
792
793 case SERVICE_DONE_EXECUTING_TRANSACTION: {
794 data.enforceInterface(IActivityManager.descriptor);
795 IBinder token = data.readStrongBinder();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -0700796 int type = data.readInt();
797 int startId = data.readInt();
798 int res = data.readInt();
799 serviceDoneExecuting(token, type, startId, res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800800 reply.writeNoException();
801 return true;
802 }
803
804 case START_INSTRUMENTATION_TRANSACTION: {
805 data.enforceInterface(IActivityManager.descriptor);
806 ComponentName className = ComponentName.readFromParcel(data);
807 String profileFile = data.readString();
808 int fl = data.readInt();
809 Bundle arguments = data.readBundle();
810 IBinder b = data.readStrongBinder();
811 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
812 boolean res = startInstrumentation(className, profileFile, fl, arguments, w);
813 reply.writeNoException();
814 reply.writeInt(res ? 1 : 0);
815 return true;
816 }
817
818
819 case FINISH_INSTRUMENTATION_TRANSACTION: {
820 data.enforceInterface(IActivityManager.descriptor);
821 IBinder b = data.readStrongBinder();
822 IApplicationThread app = ApplicationThreadNative.asInterface(b);
823 int resultCode = data.readInt();
824 Bundle results = data.readBundle();
825 finishInstrumentation(app, resultCode, results);
826 reply.writeNoException();
827 return true;
828 }
829
830 case GET_CONFIGURATION_TRANSACTION: {
831 data.enforceInterface(IActivityManager.descriptor);
832 Configuration config = getConfiguration();
833 reply.writeNoException();
834 config.writeToParcel(reply, 0);
835 return true;
836 }
837
838 case UPDATE_CONFIGURATION_TRANSACTION: {
839 data.enforceInterface(IActivityManager.descriptor);
840 Configuration config = Configuration.CREATOR.createFromParcel(data);
841 updateConfiguration(config);
842 reply.writeNoException();
843 return true;
844 }
845
846 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
847 data.enforceInterface(IActivityManager.descriptor);
848 IBinder token = data.readStrongBinder();
849 int requestedOrientation = data.readInt();
850 setRequestedOrientation(token, requestedOrientation);
851 reply.writeNoException();
852 return true;
853 }
854
855 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
856 data.enforceInterface(IActivityManager.descriptor);
857 IBinder token = data.readStrongBinder();
858 int req = getRequestedOrientation(token);
859 reply.writeNoException();
860 reply.writeInt(req);
861 return true;
862 }
863
864 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
865 data.enforceInterface(IActivityManager.descriptor);
866 IBinder token = data.readStrongBinder();
867 ComponentName cn = getActivityClassForToken(token);
868 reply.writeNoException();
869 ComponentName.writeToParcel(cn, reply);
870 return true;
871 }
872
873 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
874 data.enforceInterface(IActivityManager.descriptor);
875 IBinder token = data.readStrongBinder();
876 reply.writeNoException();
877 reply.writeString(getPackageForToken(token));
878 return true;
879 }
880
881 case GET_INTENT_SENDER_TRANSACTION: {
882 data.enforceInterface(IActivityManager.descriptor);
883 int type = data.readInt();
884 String packageName = data.readString();
885 IBinder token = data.readStrongBinder();
886 String resultWho = data.readString();
887 int requestCode = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800888 Intent[] requestIntents;
889 String[] requestResolvedTypes;
890 if (data.readInt() != 0) {
891 requestIntents = data.createTypedArray(Intent.CREATOR);
892 requestResolvedTypes = data.createStringArray();
893 } else {
894 requestIntents = null;
895 requestResolvedTypes = null;
896 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800897 int fl = data.readInt();
Dianne Hackborn7a2195c2012-03-19 17:38:00 -0700898 Bundle options = data.readInt() != 0
899 ? Bundle.CREATOR.createFromParcel(data) : null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800900 IIntentSender res = getIntentSender(type, packageName, token,
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800901 resultWho, requestCode, requestIntents,
Dianne Hackborn7a2195c2012-03-19 17:38:00 -0700902 requestResolvedTypes, fl, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800903 reply.writeNoException();
904 reply.writeStrongBinder(res != null ? res.asBinder() : null);
905 return true;
906 }
907
908 case CANCEL_INTENT_SENDER_TRANSACTION: {
909 data.enforceInterface(IActivityManager.descriptor);
910 IIntentSender r = IIntentSender.Stub.asInterface(
911 data.readStrongBinder());
912 cancelIntentSender(r);
913 reply.writeNoException();
914 return true;
915 }
916
917 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
918 data.enforceInterface(IActivityManager.descriptor);
919 IIntentSender r = IIntentSender.Stub.asInterface(
920 data.readStrongBinder());
921 String res = getPackageForIntentSender(r);
922 reply.writeNoException();
923 reply.writeString(res);
924 return true;
925 }
926
Christopher Tatec4a07d12012-04-06 14:19:13 -0700927 case GET_UID_FOR_INTENT_SENDER_TRANSACTION: {
928 data.enforceInterface(IActivityManager.descriptor);
929 IIntentSender r = IIntentSender.Stub.asInterface(
930 data.readStrongBinder());
931 int res = getUidForIntentSender(r);
932 reply.writeNoException();
933 reply.writeInt(res);
934 return true;
935 }
936
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800937 case SET_PROCESS_LIMIT_TRANSACTION: {
938 data.enforceInterface(IActivityManager.descriptor);
939 int max = data.readInt();
940 setProcessLimit(max);
941 reply.writeNoException();
942 return true;
943 }
944
945 case GET_PROCESS_LIMIT_TRANSACTION: {
946 data.enforceInterface(IActivityManager.descriptor);
947 int limit = getProcessLimit();
948 reply.writeNoException();
949 reply.writeInt(limit);
950 return true;
951 }
952
953 case SET_PROCESS_FOREGROUND_TRANSACTION: {
954 data.enforceInterface(IActivityManager.descriptor);
955 IBinder token = data.readStrongBinder();
956 int pid = data.readInt();
957 boolean isForeground = data.readInt() != 0;
958 setProcessForeground(token, pid, isForeground);
959 reply.writeNoException();
960 return true;
961 }
962
963 case CHECK_PERMISSION_TRANSACTION: {
964 data.enforceInterface(IActivityManager.descriptor);
965 String perm = data.readString();
966 int pid = data.readInt();
967 int uid = data.readInt();
968 int res = checkPermission(perm, pid, uid);
969 reply.writeNoException();
970 reply.writeInt(res);
971 return true;
972 }
973
974 case CHECK_URI_PERMISSION_TRANSACTION: {
975 data.enforceInterface(IActivityManager.descriptor);
976 Uri uri = Uri.CREATOR.createFromParcel(data);
977 int pid = data.readInt();
978 int uid = data.readInt();
979 int mode = data.readInt();
980 int res = checkUriPermission(uri, pid, uid, mode);
981 reply.writeNoException();
982 reply.writeInt(res);
983 return true;
984 }
985
986 case CLEAR_APP_DATA_TRANSACTION: {
987 data.enforceInterface(IActivityManager.descriptor);
988 String packageName = data.readString();
989 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
990 data.readStrongBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -0700991 int userId = data.readInt();
992 boolean res = clearApplicationUserData(packageName, observer, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800993 reply.writeNoException();
994 reply.writeInt(res ? 1 : 0);
995 return true;
996 }
997
998 case GRANT_URI_PERMISSION_TRANSACTION: {
999 data.enforceInterface(IActivityManager.descriptor);
1000 IBinder b = data.readStrongBinder();
1001 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1002 String targetPkg = data.readString();
1003 Uri uri = Uri.CREATOR.createFromParcel(data);
1004 int mode = data.readInt();
1005 grantUriPermission(app, targetPkg, uri, mode);
1006 reply.writeNoException();
1007 return true;
1008 }
1009
1010 case REVOKE_URI_PERMISSION_TRANSACTION: {
1011 data.enforceInterface(IActivityManager.descriptor);
1012 IBinder b = data.readStrongBinder();
1013 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1014 Uri uri = Uri.CREATOR.createFromParcel(data);
1015 int mode = data.readInt();
1016 revokeUriPermission(app, uri, mode);
1017 reply.writeNoException();
1018 return true;
1019 }
1020
1021 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
1022 data.enforceInterface(IActivityManager.descriptor);
1023 IBinder b = data.readStrongBinder();
1024 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1025 boolean waiting = data.readInt() != 0;
1026 showWaitingForDebugger(app, waiting);
1027 reply.writeNoException();
1028 return true;
1029 }
1030
1031 case GET_MEMORY_INFO_TRANSACTION: {
1032 data.enforceInterface(IActivityManager.descriptor);
1033 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
1034 getMemoryInfo(mi);
1035 reply.writeNoException();
1036 mi.writeToParcel(reply, 0);
1037 return true;
1038 }
1039
1040 case UNHANDLED_BACK_TRANSACTION: {
1041 data.enforceInterface(IActivityManager.descriptor);
1042 unhandledBack();
1043 reply.writeNoException();
1044 return true;
1045 }
1046
1047 case OPEN_CONTENT_URI_TRANSACTION: {
1048 data.enforceInterface(IActivityManager.descriptor);
1049 Uri uri = Uri.parse(data.readString());
1050 ParcelFileDescriptor pfd = openContentUri(uri);
1051 reply.writeNoException();
1052 if (pfd != null) {
1053 reply.writeInt(1);
1054 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1055 } else {
1056 reply.writeInt(0);
1057 }
1058 return true;
1059 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001060
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001061 case GOING_TO_SLEEP_TRANSACTION: {
1062 data.enforceInterface(IActivityManager.descriptor);
1063 goingToSleep();
1064 reply.writeNoException();
1065 return true;
1066 }
1067
1068 case WAKING_UP_TRANSACTION: {
1069 data.enforceInterface(IActivityManager.descriptor);
1070 wakingUp();
1071 reply.writeNoException();
1072 return true;
1073 }
1074
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001075 case SET_LOCK_SCREEN_SHOWN_TRANSACTION: {
1076 data.enforceInterface(IActivityManager.descriptor);
1077 setLockScreenShown(data.readInt() != 0);
1078 reply.writeNoException();
1079 return true;
1080 }
1081
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001082 case SET_DEBUG_APP_TRANSACTION: {
1083 data.enforceInterface(IActivityManager.descriptor);
1084 String pn = data.readString();
1085 boolean wfd = data.readInt() != 0;
1086 boolean per = data.readInt() != 0;
1087 setDebugApp(pn, wfd, per);
1088 reply.writeNoException();
1089 return true;
1090 }
1091
1092 case SET_ALWAYS_FINISH_TRANSACTION: {
1093 data.enforceInterface(IActivityManager.descriptor);
1094 boolean enabled = data.readInt() != 0;
1095 setAlwaysFinish(enabled);
1096 reply.writeNoException();
1097 return true;
1098 }
1099
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001100 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001101 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001102 IActivityController watcher = IActivityController.Stub.asInterface(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001103 data.readStrongBinder());
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001104 setActivityController(watcher);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001105 return true;
1106 }
1107
1108 case ENTER_SAFE_MODE_TRANSACTION: {
1109 data.enforceInterface(IActivityManager.descriptor);
1110 enterSafeMode();
1111 reply.writeNoException();
1112 return true;
1113 }
1114
1115 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1116 data.enforceInterface(IActivityManager.descriptor);
1117 IIntentSender is = IIntentSender.Stub.asInterface(
1118 data.readStrongBinder());
1119 noteWakeupAlarm(is);
1120 reply.writeNoException();
1121 return true;
1122 }
1123
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001124 case KILL_PIDS_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001125 data.enforceInterface(IActivityManager.descriptor);
1126 int[] pids = data.createIntArray();
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001127 String reason = data.readString();
Dianne Hackborn64825172011-03-02 21:32:58 -08001128 boolean secure = data.readInt() != 0;
1129 boolean res = killPids(pids, reason, secure);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001130 reply.writeNoException();
1131 reply.writeInt(res ? 1 : 0);
1132 return true;
1133 }
1134
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07001135 case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: {
1136 data.enforceInterface(IActivityManager.descriptor);
1137 String reason = data.readString();
1138 boolean res = killProcessesBelowForeground(reason);
1139 reply.writeNoException();
1140 reply.writeInt(res ? 1 : 0);
1141 return true;
1142 }
1143
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001144 case START_RUNNING_TRANSACTION: {
1145 data.enforceInterface(IActivityManager.descriptor);
1146 String pkg = data.readString();
1147 String cls = data.readString();
1148 String action = data.readString();
1149 String indata = data.readString();
1150 startRunning(pkg, cls, action, indata);
1151 reply.writeNoException();
1152 return true;
1153 }
1154
Dan Egnor60d87622009-12-16 16:32:58 -08001155 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1156 data.enforceInterface(IActivityManager.descriptor);
1157 IBinder app = data.readStrongBinder();
1158 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1159 handleApplicationCrash(app, ci);
1160 reply.writeNoException();
1161 return true;
1162 }
1163
1164 case HANDLE_APPLICATION_WTF_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001165 data.enforceInterface(IActivityManager.descriptor);
1166 IBinder app = data.readStrongBinder();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001167 String tag = data.readString();
Dan Egnorb7f03672009-12-09 16:22:32 -08001168 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
Dan Egnor60d87622009-12-16 16:32:58 -08001169 boolean res = handleApplicationWtf(app, tag, ci);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001170 reply.writeNoException();
Dan Egnor60d87622009-12-16 16:32:58 -08001171 reply.writeInt(res ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001172 return true;
1173 }
Dan Egnorb7f03672009-12-09 16:22:32 -08001174
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001175 case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: {
1176 data.enforceInterface(IActivityManager.descriptor);
1177 IBinder app = data.readStrongBinder();
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07001178 int violationMask = data.readInt();
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07001179 StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data);
1180 handleApplicationStrictModeViolation(app, violationMask, info);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001181 reply.writeNoException();
1182 return true;
1183 }
1184
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001185 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1186 data.enforceInterface(IActivityManager.descriptor);
1187 int sig = data.readInt();
1188 signalPersistentProcesses(sig);
1189 reply.writeNoException();
1190 return true;
1191 }
1192
Dianne Hackborn03abb812010-01-04 18:43:19 -08001193 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1194 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001195 String packageName = data.readString();
Dianne Hackborn03abb812010-01-04 18:43:19 -08001196 killBackgroundProcesses(packageName);
1197 reply.writeNoException();
1198 return true;
1199 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08001200
1201 case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
1202 data.enforceInterface(IActivityManager.descriptor);
1203 killAllBackgroundProcesses();
1204 reply.writeNoException();
1205 return true;
1206 }
Dianne Hackborn03abb812010-01-04 18:43:19 -08001207
1208 case FORCE_STOP_PACKAGE_TRANSACTION: {
1209 data.enforceInterface(IActivityManager.descriptor);
1210 String packageName = data.readString();
1211 forceStopPackage(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001212 reply.writeNoException();
1213 return true;
1214 }
Dianne Hackborn27ff9132012-03-06 14:57:58 -08001215
1216 case GET_MY_MEMORY_STATE_TRANSACTION: {
1217 data.enforceInterface(IActivityManager.descriptor);
1218 ActivityManager.RunningAppProcessInfo info =
1219 new ActivityManager.RunningAppProcessInfo();
1220 getMyMemoryState(info);
1221 reply.writeNoException();
1222 info.writeToParcel(reply, 0);
1223 return true;
1224 }
1225
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001226 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1227 data.enforceInterface(IActivityManager.descriptor);
1228 ConfigurationInfo config = getDeviceConfigurationInfo();
1229 reply.writeNoException();
1230 config.writeToParcel(reply, 0);
1231 return true;
1232 }
1233
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001234 case PROFILE_CONTROL_TRANSACTION: {
1235 data.enforceInterface(IActivityManager.descriptor);
1236 String process = data.readString();
1237 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001238 int profileType = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001239 String path = data.readString();
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07001240 ParcelFileDescriptor fd = data.readInt() != 0
1241 ? data.readFileDescriptor() : null;
Romain Guy7eabe552011-07-21 14:56:34 -07001242 boolean res = profileControl(process, start, path, fd, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001243 reply.writeNoException();
1244 reply.writeInt(res ? 1 : 0);
1245 return true;
1246 }
1247
Dianne Hackborn55280a92009-05-07 15:53:46 -07001248 case SHUTDOWN_TRANSACTION: {
1249 data.enforceInterface(IActivityManager.descriptor);
1250 boolean res = shutdown(data.readInt());
1251 reply.writeNoException();
1252 reply.writeInt(res ? 1 : 0);
1253 return true;
1254 }
1255
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001256 case STOP_APP_SWITCHES_TRANSACTION: {
1257 data.enforceInterface(IActivityManager.descriptor);
1258 stopAppSwitches();
1259 reply.writeNoException();
1260 return true;
1261 }
1262
1263 case RESUME_APP_SWITCHES_TRANSACTION: {
1264 data.enforceInterface(IActivityManager.descriptor);
1265 resumeAppSwitches();
1266 reply.writeNoException();
1267 return true;
1268 }
1269
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001270 case PEEK_SERVICE_TRANSACTION: {
1271 data.enforceInterface(IActivityManager.descriptor);
1272 Intent service = Intent.CREATOR.createFromParcel(data);
1273 String resolvedType = data.readString();
1274 IBinder binder = peekService(service, resolvedType);
1275 reply.writeNoException();
1276 reply.writeStrongBinder(binder);
1277 return true;
1278 }
Christopher Tate181fafa2009-05-14 11:12:14 -07001279
1280 case START_BACKUP_AGENT_TRANSACTION: {
1281 data.enforceInterface(IActivityManager.descriptor);
1282 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1283 int backupRestoreMode = data.readInt();
1284 boolean success = bindBackupAgent(info, backupRestoreMode);
1285 reply.writeNoException();
1286 reply.writeInt(success ? 1 : 0);
1287 return true;
1288 }
1289
1290 case BACKUP_AGENT_CREATED_TRANSACTION: {
1291 data.enforceInterface(IActivityManager.descriptor);
1292 String packageName = data.readString();
1293 IBinder agent = data.readStrongBinder();
1294 backupAgentCreated(packageName, agent);
1295 reply.writeNoException();
1296 return true;
1297 }
1298
1299 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1300 data.enforceInterface(IActivityManager.descriptor);
1301 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1302 unbindBackupAgent(info);
1303 reply.writeNoException();
1304 return true;
1305 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001306
Dianne Hackborn2d91af02009-07-16 13:34:33 -07001307 case START_ACTIVITY_IN_PACKAGE_TRANSACTION:
1308 {
1309 data.enforceInterface(IActivityManager.descriptor);
1310 int uid = data.readInt();
1311 Intent intent = Intent.CREATOR.createFromParcel(data);
1312 String resolvedType = data.readString();
1313 IBinder resultTo = data.readStrongBinder();
1314 String resultWho = data.readString();
1315 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -07001316 int startFlags = data.readInt();
1317 Bundle options = data.readInt() != 0
1318 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn2d91af02009-07-16 13:34:33 -07001319 int result = startActivityInPackage(uid, intent, resolvedType,
Dianne Hackborna4972e92012-03-14 10:38:05 -07001320 resultTo, resultWho, requestCode, startFlags, options);
Dianne Hackborn2d91af02009-07-16 13:34:33 -07001321 reply.writeNoException();
1322 reply.writeInt(result);
1323 return true;
1324 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001325
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001326 case KILL_APPLICATION_WITH_UID_TRANSACTION: {
1327 data.enforceInterface(IActivityManager.descriptor);
1328 String pkg = data.readString();
1329 int uid = data.readInt();
1330 killApplicationWithUid(pkg, uid);
1331 reply.writeNoException();
1332 return true;
1333 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001334
1335 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1336 data.enforceInterface(IActivityManager.descriptor);
1337 String reason = data.readString();
1338 closeSystemDialogs(reason);
1339 reply.writeNoException();
1340 return true;
1341 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001342
1343 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1344 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001345 int[] pids = data.createIntArray();
1346 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001347 reply.writeNoException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001348 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001349 return true;
1350 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001351
1352 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1353 data.enforceInterface(IActivityManager.descriptor);
1354 String processName = data.readString();
1355 int uid = data.readInt();
1356 killApplicationProcess(processName, uid);
1357 reply.writeNoException();
1358 return true;
1359 }
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001360
1361 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1362 data.enforceInterface(IActivityManager.descriptor);
1363 IBinder token = data.readStrongBinder();
1364 String packageName = data.readString();
1365 int enterAnim = data.readInt();
1366 int exitAnim = data.readInt();
1367 overridePendingTransition(token, packageName, enterAnim, exitAnim);
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001368 reply.writeNoException();
1369 return true;
1370 }
1371
1372 case IS_USER_A_MONKEY_TRANSACTION: {
1373 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001374 boolean areThey = isUserAMonkey();
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001375 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001376 reply.writeInt(areThey ? 1 : 0);
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001377 return true;
1378 }
Dianne Hackborn860755f2010-06-03 18:47:52 -07001379
1380 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1381 data.enforceInterface(IActivityManager.descriptor);
1382 finishHeavyWeightApp();
1383 reply.writeNoException();
1384 return true;
1385 }
Daniel Sandler69a48172010-06-23 16:29:36 -04001386
1387 case IS_IMMERSIVE_TRANSACTION: {
1388 data.enforceInterface(IActivityManager.descriptor);
1389 IBinder token = data.readStrongBinder();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001390 boolean isit = isImmersive(token);
Daniel Sandler69a48172010-06-23 16:29:36 -04001391 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001392 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001393 return true;
1394 }
1395
1396 case SET_IMMERSIVE_TRANSACTION: {
1397 data.enforceInterface(IActivityManager.descriptor);
1398 IBinder token = data.readStrongBinder();
1399 boolean imm = data.readInt() == 1;
1400 setImmersive(token, imm);
1401 reply.writeNoException();
1402 return true;
1403 }
1404
1405 case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
1406 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001407 boolean isit = isTopActivityImmersive();
Daniel Sandler69a48172010-06-23 16:29:36 -04001408 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001409 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001410 return true;
1411 }
1412
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001413 case CRASH_APPLICATION_TRANSACTION: {
1414 data.enforceInterface(IActivityManager.descriptor);
1415 int uid = data.readInt();
1416 int initialPid = data.readInt();
1417 String packageName = data.readString();
1418 String message = data.readString();
1419 crashApplication(uid, initialPid, packageName, message);
1420 reply.writeNoException();
1421 return true;
1422 }
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001423
1424 case GET_PROVIDER_MIME_TYPE_TRANSACTION: {
1425 data.enforceInterface(IActivityManager.descriptor);
1426 Uri uri = Uri.CREATOR.createFromParcel(data);
1427 String type = getProviderMimeType(uri);
1428 reply.writeNoException();
1429 reply.writeString(type);
1430 return true;
1431 }
1432
Dianne Hackborn7e269642010-08-25 19:50:20 -07001433 case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
1434 data.enforceInterface(IActivityManager.descriptor);
1435 String name = data.readString();
1436 IBinder perm = newUriPermissionOwner(name);
1437 reply.writeNoException();
1438 reply.writeStrongBinder(perm);
1439 return true;
1440 }
1441
1442 case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1443 data.enforceInterface(IActivityManager.descriptor);
1444 IBinder owner = data.readStrongBinder();
1445 int fromUid = data.readInt();
1446 String targetPkg = data.readString();
1447 Uri uri = Uri.CREATOR.createFromParcel(data);
1448 int mode = data.readInt();
1449 grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode);
1450 reply.writeNoException();
1451 return true;
1452 }
1453
1454 case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1455 data.enforceInterface(IActivityManager.descriptor);
1456 IBinder owner = data.readStrongBinder();
1457 Uri uri = null;
1458 if (data.readInt() != 0) {
1459 Uri.CREATOR.createFromParcel(data);
1460 }
1461 int mode = data.readInt();
1462 revokeUriPermissionFromOwner(owner, uri, mode);
1463 reply.writeNoException();
1464 return true;
1465 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001466
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001467 case CHECK_GRANT_URI_PERMISSION_TRANSACTION: {
1468 data.enforceInterface(IActivityManager.descriptor);
1469 int callingUid = data.readInt();
1470 String targetPkg = data.readString();
1471 Uri uri = Uri.CREATOR.createFromParcel(data);
1472 int modeFlags = data.readInt();
1473 int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags);
1474 reply.writeNoException();
1475 reply.writeInt(res);
1476 return true;
1477 }
1478
Andy McFadden824c5102010-07-09 16:26:57 -07001479 case DUMP_HEAP_TRANSACTION: {
1480 data.enforceInterface(IActivityManager.descriptor);
1481 String process = data.readString();
1482 boolean managed = data.readInt() != 0;
1483 String path = data.readString();
1484 ParcelFileDescriptor fd = data.readInt() != 0
1485 ? data.readFileDescriptor() : null;
1486 boolean res = dumpHeap(process, managed, path, fd);
1487 reply.writeNoException();
1488 reply.writeInt(res ? 1 : 0);
1489 return true;
1490 }
1491
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001492 case START_ACTIVITIES_IN_PACKAGE_TRANSACTION:
1493 {
1494 data.enforceInterface(IActivityManager.descriptor);
1495 int uid = data.readInt();
1496 Intent[] intents = data.createTypedArray(Intent.CREATOR);
1497 String[] resolvedTypes = data.createStringArray();
1498 IBinder resultTo = data.readStrongBinder();
Dianne Hackborna4972e92012-03-14 10:38:05 -07001499 Bundle options = data.readInt() != 0
1500 ? Bundle.CREATOR.createFromParcel(data) : null;
1501 int result = startActivitiesInPackage(uid, intents, resolvedTypes,
1502 resultTo, options);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001503 reply.writeNoException();
1504 reply.writeInt(result);
1505 return true;
1506 }
1507
1508 case START_ACTIVITIES_TRANSACTION:
1509 {
1510 data.enforceInterface(IActivityManager.descriptor);
1511 IBinder b = data.readStrongBinder();
1512 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1513 Intent[] intents = data.createTypedArray(Intent.CREATOR);
1514 String[] resolvedTypes = data.createStringArray();
1515 IBinder resultTo = data.readStrongBinder();
Dianne Hackborna4972e92012-03-14 10:38:05 -07001516 Bundle options = data.readInt() != 0
1517 ? Bundle.CREATOR.createFromParcel(data) : null;
1518 int result = startActivities(app, intents, resolvedTypes, resultTo,
1519 options);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001520 reply.writeNoException();
1521 reply.writeInt(result);
1522 return true;
1523 }
1524
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001525 case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1526 {
1527 data.enforceInterface(IActivityManager.descriptor);
1528 int mode = getFrontActivityScreenCompatMode();
1529 reply.writeNoException();
1530 reply.writeInt(mode);
1531 return true;
1532 }
1533
1534 case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1535 {
1536 data.enforceInterface(IActivityManager.descriptor);
1537 int mode = data.readInt();
1538 setFrontActivityScreenCompatMode(mode);
1539 reply.writeNoException();
1540 reply.writeInt(mode);
1541 return true;
1542 }
1543
1544 case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1545 {
1546 data.enforceInterface(IActivityManager.descriptor);
1547 String pkg = data.readString();
1548 int mode = getPackageScreenCompatMode(pkg);
1549 reply.writeNoException();
1550 reply.writeInt(mode);
1551 return true;
1552 }
1553
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001554 case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1555 {
1556 data.enforceInterface(IActivityManager.descriptor);
1557 String pkg = data.readString();
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001558 int mode = data.readInt();
1559 setPackageScreenCompatMode(pkg, mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001560 reply.writeNoException();
1561 return true;
1562 }
Dianne Hackbornaa9d84c2011-05-09 19:00:59 -07001563
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001564 case SWITCH_USER_TRANSACTION: {
1565 data.enforceInterface(IActivityManager.descriptor);
1566 int userid = data.readInt();
1567 boolean result = switchUser(userid);
1568 reply.writeNoException();
1569 reply.writeInt(result ? 1 : 0);
1570 return true;
1571 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07001572
Dianne Hackborn80a4af22012-08-27 19:18:31 -07001573 case STOP_USER_TRANSACTION: {
1574 data.enforceInterface(IActivityManager.descriptor);
1575 int userid = data.readInt();
1576 IStopUserCallback callback = IStopUserCallback.Stub.asInterface(
1577 data.readStrongBinder());
1578 int result = stopUser(userid, callback);
1579 reply.writeNoException();
1580 reply.writeInt(result);
1581 return true;
1582 }
1583
Amith Yamasani52f1d752012-03-28 18:19:29 -07001584 case GET_CURRENT_USER_TRANSACTION: {
1585 data.enforceInterface(IActivityManager.descriptor);
1586 UserInfo userInfo = getCurrentUser();
1587 reply.writeNoException();
1588 userInfo.writeToParcel(reply, 0);
1589 return true;
1590 }
1591
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001592 case REMOVE_SUB_TASK_TRANSACTION:
1593 {
1594 data.enforceInterface(IActivityManager.descriptor);
1595 int taskId = data.readInt();
1596 int subTaskIndex = data.readInt();
1597 boolean result = removeSubTask(taskId, subTaskIndex);
1598 reply.writeNoException();
1599 reply.writeInt(result ? 1 : 0);
1600 return true;
1601 }
1602
1603 case REMOVE_TASK_TRANSACTION:
1604 {
1605 data.enforceInterface(IActivityManager.descriptor);
1606 int taskId = data.readInt();
1607 int fl = data.readInt();
1608 boolean result = removeTask(taskId, fl);
1609 reply.writeNoException();
1610 reply.writeInt(result ? 1 : 0);
1611 return true;
1612 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001613
Jeff Sharkeya4620792011-05-20 15:29:23 -07001614 case REGISTER_PROCESS_OBSERVER_TRANSACTION: {
1615 data.enforceInterface(IActivityManager.descriptor);
1616 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1617 data.readStrongBinder());
1618 registerProcessObserver(observer);
1619 return true;
1620 }
1621
1622 case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: {
1623 data.enforceInterface(IActivityManager.descriptor);
1624 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1625 data.readStrongBinder());
1626 unregisterProcessObserver(observer);
1627 return true;
1628 }
1629
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07001630 case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1631 {
1632 data.enforceInterface(IActivityManager.descriptor);
1633 String pkg = data.readString();
1634 boolean ask = getPackageAskScreenCompat(pkg);
1635 reply.writeNoException();
1636 reply.writeInt(ask ? 1 : 0);
1637 return true;
1638 }
1639
1640 case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1641 {
1642 data.enforceInterface(IActivityManager.descriptor);
1643 String pkg = data.readString();
1644 boolean ask = data.readInt() != 0;
1645 setPackageAskScreenCompat(pkg, ask);
1646 reply.writeNoException();
1647 return true;
1648 }
1649
Dianne Hackborn6c418d52011-06-29 14:05:33 -07001650 case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: {
1651 data.enforceInterface(IActivityManager.descriptor);
1652 IIntentSender r = IIntentSender.Stub.asInterface(
1653 data.readStrongBinder());
1654 boolean res = isIntentSenderTargetedToPackage(r);
1655 reply.writeNoException();
1656 reply.writeInt(res ? 1 : 0);
1657 return true;
1658 }
1659
Dianne Hackborn1927ae82012-06-22 15:21:36 -07001660 case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: {
1661 data.enforceInterface(IActivityManager.descriptor);
1662 IIntentSender r = IIntentSender.Stub.asInterface(
1663 data.readStrongBinder());
1664 boolean res = isIntentSenderAnActivity(r);
1665 reply.writeNoException();
1666 reply.writeInt(res ? 1 : 0);
1667 return true;
1668 }
1669
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001670 case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
1671 data.enforceInterface(IActivityManager.descriptor);
1672 Configuration config = Configuration.CREATOR.createFromParcel(data);
1673 updatePersistentConfiguration(config);
1674 reply.writeNoException();
1675 return true;
1676 }
1677
Dianne Hackbornb437e092011-08-05 17:50:29 -07001678 case GET_PROCESS_PSS_TRANSACTION: {
1679 data.enforceInterface(IActivityManager.descriptor);
1680 int[] pids = data.createIntArray();
1681 long[] pss = getProcessPss(pids);
1682 reply.writeNoException();
1683 reply.writeLongArray(pss);
1684 return true;
1685 }
1686
Dianne Hackborn661cd522011-08-22 00:26:20 -07001687 case SHOW_BOOT_MESSAGE_TRANSACTION: {
1688 data.enforceInterface(IActivityManager.descriptor);
1689 CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
1690 boolean always = data.readInt() != 0;
1691 showBootMessage(msg, always);
1692 reply.writeNoException();
1693 return true;
1694 }
1695
Dianne Hackborn90c52de2011-09-23 12:57:44 -07001696 case DISMISS_KEYGUARD_ON_NEXT_ACTIVITY_TRANSACTION: {
1697 data.enforceInterface(IActivityManager.descriptor);
1698 dismissKeyguardOnNextActivity();
1699 reply.writeNoException();
1700 return true;
1701 }
1702
Adam Powelldd8fab22012-03-22 17:47:27 -07001703 case TARGET_TASK_AFFINITY_MATCHES_ACTIVITY_TRANSACTION: {
1704 data.enforceInterface(IActivityManager.descriptor);
1705 IBinder token = data.readStrongBinder();
1706 String destAffinity = data.readString();
1707 boolean res = targetTaskAffinityMatchesActivity(token, destAffinity);
1708 reply.writeNoException();
1709 reply.writeInt(res ? 1 : 0);
1710 return true;
1711 }
1712
1713 case NAVIGATE_UP_TO_TRANSACTION: {
1714 data.enforceInterface(IActivityManager.descriptor);
1715 IBinder token = data.readStrongBinder();
1716 Intent target = Intent.CREATOR.createFromParcel(data);
1717 int resultCode = data.readInt();
1718 Intent resultData = null;
1719 if (data.readInt() != 0) {
1720 resultData = Intent.CREATOR.createFromParcel(data);
1721 }
1722 boolean res = navigateUpTo(token, target, resultCode, resultData);
1723 reply.writeNoException();
1724 reply.writeInt(res ? 1 : 0);
1725 return true;
1726 }
1727
Dianne Hackborn5320eb82012-05-18 12:05:04 -07001728 case GET_LAUNCHED_FROM_UID_TRANSACTION: {
1729 data.enforceInterface(IActivityManager.descriptor);
1730 IBinder token = data.readStrongBinder();
1731 int res = getLaunchedFromUid(token);
1732 reply.writeNoException();
1733 reply.writeInt(res);
1734 return true;
1735 }
1736
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001737 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08001738
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001739 return super.onTransact(code, data, reply, flags);
1740 }
1741
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08001742 public IBinder asBinder() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001743 return this;
1744 }
1745
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08001746 private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
1747 protected IActivityManager create() {
1748 IBinder b = ServiceManager.getService("activity");
Joe Onorato43a17652011-04-06 19:22:23 -07001749 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08001750 Log.v("ActivityManager", "default service binder = " + b);
1751 }
1752 IActivityManager am = asInterface(b);
Joe Onorato43a17652011-04-06 19:22:23 -07001753 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08001754 Log.v("ActivityManager", "default service = " + am);
1755 }
1756 return am;
1757 }
1758 };
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001759}
1760
1761class ActivityManagerProxy implements IActivityManager
1762{
1763 public ActivityManagerProxy(IBinder remote)
1764 {
1765 mRemote = remote;
1766 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08001767
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001768 public IBinder asBinder()
1769 {
1770 return mRemote;
1771 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08001772
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001773 public int startActivity(IApplicationThread caller, Intent intent,
Dianne Hackborna4972e92012-03-14 10:38:05 -07001774 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
1775 int startFlags, String profileFile,
1776 ParcelFileDescriptor profileFd, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001777 Parcel data = Parcel.obtain();
1778 Parcel reply = Parcel.obtain();
1779 data.writeInterfaceToken(IActivityManager.descriptor);
1780 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1781 intent.writeToParcel(data, 0);
1782 data.writeString(resolvedType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001783 data.writeStrongBinder(resultTo);
1784 data.writeString(resultWho);
1785 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07001786 data.writeInt(startFlags);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07001787 data.writeString(profileFile);
1788 if (profileFd != null) {
1789 data.writeInt(1);
1790 profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1791 } else {
1792 data.writeInt(0);
1793 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07001794 if (options != null) {
1795 data.writeInt(1);
1796 options.writeToParcel(data, 0);
1797 } else {
1798 data.writeInt(0);
1799 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001800 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
1801 reply.readException();
1802 int result = reply.readInt();
1803 reply.recycle();
1804 data.recycle();
1805 return result;
1806 }
Amith Yamasani82644082012-08-03 13:09:11 -07001807
1808 public int startActivityAsUser(IApplicationThread caller, Intent intent,
1809 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
1810 int startFlags, String profileFile,
1811 ParcelFileDescriptor profileFd, Bundle options, int userId) throws RemoteException {
1812 Parcel data = Parcel.obtain();
1813 Parcel reply = Parcel.obtain();
1814 data.writeInterfaceToken(IActivityManager.descriptor);
1815 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1816 intent.writeToParcel(data, 0);
1817 data.writeString(resolvedType);
1818 data.writeStrongBinder(resultTo);
1819 data.writeString(resultWho);
1820 data.writeInt(requestCode);
1821 data.writeInt(startFlags);
1822 data.writeString(profileFile);
1823 if (profileFd != null) {
1824 data.writeInt(1);
1825 profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1826 } else {
1827 data.writeInt(0);
1828 }
1829 if (options != null) {
1830 data.writeInt(1);
1831 options.writeToParcel(data, 0);
1832 } else {
1833 data.writeInt(0);
1834 }
1835 data.writeInt(userId);
1836 mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0);
1837 reply.readException();
1838 int result = reply.readInt();
1839 reply.recycle();
1840 data.recycle();
1841 return result;
1842 }
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08001843 public WaitResult startActivityAndWait(IApplicationThread caller, Intent intent,
Dianne Hackborna4972e92012-03-14 10:38:05 -07001844 String resolvedType, IBinder resultTo, String resultWho,
1845 int requestCode, int startFlags, String profileFile,
1846 ParcelFileDescriptor profileFd, Bundle options) throws RemoteException {
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08001847 Parcel data = Parcel.obtain();
1848 Parcel reply = Parcel.obtain();
1849 data.writeInterfaceToken(IActivityManager.descriptor);
1850 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1851 intent.writeToParcel(data, 0);
1852 data.writeString(resolvedType);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08001853 data.writeStrongBinder(resultTo);
1854 data.writeString(resultWho);
1855 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07001856 data.writeInt(startFlags);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07001857 data.writeString(profileFile);
1858 if (profileFd != null) {
1859 data.writeInt(1);
1860 profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1861 } else {
1862 data.writeInt(0);
1863 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07001864 if (options != null) {
1865 data.writeInt(1);
1866 options.writeToParcel(data, 0);
1867 } else {
1868 data.writeInt(0);
1869 }
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08001870 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
1871 reply.readException();
1872 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
1873 reply.recycle();
1874 data.recycle();
1875 return result;
1876 }
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07001877 public int startActivityWithConfig(IApplicationThread caller, Intent intent,
Dianne Hackborna4972e92012-03-14 10:38:05 -07001878 String resolvedType, IBinder resultTo, String resultWho,
1879 int requestCode, int startFlags, Configuration config,
1880 Bundle options) throws RemoteException {
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07001881 Parcel data = Parcel.obtain();
1882 Parcel reply = Parcel.obtain();
1883 data.writeInterfaceToken(IActivityManager.descriptor);
1884 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1885 intent.writeToParcel(data, 0);
1886 data.writeString(resolvedType);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07001887 data.writeStrongBinder(resultTo);
1888 data.writeString(resultWho);
1889 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07001890 data.writeInt(startFlags);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07001891 config.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07001892 if (options != null) {
1893 data.writeInt(1);
1894 options.writeToParcel(data, 0);
1895 } else {
1896 data.writeInt(0);
1897 }
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07001898 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
1899 reply.readException();
1900 int result = reply.readInt();
1901 reply.recycle();
1902 data.recycle();
1903 return result;
1904 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07001905 public int startActivityIntentSender(IApplicationThread caller,
1906 IntentSender intent, Intent fillInIntent, String resolvedType,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07001907 IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna4972e92012-03-14 10:38:05 -07001908 int flagsMask, int flagsValues, Bundle options) throws RemoteException {
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07001909 Parcel data = Parcel.obtain();
1910 Parcel reply = Parcel.obtain();
1911 data.writeInterfaceToken(IActivityManager.descriptor);
1912 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1913 intent.writeToParcel(data, 0);
1914 if (fillInIntent != null) {
1915 data.writeInt(1);
1916 fillInIntent.writeToParcel(data, 0);
1917 } else {
1918 data.writeInt(0);
1919 }
1920 data.writeString(resolvedType);
1921 data.writeStrongBinder(resultTo);
1922 data.writeString(resultWho);
1923 data.writeInt(requestCode);
1924 data.writeInt(flagsMask);
1925 data.writeInt(flagsValues);
Dianne Hackborna4972e92012-03-14 10:38:05 -07001926 if (options != null) {
1927 data.writeInt(1);
1928 options.writeToParcel(data, 0);
1929 } else {
1930 data.writeInt(0);
1931 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07001932 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07001933 reply.readException();
1934 int result = reply.readInt();
1935 reply.recycle();
1936 data.recycle();
1937 return result;
1938 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001939 public boolean startNextMatchingActivity(IBinder callingActivity,
Dianne Hackborna4972e92012-03-14 10:38:05 -07001940 Intent intent, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001941 Parcel data = Parcel.obtain();
1942 Parcel reply = Parcel.obtain();
1943 data.writeInterfaceToken(IActivityManager.descriptor);
1944 data.writeStrongBinder(callingActivity);
1945 intent.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07001946 if (options != null) {
1947 data.writeInt(1);
1948 options.writeToParcel(data, 0);
1949 } else {
1950 data.writeInt(0);
1951 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001952 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
1953 reply.readException();
1954 int result = reply.readInt();
1955 reply.recycle();
1956 data.recycle();
1957 return result != 0;
1958 }
1959 public boolean finishActivity(IBinder token, int resultCode, Intent resultData)
1960 throws RemoteException {
1961 Parcel data = Parcel.obtain();
1962 Parcel reply = Parcel.obtain();
1963 data.writeInterfaceToken(IActivityManager.descriptor);
1964 data.writeStrongBinder(token);
1965 data.writeInt(resultCode);
1966 if (resultData != null) {
1967 data.writeInt(1);
1968 resultData.writeToParcel(data, 0);
1969 } else {
1970 data.writeInt(0);
1971 }
1972 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
1973 reply.readException();
1974 boolean res = reply.readInt() != 0;
1975 data.recycle();
1976 reply.recycle();
1977 return res;
1978 }
1979 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
1980 {
1981 Parcel data = Parcel.obtain();
1982 Parcel reply = Parcel.obtain();
1983 data.writeInterfaceToken(IActivityManager.descriptor);
1984 data.writeStrongBinder(token);
1985 data.writeString(resultWho);
1986 data.writeInt(requestCode);
1987 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
1988 reply.readException();
1989 data.recycle();
1990 reply.recycle();
1991 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -07001992 public boolean finishActivityAffinity(IBinder token) throws RemoteException {
1993 Parcel data = Parcel.obtain();
1994 Parcel reply = Parcel.obtain();
1995 data.writeInterfaceToken(IActivityManager.descriptor);
1996 data.writeStrongBinder(token);
1997 mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0);
1998 reply.readException();
1999 boolean res = reply.readInt() != 0;
2000 data.recycle();
2001 reply.recycle();
2002 return res;
2003 }
Dianne Hackborn061d58a2010-03-12 15:07:06 -08002004 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
2005 Parcel data = Parcel.obtain();
2006 Parcel reply = Parcel.obtain();
2007 data.writeInterfaceToken(IActivityManager.descriptor);
2008 data.writeStrongBinder(token);
2009 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
2010 reply.readException();
2011 boolean res = reply.readInt() != 0;
2012 data.recycle();
2013 reply.recycle();
2014 return res;
2015 }
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002016 public Intent registerReceiver(IApplicationThread caller, String packageName,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002017 IIntentReceiver receiver,
2018 IntentFilter filter, String perm) throws RemoteException
2019 {
2020 Parcel data = Parcel.obtain();
2021 Parcel reply = Parcel.obtain();
2022 data.writeInterfaceToken(IActivityManager.descriptor);
2023 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002024 data.writeString(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002025 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
2026 filter.writeToParcel(data, 0);
2027 data.writeString(perm);
2028 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2029 reply.readException();
2030 Intent intent = null;
2031 int haveIntent = reply.readInt();
2032 if (haveIntent != 0) {
2033 intent = Intent.CREATOR.createFromParcel(reply);
2034 }
2035 reply.recycle();
2036 data.recycle();
2037 return intent;
2038 }
2039 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
2040 {
2041 Parcel data = Parcel.obtain();
2042 Parcel reply = Parcel.obtain();
2043 data.writeInterfaceToken(IActivityManager.descriptor);
2044 data.writeStrongBinder(receiver.asBinder());
2045 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2046 reply.readException();
2047 data.recycle();
2048 reply.recycle();
2049 }
2050 public int broadcastIntent(IApplicationThread caller,
2051 Intent intent, String resolvedType, IIntentReceiver resultTo,
2052 int resultCode, String resultData, Bundle map,
2053 String requiredPermission, boolean serialized,
Amith Yamasani742a6712011-05-04 14:49:28 -07002054 boolean sticky, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002055 {
2056 Parcel data = Parcel.obtain();
2057 Parcel reply = Parcel.obtain();
2058 data.writeInterfaceToken(IActivityManager.descriptor);
2059 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2060 intent.writeToParcel(data, 0);
2061 data.writeString(resolvedType);
2062 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
2063 data.writeInt(resultCode);
2064 data.writeString(resultData);
2065 data.writeBundle(map);
2066 data.writeString(requiredPermission);
2067 data.writeInt(serialized ? 1 : 0);
2068 data.writeInt(sticky ? 1 : 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07002069 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002070 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
2071 reply.readException();
2072 int res = reply.readInt();
2073 reply.recycle();
2074 data.recycle();
2075 return res;
2076 }
Amith Yamasani742a6712011-05-04 14:49:28 -07002077 public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
2078 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002079 {
2080 Parcel data = Parcel.obtain();
2081 Parcel reply = Parcel.obtain();
2082 data.writeInterfaceToken(IActivityManager.descriptor);
2083 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2084 intent.writeToParcel(data, 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07002085 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002086 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
2087 reply.readException();
2088 data.recycle();
2089 reply.recycle();
2090 }
2091 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, boolean abortBroadcast) throws RemoteException
2092 {
2093 Parcel data = Parcel.obtain();
2094 Parcel reply = Parcel.obtain();
2095 data.writeInterfaceToken(IActivityManager.descriptor);
2096 data.writeStrongBinder(who);
2097 data.writeInt(resultCode);
2098 data.writeString(resultData);
2099 data.writeBundle(map);
2100 data.writeInt(abortBroadcast ? 1 : 0);
2101 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2102 reply.readException();
2103 data.recycle();
2104 reply.recycle();
2105 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002106 public void attachApplication(IApplicationThread app) throws RemoteException
2107 {
2108 Parcel data = Parcel.obtain();
2109 Parcel reply = Parcel.obtain();
2110 data.writeInterfaceToken(IActivityManager.descriptor);
2111 data.writeStrongBinder(app.asBinder());
2112 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
2113 reply.readException();
2114 data.recycle();
2115 reply.recycle();
2116 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002117 public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
2118 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002119 {
2120 Parcel data = Parcel.obtain();
2121 Parcel reply = Parcel.obtain();
2122 data.writeInterfaceToken(IActivityManager.descriptor);
2123 data.writeStrongBinder(token);
Dianne Hackborne88846e2009-09-30 21:34:25 -07002124 if (config != null) {
2125 data.writeInt(1);
2126 config.writeToParcel(data, 0);
2127 } else {
2128 data.writeInt(0);
2129 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002130 data.writeInt(stopProfiling ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002131 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2132 reply.readException();
2133 data.recycle();
2134 reply.recycle();
2135 }
Dianne Hackborn0aae2d42010-12-07 23:51:29 -08002136 public void activityPaused(IBinder token) throws RemoteException
2137 {
2138 Parcel data = Parcel.obtain();
2139 Parcel reply = Parcel.obtain();
2140 data.writeInterfaceToken(IActivityManager.descriptor);
2141 data.writeStrongBinder(token);
2142 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
2143 reply.readException();
2144 data.recycle();
2145 reply.recycle();
2146 }
2147 public void activityStopped(IBinder token, Bundle state,
2148 Bitmap thumbnail, CharSequence description) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002149 {
2150 Parcel data = Parcel.obtain();
2151 Parcel reply = Parcel.obtain();
2152 data.writeInterfaceToken(IActivityManager.descriptor);
2153 data.writeStrongBinder(token);
2154 data.writeBundle(state);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002155 if (thumbnail != null) {
2156 data.writeInt(1);
2157 thumbnail.writeToParcel(data, 0);
2158 } else {
2159 data.writeInt(0);
2160 }
2161 TextUtils.writeToParcel(description, data, 0);
2162 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2163 reply.readException();
2164 data.recycle();
2165 reply.recycle();
2166 }
Dianne Hackborn4eba96b2011-01-21 13:34:36 -08002167 public void activitySlept(IBinder token) throws RemoteException
2168 {
2169 Parcel data = Parcel.obtain();
2170 Parcel reply = Parcel.obtain();
2171 data.writeInterfaceToken(IActivityManager.descriptor);
2172 data.writeStrongBinder(token);
2173 mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2174 reply.readException();
2175 data.recycle();
2176 reply.recycle();
2177 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002178 public void activityDestroyed(IBinder token) throws RemoteException
2179 {
2180 Parcel data = Parcel.obtain();
2181 Parcel reply = Parcel.obtain();
2182 data.writeInterfaceToken(IActivityManager.descriptor);
2183 data.writeStrongBinder(token);
2184 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2185 reply.readException();
2186 data.recycle();
2187 reply.recycle();
2188 }
2189 public String getCallingPackage(IBinder token) throws RemoteException
2190 {
2191 Parcel data = Parcel.obtain();
2192 Parcel reply = Parcel.obtain();
2193 data.writeInterfaceToken(IActivityManager.descriptor);
2194 data.writeStrongBinder(token);
2195 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
2196 reply.readException();
2197 String res = reply.readString();
2198 data.recycle();
2199 reply.recycle();
2200 return res;
2201 }
2202 public ComponentName getCallingActivity(IBinder token)
2203 throws RemoteException {
2204 Parcel data = Parcel.obtain();
2205 Parcel reply = Parcel.obtain();
2206 data.writeInterfaceToken(IActivityManager.descriptor);
2207 data.writeStrongBinder(token);
2208 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
2209 reply.readException();
2210 ComponentName res = ComponentName.readFromParcel(reply);
2211 data.recycle();
2212 reply.recycle();
2213 return res;
2214 }
2215 public List getTasks(int maxNum, int flags,
2216 IThumbnailReceiver receiver) throws RemoteException {
2217 Parcel data = Parcel.obtain();
2218 Parcel reply = Parcel.obtain();
2219 data.writeInterfaceToken(IActivityManager.descriptor);
2220 data.writeInt(maxNum);
2221 data.writeInt(flags);
2222 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
2223 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
2224 reply.readException();
2225 ArrayList list = null;
2226 int N = reply.readInt();
2227 if (N >= 0) {
2228 list = new ArrayList();
2229 while (N > 0) {
2230 ActivityManager.RunningTaskInfo info =
2231 ActivityManager.RunningTaskInfo.CREATOR
2232 .createFromParcel(reply);
2233 list.add(info);
2234 N--;
2235 }
2236 }
2237 data.recycle();
2238 reply.recycle();
2239 return list;
2240 }
2241 public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -07002242 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002243 Parcel data = Parcel.obtain();
2244 Parcel reply = Parcel.obtain();
2245 data.writeInterfaceToken(IActivityManager.descriptor);
2246 data.writeInt(maxNum);
2247 data.writeInt(flags);
Amith Yamasani82644082012-08-03 13:09:11 -07002248 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002249 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
2250 reply.readException();
2251 ArrayList<ActivityManager.RecentTaskInfo> list
2252 = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR);
2253 data.recycle();
2254 reply.recycle();
2255 return list;
2256 }
Dianne Hackbornf26fd992011-04-08 18:14:09 -07002257 public ActivityManager.TaskThumbnails getTaskThumbnails(int id) throws RemoteException {
Dianne Hackbornd94df452011-02-16 18:53:31 -08002258 Parcel data = Parcel.obtain();
2259 Parcel reply = Parcel.obtain();
2260 data.writeInterfaceToken(IActivityManager.descriptor);
2261 data.writeInt(id);
Dianne Hackbornf26fd992011-04-08 18:14:09 -07002262 mRemote.transact(GET_TASK_THUMBNAILS_TRANSACTION, data, reply, 0);
Dianne Hackbornd94df452011-02-16 18:53:31 -08002263 reply.readException();
Dianne Hackbornf26fd992011-04-08 18:14:09 -07002264 ActivityManager.TaskThumbnails bm = null;
Dianne Hackbornd94df452011-02-16 18:53:31 -08002265 if (reply.readInt() != 0) {
Dianne Hackbornf26fd992011-04-08 18:14:09 -07002266 bm = ActivityManager.TaskThumbnails.CREATOR.createFromParcel(reply);
Dianne Hackbornd94df452011-02-16 18:53:31 -08002267 }
2268 data.recycle();
2269 reply.recycle();
2270 return bm;
2271 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002272 public List getServices(int maxNum, int flags) throws RemoteException {
2273 Parcel data = Parcel.obtain();
2274 Parcel reply = Parcel.obtain();
2275 data.writeInterfaceToken(IActivityManager.descriptor);
2276 data.writeInt(maxNum);
2277 data.writeInt(flags);
2278 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
2279 reply.readException();
2280 ArrayList list = null;
2281 int N = reply.readInt();
2282 if (N >= 0) {
2283 list = new ArrayList();
2284 while (N > 0) {
2285 ActivityManager.RunningServiceInfo info =
2286 ActivityManager.RunningServiceInfo.CREATOR
2287 .createFromParcel(reply);
2288 list.add(info);
2289 N--;
2290 }
2291 }
2292 data.recycle();
2293 reply.recycle();
2294 return list;
2295 }
2296 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
2297 throws RemoteException {
2298 Parcel data = Parcel.obtain();
2299 Parcel reply = Parcel.obtain();
2300 data.writeInterfaceToken(IActivityManager.descriptor);
2301 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
2302 reply.readException();
2303 ArrayList<ActivityManager.ProcessErrorStateInfo> list
2304 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
2305 data.recycle();
2306 reply.recycle();
2307 return list;
2308 }
2309 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
2310 throws RemoteException {
2311 Parcel data = Parcel.obtain();
2312 Parcel reply = Parcel.obtain();
2313 data.writeInterfaceToken(IActivityManager.descriptor);
2314 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
2315 reply.readException();
2316 ArrayList<ActivityManager.RunningAppProcessInfo> list
2317 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
2318 data.recycle();
2319 reply.recycle();
2320 return list;
2321 }
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -07002322 public List<ApplicationInfo> getRunningExternalApplications()
2323 throws RemoteException {
2324 Parcel data = Parcel.obtain();
2325 Parcel reply = Parcel.obtain();
2326 data.writeInterfaceToken(IActivityManager.descriptor);
2327 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
2328 reply.readException();
2329 ArrayList<ApplicationInfo> list
2330 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
2331 data.recycle();
2332 reply.recycle();
2333 return list;
2334 }
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07002335 public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002336 {
2337 Parcel data = Parcel.obtain();
2338 Parcel reply = Parcel.obtain();
2339 data.writeInterfaceToken(IActivityManager.descriptor);
2340 data.writeInt(task);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08002341 data.writeInt(flags);
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07002342 if (options != null) {
2343 data.writeInt(1);
2344 options.writeToParcel(data, 0);
2345 } else {
2346 data.writeInt(0);
2347 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002348 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
2349 reply.readException();
2350 data.recycle();
2351 reply.recycle();
2352 }
2353 public void moveTaskToBack(int task) throws RemoteException
2354 {
2355 Parcel data = Parcel.obtain();
2356 Parcel reply = Parcel.obtain();
2357 data.writeInterfaceToken(IActivityManager.descriptor);
2358 data.writeInt(task);
2359 mRemote.transact(MOVE_TASK_TO_BACK_TRANSACTION, data, reply, 0);
2360 reply.readException();
2361 data.recycle();
2362 reply.recycle();
2363 }
2364 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
2365 throws RemoteException {
2366 Parcel data = Parcel.obtain();
2367 Parcel reply = Parcel.obtain();
2368 data.writeInterfaceToken(IActivityManager.descriptor);
2369 data.writeStrongBinder(token);
2370 data.writeInt(nonRoot ? 1 : 0);
2371 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
2372 reply.readException();
2373 boolean res = reply.readInt() != 0;
2374 data.recycle();
2375 reply.recycle();
2376 return res;
2377 }
2378 public void moveTaskBackwards(int task) throws RemoteException
2379 {
2380 Parcel data = Parcel.obtain();
2381 Parcel reply = Parcel.obtain();
2382 data.writeInterfaceToken(IActivityManager.descriptor);
2383 data.writeInt(task);
2384 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
2385 reply.readException();
2386 data.recycle();
2387 reply.recycle();
2388 }
2389 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
2390 {
2391 Parcel data = Parcel.obtain();
2392 Parcel reply = Parcel.obtain();
2393 data.writeInterfaceToken(IActivityManager.descriptor);
2394 data.writeStrongBinder(token);
2395 data.writeInt(onlyRoot ? 1 : 0);
2396 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
2397 reply.readException();
2398 int res = reply.readInt();
2399 data.recycle();
2400 reply.recycle();
2401 return res;
2402 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002403 public void reportThumbnail(IBinder token,
2404 Bitmap thumbnail, CharSequence description) throws RemoteException
2405 {
2406 Parcel data = Parcel.obtain();
2407 Parcel reply = Parcel.obtain();
2408 data.writeInterfaceToken(IActivityManager.descriptor);
2409 data.writeStrongBinder(token);
2410 if (thumbnail != null) {
2411 data.writeInt(1);
2412 thumbnail.writeToParcel(data, 0);
2413 } else {
2414 data.writeInt(0);
2415 }
2416 TextUtils.writeToParcel(description, data, 0);
2417 mRemote.transact(REPORT_THUMBNAIL_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2418 reply.readException();
2419 data.recycle();
2420 reply.recycle();
2421 }
2422 public ContentProviderHolder getContentProvider(IApplicationThread caller,
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002423 String name, boolean stable) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002424 Parcel data = Parcel.obtain();
2425 Parcel reply = Parcel.obtain();
2426 data.writeInterfaceToken(IActivityManager.descriptor);
2427 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2428 data.writeString(name);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002429 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002430 mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
2431 reply.readException();
2432 int res = reply.readInt();
2433 ContentProviderHolder cph = null;
2434 if (res != 0) {
2435 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
2436 }
2437 data.recycle();
2438 reply.recycle();
2439 return cph;
2440 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08002441 public ContentProviderHolder getContentProviderExternal(String name, IBinder token)
2442 throws RemoteException
2443 {
2444 Parcel data = Parcel.obtain();
2445 Parcel reply = Parcel.obtain();
2446 data.writeInterfaceToken(IActivityManager.descriptor);
2447 data.writeString(name);
2448 data.writeStrongBinder(token);
2449 mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
2450 reply.readException();
2451 int res = reply.readInt();
2452 ContentProviderHolder cph = null;
2453 if (res != 0) {
2454 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
2455 }
2456 data.recycle();
2457 reply.recycle();
2458 return cph;
2459 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002460 public void publishContentProviders(IApplicationThread caller,
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002461 List<ContentProviderHolder> providers) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002462 {
2463 Parcel data = Parcel.obtain();
2464 Parcel reply = Parcel.obtain();
2465 data.writeInterfaceToken(IActivityManager.descriptor);
2466 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2467 data.writeTypedList(providers);
2468 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
2469 reply.readException();
2470 data.recycle();
2471 reply.recycle();
2472 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002473 public boolean refContentProvider(IBinder connection, int stable, int unstable)
2474 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002475 Parcel data = Parcel.obtain();
2476 Parcel reply = Parcel.obtain();
2477 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002478 data.writeStrongBinder(connection);
2479 data.writeInt(stable);
2480 data.writeInt(unstable);
2481 mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
2482 reply.readException();
2483 boolean res = reply.readInt() != 0;
2484 data.recycle();
2485 reply.recycle();
2486 return res;
2487 }
2488 public void unstableProviderDied(IBinder connection) throws RemoteException {
2489 Parcel data = Parcel.obtain();
2490 Parcel reply = Parcel.obtain();
2491 data.writeInterfaceToken(IActivityManager.descriptor);
2492 data.writeStrongBinder(connection);
2493 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0);
2494 reply.readException();
2495 data.recycle();
2496 reply.recycle();
2497 }
2498
2499 public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException {
2500 Parcel data = Parcel.obtain();
2501 Parcel reply = Parcel.obtain();
2502 data.writeInterfaceToken(IActivityManager.descriptor);
2503 data.writeStrongBinder(connection);
2504 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002505 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
2506 reply.readException();
2507 data.recycle();
2508 reply.recycle();
2509 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08002510
2511 public void removeContentProviderExternal(String name, IBinder token) throws RemoteException {
2512 Parcel data = Parcel.obtain();
2513 Parcel reply = Parcel.obtain();
2514 data.writeInterfaceToken(IActivityManager.descriptor);
2515 data.writeString(name);
2516 data.writeStrongBinder(token);
2517 mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
2518 reply.readException();
2519 data.recycle();
2520 reply.recycle();
2521 }
2522
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07002523 public PendingIntent getRunningServiceControlPanel(ComponentName service)
2524 throws RemoteException
2525 {
2526 Parcel data = Parcel.obtain();
2527 Parcel reply = Parcel.obtain();
2528 data.writeInterfaceToken(IActivityManager.descriptor);
2529 service.writeToParcel(data, 0);
2530 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
2531 reply.readException();
2532 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
2533 data.recycle();
2534 reply.recycle();
2535 return res;
2536 }
2537
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002538 public ComponentName startService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07002539 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002540 {
2541 Parcel data = Parcel.obtain();
2542 Parcel reply = Parcel.obtain();
2543 data.writeInterfaceToken(IActivityManager.descriptor);
2544 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2545 service.writeToParcel(data, 0);
2546 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07002547 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002548 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
2549 reply.readException();
2550 ComponentName res = ComponentName.readFromParcel(reply);
2551 data.recycle();
2552 reply.recycle();
2553 return res;
2554 }
2555 public int stopService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07002556 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002557 {
2558 Parcel data = Parcel.obtain();
2559 Parcel reply = Parcel.obtain();
2560 data.writeInterfaceToken(IActivityManager.descriptor);
2561 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2562 service.writeToParcel(data, 0);
2563 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07002564 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002565 mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0);
2566 reply.readException();
2567 int res = reply.readInt();
2568 reply.recycle();
2569 data.recycle();
2570 return res;
2571 }
2572 public boolean stopServiceToken(ComponentName className, IBinder token,
2573 int startId) throws RemoteException {
2574 Parcel data = Parcel.obtain();
2575 Parcel reply = Parcel.obtain();
2576 data.writeInterfaceToken(IActivityManager.descriptor);
2577 ComponentName.writeToParcel(className, data);
2578 data.writeStrongBinder(token);
2579 data.writeInt(startId);
2580 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
2581 reply.readException();
2582 boolean res = reply.readInt() != 0;
2583 data.recycle();
2584 reply.recycle();
2585 return res;
2586 }
2587 public void setServiceForeground(ComponentName className, IBinder token,
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07002588 int id, Notification notification, boolean removeNotification) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002589 Parcel data = Parcel.obtain();
2590 Parcel reply = Parcel.obtain();
2591 data.writeInterfaceToken(IActivityManager.descriptor);
2592 ComponentName.writeToParcel(className, data);
2593 data.writeStrongBinder(token);
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07002594 data.writeInt(id);
2595 if (notification != null) {
2596 data.writeInt(1);
2597 notification.writeToParcel(data, 0);
2598 } else {
2599 data.writeInt(0);
2600 }
2601 data.writeInt(removeNotification ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002602 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
2603 reply.readException();
2604 data.recycle();
2605 reply.recycle();
2606 }
2607 public int bindService(IApplicationThread caller, IBinder token,
2608 Intent service, String resolvedType, IServiceConnection connection,
Amith Yamasani37ce3a82012-02-06 12:04:42 -08002609 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002610 Parcel data = Parcel.obtain();
2611 Parcel reply = Parcel.obtain();
2612 data.writeInterfaceToken(IActivityManager.descriptor);
2613 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2614 data.writeStrongBinder(token);
2615 service.writeToParcel(data, 0);
2616 data.writeString(resolvedType);
2617 data.writeStrongBinder(connection.asBinder());
2618 data.writeInt(flags);
Amith Yamasani37ce3a82012-02-06 12:04:42 -08002619 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002620 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
2621 reply.readException();
2622 int res = reply.readInt();
2623 data.recycle();
2624 reply.recycle();
2625 return res;
2626 }
2627 public boolean unbindService(IServiceConnection connection) throws RemoteException
2628 {
2629 Parcel data = Parcel.obtain();
2630 Parcel reply = Parcel.obtain();
2631 data.writeInterfaceToken(IActivityManager.descriptor);
2632 data.writeStrongBinder(connection.asBinder());
2633 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
2634 reply.readException();
2635 boolean res = reply.readInt() != 0;
2636 data.recycle();
2637 reply.recycle();
2638 return res;
2639 }
2640
2641 public void publishService(IBinder token,
2642 Intent intent, IBinder service) throws RemoteException {
2643 Parcel data = Parcel.obtain();
2644 Parcel reply = Parcel.obtain();
2645 data.writeInterfaceToken(IActivityManager.descriptor);
2646 data.writeStrongBinder(token);
2647 intent.writeToParcel(data, 0);
2648 data.writeStrongBinder(service);
2649 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
2650 reply.readException();
2651 data.recycle();
2652 reply.recycle();
2653 }
2654
2655 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
2656 throws RemoteException {
2657 Parcel data = Parcel.obtain();
2658 Parcel reply = Parcel.obtain();
2659 data.writeInterfaceToken(IActivityManager.descriptor);
2660 data.writeStrongBinder(token);
2661 intent.writeToParcel(data, 0);
2662 data.writeInt(doRebind ? 1 : 0);
2663 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
2664 reply.readException();
2665 data.recycle();
2666 reply.recycle();
2667 }
2668
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07002669 public void serviceDoneExecuting(IBinder token, int type, int startId,
2670 int res) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002671 Parcel data = Parcel.obtain();
2672 Parcel reply = Parcel.obtain();
2673 data.writeInterfaceToken(IActivityManager.descriptor);
2674 data.writeStrongBinder(token);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07002675 data.writeInt(type);
2676 data.writeInt(startId);
2677 data.writeInt(res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002678 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2679 reply.readException();
2680 data.recycle();
2681 reply.recycle();
2682 }
2683
2684 public IBinder peekService(Intent service, String resolvedType) throws RemoteException {
2685 Parcel data = Parcel.obtain();
2686 Parcel reply = Parcel.obtain();
2687 data.writeInterfaceToken(IActivityManager.descriptor);
2688 service.writeToParcel(data, 0);
2689 data.writeString(resolvedType);
2690 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
2691 reply.readException();
2692 IBinder binder = reply.readStrongBinder();
2693 reply.recycle();
2694 data.recycle();
2695 return binder;
2696 }
2697
Christopher Tate181fafa2009-05-14 11:12:14 -07002698 public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
2699 throws RemoteException {
2700 Parcel data = Parcel.obtain();
2701 Parcel reply = Parcel.obtain();
2702 data.writeInterfaceToken(IActivityManager.descriptor);
2703 app.writeToParcel(data, 0);
2704 data.writeInt(backupRestoreMode);
2705 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
2706 reply.readException();
2707 boolean success = reply.readInt() != 0;
2708 reply.recycle();
2709 data.recycle();
2710 return success;
2711 }
2712
2713 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
2714 Parcel data = Parcel.obtain();
2715 Parcel reply = Parcel.obtain();
2716 data.writeInterfaceToken(IActivityManager.descriptor);
2717 data.writeString(packageName);
2718 data.writeStrongBinder(agent);
2719 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
2720 reply.recycle();
2721 data.recycle();
2722 }
2723
2724 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
2725 Parcel data = Parcel.obtain();
2726 Parcel reply = Parcel.obtain();
2727 data.writeInterfaceToken(IActivityManager.descriptor);
2728 app.writeToParcel(data, 0);
2729 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
2730 reply.readException();
2731 reply.recycle();
2732 data.recycle();
2733 }
2734
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002735 public boolean startInstrumentation(ComponentName className, String profileFile,
2736 int flags, Bundle arguments, IInstrumentationWatcher watcher)
2737 throws RemoteException {
2738 Parcel data = Parcel.obtain();
2739 Parcel reply = Parcel.obtain();
2740 data.writeInterfaceToken(IActivityManager.descriptor);
2741 ComponentName.writeToParcel(className, data);
2742 data.writeString(profileFile);
2743 data.writeInt(flags);
2744 data.writeBundle(arguments);
2745 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
2746 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
2747 reply.readException();
2748 boolean res = reply.readInt() != 0;
2749 reply.recycle();
2750 data.recycle();
2751 return res;
2752 }
2753
2754 public void finishInstrumentation(IApplicationThread target,
2755 int resultCode, Bundle results) throws RemoteException {
2756 Parcel data = Parcel.obtain();
2757 Parcel reply = Parcel.obtain();
2758 data.writeInterfaceToken(IActivityManager.descriptor);
2759 data.writeStrongBinder(target != null ? target.asBinder() : null);
2760 data.writeInt(resultCode);
2761 data.writeBundle(results);
2762 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
2763 reply.readException();
2764 data.recycle();
2765 reply.recycle();
2766 }
2767 public Configuration getConfiguration() throws RemoteException
2768 {
2769 Parcel data = Parcel.obtain();
2770 Parcel reply = Parcel.obtain();
2771 data.writeInterfaceToken(IActivityManager.descriptor);
2772 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
2773 reply.readException();
2774 Configuration res = Configuration.CREATOR.createFromParcel(reply);
2775 reply.recycle();
2776 data.recycle();
2777 return res;
2778 }
2779 public void updateConfiguration(Configuration values) throws RemoteException
2780 {
2781 Parcel data = Parcel.obtain();
2782 Parcel reply = Parcel.obtain();
2783 data.writeInterfaceToken(IActivityManager.descriptor);
2784 values.writeToParcel(data, 0);
2785 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
2786 reply.readException();
2787 data.recycle();
2788 reply.recycle();
2789 }
2790 public void setRequestedOrientation(IBinder token, int requestedOrientation)
2791 throws RemoteException {
2792 Parcel data = Parcel.obtain();
2793 Parcel reply = Parcel.obtain();
2794 data.writeInterfaceToken(IActivityManager.descriptor);
2795 data.writeStrongBinder(token);
2796 data.writeInt(requestedOrientation);
2797 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
2798 reply.readException();
2799 data.recycle();
2800 reply.recycle();
2801 }
2802 public int getRequestedOrientation(IBinder token) throws RemoteException {
2803 Parcel data = Parcel.obtain();
2804 Parcel reply = Parcel.obtain();
2805 data.writeInterfaceToken(IActivityManager.descriptor);
2806 data.writeStrongBinder(token);
2807 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
2808 reply.readException();
2809 int res = reply.readInt();
2810 data.recycle();
2811 reply.recycle();
2812 return res;
2813 }
2814 public ComponentName getActivityClassForToken(IBinder token)
2815 throws RemoteException {
2816 Parcel data = Parcel.obtain();
2817 Parcel reply = Parcel.obtain();
2818 data.writeInterfaceToken(IActivityManager.descriptor);
2819 data.writeStrongBinder(token);
2820 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
2821 reply.readException();
2822 ComponentName res = ComponentName.readFromParcel(reply);
2823 data.recycle();
2824 reply.recycle();
2825 return res;
2826 }
2827 public String getPackageForToken(IBinder token) throws RemoteException
2828 {
2829 Parcel data = Parcel.obtain();
2830 Parcel reply = Parcel.obtain();
2831 data.writeInterfaceToken(IActivityManager.descriptor);
2832 data.writeStrongBinder(token);
2833 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
2834 reply.readException();
2835 String res = reply.readString();
2836 data.recycle();
2837 reply.recycle();
2838 return res;
2839 }
2840 public IIntentSender getIntentSender(int type,
2841 String packageName, IBinder token, String resultWho,
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07002842 int requestCode, Intent[] intents, String[] resolvedTypes, int flags,
2843 Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002844 Parcel data = Parcel.obtain();
2845 Parcel reply = Parcel.obtain();
2846 data.writeInterfaceToken(IActivityManager.descriptor);
2847 data.writeInt(type);
2848 data.writeString(packageName);
2849 data.writeStrongBinder(token);
2850 data.writeString(resultWho);
2851 data.writeInt(requestCode);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08002852 if (intents != null) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002853 data.writeInt(1);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08002854 data.writeTypedArray(intents, 0);
2855 data.writeStringArray(resolvedTypes);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002856 } else {
2857 data.writeInt(0);
2858 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002859 data.writeInt(flags);
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07002860 if (options != null) {
2861 data.writeInt(1);
2862 options.writeToParcel(data, 0);
2863 } else {
2864 data.writeInt(0);
2865 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002866 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
2867 reply.readException();
2868 IIntentSender res = IIntentSender.Stub.asInterface(
2869 reply.readStrongBinder());
2870 data.recycle();
2871 reply.recycle();
2872 return res;
2873 }
2874 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
2875 Parcel data = Parcel.obtain();
2876 Parcel reply = Parcel.obtain();
2877 data.writeInterfaceToken(IActivityManager.descriptor);
2878 data.writeStrongBinder(sender.asBinder());
2879 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
2880 reply.readException();
2881 data.recycle();
2882 reply.recycle();
2883 }
2884 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
2885 Parcel data = Parcel.obtain();
2886 Parcel reply = Parcel.obtain();
2887 data.writeInterfaceToken(IActivityManager.descriptor);
2888 data.writeStrongBinder(sender.asBinder());
2889 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
2890 reply.readException();
2891 String res = reply.readString();
2892 data.recycle();
2893 reply.recycle();
2894 return res;
2895 }
Christopher Tatec4a07d12012-04-06 14:19:13 -07002896 public int getUidForIntentSender(IIntentSender sender) throws RemoteException {
2897 Parcel data = Parcel.obtain();
2898 Parcel reply = Parcel.obtain();
2899 data.writeInterfaceToken(IActivityManager.descriptor);
2900 data.writeStrongBinder(sender.asBinder());
2901 mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
2902 reply.readException();
2903 int res = reply.readInt();
2904 data.recycle();
2905 reply.recycle();
2906 return res;
2907 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002908 public void setProcessLimit(int max) throws RemoteException
2909 {
2910 Parcel data = Parcel.obtain();
2911 Parcel reply = Parcel.obtain();
2912 data.writeInterfaceToken(IActivityManager.descriptor);
2913 data.writeInt(max);
2914 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
2915 reply.readException();
2916 data.recycle();
2917 reply.recycle();
2918 }
2919 public int getProcessLimit() throws RemoteException
2920 {
2921 Parcel data = Parcel.obtain();
2922 Parcel reply = Parcel.obtain();
2923 data.writeInterfaceToken(IActivityManager.descriptor);
2924 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
2925 reply.readException();
2926 int res = reply.readInt();
2927 data.recycle();
2928 reply.recycle();
2929 return res;
2930 }
2931 public void setProcessForeground(IBinder token, int pid,
2932 boolean isForeground) throws RemoteException {
2933 Parcel data = Parcel.obtain();
2934 Parcel reply = Parcel.obtain();
2935 data.writeInterfaceToken(IActivityManager.descriptor);
2936 data.writeStrongBinder(token);
2937 data.writeInt(pid);
2938 data.writeInt(isForeground ? 1 : 0);
2939 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
2940 reply.readException();
2941 data.recycle();
2942 reply.recycle();
2943 }
2944 public int checkPermission(String permission, int pid, int uid)
2945 throws RemoteException {
2946 Parcel data = Parcel.obtain();
2947 Parcel reply = Parcel.obtain();
2948 data.writeInterfaceToken(IActivityManager.descriptor);
2949 data.writeString(permission);
2950 data.writeInt(pid);
2951 data.writeInt(uid);
2952 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
2953 reply.readException();
2954 int res = reply.readInt();
2955 data.recycle();
2956 reply.recycle();
2957 return res;
2958 }
2959 public boolean clearApplicationUserData(final String packageName,
Amith Yamasani742a6712011-05-04 14:49:28 -07002960 final IPackageDataObserver observer, final int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002961 Parcel data = Parcel.obtain();
2962 Parcel reply = Parcel.obtain();
2963 data.writeInterfaceToken(IActivityManager.descriptor);
2964 data.writeString(packageName);
2965 data.writeStrongBinder(observer.asBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -07002966 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002967 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
2968 reply.readException();
2969 boolean res = reply.readInt() != 0;
2970 data.recycle();
2971 reply.recycle();
2972 return res;
2973 }
2974 public int checkUriPermission(Uri uri, int pid, int uid, int mode)
2975 throws RemoteException {
2976 Parcel data = Parcel.obtain();
2977 Parcel reply = Parcel.obtain();
2978 data.writeInterfaceToken(IActivityManager.descriptor);
2979 uri.writeToParcel(data, 0);
2980 data.writeInt(pid);
2981 data.writeInt(uid);
2982 data.writeInt(mode);
2983 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
2984 reply.readException();
2985 int res = reply.readInt();
2986 data.recycle();
2987 reply.recycle();
2988 return res;
2989 }
2990 public void grantUriPermission(IApplicationThread caller, String targetPkg,
2991 Uri uri, int mode) throws RemoteException {
2992 Parcel data = Parcel.obtain();
2993 Parcel reply = Parcel.obtain();
2994 data.writeInterfaceToken(IActivityManager.descriptor);
2995 data.writeStrongBinder(caller.asBinder());
2996 data.writeString(targetPkg);
2997 uri.writeToParcel(data, 0);
2998 data.writeInt(mode);
2999 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
3000 reply.readException();
3001 data.recycle();
3002 reply.recycle();
3003 }
3004 public void revokeUriPermission(IApplicationThread caller, Uri uri,
3005 int mode) throws RemoteException {
3006 Parcel data = Parcel.obtain();
3007 Parcel reply = Parcel.obtain();
3008 data.writeInterfaceToken(IActivityManager.descriptor);
3009 data.writeStrongBinder(caller.asBinder());
3010 uri.writeToParcel(data, 0);
3011 data.writeInt(mode);
3012 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
3013 reply.readException();
3014 data.recycle();
3015 reply.recycle();
3016 }
3017 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
3018 throws RemoteException {
3019 Parcel data = Parcel.obtain();
3020 Parcel reply = Parcel.obtain();
3021 data.writeInterfaceToken(IActivityManager.descriptor);
3022 data.writeStrongBinder(who.asBinder());
3023 data.writeInt(waiting ? 1 : 0);
3024 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
3025 reply.readException();
3026 data.recycle();
3027 reply.recycle();
3028 }
3029 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
3030 Parcel data = Parcel.obtain();
3031 Parcel reply = Parcel.obtain();
3032 data.writeInterfaceToken(IActivityManager.descriptor);
3033 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
3034 reply.readException();
3035 outInfo.readFromParcel(reply);
3036 data.recycle();
3037 reply.recycle();
3038 }
3039 public void unhandledBack() throws RemoteException
3040 {
3041 Parcel data = Parcel.obtain();
3042 Parcel reply = Parcel.obtain();
3043 data.writeInterfaceToken(IActivityManager.descriptor);
3044 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
3045 reply.readException();
3046 data.recycle();
3047 reply.recycle();
3048 }
3049 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
3050 {
3051 Parcel data = Parcel.obtain();
3052 Parcel reply = Parcel.obtain();
3053 data.writeInterfaceToken(IActivityManager.descriptor);
3054 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
3055 reply.readException();
3056 ParcelFileDescriptor pfd = null;
3057 if (reply.readInt() != 0) {
3058 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
3059 }
3060 data.recycle();
3061 reply.recycle();
3062 return pfd;
3063 }
3064 public void goingToSleep() throws RemoteException
3065 {
3066 Parcel data = Parcel.obtain();
3067 Parcel reply = Parcel.obtain();
3068 data.writeInterfaceToken(IActivityManager.descriptor);
3069 mRemote.transact(GOING_TO_SLEEP_TRANSACTION, data, reply, 0);
3070 reply.readException();
3071 data.recycle();
3072 reply.recycle();
3073 }
3074 public void wakingUp() throws RemoteException
3075 {
3076 Parcel data = Parcel.obtain();
3077 Parcel reply = Parcel.obtain();
3078 data.writeInterfaceToken(IActivityManager.descriptor);
3079 mRemote.transact(WAKING_UP_TRANSACTION, data, reply, 0);
3080 reply.readException();
3081 data.recycle();
3082 reply.recycle();
3083 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07003084 public void setLockScreenShown(boolean shown) throws RemoteException
3085 {
3086 Parcel data = Parcel.obtain();
3087 Parcel reply = Parcel.obtain();
3088 data.writeInterfaceToken(IActivityManager.descriptor);
3089 data.writeInt(shown ? 1 : 0);
3090 mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0);
3091 reply.readException();
3092 data.recycle();
3093 reply.recycle();
3094 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003095 public void setDebugApp(
3096 String packageName, boolean waitForDebugger, boolean persistent)
3097 throws RemoteException
3098 {
3099 Parcel data = Parcel.obtain();
3100 Parcel reply = Parcel.obtain();
3101 data.writeInterfaceToken(IActivityManager.descriptor);
3102 data.writeString(packageName);
3103 data.writeInt(waitForDebugger ? 1 : 0);
3104 data.writeInt(persistent ? 1 : 0);
3105 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
3106 reply.readException();
3107 data.recycle();
3108 reply.recycle();
3109 }
3110 public void setAlwaysFinish(boolean enabled) throws RemoteException
3111 {
3112 Parcel data = Parcel.obtain();
3113 Parcel reply = Parcel.obtain();
3114 data.writeInterfaceToken(IActivityManager.descriptor);
3115 data.writeInt(enabled ? 1 : 0);
3116 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
3117 reply.readException();
3118 data.recycle();
3119 reply.recycle();
3120 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07003121 public void setActivityController(IActivityController watcher) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003122 {
3123 Parcel data = Parcel.obtain();
3124 Parcel reply = Parcel.obtain();
3125 data.writeInterfaceToken(IActivityManager.descriptor);
3126 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07003127 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003128 reply.readException();
3129 data.recycle();
3130 reply.recycle();
3131 }
3132 public void enterSafeMode() throws RemoteException {
3133 Parcel data = Parcel.obtain();
3134 data.writeInterfaceToken(IActivityManager.descriptor);
3135 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
3136 data.recycle();
3137 }
3138 public void noteWakeupAlarm(IIntentSender sender) throws RemoteException {
3139 Parcel data = Parcel.obtain();
3140 data.writeStrongBinder(sender.asBinder());
3141 data.writeInterfaceToken(IActivityManager.descriptor);
3142 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
3143 data.recycle();
3144 }
Dianne Hackborn64825172011-03-02 21:32:58 -08003145 public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003146 Parcel data = Parcel.obtain();
3147 Parcel reply = Parcel.obtain();
3148 data.writeInterfaceToken(IActivityManager.descriptor);
3149 data.writeIntArray(pids);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07003150 data.writeString(reason);
Dianne Hackborn64825172011-03-02 21:32:58 -08003151 data.writeInt(secure ? 1 : 0);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07003152 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003153 boolean res = reply.readInt() != 0;
3154 data.recycle();
3155 reply.recycle();
3156 return res;
3157 }
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07003158 @Override
3159 public boolean killProcessesBelowForeground(String reason) throws RemoteException {
3160 Parcel data = Parcel.obtain();
3161 Parcel reply = Parcel.obtain();
3162 data.writeInterfaceToken(IActivityManager.descriptor);
3163 data.writeString(reason);
3164 mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0);
3165 boolean res = reply.readInt() != 0;
3166 data.recycle();
3167 reply.recycle();
3168 return res;
3169 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003170 public void startRunning(String pkg, String cls, String action,
3171 String indata) throws RemoteException {
3172 Parcel data = Parcel.obtain();
3173 Parcel reply = Parcel.obtain();
3174 data.writeInterfaceToken(IActivityManager.descriptor);
3175 data.writeString(pkg);
3176 data.writeString(cls);
3177 data.writeString(action);
3178 data.writeString(indata);
3179 mRemote.transact(START_RUNNING_TRANSACTION, data, reply, 0);
3180 reply.readException();
3181 data.recycle();
3182 reply.recycle();
3183 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003184 public boolean testIsSystemReady()
3185 {
3186 /* this base class version is never called */
3187 return true;
3188 }
Dan Egnor60d87622009-12-16 16:32:58 -08003189 public void handleApplicationCrash(IBinder app,
3190 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
3191 {
3192 Parcel data = Parcel.obtain();
3193 Parcel reply = Parcel.obtain();
3194 data.writeInterfaceToken(IActivityManager.descriptor);
3195 data.writeStrongBinder(app);
3196 crashInfo.writeToParcel(data, 0);
3197 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
3198 reply.readException();
3199 reply.recycle();
3200 data.recycle();
3201 }
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07003202
Dan Egnor60d87622009-12-16 16:32:58 -08003203 public boolean handleApplicationWtf(IBinder app, String tag,
Dan Egnorb7f03672009-12-09 16:22:32 -08003204 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003205 {
3206 Parcel data = Parcel.obtain();
3207 Parcel reply = Parcel.obtain();
3208 data.writeInterfaceToken(IActivityManager.descriptor);
3209 data.writeStrongBinder(app);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003210 data.writeString(tag);
Dan Egnorb7f03672009-12-09 16:22:32 -08003211 crashInfo.writeToParcel(data, 0);
Dan Egnor60d87622009-12-16 16:32:58 -08003212 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003213 reply.readException();
Dan Egnor60d87622009-12-16 16:32:58 -08003214 boolean res = reply.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003215 reply.recycle();
3216 data.recycle();
Dan Egnor60d87622009-12-16 16:32:58 -08003217 return res;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003218 }
Dan Egnorb7f03672009-12-09 16:22:32 -08003219
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07003220 public void handleApplicationStrictModeViolation(IBinder app,
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07003221 int violationMask,
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07003222 StrictMode.ViolationInfo info) throws RemoteException
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07003223 {
3224 Parcel data = Parcel.obtain();
3225 Parcel reply = Parcel.obtain();
3226 data.writeInterfaceToken(IActivityManager.descriptor);
3227 data.writeStrongBinder(app);
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07003228 data.writeInt(violationMask);
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07003229 info.writeToParcel(data, 0);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07003230 mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0);
3231 reply.readException();
3232 reply.recycle();
3233 data.recycle();
3234 }
3235
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003236 public void signalPersistentProcesses(int sig) throws RemoteException {
3237 Parcel data = Parcel.obtain();
3238 Parcel reply = Parcel.obtain();
3239 data.writeInterfaceToken(IActivityManager.descriptor);
3240 data.writeInt(sig);
3241 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
3242 reply.readException();
3243 data.recycle();
3244 reply.recycle();
3245 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08003246
Dianne Hackborn03abb812010-01-04 18:43:19 -08003247 public void killBackgroundProcesses(String packageName) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003248 Parcel data = Parcel.obtain();
3249 Parcel reply = Parcel.obtain();
3250 data.writeInterfaceToken(IActivityManager.descriptor);
3251 data.writeString(packageName);
Dianne Hackborn03abb812010-01-04 18:43:19 -08003252 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
3253 reply.readException();
3254 data.recycle();
3255 reply.recycle();
3256 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08003257
3258 public void killAllBackgroundProcesses() throws RemoteException {
3259 Parcel data = Parcel.obtain();
3260 Parcel reply = Parcel.obtain();
3261 data.writeInterfaceToken(IActivityManager.descriptor);
3262 mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
3263 reply.readException();
3264 data.recycle();
3265 reply.recycle();
3266 }
3267
Dianne Hackborn03abb812010-01-04 18:43:19 -08003268 public void forceStopPackage(String packageName) throws RemoteException {
3269 Parcel data = Parcel.obtain();
3270 Parcel reply = Parcel.obtain();
3271 data.writeInterfaceToken(IActivityManager.descriptor);
3272 data.writeString(packageName);
3273 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003274 reply.readException();
3275 data.recycle();
3276 reply.recycle();
3277 }
3278
Dianne Hackborn27ff9132012-03-06 14:57:58 -08003279 public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
3280 throws RemoteException
3281 {
3282 Parcel data = Parcel.obtain();
3283 Parcel reply = Parcel.obtain();
3284 data.writeInterfaceToken(IActivityManager.descriptor);
3285 mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0);
3286 reply.readException();
3287 outInfo.readFromParcel(reply);
3288 reply.recycle();
3289 data.recycle();
3290 }
3291
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003292 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
3293 {
3294 Parcel data = Parcel.obtain();
3295 Parcel reply = Parcel.obtain();
3296 data.writeInterfaceToken(IActivityManager.descriptor);
3297 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
3298 reply.readException();
3299 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
3300 reply.recycle();
3301 data.recycle();
3302 return res;
3303 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003304
3305 public boolean profileControl(String process, boolean start,
Romain Guy7eabe552011-07-21 14:56:34 -07003306 String path, ParcelFileDescriptor fd, int profileType) throws RemoteException
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003307 {
3308 Parcel data = Parcel.obtain();
3309 Parcel reply = Parcel.obtain();
3310 data.writeInterfaceToken(IActivityManager.descriptor);
3311 data.writeString(process);
3312 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07003313 data.writeInt(profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003314 data.writeString(path);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07003315 if (fd != null) {
3316 data.writeInt(1);
3317 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
3318 } else {
3319 data.writeInt(0);
3320 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003321 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
3322 reply.readException();
3323 boolean res = reply.readInt() != 0;
3324 reply.recycle();
3325 data.recycle();
3326 return res;
3327 }
3328
Dianne Hackborn55280a92009-05-07 15:53:46 -07003329 public boolean shutdown(int timeout) throws RemoteException
3330 {
3331 Parcel data = Parcel.obtain();
3332 Parcel reply = Parcel.obtain();
3333 data.writeInterfaceToken(IActivityManager.descriptor);
3334 data.writeInt(timeout);
3335 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
3336 reply.readException();
3337 boolean res = reply.readInt() != 0;
3338 reply.recycle();
3339 data.recycle();
3340 return res;
3341 }
3342
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07003343 public void stopAppSwitches() throws RemoteException {
3344 Parcel data = Parcel.obtain();
3345 Parcel reply = Parcel.obtain();
3346 data.writeInterfaceToken(IActivityManager.descriptor);
3347 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
3348 reply.readException();
3349 reply.recycle();
3350 data.recycle();
3351 }
3352
3353 public void resumeAppSwitches() throws RemoteException {
3354 Parcel data = Parcel.obtain();
3355 Parcel reply = Parcel.obtain();
3356 data.writeInterfaceToken(IActivityManager.descriptor);
3357 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
3358 reply.readException();
3359 reply.recycle();
3360 data.recycle();
3361 }
3362
Dianne Hackborn2d91af02009-07-16 13:34:33 -07003363 public int startActivityInPackage(int uid,
3364 Intent intent, String resolvedType, IBinder resultTo,
Dianne Hackborna4972e92012-03-14 10:38:05 -07003365 String resultWho, int requestCode, int startFlags, Bundle options)
Dianne Hackborn2d91af02009-07-16 13:34:33 -07003366 throws RemoteException {
3367 Parcel data = Parcel.obtain();
3368 Parcel reply = Parcel.obtain();
3369 data.writeInterfaceToken(IActivityManager.descriptor);
3370 data.writeInt(uid);
3371 intent.writeToParcel(data, 0);
3372 data.writeString(resolvedType);
3373 data.writeStrongBinder(resultTo);
3374 data.writeString(resultWho);
3375 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07003376 data.writeInt(startFlags);
3377 if (options != null) {
3378 data.writeInt(1);
3379 options.writeToParcel(data, 0);
3380 } else {
3381 data.writeInt(0);
3382 }
Dianne Hackborn2d91af02009-07-16 13:34:33 -07003383 mRemote.transact(START_ACTIVITY_IN_PACKAGE_TRANSACTION, data, reply, 0);
3384 reply.readException();
3385 int result = reply.readInt();
3386 reply.recycle();
3387 data.recycle();
3388 return result;
3389 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07003390
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07003391 public void killApplicationWithUid(String pkg, int uid) throws RemoteException {
3392 Parcel data = Parcel.obtain();
3393 Parcel reply = Parcel.obtain();
3394 data.writeInterfaceToken(IActivityManager.descriptor);
3395 data.writeString(pkg);
3396 data.writeInt(uid);
3397 mRemote.transact(KILL_APPLICATION_WITH_UID_TRANSACTION, data, reply, 0);
3398 reply.readException();
3399 data.recycle();
3400 reply.recycle();
3401 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07003402
3403 public void closeSystemDialogs(String reason) throws RemoteException {
3404 Parcel data = Parcel.obtain();
3405 Parcel reply = Parcel.obtain();
3406 data.writeInterfaceToken(IActivityManager.descriptor);
3407 data.writeString(reason);
3408 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
3409 reply.readException();
3410 data.recycle();
3411 reply.recycle();
3412 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003413
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07003414 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003415 throws RemoteException {
3416 Parcel data = Parcel.obtain();
3417 Parcel reply = Parcel.obtain();
3418 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07003419 data.writeIntArray(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003420 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
3421 reply.readException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07003422 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003423 data.recycle();
3424 reply.recycle();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07003425 return res;
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003426 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07003427
3428 public void killApplicationProcess(String processName, int uid) throws RemoteException {
3429 Parcel data = Parcel.obtain();
3430 Parcel reply = Parcel.obtain();
3431 data.writeInterfaceToken(IActivityManager.descriptor);
3432 data.writeString(processName);
3433 data.writeInt(uid);
3434 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
3435 reply.readException();
3436 data.recycle();
3437 reply.recycle();
3438 }
3439
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07003440 public void overridePendingTransition(IBinder token, String packageName,
3441 int enterAnim, int exitAnim) throws RemoteException {
3442 Parcel data = Parcel.obtain();
3443 Parcel reply = Parcel.obtain();
3444 data.writeInterfaceToken(IActivityManager.descriptor);
3445 data.writeStrongBinder(token);
3446 data.writeString(packageName);
3447 data.writeInt(enterAnim);
3448 data.writeInt(exitAnim);
3449 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
3450 reply.readException();
3451 data.recycle();
3452 reply.recycle();
3453 }
3454
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08003455 public boolean isUserAMonkey() throws RemoteException {
3456 Parcel data = Parcel.obtain();
3457 Parcel reply = Parcel.obtain();
3458 data.writeInterfaceToken(IActivityManager.descriptor);
3459 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
3460 reply.readException();
3461 boolean res = reply.readInt() != 0;
3462 data.recycle();
3463 reply.recycle();
3464 return res;
3465 }
3466
Dianne Hackborn860755f2010-06-03 18:47:52 -07003467 public void finishHeavyWeightApp() throws RemoteException {
3468 Parcel data = Parcel.obtain();
3469 Parcel reply = Parcel.obtain();
3470 data.writeInterfaceToken(IActivityManager.descriptor);
3471 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
3472 reply.readException();
3473 data.recycle();
3474 reply.recycle();
3475 }
3476
Daniel Sandler69a48172010-06-23 16:29:36 -04003477 public void setImmersive(IBinder token, boolean immersive)
3478 throws RemoteException {
3479 Parcel data = Parcel.obtain();
3480 Parcel reply = Parcel.obtain();
3481 data.writeInterfaceToken(IActivityManager.descriptor);
3482 data.writeStrongBinder(token);
3483 data.writeInt(immersive ? 1 : 0);
3484 mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
3485 reply.readException();
3486 data.recycle();
3487 reply.recycle();
3488 }
3489
3490 public boolean isImmersive(IBinder token)
3491 throws RemoteException {
3492 Parcel data = Parcel.obtain();
3493 Parcel reply = Parcel.obtain();
3494 data.writeInterfaceToken(IActivityManager.descriptor);
3495 data.writeStrongBinder(token);
3496 mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04003497 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07003498 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04003499 data.recycle();
3500 reply.recycle();
3501 return res;
3502 }
3503
3504 public boolean isTopActivityImmersive()
3505 throws RemoteException {
3506 Parcel data = Parcel.obtain();
3507 Parcel reply = Parcel.obtain();
3508 data.writeInterfaceToken(IActivityManager.descriptor);
3509 mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04003510 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07003511 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04003512 data.recycle();
3513 reply.recycle();
3514 return res;
3515 }
3516
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07003517 public void crashApplication(int uid, int initialPid, String packageName,
3518 String message) throws RemoteException {
3519 Parcel data = Parcel.obtain();
3520 Parcel reply = Parcel.obtain();
3521 data.writeInterfaceToken(IActivityManager.descriptor);
3522 data.writeInt(uid);
3523 data.writeInt(initialPid);
3524 data.writeString(packageName);
3525 data.writeString(message);
3526 mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0);
3527 reply.readException();
3528 data.recycle();
3529 reply.recycle();
3530 }
Andy McFadden824c5102010-07-09 16:26:57 -07003531
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07003532 public String getProviderMimeType(Uri uri)
3533 throws RemoteException {
3534 Parcel data = Parcel.obtain();
3535 Parcel reply = Parcel.obtain();
3536 data.writeInterfaceToken(IActivityManager.descriptor);
3537 uri.writeToParcel(data, 0);
3538 mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0);
3539 reply.readException();
3540 String res = reply.readString();
3541 data.recycle();
3542 reply.recycle();
3543 return res;
3544 }
3545
Dianne Hackborn7e269642010-08-25 19:50:20 -07003546 public IBinder newUriPermissionOwner(String name)
3547 throws RemoteException {
3548 Parcel data = Parcel.obtain();
3549 Parcel reply = Parcel.obtain();
3550 data.writeInterfaceToken(IActivityManager.descriptor);
3551 data.writeString(name);
3552 mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
3553 reply.readException();
3554 IBinder res = reply.readStrongBinder();
3555 data.recycle();
3556 reply.recycle();
3557 return res;
3558 }
3559
3560 public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
3561 Uri uri, int mode) throws RemoteException {
3562 Parcel data = Parcel.obtain();
3563 Parcel reply = Parcel.obtain();
3564 data.writeInterfaceToken(IActivityManager.descriptor);
3565 data.writeStrongBinder(owner);
3566 data.writeInt(fromUid);
3567 data.writeString(targetPkg);
3568 uri.writeToParcel(data, 0);
3569 data.writeInt(mode);
3570 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
3571 reply.readException();
3572 data.recycle();
3573 reply.recycle();
3574 }
3575
3576 public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
3577 int mode) throws RemoteException {
3578 Parcel data = Parcel.obtain();
3579 Parcel reply = Parcel.obtain();
3580 data.writeInterfaceToken(IActivityManager.descriptor);
3581 data.writeStrongBinder(owner);
3582 if (uri != null) {
3583 data.writeInt(1);
3584 uri.writeToParcel(data, 0);
3585 } else {
3586 data.writeInt(0);
3587 }
3588 data.writeInt(mode);
3589 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
3590 reply.readException();
3591 data.recycle();
3592 reply.recycle();
3593 }
Dianne Hackbornc8f84972010-08-25 23:14:44 -07003594
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07003595 public int checkGrantUriPermission(int callingUid, String targetPkg,
3596 Uri uri, int modeFlags) throws RemoteException {
3597 Parcel data = Parcel.obtain();
3598 Parcel reply = Parcel.obtain();
3599 data.writeInterfaceToken(IActivityManager.descriptor);
3600 data.writeInt(callingUid);
3601 data.writeString(targetPkg);
3602 uri.writeToParcel(data, 0);
3603 data.writeInt(modeFlags);
3604 mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
3605 reply.readException();
3606 int res = reply.readInt();
3607 data.recycle();
3608 reply.recycle();
3609 return res;
3610 }
3611
Andy McFadden824c5102010-07-09 16:26:57 -07003612 public boolean dumpHeap(String process, boolean managed,
3613 String path, ParcelFileDescriptor fd) throws RemoteException {
3614 Parcel data = Parcel.obtain();
3615 Parcel reply = Parcel.obtain();
3616 data.writeInterfaceToken(IActivityManager.descriptor);
3617 data.writeString(process);
3618 data.writeInt(managed ? 1 : 0);
3619 data.writeString(path);
3620 if (fd != null) {
3621 data.writeInt(1);
3622 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
3623 } else {
3624 data.writeInt(0);
3625 }
3626 mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
3627 reply.readException();
3628 boolean res = reply.readInt() != 0;
3629 reply.recycle();
3630 data.recycle();
3631 return res;
3632 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07003633
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003634 public int startActivities(IApplicationThread caller,
Dianne Hackborna4972e92012-03-14 10:38:05 -07003635 Intent[] intents, String[] resolvedTypes, IBinder resultTo,
3636 Bundle options) throws RemoteException {
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003637 Parcel data = Parcel.obtain();
3638 Parcel reply = Parcel.obtain();
3639 data.writeInterfaceToken(IActivityManager.descriptor);
3640 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3641 data.writeTypedArray(intents, 0);
3642 data.writeStringArray(resolvedTypes);
3643 data.writeStrongBinder(resultTo);
Dianne Hackborna4972e92012-03-14 10:38:05 -07003644 if (options != null) {
3645 data.writeInt(1);
3646 options.writeToParcel(data, 0);
3647 } else {
3648 data.writeInt(0);
3649 }
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003650 mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0);
3651 reply.readException();
3652 int result = reply.readInt();
3653 reply.recycle();
3654 data.recycle();
3655 return result;
3656 }
3657
3658 public int startActivitiesInPackage(int uid,
Dianne Hackborna4972e92012-03-14 10:38:05 -07003659 Intent[] intents, String[] resolvedTypes, IBinder resultTo,
3660 Bundle options) throws RemoteException {
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003661 Parcel data = Parcel.obtain();
3662 Parcel reply = Parcel.obtain();
3663 data.writeInterfaceToken(IActivityManager.descriptor);
3664 data.writeInt(uid);
3665 data.writeTypedArray(intents, 0);
3666 data.writeStringArray(resolvedTypes);
3667 data.writeStrongBinder(resultTo);
Dianne Hackborna4972e92012-03-14 10:38:05 -07003668 if (options != null) {
3669 data.writeInt(1);
3670 options.writeToParcel(data, 0);
3671 } else {
3672 data.writeInt(0);
3673 }
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003674 mRemote.transact(START_ACTIVITIES_IN_PACKAGE_TRANSACTION, data, reply, 0);
3675 reply.readException();
3676 int result = reply.readInt();
3677 reply.recycle();
3678 data.recycle();
3679 return result;
3680 }
3681
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07003682 public int getFrontActivityScreenCompatMode() throws RemoteException {
3683 Parcel data = Parcel.obtain();
3684 Parcel reply = Parcel.obtain();
3685 data.writeInterfaceToken(IActivityManager.descriptor);
3686 mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
3687 reply.readException();
3688 int mode = reply.readInt();
3689 reply.recycle();
3690 data.recycle();
3691 return mode;
3692 }
3693
3694 public void setFrontActivityScreenCompatMode(int mode) throws RemoteException {
3695 Parcel data = Parcel.obtain();
3696 Parcel reply = Parcel.obtain();
3697 data.writeInterfaceToken(IActivityManager.descriptor);
3698 data.writeInt(mode);
3699 mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
3700 reply.readException();
3701 reply.recycle();
3702 data.recycle();
3703 }
3704
3705 public int getPackageScreenCompatMode(String packageName) throws RemoteException {
3706 Parcel data = Parcel.obtain();
3707 Parcel reply = Parcel.obtain();
3708 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07003709 data.writeString(packageName);
3710 mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07003711 reply.readException();
3712 int mode = reply.readInt();
3713 reply.recycle();
3714 data.recycle();
3715 return mode;
3716 }
3717
3718 public void setPackageScreenCompatMode(String packageName, int mode)
Dianne Hackborne2515ee2011-04-27 18:52:56 -04003719 throws RemoteException {
3720 Parcel data = Parcel.obtain();
3721 Parcel reply = Parcel.obtain();
3722 data.writeInterfaceToken(IActivityManager.descriptor);
3723 data.writeString(packageName);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07003724 data.writeInt(mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04003725 mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
3726 reply.readException();
3727 reply.recycle();
3728 data.recycle();
3729 }
3730
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07003731 public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
3732 Parcel data = Parcel.obtain();
3733 Parcel reply = Parcel.obtain();
3734 data.writeInterfaceToken(IActivityManager.descriptor);
3735 data.writeString(packageName);
3736 mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
3737 reply.readException();
3738 boolean ask = reply.readInt() != 0;
3739 reply.recycle();
3740 data.recycle();
3741 return ask;
3742 }
3743
3744 public void setPackageAskScreenCompat(String packageName, boolean ask)
3745 throws RemoteException {
3746 Parcel data = Parcel.obtain();
3747 Parcel reply = Parcel.obtain();
3748 data.writeInterfaceToken(IActivityManager.descriptor);
3749 data.writeString(packageName);
3750 data.writeInt(ask ? 1 : 0);
3751 mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
3752 reply.readException();
3753 reply.recycle();
3754 data.recycle();
3755 }
3756
Amith Yamasani4b2e9342011-03-31 12:38:53 -07003757 public boolean switchUser(int userid) throws RemoteException {
3758 Parcel data = Parcel.obtain();
3759 Parcel reply = Parcel.obtain();
3760 data.writeInterfaceToken(IActivityManager.descriptor);
3761 data.writeInt(userid);
3762 mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0);
3763 reply.readException();
3764 boolean result = reply.readInt() != 0;
3765 reply.recycle();
3766 data.recycle();
3767 return result;
3768 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07003769
Dianne Hackborn80a4af22012-08-27 19:18:31 -07003770 public int stopUser(int userid, IStopUserCallback callback) throws RemoteException {
3771 Parcel data = Parcel.obtain();
3772 Parcel reply = Parcel.obtain();
3773 data.writeInterfaceToken(IActivityManager.descriptor);
3774 data.writeInt(userid);
3775 data.writeStrongInterface(callback);
3776 mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0);
3777 reply.readException();
3778 int result = reply.readInt();
3779 reply.recycle();
3780 data.recycle();
3781 return result;
3782 }
3783
Amith Yamasani52f1d752012-03-28 18:19:29 -07003784 public UserInfo getCurrentUser() throws RemoteException {
3785 Parcel data = Parcel.obtain();
3786 Parcel reply = Parcel.obtain();
3787 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn80a4af22012-08-27 19:18:31 -07003788 mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0);
Amith Yamasani52f1d752012-03-28 18:19:29 -07003789 reply.readException();
3790 UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply);
3791 reply.recycle();
3792 data.recycle();
3793 return userInfo;
3794 }
3795
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07003796 public boolean removeSubTask(int taskId, int subTaskIndex) throws RemoteException {
3797 Parcel data = Parcel.obtain();
3798 Parcel reply = Parcel.obtain();
3799 data.writeInterfaceToken(IActivityManager.descriptor);
3800 data.writeInt(taskId);
3801 data.writeInt(subTaskIndex);
3802 mRemote.transact(REMOVE_SUB_TASK_TRANSACTION, data, reply, 0);
3803 reply.readException();
3804 boolean result = reply.readInt() != 0;
3805 reply.recycle();
3806 data.recycle();
3807 return result;
3808 }
3809
3810 public boolean removeTask(int taskId, int flags) throws RemoteException {
3811 Parcel data = Parcel.obtain();
3812 Parcel reply = Parcel.obtain();
3813 data.writeInterfaceToken(IActivityManager.descriptor);
3814 data.writeInt(taskId);
3815 data.writeInt(flags);
3816 mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
3817 reply.readException();
3818 boolean result = reply.readInt() != 0;
3819 reply.recycle();
3820 data.recycle();
3821 return result;
3822 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07003823
Jeff Sharkeya4620792011-05-20 15:29:23 -07003824 public void registerProcessObserver(IProcessObserver observer) throws RemoteException {
3825 Parcel data = Parcel.obtain();
3826 Parcel reply = Parcel.obtain();
3827 data.writeInterfaceToken(IActivityManager.descriptor);
3828 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
3829 mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
3830 reply.readException();
3831 data.recycle();
3832 reply.recycle();
3833 }
3834
3835 public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException {
3836 Parcel data = Parcel.obtain();
3837 Parcel reply = Parcel.obtain();
3838 data.writeInterfaceToken(IActivityManager.descriptor);
3839 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
3840 mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
3841 reply.readException();
3842 data.recycle();
3843 reply.recycle();
3844 }
3845
Dianne Hackborn6c418d52011-06-29 14:05:33 -07003846 public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException {
3847 Parcel data = Parcel.obtain();
3848 Parcel reply = Parcel.obtain();
3849 data.writeInterfaceToken(IActivityManager.descriptor);
3850 data.writeStrongBinder(sender.asBinder());
3851 mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0);
3852 reply.readException();
3853 boolean res = reply.readInt() != 0;
3854 data.recycle();
3855 reply.recycle();
3856 return res;
3857 }
3858
Dianne Hackborn1927ae82012-06-22 15:21:36 -07003859 public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException {
3860 Parcel data = Parcel.obtain();
3861 Parcel reply = Parcel.obtain();
3862 data.writeInterfaceToken(IActivityManager.descriptor);
3863 data.writeStrongBinder(sender.asBinder());
3864 mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0);
3865 reply.readException();
3866 boolean res = reply.readInt() != 0;
3867 data.recycle();
3868 reply.recycle();
3869 return res;
3870 }
3871
Dianne Hackborn31ca8542011-07-19 14:58:28 -07003872 public void updatePersistentConfiguration(Configuration values) throws RemoteException
3873 {
3874 Parcel data = Parcel.obtain();
3875 Parcel reply = Parcel.obtain();
3876 data.writeInterfaceToken(IActivityManager.descriptor);
3877 values.writeToParcel(data, 0);
3878 mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0);
3879 reply.readException();
3880 data.recycle();
3881 reply.recycle();
3882 }
3883
Dianne Hackbornb437e092011-08-05 17:50:29 -07003884 public long[] getProcessPss(int[] pids) throws RemoteException {
3885 Parcel data = Parcel.obtain();
3886 Parcel reply = Parcel.obtain();
3887 data.writeInterfaceToken(IActivityManager.descriptor);
3888 data.writeIntArray(pids);
3889 mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0);
3890 reply.readException();
3891 long[] res = reply.createLongArray();
3892 data.recycle();
3893 reply.recycle();
3894 return res;
3895 }
3896
Dianne Hackborn661cd522011-08-22 00:26:20 -07003897 public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
3898 Parcel data = Parcel.obtain();
3899 Parcel reply = Parcel.obtain();
3900 data.writeInterfaceToken(IActivityManager.descriptor);
3901 TextUtils.writeToParcel(msg, data, 0);
3902 data.writeInt(always ? 1 : 0);
3903 mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
3904 reply.readException();
3905 data.recycle();
3906 reply.recycle();
3907 }
3908
Dianne Hackborn90c52de2011-09-23 12:57:44 -07003909 public void dismissKeyguardOnNextActivity() throws RemoteException {
3910 Parcel data = Parcel.obtain();
3911 Parcel reply = Parcel.obtain();
3912 data.writeInterfaceToken(IActivityManager.descriptor);
3913 mRemote.transact(DISMISS_KEYGUARD_ON_NEXT_ACTIVITY_TRANSACTION, data, reply, 0);
3914 reply.readException();
3915 data.recycle();
3916 reply.recycle();
3917 }
3918
Adam Powelldd8fab22012-03-22 17:47:27 -07003919 public boolean targetTaskAffinityMatchesActivity(IBinder token, String destAffinity)
3920 throws RemoteException {
3921 Parcel data = Parcel.obtain();
3922 Parcel reply = Parcel.obtain();
3923 data.writeInterfaceToken(IActivityManager.descriptor);
3924 data.writeStrongBinder(token);
3925 data.writeString(destAffinity);
3926 mRemote.transact(TARGET_TASK_AFFINITY_MATCHES_ACTIVITY_TRANSACTION, data, reply, 0);
3927 reply.readException();
3928 boolean result = reply.readInt() != 0;
3929 data.recycle();
3930 reply.recycle();
3931 return result;
3932 }
3933
3934 public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData)
3935 throws RemoteException {
3936 Parcel data = Parcel.obtain();
3937 Parcel reply = Parcel.obtain();
3938 data.writeInterfaceToken(IActivityManager.descriptor);
3939 data.writeStrongBinder(token);
3940 target.writeToParcel(data, 0);
3941 data.writeInt(resultCode);
3942 if (resultData != null) {
3943 data.writeInt(1);
3944 resultData.writeToParcel(data, 0);
3945 } else {
3946 data.writeInt(0);
3947 }
3948 mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0);
3949 reply.readException();
3950 boolean result = reply.readInt() != 0;
3951 data.recycle();
3952 reply.recycle();
3953 return result;
3954 }
3955
Dianne Hackborn5320eb82012-05-18 12:05:04 -07003956 public int getLaunchedFromUid(IBinder activityToken) throws RemoteException {
3957 Parcel data = Parcel.obtain();
3958 Parcel reply = Parcel.obtain();
3959 data.writeInterfaceToken(IActivityManager.descriptor);
3960 data.writeStrongBinder(activityToken);
3961 mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0);
3962 reply.readException();
3963 int result = reply.readInt();
3964 data.recycle();
3965 reply.recycle();
3966 return result;
3967 }
3968
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003969 private IBinder mRemote;
3970}