blob: b78d22f7653a78a17e5788c5d21367f049558075 [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;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080020import android.content.Intent;
21import android.content.IntentFilter;
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -070022import android.content.IIntentSender;
23import android.content.IIntentReceiver;
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;
28import android.content.res.Configuration;
29import android.graphics.Bitmap;
30import android.net.Uri;
31import android.os.Binder;
32import android.os.Bundle;
Dianne Hackborn3025ef32009-08-31 21:31:47 -070033import android.os.Debug;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080034import android.os.Parcelable;
35import android.os.ParcelFileDescriptor;
36import android.os.RemoteException;
37import android.os.IBinder;
38import android.os.Parcel;
39import android.os.ServiceManager;
40import android.text.TextUtils;
41import android.util.Config;
42import android.util.Log;
43
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080044import java.util.ArrayList;
45import java.util.List;
46
47/** {@hide} */
48public abstract class ActivityManagerNative extends Binder implements IActivityManager
49{
50 /**
51 * Cast a Binder object into an activity manager interface, generating
52 * a proxy if needed.
53 */
54 static public IActivityManager asInterface(IBinder obj)
55 {
56 if (obj == null) {
57 return null;
58 }
59 IActivityManager in =
60 (IActivityManager)obj.queryLocalInterface(descriptor);
61 if (in != null) {
62 return in;
63 }
64
65 return new ActivityManagerProxy(obj);
66 }
67
68 /**
69 * Retrieve the system's default/global activity manager.
70 */
71 static public IActivityManager getDefault()
72 {
73 if (gDefault != null) {
74 //if (Config.LOGV) Log.v(
75 // "ActivityManager", "returning cur default = " + gDefault);
76 return gDefault;
77 }
78 IBinder b = ServiceManager.getService("activity");
79 if (Config.LOGV) Log.v(
80 "ActivityManager", "default service binder = " + b);
81 gDefault = asInterface(b);
82 if (Config.LOGV) Log.v(
83 "ActivityManager", "default service = " + gDefault);
84 return gDefault;
85 }
86
87 /**
88 * Convenience for checking whether the system is ready. For internal use only.
89 */
90 static public boolean isSystemReady() {
91 if (!sSystemReady) {
92 sSystemReady = getDefault().testIsSystemReady();
93 }
94 return sSystemReady;
95 }
96 static boolean sSystemReady = false;
97
98 /**
99 * Convenience for sending a sticky broadcast. For internal use only.
100 * If you don't care about permission, use null.
101 */
102 static public void broadcastStickyIntent(Intent intent, String permission)
103 {
104 try {
105 getDefault().broadcastIntent(
106 null, intent, null, null, Activity.RESULT_OK, null, null,
107 null /*permission*/, false, true);
108 } catch (RemoteException ex) {
109 }
110 }
111
112 static public void noteWakeupAlarm(PendingIntent ps) {
113 try {
114 getDefault().noteWakeupAlarm(ps.getTarget());
115 } catch (RemoteException ex) {
116 }
117 }
118
119 public ActivityManagerNative()
120 {
121 attachInterface(this, descriptor);
122 }
123
124 public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
125 throws RemoteException {
126 switch (code) {
127 case START_ACTIVITY_TRANSACTION:
128 {
129 data.enforceInterface(IActivityManager.descriptor);
130 IBinder b = data.readStrongBinder();
131 IApplicationThread app = ApplicationThreadNative.asInterface(b);
132 Intent intent = Intent.CREATOR.createFromParcel(data);
133 String resolvedType = data.readString();
134 Uri[] grantedUriPermissions = data.createTypedArray(Uri.CREATOR);
135 int grantedMode = data.readInt();
136 IBinder resultTo = data.readStrongBinder();
137 String resultWho = data.readString();
138 int requestCode = data.readInt();
139 boolean onlyIfNeeded = data.readInt() != 0;
140 boolean debug = data.readInt() != 0;
141 int result = startActivity(app, intent, resolvedType,
142 grantedUriPermissions, grantedMode, resultTo, resultWho,
143 requestCode, onlyIfNeeded, debug);
144 reply.writeNoException();
145 reply.writeInt(result);
146 return true;
147 }
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700148
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800149 case START_ACTIVITY_AND_WAIT_TRANSACTION:
150 {
151 data.enforceInterface(IActivityManager.descriptor);
152 IBinder b = data.readStrongBinder();
153 IApplicationThread app = ApplicationThreadNative.asInterface(b);
154 Intent intent = Intent.CREATOR.createFromParcel(data);
155 String resolvedType = data.readString();
156 Uri[] grantedUriPermissions = data.createTypedArray(Uri.CREATOR);
157 int grantedMode = data.readInt();
158 IBinder resultTo = data.readStrongBinder();
159 String resultWho = data.readString();
160 int requestCode = data.readInt();
161 boolean onlyIfNeeded = data.readInt() != 0;
162 boolean debug = data.readInt() != 0;
163 WaitResult result = startActivityAndWait(app, intent, resolvedType,
164 grantedUriPermissions, grantedMode, resultTo, resultWho,
165 requestCode, onlyIfNeeded, debug);
166 reply.writeNoException();
167 result.writeToParcel(reply, 0);
168 return true;
169 }
170
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700171 case START_ACTIVITY_WITH_CONFIG_TRANSACTION:
172 {
173 data.enforceInterface(IActivityManager.descriptor);
174 IBinder b = data.readStrongBinder();
175 IApplicationThread app = ApplicationThreadNative.asInterface(b);
176 Intent intent = Intent.CREATOR.createFromParcel(data);
177 String resolvedType = data.readString();
178 Uri[] grantedUriPermissions = data.createTypedArray(Uri.CREATOR);
179 int grantedMode = data.readInt();
180 IBinder resultTo = data.readStrongBinder();
181 String resultWho = data.readString();
182 int requestCode = data.readInt();
183 boolean onlyIfNeeded = data.readInt() != 0;
184 boolean debug = data.readInt() != 0;
185 Configuration config = Configuration.CREATOR.createFromParcel(data);
186 int result = startActivityWithConfig(app, intent, resolvedType,
187 grantedUriPermissions, grantedMode, resultTo, resultWho,
188 requestCode, onlyIfNeeded, debug, config);
189 reply.writeNoException();
190 reply.writeInt(result);
191 return true;
192 }
193
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700194 case START_ACTIVITY_INTENT_SENDER_TRANSACTION:
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700195 {
196 data.enforceInterface(IActivityManager.descriptor);
197 IBinder b = data.readStrongBinder();
198 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700199 IntentSender intent = IntentSender.CREATOR.createFromParcel(data);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700200 Intent fillInIntent = null;
201 if (data.readInt() != 0) {
202 fillInIntent = Intent.CREATOR.createFromParcel(data);
203 }
204 String resolvedType = data.readString();
205 IBinder resultTo = data.readStrongBinder();
206 String resultWho = data.readString();
207 int requestCode = data.readInt();
208 int flagsMask = data.readInt();
209 int flagsValues = data.readInt();
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700210 int result = startActivityIntentSender(app, intent,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700211 fillInIntent, resolvedType, resultTo, resultWho,
212 requestCode, flagsMask, flagsValues);
213 reply.writeNoException();
214 reply.writeInt(result);
215 return true;
216 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800217
218 case START_NEXT_MATCHING_ACTIVITY_TRANSACTION:
219 {
220 data.enforceInterface(IActivityManager.descriptor);
221 IBinder callingActivity = data.readStrongBinder();
222 Intent intent = Intent.CREATOR.createFromParcel(data);
223 boolean result = startNextMatchingActivity(callingActivity, intent);
224 reply.writeNoException();
225 reply.writeInt(result ? 1 : 0);
226 return true;
227 }
228
229 case FINISH_ACTIVITY_TRANSACTION: {
230 data.enforceInterface(IActivityManager.descriptor);
231 IBinder token = data.readStrongBinder();
232 Intent resultData = null;
233 int resultCode = data.readInt();
234 if (data.readInt() != 0) {
235 resultData = Intent.CREATOR.createFromParcel(data);
236 }
237 boolean res = finishActivity(token, resultCode, resultData);
238 reply.writeNoException();
239 reply.writeInt(res ? 1 : 0);
240 return true;
241 }
242
243 case FINISH_SUB_ACTIVITY_TRANSACTION: {
244 data.enforceInterface(IActivityManager.descriptor);
245 IBinder token = data.readStrongBinder();
246 String resultWho = data.readString();
247 int requestCode = data.readInt();
248 finishSubActivity(token, resultWho, requestCode);
249 reply.writeNoException();
250 return true;
251 }
252
Dianne Hackborn061d58a2010-03-12 15:07:06 -0800253 case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: {
254 data.enforceInterface(IActivityManager.descriptor);
255 IBinder token = data.readStrongBinder();
256 boolean res = willActivityBeVisible(token);
257 reply.writeNoException();
258 reply.writeInt(res ? 1 : 0);
259 return true;
260 }
261
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800262 case REGISTER_RECEIVER_TRANSACTION:
263 {
264 data.enforceInterface(IActivityManager.descriptor);
265 IBinder b = data.readStrongBinder();
266 IApplicationThread app =
267 b != null ? ApplicationThreadNative.asInterface(b) : null;
268 b = data.readStrongBinder();
269 IIntentReceiver rec
270 = b != null ? IIntentReceiver.Stub.asInterface(b) : null;
271 IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data);
272 String perm = data.readString();
273 Intent intent = registerReceiver(app, rec, filter, perm);
274 reply.writeNoException();
275 if (intent != null) {
276 reply.writeInt(1);
277 intent.writeToParcel(reply, 0);
278 } else {
279 reply.writeInt(0);
280 }
281 return true;
282 }
283
284 case UNREGISTER_RECEIVER_TRANSACTION:
285 {
286 data.enforceInterface(IActivityManager.descriptor);
287 IBinder b = data.readStrongBinder();
288 if (b == null) {
289 return true;
290 }
291 IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b);
292 unregisterReceiver(rec);
293 reply.writeNoException();
294 return true;
295 }
296
297 case BROADCAST_INTENT_TRANSACTION:
298 {
299 data.enforceInterface(IActivityManager.descriptor);
300 IBinder b = data.readStrongBinder();
301 IApplicationThread app =
302 b != null ? ApplicationThreadNative.asInterface(b) : null;
303 Intent intent = Intent.CREATOR.createFromParcel(data);
304 String resolvedType = data.readString();
305 b = data.readStrongBinder();
306 IIntentReceiver resultTo =
307 b != null ? IIntentReceiver.Stub.asInterface(b) : null;
308 int resultCode = data.readInt();
309 String resultData = data.readString();
310 Bundle resultExtras = data.readBundle();
311 String perm = data.readString();
312 boolean serialized = data.readInt() != 0;
313 boolean sticky = data.readInt() != 0;
314 int res = broadcastIntent(app, intent, resolvedType, resultTo,
315 resultCode, resultData, resultExtras, perm,
316 serialized, sticky);
317 reply.writeNoException();
318 reply.writeInt(res);
319 return true;
320 }
321
322 case UNBROADCAST_INTENT_TRANSACTION:
323 {
324 data.enforceInterface(IActivityManager.descriptor);
325 IBinder b = data.readStrongBinder();
326 IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null;
327 Intent intent = Intent.CREATOR.createFromParcel(data);
328 unbroadcastIntent(app, intent);
329 reply.writeNoException();
330 return true;
331 }
332
333 case FINISH_RECEIVER_TRANSACTION: {
334 data.enforceInterface(IActivityManager.descriptor);
335 IBinder who = data.readStrongBinder();
336 int resultCode = data.readInt();
337 String resultData = data.readString();
338 Bundle resultExtras = data.readBundle();
339 boolean resultAbort = data.readInt() != 0;
340 if (who != null) {
341 finishReceiver(who, resultCode, resultData, resultExtras, resultAbort);
342 }
343 reply.writeNoException();
344 return true;
345 }
346
347 case SET_PERSISTENT_TRANSACTION: {
348 data.enforceInterface(IActivityManager.descriptor);
349 IBinder token = data.readStrongBinder();
350 boolean isPersistent = data.readInt() != 0;
351 if (token != null) {
352 setPersistent(token, isPersistent);
353 }
354 reply.writeNoException();
355 return true;
356 }
357
358 case ATTACH_APPLICATION_TRANSACTION: {
359 data.enforceInterface(IActivityManager.descriptor);
360 IApplicationThread app = ApplicationThreadNative.asInterface(
361 data.readStrongBinder());
362 if (app != null) {
363 attachApplication(app);
364 }
365 reply.writeNoException();
366 return true;
367 }
368
369 case ACTIVITY_IDLE_TRANSACTION: {
370 data.enforceInterface(IActivityManager.descriptor);
371 IBinder token = data.readStrongBinder();
Dianne Hackborne88846e2009-09-30 21:34:25 -0700372 Configuration config = null;
373 if (data.readInt() != 0) {
374 config = Configuration.CREATOR.createFromParcel(data);
375 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800376 if (token != null) {
Dianne Hackborne88846e2009-09-30 21:34:25 -0700377 activityIdle(token, config);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800378 }
379 reply.writeNoException();
380 return true;
381 }
382
383 case ACTIVITY_PAUSED_TRANSACTION: {
384 data.enforceInterface(IActivityManager.descriptor);
385 IBinder token = data.readStrongBinder();
386 Bundle map = data.readBundle();
387 activityPaused(token, map);
388 reply.writeNoException();
389 return true;
390 }
391
392 case ACTIVITY_STOPPED_TRANSACTION: {
393 data.enforceInterface(IActivityManager.descriptor);
394 IBinder token = data.readStrongBinder();
395 Bitmap thumbnail = data.readInt() != 0
396 ? Bitmap.CREATOR.createFromParcel(data) : null;
397 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
398 activityStopped(token, thumbnail, description);
399 reply.writeNoException();
400 return true;
401 }
402
403 case ACTIVITY_DESTROYED_TRANSACTION: {
404 data.enforceInterface(IActivityManager.descriptor);
405 IBinder token = data.readStrongBinder();
406 activityDestroyed(token);
407 reply.writeNoException();
408 return true;
409 }
410
411 case GET_CALLING_PACKAGE_TRANSACTION: {
412 data.enforceInterface(IActivityManager.descriptor);
413 IBinder token = data.readStrongBinder();
414 String res = token != null ? getCallingPackage(token) : null;
415 reply.writeNoException();
416 reply.writeString(res);
417 return true;
418 }
419
420 case GET_CALLING_ACTIVITY_TRANSACTION: {
421 data.enforceInterface(IActivityManager.descriptor);
422 IBinder token = data.readStrongBinder();
423 ComponentName cn = getCallingActivity(token);
424 reply.writeNoException();
425 ComponentName.writeToParcel(cn, reply);
426 return true;
427 }
428
429 case GET_TASKS_TRANSACTION: {
430 data.enforceInterface(IActivityManager.descriptor);
431 int maxNum = data.readInt();
432 int fl = data.readInt();
433 IBinder receiverBinder = data.readStrongBinder();
434 IThumbnailReceiver receiver = receiverBinder != null
435 ? IThumbnailReceiver.Stub.asInterface(receiverBinder)
436 : null;
437 List list = getTasks(maxNum, fl, receiver);
438 reply.writeNoException();
439 int N = list != null ? list.size() : -1;
440 reply.writeInt(N);
441 int i;
442 for (i=0; i<N; i++) {
443 ActivityManager.RunningTaskInfo info =
444 (ActivityManager.RunningTaskInfo)list.get(i);
445 info.writeToParcel(reply, 0);
446 }
447 return true;
448 }
449
450 case GET_RECENT_TASKS_TRANSACTION: {
451 data.enforceInterface(IActivityManager.descriptor);
452 int maxNum = data.readInt();
453 int fl = data.readInt();
454 List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum,
455 fl);
456 reply.writeNoException();
457 reply.writeTypedList(list);
458 return true;
459 }
460
461 case GET_SERVICES_TRANSACTION: {
462 data.enforceInterface(IActivityManager.descriptor);
463 int maxNum = data.readInt();
464 int fl = data.readInt();
465 List list = getServices(maxNum, fl);
466 reply.writeNoException();
467 int N = list != null ? list.size() : -1;
468 reply.writeInt(N);
469 int i;
470 for (i=0; i<N; i++) {
471 ActivityManager.RunningServiceInfo info =
472 (ActivityManager.RunningServiceInfo)list.get(i);
473 info.writeToParcel(reply, 0);
474 }
475 return true;
476 }
477
478 case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: {
479 data.enforceInterface(IActivityManager.descriptor);
480 List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState();
481 reply.writeNoException();
482 reply.writeTypedList(list);
483 return true;
484 }
485
486 case GET_RUNNING_APP_PROCESSES_TRANSACTION: {
487 data.enforceInterface(IActivityManager.descriptor);
488 List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses();
489 reply.writeNoException();
490 reply.writeTypedList(list);
491 return true;
492 }
493
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -0700494 case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: {
495 data.enforceInterface(IActivityManager.descriptor);
496 List<ApplicationInfo> list = getRunningExternalApplications();
497 reply.writeNoException();
498 reply.writeTypedList(list);
499 return true;
500 }
501
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800502 case MOVE_TASK_TO_FRONT_TRANSACTION: {
503 data.enforceInterface(IActivityManager.descriptor);
504 int task = data.readInt();
505 moveTaskToFront(task);
506 reply.writeNoException();
507 return true;
508 }
509
510 case MOVE_TASK_TO_BACK_TRANSACTION: {
511 data.enforceInterface(IActivityManager.descriptor);
512 int task = data.readInt();
513 moveTaskToBack(task);
514 reply.writeNoException();
515 return true;
516 }
517
518 case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: {
519 data.enforceInterface(IActivityManager.descriptor);
520 IBinder token = data.readStrongBinder();
521 boolean nonRoot = data.readInt() != 0;
522 boolean res = moveActivityTaskToBack(token, nonRoot);
523 reply.writeNoException();
524 reply.writeInt(res ? 1 : 0);
525 return true;
526 }
527
528 case MOVE_TASK_BACKWARDS_TRANSACTION: {
529 data.enforceInterface(IActivityManager.descriptor);
530 int task = data.readInt();
531 moveTaskBackwards(task);
532 reply.writeNoException();
533 return true;
534 }
535
536 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
537 data.enforceInterface(IActivityManager.descriptor);
538 IBinder token = data.readStrongBinder();
539 boolean onlyRoot = data.readInt() != 0;
540 int res = token != null
541 ? getTaskForActivity(token, onlyRoot) : -1;
542 reply.writeNoException();
543 reply.writeInt(res);
544 return true;
545 }
546
547 case FINISH_OTHER_INSTANCES_TRANSACTION: {
548 data.enforceInterface(IActivityManager.descriptor);
549 IBinder token = data.readStrongBinder();
550 ComponentName className = ComponentName.readFromParcel(data);
551 finishOtherInstances(token, className);
552 reply.writeNoException();
553 return true;
554 }
555
556 case REPORT_THUMBNAIL_TRANSACTION: {
557 data.enforceInterface(IActivityManager.descriptor);
558 IBinder token = data.readStrongBinder();
559 Bitmap thumbnail = data.readInt() != 0
560 ? Bitmap.CREATOR.createFromParcel(data) : null;
561 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
562 reportThumbnail(token, thumbnail, description);
563 reply.writeNoException();
564 return true;
565 }
566
567 case GET_CONTENT_PROVIDER_TRANSACTION: {
568 data.enforceInterface(IActivityManager.descriptor);
569 IBinder b = data.readStrongBinder();
570 IApplicationThread app = ApplicationThreadNative.asInterface(b);
571 String name = data.readString();
572 ContentProviderHolder cph = getContentProvider(app, name);
573 reply.writeNoException();
574 if (cph != null) {
575 reply.writeInt(1);
576 cph.writeToParcel(reply, 0);
577 } else {
578 reply.writeInt(0);
579 }
580 return true;
581 }
582
583 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
584 data.enforceInterface(IActivityManager.descriptor);
585 IBinder b = data.readStrongBinder();
586 IApplicationThread app = ApplicationThreadNative.asInterface(b);
587 ArrayList<ContentProviderHolder> providers =
588 data.createTypedArrayList(ContentProviderHolder.CREATOR);
589 publishContentProviders(app, providers);
590 reply.writeNoException();
591 return true;
592 }
593
594 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
595 data.enforceInterface(IActivityManager.descriptor);
596 IBinder b = data.readStrongBinder();
597 IApplicationThread app = ApplicationThreadNative.asInterface(b);
598 String name = data.readString();
599 removeContentProvider(app, name);
600 reply.writeNoException();
601 return true;
602 }
603
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700604 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
605 data.enforceInterface(IActivityManager.descriptor);
606 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
607 PendingIntent pi = getRunningServiceControlPanel(comp);
608 reply.writeNoException();
609 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
610 return true;
611 }
612
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800613 case START_SERVICE_TRANSACTION: {
614 data.enforceInterface(IActivityManager.descriptor);
615 IBinder b = data.readStrongBinder();
616 IApplicationThread app = ApplicationThreadNative.asInterface(b);
617 Intent service = Intent.CREATOR.createFromParcel(data);
618 String resolvedType = data.readString();
619 ComponentName cn = startService(app, service, resolvedType);
620 reply.writeNoException();
621 ComponentName.writeToParcel(cn, reply);
622 return true;
623 }
624
625 case STOP_SERVICE_TRANSACTION: {
626 data.enforceInterface(IActivityManager.descriptor);
627 IBinder b = data.readStrongBinder();
628 IApplicationThread app = ApplicationThreadNative.asInterface(b);
629 Intent service = Intent.CREATOR.createFromParcel(data);
630 String resolvedType = data.readString();
631 int res = stopService(app, service, resolvedType);
632 reply.writeNoException();
633 reply.writeInt(res);
634 return true;
635 }
636
637 case STOP_SERVICE_TOKEN_TRANSACTION: {
638 data.enforceInterface(IActivityManager.descriptor);
639 ComponentName className = ComponentName.readFromParcel(data);
640 IBinder token = data.readStrongBinder();
641 int startId = data.readInt();
642 boolean res = stopServiceToken(className, token, startId);
643 reply.writeNoException();
644 reply.writeInt(res ? 1 : 0);
645 return true;
646 }
647
648 case SET_SERVICE_FOREGROUND_TRANSACTION: {
649 data.enforceInterface(IActivityManager.descriptor);
650 ComponentName className = ComponentName.readFromParcel(data);
651 IBinder token = data.readStrongBinder();
Dianne Hackbornd8a43f62009-08-17 23:33:56 -0700652 int id = data.readInt();
653 Notification notification = null;
654 if (data.readInt() != 0) {
655 notification = Notification.CREATOR.createFromParcel(data);
656 }
657 boolean removeNotification = data.readInt() != 0;
658 setServiceForeground(className, token, id, notification, removeNotification);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800659 reply.writeNoException();
660 return true;
661 }
662
663 case BIND_SERVICE_TRANSACTION: {
664 data.enforceInterface(IActivityManager.descriptor);
665 IBinder b = data.readStrongBinder();
666 IApplicationThread app = ApplicationThreadNative.asInterface(b);
667 IBinder token = data.readStrongBinder();
668 Intent service = Intent.CREATOR.createFromParcel(data);
669 String resolvedType = data.readString();
670 b = data.readStrongBinder();
671 int fl = data.readInt();
672 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
673 int res = bindService(app, token, service, resolvedType, conn, fl);
674 reply.writeNoException();
675 reply.writeInt(res);
676 return true;
677 }
678
679 case UNBIND_SERVICE_TRANSACTION: {
680 data.enforceInterface(IActivityManager.descriptor);
681 IBinder b = data.readStrongBinder();
682 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
683 boolean res = unbindService(conn);
684 reply.writeNoException();
685 reply.writeInt(res ? 1 : 0);
686 return true;
687 }
688
689 case PUBLISH_SERVICE_TRANSACTION: {
690 data.enforceInterface(IActivityManager.descriptor);
691 IBinder token = data.readStrongBinder();
692 Intent intent = Intent.CREATOR.createFromParcel(data);
693 IBinder service = data.readStrongBinder();
694 publishService(token, intent, service);
695 reply.writeNoException();
696 return true;
697 }
698
699 case UNBIND_FINISHED_TRANSACTION: {
700 data.enforceInterface(IActivityManager.descriptor);
701 IBinder token = data.readStrongBinder();
702 Intent intent = Intent.CREATOR.createFromParcel(data);
703 boolean doRebind = data.readInt() != 0;
704 unbindFinished(token, intent, doRebind);
705 reply.writeNoException();
706 return true;
707 }
708
709 case SERVICE_DONE_EXECUTING_TRANSACTION: {
710 data.enforceInterface(IActivityManager.descriptor);
711 IBinder token = data.readStrongBinder();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -0700712 int type = data.readInt();
713 int startId = data.readInt();
714 int res = data.readInt();
715 serviceDoneExecuting(token, type, startId, res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800716 reply.writeNoException();
717 return true;
718 }
719
720 case START_INSTRUMENTATION_TRANSACTION: {
721 data.enforceInterface(IActivityManager.descriptor);
722 ComponentName className = ComponentName.readFromParcel(data);
723 String profileFile = data.readString();
724 int fl = data.readInt();
725 Bundle arguments = data.readBundle();
726 IBinder b = data.readStrongBinder();
727 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
728 boolean res = startInstrumentation(className, profileFile, fl, arguments, w);
729 reply.writeNoException();
730 reply.writeInt(res ? 1 : 0);
731 return true;
732 }
733
734
735 case FINISH_INSTRUMENTATION_TRANSACTION: {
736 data.enforceInterface(IActivityManager.descriptor);
737 IBinder b = data.readStrongBinder();
738 IApplicationThread app = ApplicationThreadNative.asInterface(b);
739 int resultCode = data.readInt();
740 Bundle results = data.readBundle();
741 finishInstrumentation(app, resultCode, results);
742 reply.writeNoException();
743 return true;
744 }
745
746 case GET_CONFIGURATION_TRANSACTION: {
747 data.enforceInterface(IActivityManager.descriptor);
748 Configuration config = getConfiguration();
749 reply.writeNoException();
750 config.writeToParcel(reply, 0);
751 return true;
752 }
753
754 case UPDATE_CONFIGURATION_TRANSACTION: {
755 data.enforceInterface(IActivityManager.descriptor);
756 Configuration config = Configuration.CREATOR.createFromParcel(data);
757 updateConfiguration(config);
758 reply.writeNoException();
759 return true;
760 }
761
762 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
763 data.enforceInterface(IActivityManager.descriptor);
764 IBinder token = data.readStrongBinder();
765 int requestedOrientation = data.readInt();
766 setRequestedOrientation(token, requestedOrientation);
767 reply.writeNoException();
768 return true;
769 }
770
771 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
772 data.enforceInterface(IActivityManager.descriptor);
773 IBinder token = data.readStrongBinder();
774 int req = getRequestedOrientation(token);
775 reply.writeNoException();
776 reply.writeInt(req);
777 return true;
778 }
779
780 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
781 data.enforceInterface(IActivityManager.descriptor);
782 IBinder token = data.readStrongBinder();
783 ComponentName cn = getActivityClassForToken(token);
784 reply.writeNoException();
785 ComponentName.writeToParcel(cn, reply);
786 return true;
787 }
788
789 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
790 data.enforceInterface(IActivityManager.descriptor);
791 IBinder token = data.readStrongBinder();
792 reply.writeNoException();
793 reply.writeString(getPackageForToken(token));
794 return true;
795 }
796
797 case GET_INTENT_SENDER_TRANSACTION: {
798 data.enforceInterface(IActivityManager.descriptor);
799 int type = data.readInt();
800 String packageName = data.readString();
801 IBinder token = data.readStrongBinder();
802 String resultWho = data.readString();
803 int requestCode = data.readInt();
804 Intent requestIntent = data.readInt() != 0
805 ? Intent.CREATOR.createFromParcel(data) : null;
806 String requestResolvedType = data.readString();
807 int fl = data.readInt();
808 IIntentSender res = getIntentSender(type, packageName, token,
809 resultWho, requestCode, requestIntent,
810 requestResolvedType, fl);
811 reply.writeNoException();
812 reply.writeStrongBinder(res != null ? res.asBinder() : null);
813 return true;
814 }
815
816 case CANCEL_INTENT_SENDER_TRANSACTION: {
817 data.enforceInterface(IActivityManager.descriptor);
818 IIntentSender r = IIntentSender.Stub.asInterface(
819 data.readStrongBinder());
820 cancelIntentSender(r);
821 reply.writeNoException();
822 return true;
823 }
824
825 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
826 data.enforceInterface(IActivityManager.descriptor);
827 IIntentSender r = IIntentSender.Stub.asInterface(
828 data.readStrongBinder());
829 String res = getPackageForIntentSender(r);
830 reply.writeNoException();
831 reply.writeString(res);
832 return true;
833 }
834
835 case SET_PROCESS_LIMIT_TRANSACTION: {
836 data.enforceInterface(IActivityManager.descriptor);
837 int max = data.readInt();
838 setProcessLimit(max);
839 reply.writeNoException();
840 return true;
841 }
842
843 case GET_PROCESS_LIMIT_TRANSACTION: {
844 data.enforceInterface(IActivityManager.descriptor);
845 int limit = getProcessLimit();
846 reply.writeNoException();
847 reply.writeInt(limit);
848 return true;
849 }
850
851 case SET_PROCESS_FOREGROUND_TRANSACTION: {
852 data.enforceInterface(IActivityManager.descriptor);
853 IBinder token = data.readStrongBinder();
854 int pid = data.readInt();
855 boolean isForeground = data.readInt() != 0;
856 setProcessForeground(token, pid, isForeground);
857 reply.writeNoException();
858 return true;
859 }
860
861 case CHECK_PERMISSION_TRANSACTION: {
862 data.enforceInterface(IActivityManager.descriptor);
863 String perm = data.readString();
864 int pid = data.readInt();
865 int uid = data.readInt();
866 int res = checkPermission(perm, pid, uid);
867 reply.writeNoException();
868 reply.writeInt(res);
869 return true;
870 }
871
872 case CHECK_URI_PERMISSION_TRANSACTION: {
873 data.enforceInterface(IActivityManager.descriptor);
874 Uri uri = Uri.CREATOR.createFromParcel(data);
875 int pid = data.readInt();
876 int uid = data.readInt();
877 int mode = data.readInt();
878 int res = checkUriPermission(uri, pid, uid, mode);
879 reply.writeNoException();
880 reply.writeInt(res);
881 return true;
882 }
883
884 case CLEAR_APP_DATA_TRANSACTION: {
885 data.enforceInterface(IActivityManager.descriptor);
886 String packageName = data.readString();
887 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
888 data.readStrongBinder());
889 boolean res = clearApplicationUserData(packageName, observer);
890 reply.writeNoException();
891 reply.writeInt(res ? 1 : 0);
892 return true;
893 }
894
895 case GRANT_URI_PERMISSION_TRANSACTION: {
896 data.enforceInterface(IActivityManager.descriptor);
897 IBinder b = data.readStrongBinder();
898 IApplicationThread app = ApplicationThreadNative.asInterface(b);
899 String targetPkg = data.readString();
900 Uri uri = Uri.CREATOR.createFromParcel(data);
901 int mode = data.readInt();
902 grantUriPermission(app, targetPkg, uri, mode);
903 reply.writeNoException();
904 return true;
905 }
906
907 case REVOKE_URI_PERMISSION_TRANSACTION: {
908 data.enforceInterface(IActivityManager.descriptor);
909 IBinder b = data.readStrongBinder();
910 IApplicationThread app = ApplicationThreadNative.asInterface(b);
911 Uri uri = Uri.CREATOR.createFromParcel(data);
912 int mode = data.readInt();
913 revokeUriPermission(app, uri, mode);
914 reply.writeNoException();
915 return true;
916 }
917
918 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
919 data.enforceInterface(IActivityManager.descriptor);
920 IBinder b = data.readStrongBinder();
921 IApplicationThread app = ApplicationThreadNative.asInterface(b);
922 boolean waiting = data.readInt() != 0;
923 showWaitingForDebugger(app, waiting);
924 reply.writeNoException();
925 return true;
926 }
927
928 case GET_MEMORY_INFO_TRANSACTION: {
929 data.enforceInterface(IActivityManager.descriptor);
930 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
931 getMemoryInfo(mi);
932 reply.writeNoException();
933 mi.writeToParcel(reply, 0);
934 return true;
935 }
936
937 case UNHANDLED_BACK_TRANSACTION: {
938 data.enforceInterface(IActivityManager.descriptor);
939 unhandledBack();
940 reply.writeNoException();
941 return true;
942 }
943
944 case OPEN_CONTENT_URI_TRANSACTION: {
945 data.enforceInterface(IActivityManager.descriptor);
946 Uri uri = Uri.parse(data.readString());
947 ParcelFileDescriptor pfd = openContentUri(uri);
948 reply.writeNoException();
949 if (pfd != null) {
950 reply.writeInt(1);
951 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
952 } else {
953 reply.writeInt(0);
954 }
955 return true;
956 }
957
958 case GOING_TO_SLEEP_TRANSACTION: {
959 data.enforceInterface(IActivityManager.descriptor);
960 goingToSleep();
961 reply.writeNoException();
962 return true;
963 }
964
965 case WAKING_UP_TRANSACTION: {
966 data.enforceInterface(IActivityManager.descriptor);
967 wakingUp();
968 reply.writeNoException();
969 return true;
970 }
971
972 case SET_DEBUG_APP_TRANSACTION: {
973 data.enforceInterface(IActivityManager.descriptor);
974 String pn = data.readString();
975 boolean wfd = data.readInt() != 0;
976 boolean per = data.readInt() != 0;
977 setDebugApp(pn, wfd, per);
978 reply.writeNoException();
979 return true;
980 }
981
982 case SET_ALWAYS_FINISH_TRANSACTION: {
983 data.enforceInterface(IActivityManager.descriptor);
984 boolean enabled = data.readInt() != 0;
985 setAlwaysFinish(enabled);
986 reply.writeNoException();
987 return true;
988 }
989
Dianne Hackbornb06ea702009-07-13 13:07:51 -0700990 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800991 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackbornb06ea702009-07-13 13:07:51 -0700992 IActivityController watcher = IActivityController.Stub.asInterface(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800993 data.readStrongBinder());
Dianne Hackbornb06ea702009-07-13 13:07:51 -0700994 setActivityController(watcher);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800995 return true;
996 }
997
998 case ENTER_SAFE_MODE_TRANSACTION: {
999 data.enforceInterface(IActivityManager.descriptor);
1000 enterSafeMode();
1001 reply.writeNoException();
1002 return true;
1003 }
1004
1005 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1006 data.enforceInterface(IActivityManager.descriptor);
1007 IIntentSender is = IIntentSender.Stub.asInterface(
1008 data.readStrongBinder());
1009 noteWakeupAlarm(is);
1010 reply.writeNoException();
1011 return true;
1012 }
1013
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001014 case KILL_PIDS_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001015 data.enforceInterface(IActivityManager.descriptor);
1016 int[] pids = data.createIntArray();
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001017 String reason = data.readString();
1018 boolean res = killPids(pids, reason);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001019 reply.writeNoException();
1020 reply.writeInt(res ? 1 : 0);
1021 return true;
1022 }
1023
1024 case REPORT_PSS_TRANSACTION: {
1025 data.enforceInterface(IActivityManager.descriptor);
1026 IBinder b = data.readStrongBinder();
1027 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1028 int pss = data.readInt();
1029 reportPss(app, pss);
1030 reply.writeNoException();
1031 return true;
1032 }
1033
1034 case START_RUNNING_TRANSACTION: {
1035 data.enforceInterface(IActivityManager.descriptor);
1036 String pkg = data.readString();
1037 String cls = data.readString();
1038 String action = data.readString();
1039 String indata = data.readString();
1040 startRunning(pkg, cls, action, indata);
1041 reply.writeNoException();
1042 return true;
1043 }
1044
Dan Egnor60d87622009-12-16 16:32:58 -08001045 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1046 data.enforceInterface(IActivityManager.descriptor);
1047 IBinder app = data.readStrongBinder();
1048 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1049 handleApplicationCrash(app, ci);
1050 reply.writeNoException();
1051 return true;
1052 }
1053
1054 case HANDLE_APPLICATION_WTF_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001055 data.enforceInterface(IActivityManager.descriptor);
1056 IBinder app = data.readStrongBinder();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001057 String tag = data.readString();
Dan Egnorb7f03672009-12-09 16:22:32 -08001058 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
Dan Egnor60d87622009-12-16 16:32:58 -08001059 boolean res = handleApplicationWtf(app, tag, ci);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001060 reply.writeNoException();
Dan Egnor60d87622009-12-16 16:32:58 -08001061 reply.writeInt(res ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001062 return true;
1063 }
Dan Egnorb7f03672009-12-09 16:22:32 -08001064
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001065 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1066 data.enforceInterface(IActivityManager.descriptor);
1067 int sig = data.readInt();
1068 signalPersistentProcesses(sig);
1069 reply.writeNoException();
1070 return true;
1071 }
1072
Dianne Hackborn03abb812010-01-04 18:43:19 -08001073 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1074 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001075 String packageName = data.readString();
Dianne Hackborn03abb812010-01-04 18:43:19 -08001076 killBackgroundProcesses(packageName);
1077 reply.writeNoException();
1078 return true;
1079 }
1080
1081 case FORCE_STOP_PACKAGE_TRANSACTION: {
1082 data.enforceInterface(IActivityManager.descriptor);
1083 String packageName = data.readString();
1084 forceStopPackage(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001085 reply.writeNoException();
1086 return true;
1087 }
1088
1089 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1090 data.enforceInterface(IActivityManager.descriptor);
1091 ConfigurationInfo config = getDeviceConfigurationInfo();
1092 reply.writeNoException();
1093 config.writeToParcel(reply, 0);
1094 return true;
1095 }
1096
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001097 case PROFILE_CONTROL_TRANSACTION: {
1098 data.enforceInterface(IActivityManager.descriptor);
1099 String process = data.readString();
1100 boolean start = data.readInt() != 0;
1101 String path = data.readString();
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07001102 ParcelFileDescriptor fd = data.readInt() != 0
1103 ? data.readFileDescriptor() : null;
1104 boolean res = profileControl(process, start, path, fd);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001105 reply.writeNoException();
1106 reply.writeInt(res ? 1 : 0);
1107 return true;
1108 }
1109
Dianne Hackborn55280a92009-05-07 15:53:46 -07001110 case SHUTDOWN_TRANSACTION: {
1111 data.enforceInterface(IActivityManager.descriptor);
1112 boolean res = shutdown(data.readInt());
1113 reply.writeNoException();
1114 reply.writeInt(res ? 1 : 0);
1115 return true;
1116 }
1117
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001118 case STOP_APP_SWITCHES_TRANSACTION: {
1119 data.enforceInterface(IActivityManager.descriptor);
1120 stopAppSwitches();
1121 reply.writeNoException();
1122 return true;
1123 }
1124
1125 case RESUME_APP_SWITCHES_TRANSACTION: {
1126 data.enforceInterface(IActivityManager.descriptor);
1127 resumeAppSwitches();
1128 reply.writeNoException();
1129 return true;
1130 }
1131
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001132 case PEEK_SERVICE_TRANSACTION: {
1133 data.enforceInterface(IActivityManager.descriptor);
1134 Intent service = Intent.CREATOR.createFromParcel(data);
1135 String resolvedType = data.readString();
1136 IBinder binder = peekService(service, resolvedType);
1137 reply.writeNoException();
1138 reply.writeStrongBinder(binder);
1139 return true;
1140 }
Christopher Tate181fafa2009-05-14 11:12:14 -07001141
1142 case START_BACKUP_AGENT_TRANSACTION: {
1143 data.enforceInterface(IActivityManager.descriptor);
1144 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1145 int backupRestoreMode = data.readInt();
1146 boolean success = bindBackupAgent(info, backupRestoreMode);
1147 reply.writeNoException();
1148 reply.writeInt(success ? 1 : 0);
1149 return true;
1150 }
1151
1152 case BACKUP_AGENT_CREATED_TRANSACTION: {
1153 data.enforceInterface(IActivityManager.descriptor);
1154 String packageName = data.readString();
1155 IBinder agent = data.readStrongBinder();
1156 backupAgentCreated(packageName, agent);
1157 reply.writeNoException();
1158 return true;
1159 }
1160
1161 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1162 data.enforceInterface(IActivityManager.descriptor);
1163 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1164 unbindBackupAgent(info);
1165 reply.writeNoException();
1166 return true;
1167 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001168
1169 case REGISTER_ACTIVITY_WATCHER_TRANSACTION: {
1170 data.enforceInterface(IActivityManager.descriptor);
1171 IActivityWatcher watcher = IActivityWatcher.Stub.asInterface(
1172 data.readStrongBinder());
1173 registerActivityWatcher(watcher);
1174 return true;
1175 }
1176
1177 case UNREGISTER_ACTIVITY_WATCHER_TRANSACTION: {
1178 data.enforceInterface(IActivityManager.descriptor);
1179 IActivityWatcher watcher = IActivityWatcher.Stub.asInterface(
1180 data.readStrongBinder());
1181 unregisterActivityWatcher(watcher);
1182 return true;
1183 }
Dianne Hackborn2d91af02009-07-16 13:34:33 -07001184
1185 case START_ACTIVITY_IN_PACKAGE_TRANSACTION:
1186 {
1187 data.enforceInterface(IActivityManager.descriptor);
1188 int uid = data.readInt();
1189 Intent intent = Intent.CREATOR.createFromParcel(data);
1190 String resolvedType = data.readString();
1191 IBinder resultTo = data.readStrongBinder();
1192 String resultWho = data.readString();
1193 int requestCode = data.readInt();
1194 boolean onlyIfNeeded = data.readInt() != 0;
1195 int result = startActivityInPackage(uid, intent, resolvedType,
1196 resultTo, resultWho, requestCode, onlyIfNeeded);
1197 reply.writeNoException();
1198 reply.writeInt(result);
1199 return true;
1200 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001201
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001202 case KILL_APPLICATION_WITH_UID_TRANSACTION: {
1203 data.enforceInterface(IActivityManager.descriptor);
1204 String pkg = data.readString();
1205 int uid = data.readInt();
1206 killApplicationWithUid(pkg, uid);
1207 reply.writeNoException();
1208 return true;
1209 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001210
1211 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1212 data.enforceInterface(IActivityManager.descriptor);
1213 String reason = data.readString();
1214 closeSystemDialogs(reason);
1215 reply.writeNoException();
1216 return true;
1217 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001218
1219 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1220 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001221 int[] pids = data.createIntArray();
1222 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001223 reply.writeNoException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001224 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001225 return true;
1226 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001227
1228 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1229 data.enforceInterface(IActivityManager.descriptor);
1230 String processName = data.readString();
1231 int uid = data.readInt();
1232 killApplicationProcess(processName, uid);
1233 reply.writeNoException();
1234 return true;
1235 }
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001236
1237 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1238 data.enforceInterface(IActivityManager.descriptor);
1239 IBinder token = data.readStrongBinder();
1240 String packageName = data.readString();
1241 int enterAnim = data.readInt();
1242 int exitAnim = data.readInt();
1243 overridePendingTransition(token, packageName, enterAnim, exitAnim);
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001244 reply.writeNoException();
1245 return true;
1246 }
1247
1248 case IS_USER_A_MONKEY_TRANSACTION: {
1249 data.enforceInterface(IActivityManager.descriptor);
1250 reply.writeInt(isUserAMonkey() ? 1 : 0);
1251 reply.writeNoException();
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001252 return true;
1253 }
Dianne Hackborn860755f2010-06-03 18:47:52 -07001254
1255 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1256 data.enforceInterface(IActivityManager.descriptor);
1257 finishHeavyWeightApp();
1258 reply.writeNoException();
1259 return true;
1260 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001261 }
1262
1263 return super.onTransact(code, data, reply, flags);
1264 }
1265
1266 public IBinder asBinder()
1267 {
1268 return this;
1269 }
1270
1271 private static IActivityManager gDefault;
1272}
1273
1274class ActivityManagerProxy implements IActivityManager
1275{
1276 public ActivityManagerProxy(IBinder remote)
1277 {
1278 mRemote = remote;
1279 }
1280
1281 public IBinder asBinder()
1282 {
1283 return mRemote;
1284 }
1285
1286 public int startActivity(IApplicationThread caller, Intent intent,
1287 String resolvedType, Uri[] grantedUriPermissions, int grantedMode,
1288 IBinder resultTo, String resultWho,
1289 int requestCode, boolean onlyIfNeeded,
1290 boolean debug) throws RemoteException {
1291 Parcel data = Parcel.obtain();
1292 Parcel reply = Parcel.obtain();
1293 data.writeInterfaceToken(IActivityManager.descriptor);
1294 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1295 intent.writeToParcel(data, 0);
1296 data.writeString(resolvedType);
1297 data.writeTypedArray(grantedUriPermissions, 0);
1298 data.writeInt(grantedMode);
1299 data.writeStrongBinder(resultTo);
1300 data.writeString(resultWho);
1301 data.writeInt(requestCode);
1302 data.writeInt(onlyIfNeeded ? 1 : 0);
1303 data.writeInt(debug ? 1 : 0);
1304 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
1305 reply.readException();
1306 int result = reply.readInt();
1307 reply.recycle();
1308 data.recycle();
1309 return result;
1310 }
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08001311 public WaitResult startActivityAndWait(IApplicationThread caller, Intent intent,
1312 String resolvedType, Uri[] grantedUriPermissions, int grantedMode,
1313 IBinder resultTo, String resultWho,
1314 int requestCode, boolean onlyIfNeeded,
1315 boolean debug) throws RemoteException {
1316 Parcel data = Parcel.obtain();
1317 Parcel reply = Parcel.obtain();
1318 data.writeInterfaceToken(IActivityManager.descriptor);
1319 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1320 intent.writeToParcel(data, 0);
1321 data.writeString(resolvedType);
1322 data.writeTypedArray(grantedUriPermissions, 0);
1323 data.writeInt(grantedMode);
1324 data.writeStrongBinder(resultTo);
1325 data.writeString(resultWho);
1326 data.writeInt(requestCode);
1327 data.writeInt(onlyIfNeeded ? 1 : 0);
1328 data.writeInt(debug ? 1 : 0);
1329 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
1330 reply.readException();
1331 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
1332 reply.recycle();
1333 data.recycle();
1334 return result;
1335 }
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07001336 public int startActivityWithConfig(IApplicationThread caller, Intent intent,
1337 String resolvedType, Uri[] grantedUriPermissions, int grantedMode,
1338 IBinder resultTo, String resultWho,
1339 int requestCode, boolean onlyIfNeeded,
1340 boolean debug, Configuration config) throws RemoteException {
1341 Parcel data = Parcel.obtain();
1342 Parcel reply = Parcel.obtain();
1343 data.writeInterfaceToken(IActivityManager.descriptor);
1344 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1345 intent.writeToParcel(data, 0);
1346 data.writeString(resolvedType);
1347 data.writeTypedArray(grantedUriPermissions, 0);
1348 data.writeInt(grantedMode);
1349 data.writeStrongBinder(resultTo);
1350 data.writeString(resultWho);
1351 data.writeInt(requestCode);
1352 data.writeInt(onlyIfNeeded ? 1 : 0);
1353 data.writeInt(debug ? 1 : 0);
1354 config.writeToParcel(data, 0);
1355 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
1356 reply.readException();
1357 int result = reply.readInt();
1358 reply.recycle();
1359 data.recycle();
1360 return result;
1361 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07001362 public int startActivityIntentSender(IApplicationThread caller,
1363 IntentSender intent, Intent fillInIntent, String resolvedType,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07001364 IBinder resultTo, String resultWho, int requestCode,
1365 int flagsMask, int flagsValues) throws RemoteException {
1366 Parcel data = Parcel.obtain();
1367 Parcel reply = Parcel.obtain();
1368 data.writeInterfaceToken(IActivityManager.descriptor);
1369 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1370 intent.writeToParcel(data, 0);
1371 if (fillInIntent != null) {
1372 data.writeInt(1);
1373 fillInIntent.writeToParcel(data, 0);
1374 } else {
1375 data.writeInt(0);
1376 }
1377 data.writeString(resolvedType);
1378 data.writeStrongBinder(resultTo);
1379 data.writeString(resultWho);
1380 data.writeInt(requestCode);
1381 data.writeInt(flagsMask);
1382 data.writeInt(flagsValues);
Dianne Hackbornfa82f222009-09-17 15:14:12 -07001383 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07001384 reply.readException();
1385 int result = reply.readInt();
1386 reply.recycle();
1387 data.recycle();
1388 return result;
1389 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001390 public boolean startNextMatchingActivity(IBinder callingActivity,
1391 Intent intent) throws RemoteException {
1392 Parcel data = Parcel.obtain();
1393 Parcel reply = Parcel.obtain();
1394 data.writeInterfaceToken(IActivityManager.descriptor);
1395 data.writeStrongBinder(callingActivity);
1396 intent.writeToParcel(data, 0);
1397 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
1398 reply.readException();
1399 int result = reply.readInt();
1400 reply.recycle();
1401 data.recycle();
1402 return result != 0;
1403 }
1404 public boolean finishActivity(IBinder token, int resultCode, Intent resultData)
1405 throws RemoteException {
1406 Parcel data = Parcel.obtain();
1407 Parcel reply = Parcel.obtain();
1408 data.writeInterfaceToken(IActivityManager.descriptor);
1409 data.writeStrongBinder(token);
1410 data.writeInt(resultCode);
1411 if (resultData != null) {
1412 data.writeInt(1);
1413 resultData.writeToParcel(data, 0);
1414 } else {
1415 data.writeInt(0);
1416 }
1417 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
1418 reply.readException();
1419 boolean res = reply.readInt() != 0;
1420 data.recycle();
1421 reply.recycle();
1422 return res;
1423 }
1424 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
1425 {
1426 Parcel data = Parcel.obtain();
1427 Parcel reply = Parcel.obtain();
1428 data.writeInterfaceToken(IActivityManager.descriptor);
1429 data.writeStrongBinder(token);
1430 data.writeString(resultWho);
1431 data.writeInt(requestCode);
1432 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
1433 reply.readException();
1434 data.recycle();
1435 reply.recycle();
1436 }
Dianne Hackborn061d58a2010-03-12 15:07:06 -08001437 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
1438 Parcel data = Parcel.obtain();
1439 Parcel reply = Parcel.obtain();
1440 data.writeInterfaceToken(IActivityManager.descriptor);
1441 data.writeStrongBinder(token);
1442 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
1443 reply.readException();
1444 boolean res = reply.readInt() != 0;
1445 data.recycle();
1446 reply.recycle();
1447 return res;
1448 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001449 public Intent registerReceiver(IApplicationThread caller,
1450 IIntentReceiver receiver,
1451 IntentFilter filter, String perm) throws RemoteException
1452 {
1453 Parcel data = Parcel.obtain();
1454 Parcel reply = Parcel.obtain();
1455 data.writeInterfaceToken(IActivityManager.descriptor);
1456 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1457 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
1458 filter.writeToParcel(data, 0);
1459 data.writeString(perm);
1460 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
1461 reply.readException();
1462 Intent intent = null;
1463 int haveIntent = reply.readInt();
1464 if (haveIntent != 0) {
1465 intent = Intent.CREATOR.createFromParcel(reply);
1466 }
1467 reply.recycle();
1468 data.recycle();
1469 return intent;
1470 }
1471 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
1472 {
1473 Parcel data = Parcel.obtain();
1474 Parcel reply = Parcel.obtain();
1475 data.writeInterfaceToken(IActivityManager.descriptor);
1476 data.writeStrongBinder(receiver.asBinder());
1477 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
1478 reply.readException();
1479 data.recycle();
1480 reply.recycle();
1481 }
1482 public int broadcastIntent(IApplicationThread caller,
1483 Intent intent, String resolvedType, IIntentReceiver resultTo,
1484 int resultCode, String resultData, Bundle map,
1485 String requiredPermission, boolean serialized,
1486 boolean sticky) throws RemoteException
1487 {
1488 Parcel data = Parcel.obtain();
1489 Parcel reply = Parcel.obtain();
1490 data.writeInterfaceToken(IActivityManager.descriptor);
1491 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1492 intent.writeToParcel(data, 0);
1493 data.writeString(resolvedType);
1494 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
1495 data.writeInt(resultCode);
1496 data.writeString(resultData);
1497 data.writeBundle(map);
1498 data.writeString(requiredPermission);
1499 data.writeInt(serialized ? 1 : 0);
1500 data.writeInt(sticky ? 1 : 0);
1501 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
1502 reply.readException();
1503 int res = reply.readInt();
1504 reply.recycle();
1505 data.recycle();
1506 return res;
1507 }
1508 public void unbroadcastIntent(IApplicationThread caller, Intent intent) throws RemoteException
1509 {
1510 Parcel data = Parcel.obtain();
1511 Parcel reply = Parcel.obtain();
1512 data.writeInterfaceToken(IActivityManager.descriptor);
1513 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1514 intent.writeToParcel(data, 0);
1515 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
1516 reply.readException();
1517 data.recycle();
1518 reply.recycle();
1519 }
1520 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, boolean abortBroadcast) throws RemoteException
1521 {
1522 Parcel data = Parcel.obtain();
1523 Parcel reply = Parcel.obtain();
1524 data.writeInterfaceToken(IActivityManager.descriptor);
1525 data.writeStrongBinder(who);
1526 data.writeInt(resultCode);
1527 data.writeString(resultData);
1528 data.writeBundle(map);
1529 data.writeInt(abortBroadcast ? 1 : 0);
1530 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
1531 reply.readException();
1532 data.recycle();
1533 reply.recycle();
1534 }
1535 public void setPersistent(IBinder token, boolean isPersistent) throws RemoteException
1536 {
1537 Parcel data = Parcel.obtain();
1538 Parcel reply = Parcel.obtain();
1539 data.writeInterfaceToken(IActivityManager.descriptor);
1540 data.writeStrongBinder(token);
1541 data.writeInt(isPersistent ? 1 : 0);
1542 mRemote.transact(SET_PERSISTENT_TRANSACTION, data, reply, 0);
1543 reply.readException();
1544 data.recycle();
1545 reply.recycle();
1546 }
1547 public void attachApplication(IApplicationThread app) throws RemoteException
1548 {
1549 Parcel data = Parcel.obtain();
1550 Parcel reply = Parcel.obtain();
1551 data.writeInterfaceToken(IActivityManager.descriptor);
1552 data.writeStrongBinder(app.asBinder());
1553 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
1554 reply.readException();
1555 data.recycle();
1556 reply.recycle();
1557 }
Dianne Hackborne88846e2009-09-30 21:34:25 -07001558 public void activityIdle(IBinder token, Configuration config) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001559 {
1560 Parcel data = Parcel.obtain();
1561 Parcel reply = Parcel.obtain();
1562 data.writeInterfaceToken(IActivityManager.descriptor);
1563 data.writeStrongBinder(token);
Dianne Hackborne88846e2009-09-30 21:34:25 -07001564 if (config != null) {
1565 data.writeInt(1);
1566 config.writeToParcel(data, 0);
1567 } else {
1568 data.writeInt(0);
1569 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001570 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
1571 reply.readException();
1572 data.recycle();
1573 reply.recycle();
1574 }
1575 public void activityPaused(IBinder token, Bundle state) throws RemoteException
1576 {
1577 Parcel data = Parcel.obtain();
1578 Parcel reply = Parcel.obtain();
1579 data.writeInterfaceToken(IActivityManager.descriptor);
1580 data.writeStrongBinder(token);
1581 data.writeBundle(state);
1582 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
1583 reply.readException();
1584 data.recycle();
1585 reply.recycle();
1586 }
1587 public void activityStopped(IBinder token,
1588 Bitmap thumbnail, CharSequence description) throws RemoteException
1589 {
1590 Parcel data = Parcel.obtain();
1591 Parcel reply = Parcel.obtain();
1592 data.writeInterfaceToken(IActivityManager.descriptor);
1593 data.writeStrongBinder(token);
1594 if (thumbnail != null) {
1595 data.writeInt(1);
1596 thumbnail.writeToParcel(data, 0);
1597 } else {
1598 data.writeInt(0);
1599 }
1600 TextUtils.writeToParcel(description, data, 0);
1601 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
1602 reply.readException();
1603 data.recycle();
1604 reply.recycle();
1605 }
1606 public void activityDestroyed(IBinder token) throws RemoteException
1607 {
1608 Parcel data = Parcel.obtain();
1609 Parcel reply = Parcel.obtain();
1610 data.writeInterfaceToken(IActivityManager.descriptor);
1611 data.writeStrongBinder(token);
1612 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
1613 reply.readException();
1614 data.recycle();
1615 reply.recycle();
1616 }
1617 public String getCallingPackage(IBinder token) throws RemoteException
1618 {
1619 Parcel data = Parcel.obtain();
1620 Parcel reply = Parcel.obtain();
1621 data.writeInterfaceToken(IActivityManager.descriptor);
1622 data.writeStrongBinder(token);
1623 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
1624 reply.readException();
1625 String res = reply.readString();
1626 data.recycle();
1627 reply.recycle();
1628 return res;
1629 }
1630 public ComponentName getCallingActivity(IBinder token)
1631 throws RemoteException {
1632 Parcel data = Parcel.obtain();
1633 Parcel reply = Parcel.obtain();
1634 data.writeInterfaceToken(IActivityManager.descriptor);
1635 data.writeStrongBinder(token);
1636 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
1637 reply.readException();
1638 ComponentName res = ComponentName.readFromParcel(reply);
1639 data.recycle();
1640 reply.recycle();
1641 return res;
1642 }
1643 public List getTasks(int maxNum, int flags,
1644 IThumbnailReceiver receiver) throws RemoteException {
1645 Parcel data = Parcel.obtain();
1646 Parcel reply = Parcel.obtain();
1647 data.writeInterfaceToken(IActivityManager.descriptor);
1648 data.writeInt(maxNum);
1649 data.writeInt(flags);
1650 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
1651 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
1652 reply.readException();
1653 ArrayList list = null;
1654 int N = reply.readInt();
1655 if (N >= 0) {
1656 list = new ArrayList();
1657 while (N > 0) {
1658 ActivityManager.RunningTaskInfo info =
1659 ActivityManager.RunningTaskInfo.CREATOR
1660 .createFromParcel(reply);
1661 list.add(info);
1662 N--;
1663 }
1664 }
1665 data.recycle();
1666 reply.recycle();
1667 return list;
1668 }
1669 public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
1670 int flags) throws RemoteException {
1671 Parcel data = Parcel.obtain();
1672 Parcel reply = Parcel.obtain();
1673 data.writeInterfaceToken(IActivityManager.descriptor);
1674 data.writeInt(maxNum);
1675 data.writeInt(flags);
1676 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
1677 reply.readException();
1678 ArrayList<ActivityManager.RecentTaskInfo> list
1679 = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR);
1680 data.recycle();
1681 reply.recycle();
1682 return list;
1683 }
1684 public List getServices(int maxNum, int flags) throws RemoteException {
1685 Parcel data = Parcel.obtain();
1686 Parcel reply = Parcel.obtain();
1687 data.writeInterfaceToken(IActivityManager.descriptor);
1688 data.writeInt(maxNum);
1689 data.writeInt(flags);
1690 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
1691 reply.readException();
1692 ArrayList list = null;
1693 int N = reply.readInt();
1694 if (N >= 0) {
1695 list = new ArrayList();
1696 while (N > 0) {
1697 ActivityManager.RunningServiceInfo info =
1698 ActivityManager.RunningServiceInfo.CREATOR
1699 .createFromParcel(reply);
1700 list.add(info);
1701 N--;
1702 }
1703 }
1704 data.recycle();
1705 reply.recycle();
1706 return list;
1707 }
1708 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
1709 throws RemoteException {
1710 Parcel data = Parcel.obtain();
1711 Parcel reply = Parcel.obtain();
1712 data.writeInterfaceToken(IActivityManager.descriptor);
1713 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
1714 reply.readException();
1715 ArrayList<ActivityManager.ProcessErrorStateInfo> list
1716 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
1717 data.recycle();
1718 reply.recycle();
1719 return list;
1720 }
1721 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
1722 throws RemoteException {
1723 Parcel data = Parcel.obtain();
1724 Parcel reply = Parcel.obtain();
1725 data.writeInterfaceToken(IActivityManager.descriptor);
1726 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
1727 reply.readException();
1728 ArrayList<ActivityManager.RunningAppProcessInfo> list
1729 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
1730 data.recycle();
1731 reply.recycle();
1732 return list;
1733 }
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -07001734 public List<ApplicationInfo> getRunningExternalApplications()
1735 throws RemoteException {
1736 Parcel data = Parcel.obtain();
1737 Parcel reply = Parcel.obtain();
1738 data.writeInterfaceToken(IActivityManager.descriptor);
1739 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
1740 reply.readException();
1741 ArrayList<ApplicationInfo> list
1742 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
1743 data.recycle();
1744 reply.recycle();
1745 return list;
1746 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001747 public void moveTaskToFront(int task) throws RemoteException
1748 {
1749 Parcel data = Parcel.obtain();
1750 Parcel reply = Parcel.obtain();
1751 data.writeInterfaceToken(IActivityManager.descriptor);
1752 data.writeInt(task);
1753 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
1754 reply.readException();
1755 data.recycle();
1756 reply.recycle();
1757 }
1758 public void moveTaskToBack(int task) throws RemoteException
1759 {
1760 Parcel data = Parcel.obtain();
1761 Parcel reply = Parcel.obtain();
1762 data.writeInterfaceToken(IActivityManager.descriptor);
1763 data.writeInt(task);
1764 mRemote.transact(MOVE_TASK_TO_BACK_TRANSACTION, data, reply, 0);
1765 reply.readException();
1766 data.recycle();
1767 reply.recycle();
1768 }
1769 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
1770 throws RemoteException {
1771 Parcel data = Parcel.obtain();
1772 Parcel reply = Parcel.obtain();
1773 data.writeInterfaceToken(IActivityManager.descriptor);
1774 data.writeStrongBinder(token);
1775 data.writeInt(nonRoot ? 1 : 0);
1776 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
1777 reply.readException();
1778 boolean res = reply.readInt() != 0;
1779 data.recycle();
1780 reply.recycle();
1781 return res;
1782 }
1783 public void moveTaskBackwards(int task) throws RemoteException
1784 {
1785 Parcel data = Parcel.obtain();
1786 Parcel reply = Parcel.obtain();
1787 data.writeInterfaceToken(IActivityManager.descriptor);
1788 data.writeInt(task);
1789 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
1790 reply.readException();
1791 data.recycle();
1792 reply.recycle();
1793 }
1794 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
1795 {
1796 Parcel data = Parcel.obtain();
1797 Parcel reply = Parcel.obtain();
1798 data.writeInterfaceToken(IActivityManager.descriptor);
1799 data.writeStrongBinder(token);
1800 data.writeInt(onlyRoot ? 1 : 0);
1801 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
1802 reply.readException();
1803 int res = reply.readInt();
1804 data.recycle();
1805 reply.recycle();
1806 return res;
1807 }
1808 public void finishOtherInstances(IBinder token, ComponentName className) throws RemoteException
1809 {
1810 Parcel data = Parcel.obtain();
1811 Parcel reply = Parcel.obtain();
1812 data.writeInterfaceToken(IActivityManager.descriptor);
1813 data.writeStrongBinder(token);
1814 ComponentName.writeToParcel(className, data);
1815 mRemote.transact(FINISH_OTHER_INSTANCES_TRANSACTION, data, reply, 0);
1816 reply.readException();
1817 data.recycle();
1818 reply.recycle();
1819 }
1820 public void reportThumbnail(IBinder token,
1821 Bitmap thumbnail, CharSequence description) throws RemoteException
1822 {
1823 Parcel data = Parcel.obtain();
1824 Parcel reply = Parcel.obtain();
1825 data.writeInterfaceToken(IActivityManager.descriptor);
1826 data.writeStrongBinder(token);
1827 if (thumbnail != null) {
1828 data.writeInt(1);
1829 thumbnail.writeToParcel(data, 0);
1830 } else {
1831 data.writeInt(0);
1832 }
1833 TextUtils.writeToParcel(description, data, 0);
1834 mRemote.transact(REPORT_THUMBNAIL_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
1835 reply.readException();
1836 data.recycle();
1837 reply.recycle();
1838 }
1839 public ContentProviderHolder getContentProvider(IApplicationThread caller,
1840 String name) throws RemoteException
1841 {
1842 Parcel data = Parcel.obtain();
1843 Parcel reply = Parcel.obtain();
1844 data.writeInterfaceToken(IActivityManager.descriptor);
1845 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1846 data.writeString(name);
1847 mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
1848 reply.readException();
1849 int res = reply.readInt();
1850 ContentProviderHolder cph = null;
1851 if (res != 0) {
1852 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
1853 }
1854 data.recycle();
1855 reply.recycle();
1856 return cph;
1857 }
1858 public void publishContentProviders(IApplicationThread caller,
1859 List<ContentProviderHolder> providers) throws RemoteException
1860 {
1861 Parcel data = Parcel.obtain();
1862 Parcel reply = Parcel.obtain();
1863 data.writeInterfaceToken(IActivityManager.descriptor);
1864 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1865 data.writeTypedList(providers);
1866 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
1867 reply.readException();
1868 data.recycle();
1869 reply.recycle();
1870 }
1871
1872 public void removeContentProvider(IApplicationThread caller,
1873 String name) throws RemoteException {
1874 Parcel data = Parcel.obtain();
1875 Parcel reply = Parcel.obtain();
1876 data.writeInterfaceToken(IActivityManager.descriptor);
1877 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1878 data.writeString(name);
1879 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
1880 reply.readException();
1881 data.recycle();
1882 reply.recycle();
1883 }
1884
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07001885 public PendingIntent getRunningServiceControlPanel(ComponentName service)
1886 throws RemoteException
1887 {
1888 Parcel data = Parcel.obtain();
1889 Parcel reply = Parcel.obtain();
1890 data.writeInterfaceToken(IActivityManager.descriptor);
1891 service.writeToParcel(data, 0);
1892 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
1893 reply.readException();
1894 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
1895 data.recycle();
1896 reply.recycle();
1897 return res;
1898 }
1899
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001900 public ComponentName startService(IApplicationThread caller, Intent service,
1901 String resolvedType) throws RemoteException
1902 {
1903 Parcel data = Parcel.obtain();
1904 Parcel reply = Parcel.obtain();
1905 data.writeInterfaceToken(IActivityManager.descriptor);
1906 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1907 service.writeToParcel(data, 0);
1908 data.writeString(resolvedType);
1909 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
1910 reply.readException();
1911 ComponentName res = ComponentName.readFromParcel(reply);
1912 data.recycle();
1913 reply.recycle();
1914 return res;
1915 }
1916 public int stopService(IApplicationThread caller, Intent service,
1917 String resolvedType) throws RemoteException
1918 {
1919 Parcel data = Parcel.obtain();
1920 Parcel reply = Parcel.obtain();
1921 data.writeInterfaceToken(IActivityManager.descriptor);
1922 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1923 service.writeToParcel(data, 0);
1924 data.writeString(resolvedType);
1925 mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0);
1926 reply.readException();
1927 int res = reply.readInt();
1928 reply.recycle();
1929 data.recycle();
1930 return res;
1931 }
1932 public boolean stopServiceToken(ComponentName className, IBinder token,
1933 int startId) throws RemoteException {
1934 Parcel data = Parcel.obtain();
1935 Parcel reply = Parcel.obtain();
1936 data.writeInterfaceToken(IActivityManager.descriptor);
1937 ComponentName.writeToParcel(className, data);
1938 data.writeStrongBinder(token);
1939 data.writeInt(startId);
1940 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
1941 reply.readException();
1942 boolean res = reply.readInt() != 0;
1943 data.recycle();
1944 reply.recycle();
1945 return res;
1946 }
1947 public void setServiceForeground(ComponentName className, IBinder token,
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07001948 int id, Notification notification, boolean removeNotification) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001949 Parcel data = Parcel.obtain();
1950 Parcel reply = Parcel.obtain();
1951 data.writeInterfaceToken(IActivityManager.descriptor);
1952 ComponentName.writeToParcel(className, data);
1953 data.writeStrongBinder(token);
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07001954 data.writeInt(id);
1955 if (notification != null) {
1956 data.writeInt(1);
1957 notification.writeToParcel(data, 0);
1958 } else {
1959 data.writeInt(0);
1960 }
1961 data.writeInt(removeNotification ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001962 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
1963 reply.readException();
1964 data.recycle();
1965 reply.recycle();
1966 }
1967 public int bindService(IApplicationThread caller, IBinder token,
1968 Intent service, String resolvedType, IServiceConnection connection,
1969 int flags) throws RemoteException {
1970 Parcel data = Parcel.obtain();
1971 Parcel reply = Parcel.obtain();
1972 data.writeInterfaceToken(IActivityManager.descriptor);
1973 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1974 data.writeStrongBinder(token);
1975 service.writeToParcel(data, 0);
1976 data.writeString(resolvedType);
1977 data.writeStrongBinder(connection.asBinder());
1978 data.writeInt(flags);
1979 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
1980 reply.readException();
1981 int res = reply.readInt();
1982 data.recycle();
1983 reply.recycle();
1984 return res;
1985 }
1986 public boolean unbindService(IServiceConnection connection) throws RemoteException
1987 {
1988 Parcel data = Parcel.obtain();
1989 Parcel reply = Parcel.obtain();
1990 data.writeInterfaceToken(IActivityManager.descriptor);
1991 data.writeStrongBinder(connection.asBinder());
1992 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
1993 reply.readException();
1994 boolean res = reply.readInt() != 0;
1995 data.recycle();
1996 reply.recycle();
1997 return res;
1998 }
1999
2000 public void publishService(IBinder token,
2001 Intent intent, IBinder service) throws RemoteException {
2002 Parcel data = Parcel.obtain();
2003 Parcel reply = Parcel.obtain();
2004 data.writeInterfaceToken(IActivityManager.descriptor);
2005 data.writeStrongBinder(token);
2006 intent.writeToParcel(data, 0);
2007 data.writeStrongBinder(service);
2008 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
2009 reply.readException();
2010 data.recycle();
2011 reply.recycle();
2012 }
2013
2014 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
2015 throws RemoteException {
2016 Parcel data = Parcel.obtain();
2017 Parcel reply = Parcel.obtain();
2018 data.writeInterfaceToken(IActivityManager.descriptor);
2019 data.writeStrongBinder(token);
2020 intent.writeToParcel(data, 0);
2021 data.writeInt(doRebind ? 1 : 0);
2022 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
2023 reply.readException();
2024 data.recycle();
2025 reply.recycle();
2026 }
2027
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07002028 public void serviceDoneExecuting(IBinder token, int type, int startId,
2029 int res) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002030 Parcel data = Parcel.obtain();
2031 Parcel reply = Parcel.obtain();
2032 data.writeInterfaceToken(IActivityManager.descriptor);
2033 data.writeStrongBinder(token);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07002034 data.writeInt(type);
2035 data.writeInt(startId);
2036 data.writeInt(res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002037 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2038 reply.readException();
2039 data.recycle();
2040 reply.recycle();
2041 }
2042
2043 public IBinder peekService(Intent service, String resolvedType) throws RemoteException {
2044 Parcel data = Parcel.obtain();
2045 Parcel reply = Parcel.obtain();
2046 data.writeInterfaceToken(IActivityManager.descriptor);
2047 service.writeToParcel(data, 0);
2048 data.writeString(resolvedType);
2049 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
2050 reply.readException();
2051 IBinder binder = reply.readStrongBinder();
2052 reply.recycle();
2053 data.recycle();
2054 return binder;
2055 }
2056
Christopher Tate181fafa2009-05-14 11:12:14 -07002057 public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
2058 throws RemoteException {
2059 Parcel data = Parcel.obtain();
2060 Parcel reply = Parcel.obtain();
2061 data.writeInterfaceToken(IActivityManager.descriptor);
2062 app.writeToParcel(data, 0);
2063 data.writeInt(backupRestoreMode);
2064 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
2065 reply.readException();
2066 boolean success = reply.readInt() != 0;
2067 reply.recycle();
2068 data.recycle();
2069 return success;
2070 }
2071
2072 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
2073 Parcel data = Parcel.obtain();
2074 Parcel reply = Parcel.obtain();
2075 data.writeInterfaceToken(IActivityManager.descriptor);
2076 data.writeString(packageName);
2077 data.writeStrongBinder(agent);
2078 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
2079 reply.recycle();
2080 data.recycle();
2081 }
2082
2083 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
2084 Parcel data = Parcel.obtain();
2085 Parcel reply = Parcel.obtain();
2086 data.writeInterfaceToken(IActivityManager.descriptor);
2087 app.writeToParcel(data, 0);
2088 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
2089 reply.readException();
2090 reply.recycle();
2091 data.recycle();
2092 }
2093
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002094 public boolean startInstrumentation(ComponentName className, String profileFile,
2095 int flags, Bundle arguments, IInstrumentationWatcher watcher)
2096 throws RemoteException {
2097 Parcel data = Parcel.obtain();
2098 Parcel reply = Parcel.obtain();
2099 data.writeInterfaceToken(IActivityManager.descriptor);
2100 ComponentName.writeToParcel(className, data);
2101 data.writeString(profileFile);
2102 data.writeInt(flags);
2103 data.writeBundle(arguments);
2104 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
2105 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
2106 reply.readException();
2107 boolean res = reply.readInt() != 0;
2108 reply.recycle();
2109 data.recycle();
2110 return res;
2111 }
2112
2113 public void finishInstrumentation(IApplicationThread target,
2114 int resultCode, Bundle results) throws RemoteException {
2115 Parcel data = Parcel.obtain();
2116 Parcel reply = Parcel.obtain();
2117 data.writeInterfaceToken(IActivityManager.descriptor);
2118 data.writeStrongBinder(target != null ? target.asBinder() : null);
2119 data.writeInt(resultCode);
2120 data.writeBundle(results);
2121 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
2122 reply.readException();
2123 data.recycle();
2124 reply.recycle();
2125 }
2126 public Configuration getConfiguration() throws RemoteException
2127 {
2128 Parcel data = Parcel.obtain();
2129 Parcel reply = Parcel.obtain();
2130 data.writeInterfaceToken(IActivityManager.descriptor);
2131 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
2132 reply.readException();
2133 Configuration res = Configuration.CREATOR.createFromParcel(reply);
2134 reply.recycle();
2135 data.recycle();
2136 return res;
2137 }
2138 public void updateConfiguration(Configuration values) throws RemoteException
2139 {
2140 Parcel data = Parcel.obtain();
2141 Parcel reply = Parcel.obtain();
2142 data.writeInterfaceToken(IActivityManager.descriptor);
2143 values.writeToParcel(data, 0);
2144 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
2145 reply.readException();
2146 data.recycle();
2147 reply.recycle();
2148 }
2149 public void setRequestedOrientation(IBinder token, int requestedOrientation)
2150 throws RemoteException {
2151 Parcel data = Parcel.obtain();
2152 Parcel reply = Parcel.obtain();
2153 data.writeInterfaceToken(IActivityManager.descriptor);
2154 data.writeStrongBinder(token);
2155 data.writeInt(requestedOrientation);
2156 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
2157 reply.readException();
2158 data.recycle();
2159 reply.recycle();
2160 }
2161 public int getRequestedOrientation(IBinder token) throws RemoteException {
2162 Parcel data = Parcel.obtain();
2163 Parcel reply = Parcel.obtain();
2164 data.writeInterfaceToken(IActivityManager.descriptor);
2165 data.writeStrongBinder(token);
2166 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
2167 reply.readException();
2168 int res = reply.readInt();
2169 data.recycle();
2170 reply.recycle();
2171 return res;
2172 }
2173 public ComponentName getActivityClassForToken(IBinder token)
2174 throws RemoteException {
2175 Parcel data = Parcel.obtain();
2176 Parcel reply = Parcel.obtain();
2177 data.writeInterfaceToken(IActivityManager.descriptor);
2178 data.writeStrongBinder(token);
2179 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
2180 reply.readException();
2181 ComponentName res = ComponentName.readFromParcel(reply);
2182 data.recycle();
2183 reply.recycle();
2184 return res;
2185 }
2186 public String getPackageForToken(IBinder token) throws RemoteException
2187 {
2188 Parcel data = Parcel.obtain();
2189 Parcel reply = Parcel.obtain();
2190 data.writeInterfaceToken(IActivityManager.descriptor);
2191 data.writeStrongBinder(token);
2192 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
2193 reply.readException();
2194 String res = reply.readString();
2195 data.recycle();
2196 reply.recycle();
2197 return res;
2198 }
2199 public IIntentSender getIntentSender(int type,
2200 String packageName, IBinder token, String resultWho,
2201 int requestCode, Intent intent, String resolvedType, int flags)
2202 throws RemoteException {
2203 Parcel data = Parcel.obtain();
2204 Parcel reply = Parcel.obtain();
2205 data.writeInterfaceToken(IActivityManager.descriptor);
2206 data.writeInt(type);
2207 data.writeString(packageName);
2208 data.writeStrongBinder(token);
2209 data.writeString(resultWho);
2210 data.writeInt(requestCode);
2211 if (intent != null) {
2212 data.writeInt(1);
2213 intent.writeToParcel(data, 0);
2214 } else {
2215 data.writeInt(0);
2216 }
2217 data.writeString(resolvedType);
2218 data.writeInt(flags);
2219 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
2220 reply.readException();
2221 IIntentSender res = IIntentSender.Stub.asInterface(
2222 reply.readStrongBinder());
2223 data.recycle();
2224 reply.recycle();
2225 return res;
2226 }
2227 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
2228 Parcel data = Parcel.obtain();
2229 Parcel reply = Parcel.obtain();
2230 data.writeInterfaceToken(IActivityManager.descriptor);
2231 data.writeStrongBinder(sender.asBinder());
2232 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
2233 reply.readException();
2234 data.recycle();
2235 reply.recycle();
2236 }
2237 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
2238 Parcel data = Parcel.obtain();
2239 Parcel reply = Parcel.obtain();
2240 data.writeInterfaceToken(IActivityManager.descriptor);
2241 data.writeStrongBinder(sender.asBinder());
2242 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
2243 reply.readException();
2244 String res = reply.readString();
2245 data.recycle();
2246 reply.recycle();
2247 return res;
2248 }
2249 public void setProcessLimit(int max) throws RemoteException
2250 {
2251 Parcel data = Parcel.obtain();
2252 Parcel reply = Parcel.obtain();
2253 data.writeInterfaceToken(IActivityManager.descriptor);
2254 data.writeInt(max);
2255 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
2256 reply.readException();
2257 data.recycle();
2258 reply.recycle();
2259 }
2260 public int getProcessLimit() throws RemoteException
2261 {
2262 Parcel data = Parcel.obtain();
2263 Parcel reply = Parcel.obtain();
2264 data.writeInterfaceToken(IActivityManager.descriptor);
2265 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
2266 reply.readException();
2267 int res = reply.readInt();
2268 data.recycle();
2269 reply.recycle();
2270 return res;
2271 }
2272 public void setProcessForeground(IBinder token, int pid,
2273 boolean isForeground) throws RemoteException {
2274 Parcel data = Parcel.obtain();
2275 Parcel reply = Parcel.obtain();
2276 data.writeInterfaceToken(IActivityManager.descriptor);
2277 data.writeStrongBinder(token);
2278 data.writeInt(pid);
2279 data.writeInt(isForeground ? 1 : 0);
2280 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
2281 reply.readException();
2282 data.recycle();
2283 reply.recycle();
2284 }
2285 public int checkPermission(String permission, int pid, int uid)
2286 throws RemoteException {
2287 Parcel data = Parcel.obtain();
2288 Parcel reply = Parcel.obtain();
2289 data.writeInterfaceToken(IActivityManager.descriptor);
2290 data.writeString(permission);
2291 data.writeInt(pid);
2292 data.writeInt(uid);
2293 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
2294 reply.readException();
2295 int res = reply.readInt();
2296 data.recycle();
2297 reply.recycle();
2298 return res;
2299 }
2300 public boolean clearApplicationUserData(final String packageName,
2301 final IPackageDataObserver observer) throws RemoteException {
2302 Parcel data = Parcel.obtain();
2303 Parcel reply = Parcel.obtain();
2304 data.writeInterfaceToken(IActivityManager.descriptor);
2305 data.writeString(packageName);
2306 data.writeStrongBinder(observer.asBinder());
2307 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
2308 reply.readException();
2309 boolean res = reply.readInt() != 0;
2310 data.recycle();
2311 reply.recycle();
2312 return res;
2313 }
2314 public int checkUriPermission(Uri uri, int pid, int uid, int mode)
2315 throws RemoteException {
2316 Parcel data = Parcel.obtain();
2317 Parcel reply = Parcel.obtain();
2318 data.writeInterfaceToken(IActivityManager.descriptor);
2319 uri.writeToParcel(data, 0);
2320 data.writeInt(pid);
2321 data.writeInt(uid);
2322 data.writeInt(mode);
2323 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
2324 reply.readException();
2325 int res = reply.readInt();
2326 data.recycle();
2327 reply.recycle();
2328 return res;
2329 }
2330 public void grantUriPermission(IApplicationThread caller, String targetPkg,
2331 Uri uri, int mode) throws RemoteException {
2332 Parcel data = Parcel.obtain();
2333 Parcel reply = Parcel.obtain();
2334 data.writeInterfaceToken(IActivityManager.descriptor);
2335 data.writeStrongBinder(caller.asBinder());
2336 data.writeString(targetPkg);
2337 uri.writeToParcel(data, 0);
2338 data.writeInt(mode);
2339 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
2340 reply.readException();
2341 data.recycle();
2342 reply.recycle();
2343 }
2344 public void revokeUriPermission(IApplicationThread caller, Uri uri,
2345 int mode) throws RemoteException {
2346 Parcel data = Parcel.obtain();
2347 Parcel reply = Parcel.obtain();
2348 data.writeInterfaceToken(IActivityManager.descriptor);
2349 data.writeStrongBinder(caller.asBinder());
2350 uri.writeToParcel(data, 0);
2351 data.writeInt(mode);
2352 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
2353 reply.readException();
2354 data.recycle();
2355 reply.recycle();
2356 }
2357 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
2358 throws RemoteException {
2359 Parcel data = Parcel.obtain();
2360 Parcel reply = Parcel.obtain();
2361 data.writeInterfaceToken(IActivityManager.descriptor);
2362 data.writeStrongBinder(who.asBinder());
2363 data.writeInt(waiting ? 1 : 0);
2364 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
2365 reply.readException();
2366 data.recycle();
2367 reply.recycle();
2368 }
2369 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
2370 Parcel data = Parcel.obtain();
2371 Parcel reply = Parcel.obtain();
2372 data.writeInterfaceToken(IActivityManager.descriptor);
2373 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
2374 reply.readException();
2375 outInfo.readFromParcel(reply);
2376 data.recycle();
2377 reply.recycle();
2378 }
2379 public void unhandledBack() throws RemoteException
2380 {
2381 Parcel data = Parcel.obtain();
2382 Parcel reply = Parcel.obtain();
2383 data.writeInterfaceToken(IActivityManager.descriptor);
2384 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
2385 reply.readException();
2386 data.recycle();
2387 reply.recycle();
2388 }
2389 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
2390 {
2391 Parcel data = Parcel.obtain();
2392 Parcel reply = Parcel.obtain();
2393 data.writeInterfaceToken(IActivityManager.descriptor);
2394 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
2395 reply.readException();
2396 ParcelFileDescriptor pfd = null;
2397 if (reply.readInt() != 0) {
2398 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
2399 }
2400 data.recycle();
2401 reply.recycle();
2402 return pfd;
2403 }
2404 public void goingToSleep() throws RemoteException
2405 {
2406 Parcel data = Parcel.obtain();
2407 Parcel reply = Parcel.obtain();
2408 data.writeInterfaceToken(IActivityManager.descriptor);
2409 mRemote.transact(GOING_TO_SLEEP_TRANSACTION, data, reply, 0);
2410 reply.readException();
2411 data.recycle();
2412 reply.recycle();
2413 }
2414 public void wakingUp() throws RemoteException
2415 {
2416 Parcel data = Parcel.obtain();
2417 Parcel reply = Parcel.obtain();
2418 data.writeInterfaceToken(IActivityManager.descriptor);
2419 mRemote.transact(WAKING_UP_TRANSACTION, data, reply, 0);
2420 reply.readException();
2421 data.recycle();
2422 reply.recycle();
2423 }
2424 public void setDebugApp(
2425 String packageName, boolean waitForDebugger, boolean persistent)
2426 throws RemoteException
2427 {
2428 Parcel data = Parcel.obtain();
2429 Parcel reply = Parcel.obtain();
2430 data.writeInterfaceToken(IActivityManager.descriptor);
2431 data.writeString(packageName);
2432 data.writeInt(waitForDebugger ? 1 : 0);
2433 data.writeInt(persistent ? 1 : 0);
2434 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
2435 reply.readException();
2436 data.recycle();
2437 reply.recycle();
2438 }
2439 public void setAlwaysFinish(boolean enabled) throws RemoteException
2440 {
2441 Parcel data = Parcel.obtain();
2442 Parcel reply = Parcel.obtain();
2443 data.writeInterfaceToken(IActivityManager.descriptor);
2444 data.writeInt(enabled ? 1 : 0);
2445 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
2446 reply.readException();
2447 data.recycle();
2448 reply.recycle();
2449 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07002450 public void setActivityController(IActivityController watcher) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002451 {
2452 Parcel data = Parcel.obtain();
2453 Parcel reply = Parcel.obtain();
2454 data.writeInterfaceToken(IActivityManager.descriptor);
2455 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07002456 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002457 reply.readException();
2458 data.recycle();
2459 reply.recycle();
2460 }
2461 public void enterSafeMode() throws RemoteException {
2462 Parcel data = Parcel.obtain();
2463 data.writeInterfaceToken(IActivityManager.descriptor);
2464 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
2465 data.recycle();
2466 }
2467 public void noteWakeupAlarm(IIntentSender sender) throws RemoteException {
2468 Parcel data = Parcel.obtain();
2469 data.writeStrongBinder(sender.asBinder());
2470 data.writeInterfaceToken(IActivityManager.descriptor);
2471 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
2472 data.recycle();
2473 }
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07002474 public boolean killPids(int[] pids, String reason) 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);
2478 data.writeIntArray(pids);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07002479 data.writeString(reason);
2480 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002481 boolean res = reply.readInt() != 0;
2482 data.recycle();
2483 reply.recycle();
2484 return res;
2485 }
2486 public void reportPss(IApplicationThread caller, int pss) throws RemoteException {
2487 Parcel data = Parcel.obtain();
2488 data.writeInterfaceToken(IActivityManager.descriptor);
2489 data.writeStrongBinder(caller.asBinder());
2490 data.writeInt(pss);
2491 mRemote.transact(REPORT_PSS_TRANSACTION, data, null, 0);
2492 data.recycle();
2493 }
2494 public void startRunning(String pkg, String cls, String action,
2495 String indata) throws RemoteException {
2496 Parcel data = Parcel.obtain();
2497 Parcel reply = Parcel.obtain();
2498 data.writeInterfaceToken(IActivityManager.descriptor);
2499 data.writeString(pkg);
2500 data.writeString(cls);
2501 data.writeString(action);
2502 data.writeString(indata);
2503 mRemote.transact(START_RUNNING_TRANSACTION, data, reply, 0);
2504 reply.readException();
2505 data.recycle();
2506 reply.recycle();
2507 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002508 public boolean testIsSystemReady()
2509 {
2510 /* this base class version is never called */
2511 return true;
2512 }
Dan Egnor60d87622009-12-16 16:32:58 -08002513 public void handleApplicationCrash(IBinder app,
2514 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
2515 {
2516 Parcel data = Parcel.obtain();
2517 Parcel reply = Parcel.obtain();
2518 data.writeInterfaceToken(IActivityManager.descriptor);
2519 data.writeStrongBinder(app);
2520 crashInfo.writeToParcel(data, 0);
2521 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
2522 reply.readException();
2523 reply.recycle();
2524 data.recycle();
2525 }
2526 public boolean handleApplicationWtf(IBinder app, String tag,
Dan Egnorb7f03672009-12-09 16:22:32 -08002527 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002528 {
2529 Parcel data = Parcel.obtain();
2530 Parcel reply = Parcel.obtain();
2531 data.writeInterfaceToken(IActivityManager.descriptor);
2532 data.writeStrongBinder(app);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002533 data.writeString(tag);
Dan Egnorb7f03672009-12-09 16:22:32 -08002534 crashInfo.writeToParcel(data, 0);
Dan Egnor60d87622009-12-16 16:32:58 -08002535 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002536 reply.readException();
Dan Egnor60d87622009-12-16 16:32:58 -08002537 boolean res = reply.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002538 reply.recycle();
2539 data.recycle();
Dan Egnor60d87622009-12-16 16:32:58 -08002540 return res;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002541 }
Dan Egnorb7f03672009-12-09 16:22:32 -08002542
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002543 public void signalPersistentProcesses(int sig) throws RemoteException {
2544 Parcel data = Parcel.obtain();
2545 Parcel reply = Parcel.obtain();
2546 data.writeInterfaceToken(IActivityManager.descriptor);
2547 data.writeInt(sig);
2548 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
2549 reply.readException();
2550 data.recycle();
2551 reply.recycle();
2552 }
2553
Dianne Hackborn03abb812010-01-04 18:43:19 -08002554 public void killBackgroundProcesses(String packageName) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002555 Parcel data = Parcel.obtain();
2556 Parcel reply = Parcel.obtain();
2557 data.writeInterfaceToken(IActivityManager.descriptor);
2558 data.writeString(packageName);
Dianne Hackborn03abb812010-01-04 18:43:19 -08002559 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
2560 reply.readException();
2561 data.recycle();
2562 reply.recycle();
2563 }
2564
2565 public void forceStopPackage(String packageName) throws RemoteException {
2566 Parcel data = Parcel.obtain();
2567 Parcel reply = Parcel.obtain();
2568 data.writeInterfaceToken(IActivityManager.descriptor);
2569 data.writeString(packageName);
2570 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002571 reply.readException();
2572 data.recycle();
2573 reply.recycle();
2574 }
2575
2576 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
2577 {
2578 Parcel data = Parcel.obtain();
2579 Parcel reply = Parcel.obtain();
2580 data.writeInterfaceToken(IActivityManager.descriptor);
2581 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
2582 reply.readException();
2583 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
2584 reply.recycle();
2585 data.recycle();
2586 return res;
2587 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08002588
2589 public boolean profileControl(String process, boolean start,
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07002590 String path, ParcelFileDescriptor fd) throws RemoteException
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08002591 {
2592 Parcel data = Parcel.obtain();
2593 Parcel reply = Parcel.obtain();
2594 data.writeInterfaceToken(IActivityManager.descriptor);
2595 data.writeString(process);
2596 data.writeInt(start ? 1 : 0);
2597 data.writeString(path);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07002598 if (fd != null) {
2599 data.writeInt(1);
2600 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2601 } else {
2602 data.writeInt(0);
2603 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08002604 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
2605 reply.readException();
2606 boolean res = reply.readInt() != 0;
2607 reply.recycle();
2608 data.recycle();
2609 return res;
2610 }
2611
Dianne Hackborn55280a92009-05-07 15:53:46 -07002612 public boolean shutdown(int timeout) throws RemoteException
2613 {
2614 Parcel data = Parcel.obtain();
2615 Parcel reply = Parcel.obtain();
2616 data.writeInterfaceToken(IActivityManager.descriptor);
2617 data.writeInt(timeout);
2618 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
2619 reply.readException();
2620 boolean res = reply.readInt() != 0;
2621 reply.recycle();
2622 data.recycle();
2623 return res;
2624 }
2625
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07002626 public void stopAppSwitches() throws RemoteException {
2627 Parcel data = Parcel.obtain();
2628 Parcel reply = Parcel.obtain();
2629 data.writeInterfaceToken(IActivityManager.descriptor);
2630 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
2631 reply.readException();
2632 reply.recycle();
2633 data.recycle();
2634 }
2635
2636 public void resumeAppSwitches() throws RemoteException {
2637 Parcel data = Parcel.obtain();
2638 Parcel reply = Parcel.obtain();
2639 data.writeInterfaceToken(IActivityManager.descriptor);
2640 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
2641 reply.readException();
2642 reply.recycle();
2643 data.recycle();
2644 }
2645
Dianne Hackbornb06ea702009-07-13 13:07:51 -07002646 public void registerActivityWatcher(IActivityWatcher watcher)
2647 throws RemoteException {
2648 Parcel data = Parcel.obtain();
2649 Parcel reply = Parcel.obtain();
2650 data.writeInterfaceToken(IActivityManager.descriptor);
2651 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
2652 mRemote.transact(REGISTER_ACTIVITY_WATCHER_TRANSACTION, data, reply, 0);
2653 reply.readException();
2654 data.recycle();
2655 reply.recycle();
2656 }
2657
2658 public void unregisterActivityWatcher(IActivityWatcher watcher)
2659 throws RemoteException {
2660 Parcel data = Parcel.obtain();
2661 Parcel reply = Parcel.obtain();
2662 data.writeInterfaceToken(IActivityManager.descriptor);
2663 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
2664 mRemote.transact(UNREGISTER_ACTIVITY_WATCHER_TRANSACTION, data, reply, 0);
2665 reply.readException();
2666 data.recycle();
2667 reply.recycle();
2668 }
2669
Dianne Hackborn2d91af02009-07-16 13:34:33 -07002670 public int startActivityInPackage(int uid,
2671 Intent intent, String resolvedType, IBinder resultTo,
2672 String resultWho, int requestCode, boolean onlyIfNeeded)
2673 throws RemoteException {
2674 Parcel data = Parcel.obtain();
2675 Parcel reply = Parcel.obtain();
2676 data.writeInterfaceToken(IActivityManager.descriptor);
2677 data.writeInt(uid);
2678 intent.writeToParcel(data, 0);
2679 data.writeString(resolvedType);
2680 data.writeStrongBinder(resultTo);
2681 data.writeString(resultWho);
2682 data.writeInt(requestCode);
2683 data.writeInt(onlyIfNeeded ? 1 : 0);
2684 mRemote.transact(START_ACTIVITY_IN_PACKAGE_TRANSACTION, data, reply, 0);
2685 reply.readException();
2686 int result = reply.readInt();
2687 reply.recycle();
2688 data.recycle();
2689 return result;
2690 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07002691
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07002692 public void killApplicationWithUid(String pkg, int uid) throws RemoteException {
2693 Parcel data = Parcel.obtain();
2694 Parcel reply = Parcel.obtain();
2695 data.writeInterfaceToken(IActivityManager.descriptor);
2696 data.writeString(pkg);
2697 data.writeInt(uid);
2698 mRemote.transact(KILL_APPLICATION_WITH_UID_TRANSACTION, data, reply, 0);
2699 reply.readException();
2700 data.recycle();
2701 reply.recycle();
2702 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07002703
2704 public void closeSystemDialogs(String reason) throws RemoteException {
2705 Parcel data = Parcel.obtain();
2706 Parcel reply = Parcel.obtain();
2707 data.writeInterfaceToken(IActivityManager.descriptor);
2708 data.writeString(reason);
2709 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
2710 reply.readException();
2711 data.recycle();
2712 reply.recycle();
2713 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07002714
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07002715 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
Dianne Hackborn3025ef32009-08-31 21:31:47 -07002716 throws RemoteException {
2717 Parcel data = Parcel.obtain();
2718 Parcel reply = Parcel.obtain();
2719 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07002720 data.writeIntArray(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07002721 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
2722 reply.readException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07002723 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07002724 data.recycle();
2725 reply.recycle();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07002726 return res;
Dianne Hackborn3025ef32009-08-31 21:31:47 -07002727 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07002728
2729 public void killApplicationProcess(String processName, int uid) throws RemoteException {
2730 Parcel data = Parcel.obtain();
2731 Parcel reply = Parcel.obtain();
2732 data.writeInterfaceToken(IActivityManager.descriptor);
2733 data.writeString(processName);
2734 data.writeInt(uid);
2735 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
2736 reply.readException();
2737 data.recycle();
2738 reply.recycle();
2739 }
2740
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07002741 public void overridePendingTransition(IBinder token, String packageName,
2742 int enterAnim, int exitAnim) throws RemoteException {
2743 Parcel data = Parcel.obtain();
2744 Parcel reply = Parcel.obtain();
2745 data.writeInterfaceToken(IActivityManager.descriptor);
2746 data.writeStrongBinder(token);
2747 data.writeString(packageName);
2748 data.writeInt(enterAnim);
2749 data.writeInt(exitAnim);
2750 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
2751 reply.readException();
2752 data.recycle();
2753 reply.recycle();
2754 }
2755
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08002756 public boolean isUserAMonkey() throws RemoteException {
2757 Parcel data = Parcel.obtain();
2758 Parcel reply = Parcel.obtain();
2759 data.writeInterfaceToken(IActivityManager.descriptor);
2760 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
2761 reply.readException();
2762 boolean res = reply.readInt() != 0;
2763 data.recycle();
2764 reply.recycle();
2765 return res;
2766 }
2767
Dianne Hackborn860755f2010-06-03 18:47:52 -07002768 public void finishHeavyWeightApp() throws RemoteException {
2769 Parcel data = Parcel.obtain();
2770 Parcel reply = Parcel.obtain();
2771 data.writeInterfaceToken(IActivityManager.descriptor);
2772 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
2773 reply.readException();
2774 data.recycle();
2775 reply.recycle();
2776 }
2777
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002778 private IBinder mRemote;
2779}