blob: 7daaf7da88e99c0a32f97eced10150519ada4c79 [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;
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -070040import android.os.StrictMode;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080041import android.text.TextUtils;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080042import android.util.Log;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080043import android.util.Singleton;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080044
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080045import java.util.ArrayList;
46import java.util.List;
47
48/** {@hide} */
49public abstract class ActivityManagerNative extends Binder implements IActivityManager
50{
51 /**
52 * Cast a Binder object into an activity manager interface, generating
53 * a proxy if needed.
54 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080055 static public IActivityManager asInterface(IBinder obj) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056 if (obj == null) {
57 return null;
58 }
59 IActivityManager in =
60 (IActivityManager)obj.queryLocalInterface(descriptor);
61 if (in != null) {
62 return in;
63 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080064
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080065 return new ActivityManagerProxy(obj);
66 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080067
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080068 /**
69 * Retrieve the system's default/global activity manager.
70 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080071 static public IActivityManager getDefault() {
72 return gDefault.get();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080073 }
74
75 /**
76 * Convenience for checking whether the system is ready. For internal use only.
77 */
78 static public boolean isSystemReady() {
79 if (!sSystemReady) {
80 sSystemReady = getDefault().testIsSystemReady();
81 }
82 return sSystemReady;
83 }
84 static boolean sSystemReady = false;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080085
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080086 /**
87 * Convenience for sending a sticky broadcast. For internal use only.
88 * If you don't care about permission, use null.
89 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080090 static public void broadcastStickyIntent(Intent intent, String permission) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080091 try {
92 getDefault().broadcastIntent(
93 null, intent, null, null, Activity.RESULT_OK, null, null,
Amith Yamasani742a6712011-05-04 14:49:28 -070094 null /*permission*/, false, true, Binder.getOrigCallingUser());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080095 } catch (RemoteException ex) {
96 }
97 }
98
99 static public void noteWakeupAlarm(PendingIntent ps) {
100 try {
101 getDefault().noteWakeupAlarm(ps.getTarget());
102 } catch (RemoteException ex) {
103 }
104 }
105
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -0800106 public ActivityManagerNative() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800107 attachInterface(this, descriptor);
108 }
109
110 public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
111 throws RemoteException {
112 switch (code) {
113 case START_ACTIVITY_TRANSACTION:
114 {
115 data.enforceInterface(IActivityManager.descriptor);
116 IBinder b = data.readStrongBinder();
117 IApplicationThread app = ApplicationThreadNative.asInterface(b);
118 Intent intent = Intent.CREATOR.createFromParcel(data);
119 String resolvedType = data.readString();
120 Uri[] grantedUriPermissions = data.createTypedArray(Uri.CREATOR);
121 int grantedMode = data.readInt();
122 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800123 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800124 int requestCode = data.readInt();
125 boolean onlyIfNeeded = data.readInt() != 0;
126 boolean debug = data.readInt() != 0;
Siva Velusamy92a8b222012-03-09 16:24:04 -0800127 boolean openglTrace = data.readInt() != 0;
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700128 String profileFile = data.readString();
129 ParcelFileDescriptor profileFd = data.readInt() != 0
130 ? data.readFileDescriptor() : null;
131 boolean autoStopProfiler = data.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800132 int result = startActivity(app, intent, resolvedType,
133 grantedUriPermissions, grantedMode, resultTo, resultWho,
Siva Velusamy92a8b222012-03-09 16:24:04 -0800134 requestCode, onlyIfNeeded, debug, openglTrace,
135 profileFile, profileFd, autoStopProfiler);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800136 reply.writeNoException();
137 reply.writeInt(result);
138 return true;
139 }
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700140
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800141 case START_ACTIVITY_AND_WAIT_TRANSACTION:
142 {
143 data.enforceInterface(IActivityManager.descriptor);
144 IBinder b = data.readStrongBinder();
145 IApplicationThread app = ApplicationThreadNative.asInterface(b);
146 Intent intent = Intent.CREATOR.createFromParcel(data);
147 String resolvedType = data.readString();
148 Uri[] grantedUriPermissions = data.createTypedArray(Uri.CREATOR);
149 int grantedMode = data.readInt();
150 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800151 String resultWho = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800152 int requestCode = data.readInt();
153 boolean onlyIfNeeded = data.readInt() != 0;
154 boolean debug = data.readInt() != 0;
Siva Velusamy92a8b222012-03-09 16:24:04 -0800155 boolean openglTrace = data.readInt() != 0;
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700156 String profileFile = data.readString();
157 ParcelFileDescriptor profileFd = data.readInt() != 0
158 ? data.readFileDescriptor() : null;
159 boolean autoStopProfiler = data.readInt() != 0;
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800160 WaitResult result = startActivityAndWait(app, intent, resolvedType,
161 grantedUriPermissions, grantedMode, resultTo, resultWho,
Siva Velusamy92a8b222012-03-09 16:24:04 -0800162 requestCode, onlyIfNeeded, debug, openglTrace,
163 profileFile, profileFd, autoStopProfiler);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800164 reply.writeNoException();
165 result.writeToParcel(reply, 0);
166 return true;
167 }
168
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700169 case START_ACTIVITY_WITH_CONFIG_TRANSACTION:
170 {
171 data.enforceInterface(IActivityManager.descriptor);
172 IBinder b = data.readStrongBinder();
173 IApplicationThread app = ApplicationThreadNative.asInterface(b);
174 Intent intent = Intent.CREATOR.createFromParcel(data);
175 String resolvedType = data.readString();
176 Uri[] grantedUriPermissions = data.createTypedArray(Uri.CREATOR);
177 int grantedMode = data.readInt();
178 IBinder resultTo = data.readStrongBinder();
179 String resultWho = data.readString();
180 int requestCode = data.readInt();
181 boolean onlyIfNeeded = data.readInt() != 0;
182 boolean debug = data.readInt() != 0;
183 Configuration config = Configuration.CREATOR.createFromParcel(data);
184 int result = startActivityWithConfig(app, intent, resolvedType,
185 grantedUriPermissions, grantedMode, resultTo, resultWho,
186 requestCode, onlyIfNeeded, debug, config);
187 reply.writeNoException();
188 reply.writeInt(result);
189 return true;
190 }
191
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700192 case START_ACTIVITY_INTENT_SENDER_TRANSACTION:
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700193 {
194 data.enforceInterface(IActivityManager.descriptor);
195 IBinder b = data.readStrongBinder();
196 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700197 IntentSender intent = IntentSender.CREATOR.createFromParcel(data);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700198 Intent fillInIntent = null;
199 if (data.readInt() != 0) {
200 fillInIntent = Intent.CREATOR.createFromParcel(data);
201 }
202 String resolvedType = data.readString();
203 IBinder resultTo = data.readStrongBinder();
204 String resultWho = data.readString();
205 int requestCode = data.readInt();
206 int flagsMask = data.readInt();
207 int flagsValues = data.readInt();
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700208 int result = startActivityIntentSender(app, intent,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700209 fillInIntent, resolvedType, resultTo, resultWho,
210 requestCode, flagsMask, flagsValues);
211 reply.writeNoException();
212 reply.writeInt(result);
213 return true;
214 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800215
216 case START_NEXT_MATCHING_ACTIVITY_TRANSACTION:
217 {
218 data.enforceInterface(IActivityManager.descriptor);
219 IBinder callingActivity = data.readStrongBinder();
220 Intent intent = Intent.CREATOR.createFromParcel(data);
221 boolean result = startNextMatchingActivity(callingActivity, intent);
222 reply.writeNoException();
223 reply.writeInt(result ? 1 : 0);
224 return true;
225 }
226
227 case FINISH_ACTIVITY_TRANSACTION: {
228 data.enforceInterface(IActivityManager.descriptor);
229 IBinder token = data.readStrongBinder();
230 Intent resultData = null;
231 int resultCode = data.readInt();
232 if (data.readInt() != 0) {
233 resultData = Intent.CREATOR.createFromParcel(data);
234 }
235 boolean res = finishActivity(token, resultCode, resultData);
236 reply.writeNoException();
237 reply.writeInt(res ? 1 : 0);
238 return true;
239 }
240
241 case FINISH_SUB_ACTIVITY_TRANSACTION: {
242 data.enforceInterface(IActivityManager.descriptor);
243 IBinder token = data.readStrongBinder();
244 String resultWho = data.readString();
245 int requestCode = data.readInt();
246 finishSubActivity(token, resultWho, requestCode);
247 reply.writeNoException();
248 return true;
249 }
250
Dianne Hackborn061d58a2010-03-12 15:07:06 -0800251 case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: {
252 data.enforceInterface(IActivityManager.descriptor);
253 IBinder token = data.readStrongBinder();
254 boolean res = willActivityBeVisible(token);
255 reply.writeNoException();
256 reply.writeInt(res ? 1 : 0);
257 return true;
258 }
259
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800260 case REGISTER_RECEIVER_TRANSACTION:
261 {
262 data.enforceInterface(IActivityManager.descriptor);
263 IBinder b = data.readStrongBinder();
264 IApplicationThread app =
265 b != null ? ApplicationThreadNative.asInterface(b) : null;
Dianne Hackborn6c418d52011-06-29 14:05:33 -0700266 String packageName = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800267 b = data.readStrongBinder();
268 IIntentReceiver rec
269 = b != null ? IIntentReceiver.Stub.asInterface(b) : null;
270 IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data);
271 String perm = data.readString();
Dianne Hackborn6c418d52011-06-29 14:05:33 -0700272 Intent intent = registerReceiver(app, packageName, rec, filter, perm);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800273 reply.writeNoException();
274 if (intent != null) {
275 reply.writeInt(1);
276 intent.writeToParcel(reply, 0);
277 } else {
278 reply.writeInt(0);
279 }
280 return true;
281 }
282
283 case UNREGISTER_RECEIVER_TRANSACTION:
284 {
285 data.enforceInterface(IActivityManager.descriptor);
286 IBinder b = data.readStrongBinder();
287 if (b == null) {
288 return true;
289 }
290 IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b);
291 unregisterReceiver(rec);
292 reply.writeNoException();
293 return true;
294 }
295
296 case BROADCAST_INTENT_TRANSACTION:
297 {
298 data.enforceInterface(IActivityManager.descriptor);
299 IBinder b = data.readStrongBinder();
300 IApplicationThread app =
301 b != null ? ApplicationThreadNative.asInterface(b) : null;
302 Intent intent = Intent.CREATOR.createFromParcel(data);
303 String resolvedType = data.readString();
304 b = data.readStrongBinder();
305 IIntentReceiver resultTo =
306 b != null ? IIntentReceiver.Stub.asInterface(b) : null;
307 int resultCode = data.readInt();
308 String resultData = data.readString();
309 Bundle resultExtras = data.readBundle();
310 String perm = data.readString();
311 boolean serialized = data.readInt() != 0;
312 boolean sticky = data.readInt() != 0;
Amith Yamasani742a6712011-05-04 14:49:28 -0700313 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800314 int res = broadcastIntent(app, intent, resolvedType, resultTo,
315 resultCode, resultData, resultExtras, perm,
Amith Yamasani742a6712011-05-04 14:49:28 -0700316 serialized, sticky, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800317 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);
Amith Yamasani742a6712011-05-04 14:49:28 -0700328 int userId = data.readInt();
329 unbroadcastIntent(app, intent, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800330 reply.writeNoException();
331 return true;
332 }
333
334 case FINISH_RECEIVER_TRANSACTION: {
335 data.enforceInterface(IActivityManager.descriptor);
336 IBinder who = data.readStrongBinder();
337 int resultCode = data.readInt();
338 String resultData = data.readString();
339 Bundle resultExtras = data.readBundle();
340 boolean resultAbort = data.readInt() != 0;
341 if (who != null) {
342 finishReceiver(who, resultCode, resultData, resultExtras, resultAbort);
343 }
344 reply.writeNoException();
345 return true;
346 }
347
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800348 case ATTACH_APPLICATION_TRANSACTION: {
349 data.enforceInterface(IActivityManager.descriptor);
350 IApplicationThread app = ApplicationThreadNative.asInterface(
351 data.readStrongBinder());
352 if (app != null) {
353 attachApplication(app);
354 }
355 reply.writeNoException();
356 return true;
357 }
358
359 case ACTIVITY_IDLE_TRANSACTION: {
360 data.enforceInterface(IActivityManager.descriptor);
361 IBinder token = data.readStrongBinder();
Dianne Hackborne88846e2009-09-30 21:34:25 -0700362 Configuration config = null;
363 if (data.readInt() != 0) {
364 config = Configuration.CREATOR.createFromParcel(data);
365 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700366 boolean stopProfiling = data.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800367 if (token != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700368 activityIdle(token, config, stopProfiling);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800369 }
370 reply.writeNoException();
371 return true;
372 }
373
374 case ACTIVITY_PAUSED_TRANSACTION: {
375 data.enforceInterface(IActivityManager.descriptor);
376 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800377 activityPaused(token);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800378 reply.writeNoException();
379 return true;
380 }
381
382 case ACTIVITY_STOPPED_TRANSACTION: {
383 data.enforceInterface(IActivityManager.descriptor);
384 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800385 Bundle map = data.readBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800386 Bitmap thumbnail = data.readInt() != 0
387 ? Bitmap.CREATOR.createFromParcel(data) : null;
388 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800389 activityStopped(token, map, thumbnail, description);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800390 reply.writeNoException();
391 return true;
392 }
393
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800394 case ACTIVITY_SLEPT_TRANSACTION: {
395 data.enforceInterface(IActivityManager.descriptor);
396 IBinder token = data.readStrongBinder();
397 activitySlept(token);
398 reply.writeNoException();
399 return true;
400 }
401
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800402 case ACTIVITY_DESTROYED_TRANSACTION: {
403 data.enforceInterface(IActivityManager.descriptor);
404 IBinder token = data.readStrongBinder();
405 activityDestroyed(token);
406 reply.writeNoException();
407 return true;
408 }
409
410 case GET_CALLING_PACKAGE_TRANSACTION: {
411 data.enforceInterface(IActivityManager.descriptor);
412 IBinder token = data.readStrongBinder();
413 String res = token != null ? getCallingPackage(token) : null;
414 reply.writeNoException();
415 reply.writeString(res);
416 return true;
417 }
418
419 case GET_CALLING_ACTIVITY_TRANSACTION: {
420 data.enforceInterface(IActivityManager.descriptor);
421 IBinder token = data.readStrongBinder();
422 ComponentName cn = getCallingActivity(token);
423 reply.writeNoException();
424 ComponentName.writeToParcel(cn, reply);
425 return true;
426 }
427
428 case GET_TASKS_TRANSACTION: {
429 data.enforceInterface(IActivityManager.descriptor);
430 int maxNum = data.readInt();
431 int fl = data.readInt();
432 IBinder receiverBinder = data.readStrongBinder();
433 IThumbnailReceiver receiver = receiverBinder != null
434 ? IThumbnailReceiver.Stub.asInterface(receiverBinder)
435 : null;
436 List list = getTasks(maxNum, fl, receiver);
437 reply.writeNoException();
438 int N = list != null ? list.size() : -1;
439 reply.writeInt(N);
440 int i;
441 for (i=0; i<N; i++) {
442 ActivityManager.RunningTaskInfo info =
443 (ActivityManager.RunningTaskInfo)list.get(i);
444 info.writeToParcel(reply, 0);
445 }
446 return true;
447 }
448
449 case GET_RECENT_TASKS_TRANSACTION: {
450 data.enforceInterface(IActivityManager.descriptor);
451 int maxNum = data.readInt();
452 int fl = data.readInt();
453 List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum,
454 fl);
455 reply.writeNoException();
456 reply.writeTypedList(list);
457 return true;
458 }
459
Dianne Hackbornf26fd992011-04-08 18:14:09 -0700460 case GET_TASK_THUMBNAILS_TRANSACTION: {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800461 data.enforceInterface(IActivityManager.descriptor);
462 int id = data.readInt();
Dianne Hackbornf26fd992011-04-08 18:14:09 -0700463 ActivityManager.TaskThumbnails bm = getTaskThumbnails(id);
Dianne Hackbornd94df452011-02-16 18:53:31 -0800464 reply.writeNoException();
465 if (bm != null) {
466 reply.writeInt(1);
467 bm.writeToParcel(reply, 0);
468 } else {
469 reply.writeInt(0);
470 }
471 return true;
472 }
473
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800474 case GET_SERVICES_TRANSACTION: {
475 data.enforceInterface(IActivityManager.descriptor);
476 int maxNum = data.readInt();
477 int fl = data.readInt();
478 List list = getServices(maxNum, fl);
479 reply.writeNoException();
480 int N = list != null ? list.size() : -1;
481 reply.writeInt(N);
482 int i;
483 for (i=0; i<N; i++) {
484 ActivityManager.RunningServiceInfo info =
485 (ActivityManager.RunningServiceInfo)list.get(i);
486 info.writeToParcel(reply, 0);
487 }
488 return true;
489 }
490
491 case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: {
492 data.enforceInterface(IActivityManager.descriptor);
493 List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState();
494 reply.writeNoException();
495 reply.writeTypedList(list);
496 return true;
497 }
498
499 case GET_RUNNING_APP_PROCESSES_TRANSACTION: {
500 data.enforceInterface(IActivityManager.descriptor);
501 List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses();
502 reply.writeNoException();
503 reply.writeTypedList(list);
504 return true;
505 }
506
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -0700507 case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: {
508 data.enforceInterface(IActivityManager.descriptor);
509 List<ApplicationInfo> list = getRunningExternalApplications();
510 reply.writeNoException();
511 reply.writeTypedList(list);
512 return true;
513 }
514
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800515 case MOVE_TASK_TO_FRONT_TRANSACTION: {
516 data.enforceInterface(IActivityManager.descriptor);
517 int task = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800518 int fl = data.readInt();
519 moveTaskToFront(task, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800520 reply.writeNoException();
521 return true;
522 }
523
524 case MOVE_TASK_TO_BACK_TRANSACTION: {
525 data.enforceInterface(IActivityManager.descriptor);
526 int task = data.readInt();
527 moveTaskToBack(task);
528 reply.writeNoException();
529 return true;
530 }
531
532 case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: {
533 data.enforceInterface(IActivityManager.descriptor);
534 IBinder token = data.readStrongBinder();
535 boolean nonRoot = data.readInt() != 0;
536 boolean res = moveActivityTaskToBack(token, nonRoot);
537 reply.writeNoException();
538 reply.writeInt(res ? 1 : 0);
539 return true;
540 }
541
542 case MOVE_TASK_BACKWARDS_TRANSACTION: {
543 data.enforceInterface(IActivityManager.descriptor);
544 int task = data.readInt();
545 moveTaskBackwards(task);
546 reply.writeNoException();
547 return true;
548 }
549
550 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
551 data.enforceInterface(IActivityManager.descriptor);
552 IBinder token = data.readStrongBinder();
553 boolean onlyRoot = data.readInt() != 0;
554 int res = token != null
555 ? getTaskForActivity(token, onlyRoot) : -1;
556 reply.writeNoException();
557 reply.writeInt(res);
558 return true;
559 }
560
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800561 case REPORT_THUMBNAIL_TRANSACTION: {
562 data.enforceInterface(IActivityManager.descriptor);
563 IBinder token = data.readStrongBinder();
564 Bitmap thumbnail = data.readInt() != 0
565 ? Bitmap.CREATOR.createFromParcel(data) : null;
566 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
567 reportThumbnail(token, thumbnail, description);
568 reply.writeNoException();
569 return true;
570 }
571
572 case GET_CONTENT_PROVIDER_TRANSACTION: {
573 data.enforceInterface(IActivityManager.descriptor);
574 IBinder b = data.readStrongBinder();
575 IApplicationThread app = ApplicationThreadNative.asInterface(b);
576 String name = data.readString();
577 ContentProviderHolder cph = getContentProvider(app, name);
578 reply.writeNoException();
579 if (cph != null) {
580 reply.writeInt(1);
581 cph.writeToParcel(reply, 0);
582 } else {
583 reply.writeInt(0);
584 }
585 return true;
586 }
587
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800588 case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
589 data.enforceInterface(IActivityManager.descriptor);
590 String name = data.readString();
591 IBinder token = data.readStrongBinder();
592 ContentProviderHolder cph = getContentProviderExternal(name, token);
593 reply.writeNoException();
594 if (cph != null) {
595 reply.writeInt(1);
596 cph.writeToParcel(reply, 0);
597 } else {
598 reply.writeInt(0);
599 }
600 return true;
601 }
602
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800603 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
604 data.enforceInterface(IActivityManager.descriptor);
605 IBinder b = data.readStrongBinder();
606 IApplicationThread app = ApplicationThreadNative.asInterface(b);
607 ArrayList<ContentProviderHolder> providers =
608 data.createTypedArrayList(ContentProviderHolder.CREATOR);
609 publishContentProviders(app, providers);
610 reply.writeNoException();
611 return true;
612 }
613
614 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
615 data.enforceInterface(IActivityManager.descriptor);
616 IBinder b = data.readStrongBinder();
617 IApplicationThread app = ApplicationThreadNative.asInterface(b);
618 String name = data.readString();
619 removeContentProvider(app, name);
620 reply.writeNoException();
621 return true;
622 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800623
624 case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
625 data.enforceInterface(IActivityManager.descriptor);
626 String name = data.readString();
627 IBinder token = data.readStrongBinder();
628 removeContentProviderExternal(name, token);
629 reply.writeNoException();
630 return true;
631 }
632
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700633 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
634 data.enforceInterface(IActivityManager.descriptor);
635 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
636 PendingIntent pi = getRunningServiceControlPanel(comp);
637 reply.writeNoException();
638 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
639 return true;
640 }
641
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800642 case START_SERVICE_TRANSACTION: {
643 data.enforceInterface(IActivityManager.descriptor);
644 IBinder b = data.readStrongBinder();
645 IApplicationThread app = ApplicationThreadNative.asInterface(b);
646 Intent service = Intent.CREATOR.createFromParcel(data);
647 String resolvedType = data.readString();
648 ComponentName cn = startService(app, service, resolvedType);
649 reply.writeNoException();
650 ComponentName.writeToParcel(cn, reply);
651 return true;
652 }
653
654 case STOP_SERVICE_TRANSACTION: {
655 data.enforceInterface(IActivityManager.descriptor);
656 IBinder b = data.readStrongBinder();
657 IApplicationThread app = ApplicationThreadNative.asInterface(b);
658 Intent service = Intent.CREATOR.createFromParcel(data);
659 String resolvedType = data.readString();
660 int res = stopService(app, service, resolvedType);
661 reply.writeNoException();
662 reply.writeInt(res);
663 return true;
664 }
665
666 case STOP_SERVICE_TOKEN_TRANSACTION: {
667 data.enforceInterface(IActivityManager.descriptor);
668 ComponentName className = ComponentName.readFromParcel(data);
669 IBinder token = data.readStrongBinder();
670 int startId = data.readInt();
671 boolean res = stopServiceToken(className, token, startId);
672 reply.writeNoException();
673 reply.writeInt(res ? 1 : 0);
674 return true;
675 }
676
677 case SET_SERVICE_FOREGROUND_TRANSACTION: {
678 data.enforceInterface(IActivityManager.descriptor);
679 ComponentName className = ComponentName.readFromParcel(data);
680 IBinder token = data.readStrongBinder();
Dianne Hackbornd8a43f62009-08-17 23:33:56 -0700681 int id = data.readInt();
682 Notification notification = null;
683 if (data.readInt() != 0) {
684 notification = Notification.CREATOR.createFromParcel(data);
685 }
686 boolean removeNotification = data.readInt() != 0;
687 setServiceForeground(className, token, id, notification, removeNotification);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800688 reply.writeNoException();
689 return true;
690 }
691
692 case BIND_SERVICE_TRANSACTION: {
693 data.enforceInterface(IActivityManager.descriptor);
694 IBinder b = data.readStrongBinder();
695 IApplicationThread app = ApplicationThreadNative.asInterface(b);
696 IBinder token = data.readStrongBinder();
697 Intent service = Intent.CREATOR.createFromParcel(data);
698 String resolvedType = data.readString();
699 b = data.readStrongBinder();
700 int fl = data.readInt();
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800701 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800702 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800703 int res = bindService(app, token, service, resolvedType, conn, fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800704 reply.writeNoException();
705 reply.writeInt(res);
706 return true;
707 }
708
709 case UNBIND_SERVICE_TRANSACTION: {
710 data.enforceInterface(IActivityManager.descriptor);
711 IBinder b = data.readStrongBinder();
712 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
713 boolean res = unbindService(conn);
714 reply.writeNoException();
715 reply.writeInt(res ? 1 : 0);
716 return true;
717 }
718
719 case PUBLISH_SERVICE_TRANSACTION: {
720 data.enforceInterface(IActivityManager.descriptor);
721 IBinder token = data.readStrongBinder();
722 Intent intent = Intent.CREATOR.createFromParcel(data);
723 IBinder service = data.readStrongBinder();
724 publishService(token, intent, service);
725 reply.writeNoException();
726 return true;
727 }
728
729 case UNBIND_FINISHED_TRANSACTION: {
730 data.enforceInterface(IActivityManager.descriptor);
731 IBinder token = data.readStrongBinder();
732 Intent intent = Intent.CREATOR.createFromParcel(data);
733 boolean doRebind = data.readInt() != 0;
734 unbindFinished(token, intent, doRebind);
735 reply.writeNoException();
736 return true;
737 }
738
739 case SERVICE_DONE_EXECUTING_TRANSACTION: {
740 data.enforceInterface(IActivityManager.descriptor);
741 IBinder token = data.readStrongBinder();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -0700742 int type = data.readInt();
743 int startId = data.readInt();
744 int res = data.readInt();
745 serviceDoneExecuting(token, type, startId, res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800746 reply.writeNoException();
747 return true;
748 }
749
750 case START_INSTRUMENTATION_TRANSACTION: {
751 data.enforceInterface(IActivityManager.descriptor);
752 ComponentName className = ComponentName.readFromParcel(data);
753 String profileFile = data.readString();
754 int fl = data.readInt();
755 Bundle arguments = data.readBundle();
756 IBinder b = data.readStrongBinder();
757 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
758 boolean res = startInstrumentation(className, profileFile, fl, arguments, w);
759 reply.writeNoException();
760 reply.writeInt(res ? 1 : 0);
761 return true;
762 }
763
764
765 case FINISH_INSTRUMENTATION_TRANSACTION: {
766 data.enforceInterface(IActivityManager.descriptor);
767 IBinder b = data.readStrongBinder();
768 IApplicationThread app = ApplicationThreadNative.asInterface(b);
769 int resultCode = data.readInt();
770 Bundle results = data.readBundle();
771 finishInstrumentation(app, resultCode, results);
772 reply.writeNoException();
773 return true;
774 }
775
776 case GET_CONFIGURATION_TRANSACTION: {
777 data.enforceInterface(IActivityManager.descriptor);
778 Configuration config = getConfiguration();
779 reply.writeNoException();
780 config.writeToParcel(reply, 0);
781 return true;
782 }
783
784 case UPDATE_CONFIGURATION_TRANSACTION: {
785 data.enforceInterface(IActivityManager.descriptor);
786 Configuration config = Configuration.CREATOR.createFromParcel(data);
787 updateConfiguration(config);
788 reply.writeNoException();
789 return true;
790 }
791
792 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
793 data.enforceInterface(IActivityManager.descriptor);
794 IBinder token = data.readStrongBinder();
795 int requestedOrientation = data.readInt();
796 setRequestedOrientation(token, requestedOrientation);
797 reply.writeNoException();
798 return true;
799 }
800
801 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
802 data.enforceInterface(IActivityManager.descriptor);
803 IBinder token = data.readStrongBinder();
804 int req = getRequestedOrientation(token);
805 reply.writeNoException();
806 reply.writeInt(req);
807 return true;
808 }
809
810 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
811 data.enforceInterface(IActivityManager.descriptor);
812 IBinder token = data.readStrongBinder();
813 ComponentName cn = getActivityClassForToken(token);
814 reply.writeNoException();
815 ComponentName.writeToParcel(cn, reply);
816 return true;
817 }
818
819 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
820 data.enforceInterface(IActivityManager.descriptor);
821 IBinder token = data.readStrongBinder();
822 reply.writeNoException();
823 reply.writeString(getPackageForToken(token));
824 return true;
825 }
826
827 case GET_INTENT_SENDER_TRANSACTION: {
828 data.enforceInterface(IActivityManager.descriptor);
829 int type = data.readInt();
830 String packageName = data.readString();
831 IBinder token = data.readStrongBinder();
832 String resultWho = data.readString();
833 int requestCode = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800834 Intent[] requestIntents;
835 String[] requestResolvedTypes;
836 if (data.readInt() != 0) {
837 requestIntents = data.createTypedArray(Intent.CREATOR);
838 requestResolvedTypes = data.createStringArray();
839 } else {
840 requestIntents = null;
841 requestResolvedTypes = null;
842 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800843 int fl = data.readInt();
844 IIntentSender res = getIntentSender(type, packageName, token,
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800845 resultWho, requestCode, requestIntents,
846 requestResolvedTypes, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800847 reply.writeNoException();
848 reply.writeStrongBinder(res != null ? res.asBinder() : null);
849 return true;
850 }
851
852 case CANCEL_INTENT_SENDER_TRANSACTION: {
853 data.enforceInterface(IActivityManager.descriptor);
854 IIntentSender r = IIntentSender.Stub.asInterface(
855 data.readStrongBinder());
856 cancelIntentSender(r);
857 reply.writeNoException();
858 return true;
859 }
860
861 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
862 data.enforceInterface(IActivityManager.descriptor);
863 IIntentSender r = IIntentSender.Stub.asInterface(
864 data.readStrongBinder());
865 String res = getPackageForIntentSender(r);
866 reply.writeNoException();
867 reply.writeString(res);
868 return true;
869 }
870
871 case SET_PROCESS_LIMIT_TRANSACTION: {
872 data.enforceInterface(IActivityManager.descriptor);
873 int max = data.readInt();
874 setProcessLimit(max);
875 reply.writeNoException();
876 return true;
877 }
878
879 case GET_PROCESS_LIMIT_TRANSACTION: {
880 data.enforceInterface(IActivityManager.descriptor);
881 int limit = getProcessLimit();
882 reply.writeNoException();
883 reply.writeInt(limit);
884 return true;
885 }
886
887 case SET_PROCESS_FOREGROUND_TRANSACTION: {
888 data.enforceInterface(IActivityManager.descriptor);
889 IBinder token = data.readStrongBinder();
890 int pid = data.readInt();
891 boolean isForeground = data.readInt() != 0;
892 setProcessForeground(token, pid, isForeground);
893 reply.writeNoException();
894 return true;
895 }
896
897 case CHECK_PERMISSION_TRANSACTION: {
898 data.enforceInterface(IActivityManager.descriptor);
899 String perm = data.readString();
900 int pid = data.readInt();
901 int uid = data.readInt();
902 int res = checkPermission(perm, pid, uid);
903 reply.writeNoException();
904 reply.writeInt(res);
905 return true;
906 }
907
908 case CHECK_URI_PERMISSION_TRANSACTION: {
909 data.enforceInterface(IActivityManager.descriptor);
910 Uri uri = Uri.CREATOR.createFromParcel(data);
911 int pid = data.readInt();
912 int uid = data.readInt();
913 int mode = data.readInt();
914 int res = checkUriPermission(uri, pid, uid, mode);
915 reply.writeNoException();
916 reply.writeInt(res);
917 return true;
918 }
919
920 case CLEAR_APP_DATA_TRANSACTION: {
921 data.enforceInterface(IActivityManager.descriptor);
922 String packageName = data.readString();
923 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
924 data.readStrongBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -0700925 int userId = data.readInt();
926 boolean res = clearApplicationUserData(packageName, observer, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800927 reply.writeNoException();
928 reply.writeInt(res ? 1 : 0);
929 return true;
930 }
931
932 case GRANT_URI_PERMISSION_TRANSACTION: {
933 data.enforceInterface(IActivityManager.descriptor);
934 IBinder b = data.readStrongBinder();
935 IApplicationThread app = ApplicationThreadNative.asInterface(b);
936 String targetPkg = data.readString();
937 Uri uri = Uri.CREATOR.createFromParcel(data);
938 int mode = data.readInt();
939 grantUriPermission(app, targetPkg, uri, mode);
940 reply.writeNoException();
941 return true;
942 }
943
944 case REVOKE_URI_PERMISSION_TRANSACTION: {
945 data.enforceInterface(IActivityManager.descriptor);
946 IBinder b = data.readStrongBinder();
947 IApplicationThread app = ApplicationThreadNative.asInterface(b);
948 Uri uri = Uri.CREATOR.createFromParcel(data);
949 int mode = data.readInt();
950 revokeUriPermission(app, uri, mode);
951 reply.writeNoException();
952 return true;
953 }
954
955 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
956 data.enforceInterface(IActivityManager.descriptor);
957 IBinder b = data.readStrongBinder();
958 IApplicationThread app = ApplicationThreadNative.asInterface(b);
959 boolean waiting = data.readInt() != 0;
960 showWaitingForDebugger(app, waiting);
961 reply.writeNoException();
962 return true;
963 }
964
965 case GET_MEMORY_INFO_TRANSACTION: {
966 data.enforceInterface(IActivityManager.descriptor);
967 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
968 getMemoryInfo(mi);
969 reply.writeNoException();
970 mi.writeToParcel(reply, 0);
971 return true;
972 }
973
974 case UNHANDLED_BACK_TRANSACTION: {
975 data.enforceInterface(IActivityManager.descriptor);
976 unhandledBack();
977 reply.writeNoException();
978 return true;
979 }
980
981 case OPEN_CONTENT_URI_TRANSACTION: {
982 data.enforceInterface(IActivityManager.descriptor);
983 Uri uri = Uri.parse(data.readString());
984 ParcelFileDescriptor pfd = openContentUri(uri);
985 reply.writeNoException();
986 if (pfd != null) {
987 reply.writeInt(1);
988 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
989 } else {
990 reply.writeInt(0);
991 }
992 return true;
993 }
994
995 case GOING_TO_SLEEP_TRANSACTION: {
996 data.enforceInterface(IActivityManager.descriptor);
997 goingToSleep();
998 reply.writeNoException();
999 return true;
1000 }
1001
1002 case WAKING_UP_TRANSACTION: {
1003 data.enforceInterface(IActivityManager.descriptor);
1004 wakingUp();
1005 reply.writeNoException();
1006 return true;
1007 }
1008
1009 case SET_DEBUG_APP_TRANSACTION: {
1010 data.enforceInterface(IActivityManager.descriptor);
1011 String pn = data.readString();
1012 boolean wfd = data.readInt() != 0;
1013 boolean per = data.readInt() != 0;
1014 setDebugApp(pn, wfd, per);
1015 reply.writeNoException();
1016 return true;
1017 }
1018
1019 case SET_ALWAYS_FINISH_TRANSACTION: {
1020 data.enforceInterface(IActivityManager.descriptor);
1021 boolean enabled = data.readInt() != 0;
1022 setAlwaysFinish(enabled);
1023 reply.writeNoException();
1024 return true;
1025 }
1026
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001027 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001028 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001029 IActivityController watcher = IActivityController.Stub.asInterface(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001030 data.readStrongBinder());
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001031 setActivityController(watcher);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001032 return true;
1033 }
1034
1035 case ENTER_SAFE_MODE_TRANSACTION: {
1036 data.enforceInterface(IActivityManager.descriptor);
1037 enterSafeMode();
1038 reply.writeNoException();
1039 return true;
1040 }
1041
1042 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1043 data.enforceInterface(IActivityManager.descriptor);
1044 IIntentSender is = IIntentSender.Stub.asInterface(
1045 data.readStrongBinder());
1046 noteWakeupAlarm(is);
1047 reply.writeNoException();
1048 return true;
1049 }
1050
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001051 case KILL_PIDS_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001052 data.enforceInterface(IActivityManager.descriptor);
1053 int[] pids = data.createIntArray();
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001054 String reason = data.readString();
Dianne Hackborn64825172011-03-02 21:32:58 -08001055 boolean secure = data.readInt() != 0;
1056 boolean res = killPids(pids, reason, secure);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001057 reply.writeNoException();
1058 reply.writeInt(res ? 1 : 0);
1059 return true;
1060 }
1061
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001062 case START_RUNNING_TRANSACTION: {
1063 data.enforceInterface(IActivityManager.descriptor);
1064 String pkg = data.readString();
1065 String cls = data.readString();
1066 String action = data.readString();
1067 String indata = data.readString();
1068 startRunning(pkg, cls, action, indata);
1069 reply.writeNoException();
1070 return true;
1071 }
1072
Dan Egnor60d87622009-12-16 16:32:58 -08001073 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1074 data.enforceInterface(IActivityManager.descriptor);
1075 IBinder app = data.readStrongBinder();
1076 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1077 handleApplicationCrash(app, ci);
1078 reply.writeNoException();
1079 return true;
1080 }
1081
1082 case HANDLE_APPLICATION_WTF_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001083 data.enforceInterface(IActivityManager.descriptor);
1084 IBinder app = data.readStrongBinder();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001085 String tag = data.readString();
Dan Egnorb7f03672009-12-09 16:22:32 -08001086 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
Dan Egnor60d87622009-12-16 16:32:58 -08001087 boolean res = handleApplicationWtf(app, tag, ci);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001088 reply.writeNoException();
Dan Egnor60d87622009-12-16 16:32:58 -08001089 reply.writeInt(res ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001090 return true;
1091 }
Dan Egnorb7f03672009-12-09 16:22:32 -08001092
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001093 case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: {
1094 data.enforceInterface(IActivityManager.descriptor);
1095 IBinder app = data.readStrongBinder();
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07001096 int violationMask = data.readInt();
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07001097 StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data);
1098 handleApplicationStrictModeViolation(app, violationMask, info);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001099 reply.writeNoException();
1100 return true;
1101 }
1102
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001103 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1104 data.enforceInterface(IActivityManager.descriptor);
1105 int sig = data.readInt();
1106 signalPersistentProcesses(sig);
1107 reply.writeNoException();
1108 return true;
1109 }
1110
Dianne Hackborn03abb812010-01-04 18:43:19 -08001111 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1112 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001113 String packageName = data.readString();
Dianne Hackborn03abb812010-01-04 18:43:19 -08001114 killBackgroundProcesses(packageName);
1115 reply.writeNoException();
1116 return true;
1117 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08001118
1119 case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
1120 data.enforceInterface(IActivityManager.descriptor);
1121 killAllBackgroundProcesses();
1122 reply.writeNoException();
1123 return true;
1124 }
Dianne Hackborn03abb812010-01-04 18:43:19 -08001125
1126 case FORCE_STOP_PACKAGE_TRANSACTION: {
1127 data.enforceInterface(IActivityManager.descriptor);
1128 String packageName = data.readString();
1129 forceStopPackage(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001130 reply.writeNoException();
1131 return true;
1132 }
Dianne Hackborn27ff9132012-03-06 14:57:58 -08001133
1134 case GET_MY_MEMORY_STATE_TRANSACTION: {
1135 data.enforceInterface(IActivityManager.descriptor);
1136 ActivityManager.RunningAppProcessInfo info =
1137 new ActivityManager.RunningAppProcessInfo();
1138 getMyMemoryState(info);
1139 reply.writeNoException();
1140 info.writeToParcel(reply, 0);
1141 return true;
1142 }
1143
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001144 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1145 data.enforceInterface(IActivityManager.descriptor);
1146 ConfigurationInfo config = getDeviceConfigurationInfo();
1147 reply.writeNoException();
1148 config.writeToParcel(reply, 0);
1149 return true;
1150 }
1151
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001152 case PROFILE_CONTROL_TRANSACTION: {
1153 data.enforceInterface(IActivityManager.descriptor);
1154 String process = data.readString();
1155 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001156 int profileType = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001157 String path = data.readString();
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07001158 ParcelFileDescriptor fd = data.readInt() != 0
1159 ? data.readFileDescriptor() : null;
Romain Guy7eabe552011-07-21 14:56:34 -07001160 boolean res = profileControl(process, start, path, fd, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001161 reply.writeNoException();
1162 reply.writeInt(res ? 1 : 0);
1163 return true;
1164 }
1165
Dianne Hackborn55280a92009-05-07 15:53:46 -07001166 case SHUTDOWN_TRANSACTION: {
1167 data.enforceInterface(IActivityManager.descriptor);
1168 boolean res = shutdown(data.readInt());
1169 reply.writeNoException();
1170 reply.writeInt(res ? 1 : 0);
1171 return true;
1172 }
1173
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001174 case STOP_APP_SWITCHES_TRANSACTION: {
1175 data.enforceInterface(IActivityManager.descriptor);
1176 stopAppSwitches();
1177 reply.writeNoException();
1178 return true;
1179 }
1180
1181 case RESUME_APP_SWITCHES_TRANSACTION: {
1182 data.enforceInterface(IActivityManager.descriptor);
1183 resumeAppSwitches();
1184 reply.writeNoException();
1185 return true;
1186 }
1187
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001188 case PEEK_SERVICE_TRANSACTION: {
1189 data.enforceInterface(IActivityManager.descriptor);
1190 Intent service = Intent.CREATOR.createFromParcel(data);
1191 String resolvedType = data.readString();
1192 IBinder binder = peekService(service, resolvedType);
1193 reply.writeNoException();
1194 reply.writeStrongBinder(binder);
1195 return true;
1196 }
Christopher Tate181fafa2009-05-14 11:12:14 -07001197
1198 case START_BACKUP_AGENT_TRANSACTION: {
1199 data.enforceInterface(IActivityManager.descriptor);
1200 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1201 int backupRestoreMode = data.readInt();
1202 boolean success = bindBackupAgent(info, backupRestoreMode);
1203 reply.writeNoException();
1204 reply.writeInt(success ? 1 : 0);
1205 return true;
1206 }
1207
1208 case BACKUP_AGENT_CREATED_TRANSACTION: {
1209 data.enforceInterface(IActivityManager.descriptor);
1210 String packageName = data.readString();
1211 IBinder agent = data.readStrongBinder();
1212 backupAgentCreated(packageName, agent);
1213 reply.writeNoException();
1214 return true;
1215 }
1216
1217 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1218 data.enforceInterface(IActivityManager.descriptor);
1219 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1220 unbindBackupAgent(info);
1221 reply.writeNoException();
1222 return true;
1223 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001224
Dianne Hackborn2d91af02009-07-16 13:34:33 -07001225 case START_ACTIVITY_IN_PACKAGE_TRANSACTION:
1226 {
1227 data.enforceInterface(IActivityManager.descriptor);
1228 int uid = data.readInt();
1229 Intent intent = Intent.CREATOR.createFromParcel(data);
1230 String resolvedType = data.readString();
1231 IBinder resultTo = data.readStrongBinder();
1232 String resultWho = data.readString();
1233 int requestCode = data.readInt();
1234 boolean onlyIfNeeded = data.readInt() != 0;
1235 int result = startActivityInPackage(uid, intent, resolvedType,
1236 resultTo, resultWho, requestCode, onlyIfNeeded);
1237 reply.writeNoException();
1238 reply.writeInt(result);
1239 return true;
1240 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001241
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001242 case KILL_APPLICATION_WITH_UID_TRANSACTION: {
1243 data.enforceInterface(IActivityManager.descriptor);
1244 String pkg = data.readString();
1245 int uid = data.readInt();
1246 killApplicationWithUid(pkg, uid);
1247 reply.writeNoException();
1248 return true;
1249 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001250
1251 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1252 data.enforceInterface(IActivityManager.descriptor);
1253 String reason = data.readString();
1254 closeSystemDialogs(reason);
1255 reply.writeNoException();
1256 return true;
1257 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001258
1259 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1260 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001261 int[] pids = data.createIntArray();
1262 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001263 reply.writeNoException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001264 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001265 return true;
1266 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001267
1268 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1269 data.enforceInterface(IActivityManager.descriptor);
1270 String processName = data.readString();
1271 int uid = data.readInt();
1272 killApplicationProcess(processName, uid);
1273 reply.writeNoException();
1274 return true;
1275 }
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001276
1277 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1278 data.enforceInterface(IActivityManager.descriptor);
1279 IBinder token = data.readStrongBinder();
1280 String packageName = data.readString();
1281 int enterAnim = data.readInt();
1282 int exitAnim = data.readInt();
1283 overridePendingTransition(token, packageName, enterAnim, exitAnim);
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001284 reply.writeNoException();
1285 return true;
1286 }
1287
1288 case IS_USER_A_MONKEY_TRANSACTION: {
1289 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001290 boolean areThey = isUserAMonkey();
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001291 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001292 reply.writeInt(areThey ? 1 : 0);
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001293 return true;
1294 }
Dianne Hackborn860755f2010-06-03 18:47:52 -07001295
1296 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1297 data.enforceInterface(IActivityManager.descriptor);
1298 finishHeavyWeightApp();
1299 reply.writeNoException();
1300 return true;
1301 }
Daniel Sandler69a48172010-06-23 16:29:36 -04001302
1303 case IS_IMMERSIVE_TRANSACTION: {
1304 data.enforceInterface(IActivityManager.descriptor);
1305 IBinder token = data.readStrongBinder();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001306 boolean isit = isImmersive(token);
Daniel Sandler69a48172010-06-23 16:29:36 -04001307 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001308 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001309 return true;
1310 }
1311
1312 case SET_IMMERSIVE_TRANSACTION: {
1313 data.enforceInterface(IActivityManager.descriptor);
1314 IBinder token = data.readStrongBinder();
1315 boolean imm = data.readInt() == 1;
1316 setImmersive(token, imm);
1317 reply.writeNoException();
1318 return true;
1319 }
1320
1321 case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
1322 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001323 boolean isit = isTopActivityImmersive();
Daniel Sandler69a48172010-06-23 16:29:36 -04001324 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001325 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001326 return true;
1327 }
1328
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001329 case CRASH_APPLICATION_TRANSACTION: {
1330 data.enforceInterface(IActivityManager.descriptor);
1331 int uid = data.readInt();
1332 int initialPid = data.readInt();
1333 String packageName = data.readString();
1334 String message = data.readString();
1335 crashApplication(uid, initialPid, packageName, message);
1336 reply.writeNoException();
1337 return true;
1338 }
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001339
1340 case GET_PROVIDER_MIME_TYPE_TRANSACTION: {
1341 data.enforceInterface(IActivityManager.descriptor);
1342 Uri uri = Uri.CREATOR.createFromParcel(data);
1343 String type = getProviderMimeType(uri);
1344 reply.writeNoException();
1345 reply.writeString(type);
1346 return true;
1347 }
1348
Dianne Hackborn7e269642010-08-25 19:50:20 -07001349 case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
1350 data.enforceInterface(IActivityManager.descriptor);
1351 String name = data.readString();
1352 IBinder perm = newUriPermissionOwner(name);
1353 reply.writeNoException();
1354 reply.writeStrongBinder(perm);
1355 return true;
1356 }
1357
1358 case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1359 data.enforceInterface(IActivityManager.descriptor);
1360 IBinder owner = data.readStrongBinder();
1361 int fromUid = data.readInt();
1362 String targetPkg = data.readString();
1363 Uri uri = Uri.CREATOR.createFromParcel(data);
1364 int mode = data.readInt();
1365 grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode);
1366 reply.writeNoException();
1367 return true;
1368 }
1369
1370 case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1371 data.enforceInterface(IActivityManager.descriptor);
1372 IBinder owner = data.readStrongBinder();
1373 Uri uri = null;
1374 if (data.readInt() != 0) {
1375 Uri.CREATOR.createFromParcel(data);
1376 }
1377 int mode = data.readInt();
1378 revokeUriPermissionFromOwner(owner, uri, mode);
1379 reply.writeNoException();
1380 return true;
1381 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001382
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001383 case CHECK_GRANT_URI_PERMISSION_TRANSACTION: {
1384 data.enforceInterface(IActivityManager.descriptor);
1385 int callingUid = data.readInt();
1386 String targetPkg = data.readString();
1387 Uri uri = Uri.CREATOR.createFromParcel(data);
1388 int modeFlags = data.readInt();
1389 int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags);
1390 reply.writeNoException();
1391 reply.writeInt(res);
1392 return true;
1393 }
1394
Andy McFadden824c5102010-07-09 16:26:57 -07001395 case DUMP_HEAP_TRANSACTION: {
1396 data.enforceInterface(IActivityManager.descriptor);
1397 String process = data.readString();
1398 boolean managed = data.readInt() != 0;
1399 String path = data.readString();
1400 ParcelFileDescriptor fd = data.readInt() != 0
1401 ? data.readFileDescriptor() : null;
1402 boolean res = dumpHeap(process, managed, path, fd);
1403 reply.writeNoException();
1404 reply.writeInt(res ? 1 : 0);
1405 return true;
1406 }
1407
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001408 case START_ACTIVITIES_IN_PACKAGE_TRANSACTION:
1409 {
1410 data.enforceInterface(IActivityManager.descriptor);
1411 int uid = data.readInt();
1412 Intent[] intents = data.createTypedArray(Intent.CREATOR);
1413 String[] resolvedTypes = data.createStringArray();
1414 IBinder resultTo = data.readStrongBinder();
1415 int result = startActivitiesInPackage(uid, intents, resolvedTypes, resultTo);
1416 reply.writeNoException();
1417 reply.writeInt(result);
1418 return true;
1419 }
1420
1421 case START_ACTIVITIES_TRANSACTION:
1422 {
1423 data.enforceInterface(IActivityManager.descriptor);
1424 IBinder b = data.readStrongBinder();
1425 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1426 Intent[] intents = data.createTypedArray(Intent.CREATOR);
1427 String[] resolvedTypes = data.createStringArray();
1428 IBinder resultTo = data.readStrongBinder();
1429 int result = startActivities(app, intents, resolvedTypes, resultTo);
1430 reply.writeNoException();
1431 reply.writeInt(result);
1432 return true;
1433 }
1434
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001435 case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1436 {
1437 data.enforceInterface(IActivityManager.descriptor);
1438 int mode = getFrontActivityScreenCompatMode();
1439 reply.writeNoException();
1440 reply.writeInt(mode);
1441 return true;
1442 }
1443
1444 case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1445 {
1446 data.enforceInterface(IActivityManager.descriptor);
1447 int mode = data.readInt();
1448 setFrontActivityScreenCompatMode(mode);
1449 reply.writeNoException();
1450 reply.writeInt(mode);
1451 return true;
1452 }
1453
1454 case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1455 {
1456 data.enforceInterface(IActivityManager.descriptor);
1457 String pkg = data.readString();
1458 int mode = getPackageScreenCompatMode(pkg);
1459 reply.writeNoException();
1460 reply.writeInt(mode);
1461 return true;
1462 }
1463
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001464 case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1465 {
1466 data.enforceInterface(IActivityManager.descriptor);
1467 String pkg = data.readString();
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001468 int mode = data.readInt();
1469 setPackageScreenCompatMode(pkg, mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001470 reply.writeNoException();
1471 return true;
1472 }
Dianne Hackbornaa9d84c2011-05-09 19:00:59 -07001473
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001474 case SWITCH_USER_TRANSACTION: {
1475 data.enforceInterface(IActivityManager.descriptor);
1476 int userid = data.readInt();
1477 boolean result = switchUser(userid);
1478 reply.writeNoException();
1479 reply.writeInt(result ? 1 : 0);
1480 return true;
1481 }
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001482
1483 case REMOVE_SUB_TASK_TRANSACTION:
1484 {
1485 data.enforceInterface(IActivityManager.descriptor);
1486 int taskId = data.readInt();
1487 int subTaskIndex = data.readInt();
1488 boolean result = removeSubTask(taskId, subTaskIndex);
1489 reply.writeNoException();
1490 reply.writeInt(result ? 1 : 0);
1491 return true;
1492 }
1493
1494 case REMOVE_TASK_TRANSACTION:
1495 {
1496 data.enforceInterface(IActivityManager.descriptor);
1497 int taskId = data.readInt();
1498 int fl = data.readInt();
1499 boolean result = removeTask(taskId, fl);
1500 reply.writeNoException();
1501 reply.writeInt(result ? 1 : 0);
1502 return true;
1503 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001504
Jeff Sharkeya4620792011-05-20 15:29:23 -07001505 case REGISTER_PROCESS_OBSERVER_TRANSACTION: {
1506 data.enforceInterface(IActivityManager.descriptor);
1507 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1508 data.readStrongBinder());
1509 registerProcessObserver(observer);
1510 return true;
1511 }
1512
1513 case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: {
1514 data.enforceInterface(IActivityManager.descriptor);
1515 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1516 data.readStrongBinder());
1517 unregisterProcessObserver(observer);
1518 return true;
1519 }
1520
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07001521 case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1522 {
1523 data.enforceInterface(IActivityManager.descriptor);
1524 String pkg = data.readString();
1525 boolean ask = getPackageAskScreenCompat(pkg);
1526 reply.writeNoException();
1527 reply.writeInt(ask ? 1 : 0);
1528 return true;
1529 }
1530
1531 case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1532 {
1533 data.enforceInterface(IActivityManager.descriptor);
1534 String pkg = data.readString();
1535 boolean ask = data.readInt() != 0;
1536 setPackageAskScreenCompat(pkg, ask);
1537 reply.writeNoException();
1538 return true;
1539 }
1540
Dianne Hackborn6c418d52011-06-29 14:05:33 -07001541 case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: {
1542 data.enforceInterface(IActivityManager.descriptor);
1543 IIntentSender r = IIntentSender.Stub.asInterface(
1544 data.readStrongBinder());
1545 boolean res = isIntentSenderTargetedToPackage(r);
1546 reply.writeNoException();
1547 reply.writeInt(res ? 1 : 0);
1548 return true;
1549 }
1550
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001551 case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
1552 data.enforceInterface(IActivityManager.descriptor);
1553 Configuration config = Configuration.CREATOR.createFromParcel(data);
1554 updatePersistentConfiguration(config);
1555 reply.writeNoException();
1556 return true;
1557 }
1558
Dianne Hackbornb437e092011-08-05 17:50:29 -07001559 case GET_PROCESS_PSS_TRANSACTION: {
1560 data.enforceInterface(IActivityManager.descriptor);
1561 int[] pids = data.createIntArray();
1562 long[] pss = getProcessPss(pids);
1563 reply.writeNoException();
1564 reply.writeLongArray(pss);
1565 return true;
1566 }
1567
Dianne Hackborn661cd522011-08-22 00:26:20 -07001568 case SHOW_BOOT_MESSAGE_TRANSACTION: {
1569 data.enforceInterface(IActivityManager.descriptor);
1570 CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
1571 boolean always = data.readInt() != 0;
1572 showBootMessage(msg, always);
1573 reply.writeNoException();
1574 return true;
1575 }
1576
Dianne Hackborn90c52de2011-09-23 12:57:44 -07001577 case DISMISS_KEYGUARD_ON_NEXT_ACTIVITY_TRANSACTION: {
1578 data.enforceInterface(IActivityManager.descriptor);
1579 dismissKeyguardOnNextActivity();
1580 reply.writeNoException();
1581 return true;
1582 }
1583
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001584 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08001585
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001586 return super.onTransact(code, data, reply, flags);
1587 }
1588
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08001589 public IBinder asBinder() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001590 return this;
1591 }
1592
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08001593 private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
1594 protected IActivityManager create() {
1595 IBinder b = ServiceManager.getService("activity");
Joe Onorato43a17652011-04-06 19:22:23 -07001596 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08001597 Log.v("ActivityManager", "default service binder = " + b);
1598 }
1599 IActivityManager am = asInterface(b);
Joe Onorato43a17652011-04-06 19:22:23 -07001600 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08001601 Log.v("ActivityManager", "default service = " + am);
1602 }
1603 return am;
1604 }
1605 };
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001606}
1607
1608class ActivityManagerProxy implements IActivityManager
1609{
1610 public ActivityManagerProxy(IBinder remote)
1611 {
1612 mRemote = remote;
1613 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08001614
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001615 public IBinder asBinder()
1616 {
1617 return mRemote;
1618 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08001619
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001620 public int startActivity(IApplicationThread caller, Intent intent,
1621 String resolvedType, Uri[] grantedUriPermissions, int grantedMode,
1622 IBinder resultTo, String resultWho,
1623 int requestCode, boolean onlyIfNeeded,
Siva Velusamy92a8b222012-03-09 16:24:04 -08001624 boolean debug, boolean openglTrace, String profileFile, ParcelFileDescriptor profileFd,
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07001625 boolean autoStopProfiler) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001626 Parcel data = Parcel.obtain();
1627 Parcel reply = Parcel.obtain();
1628 data.writeInterfaceToken(IActivityManager.descriptor);
1629 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1630 intent.writeToParcel(data, 0);
1631 data.writeString(resolvedType);
1632 data.writeTypedArray(grantedUriPermissions, 0);
1633 data.writeInt(grantedMode);
1634 data.writeStrongBinder(resultTo);
1635 data.writeString(resultWho);
1636 data.writeInt(requestCode);
1637 data.writeInt(onlyIfNeeded ? 1 : 0);
1638 data.writeInt(debug ? 1 : 0);
Siva Velusamy92a8b222012-03-09 16:24:04 -08001639 data.writeInt(openglTrace ? 1 : 0);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07001640 data.writeString(profileFile);
1641 if (profileFd != null) {
1642 data.writeInt(1);
1643 profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1644 } else {
1645 data.writeInt(0);
1646 }
1647 data.writeInt(autoStopProfiler ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001648 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
1649 reply.readException();
1650 int result = reply.readInt();
1651 reply.recycle();
1652 data.recycle();
1653 return result;
1654 }
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08001655 public WaitResult startActivityAndWait(IApplicationThread caller, Intent intent,
1656 String resolvedType, Uri[] grantedUriPermissions, int grantedMode,
1657 IBinder resultTo, String resultWho,
1658 int requestCode, boolean onlyIfNeeded,
Siva Velusamy92a8b222012-03-09 16:24:04 -08001659 boolean debug, boolean openglTrace, String profileFile, ParcelFileDescriptor profileFd,
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07001660 boolean autoStopProfiler) throws RemoteException {
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08001661 Parcel data = Parcel.obtain();
1662 Parcel reply = Parcel.obtain();
1663 data.writeInterfaceToken(IActivityManager.descriptor);
1664 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1665 intent.writeToParcel(data, 0);
1666 data.writeString(resolvedType);
1667 data.writeTypedArray(grantedUriPermissions, 0);
1668 data.writeInt(grantedMode);
1669 data.writeStrongBinder(resultTo);
1670 data.writeString(resultWho);
1671 data.writeInt(requestCode);
1672 data.writeInt(onlyIfNeeded ? 1 : 0);
1673 data.writeInt(debug ? 1 : 0);
Siva Velusamy92a8b222012-03-09 16:24:04 -08001674 data.writeInt(openglTrace ? 1 : 0);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07001675 data.writeString(profileFile);
1676 if (profileFd != null) {
1677 data.writeInt(1);
1678 profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1679 } else {
1680 data.writeInt(0);
1681 }
1682 data.writeInt(autoStopProfiler ? 1 : 0);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08001683 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
1684 reply.readException();
1685 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
1686 reply.recycle();
1687 data.recycle();
1688 return result;
1689 }
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07001690 public int startActivityWithConfig(IApplicationThread caller, Intent intent,
1691 String resolvedType, Uri[] grantedUriPermissions, int grantedMode,
1692 IBinder resultTo, String resultWho,
1693 int requestCode, boolean onlyIfNeeded,
1694 boolean debug, Configuration config) throws RemoteException {
1695 Parcel data = Parcel.obtain();
1696 Parcel reply = Parcel.obtain();
1697 data.writeInterfaceToken(IActivityManager.descriptor);
1698 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1699 intent.writeToParcel(data, 0);
1700 data.writeString(resolvedType);
1701 data.writeTypedArray(grantedUriPermissions, 0);
1702 data.writeInt(grantedMode);
1703 data.writeStrongBinder(resultTo);
1704 data.writeString(resultWho);
1705 data.writeInt(requestCode);
1706 data.writeInt(onlyIfNeeded ? 1 : 0);
1707 data.writeInt(debug ? 1 : 0);
1708 config.writeToParcel(data, 0);
1709 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
1710 reply.readException();
1711 int result = reply.readInt();
1712 reply.recycle();
1713 data.recycle();
1714 return result;
1715 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07001716 public int startActivityIntentSender(IApplicationThread caller,
1717 IntentSender intent, Intent fillInIntent, String resolvedType,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07001718 IBinder resultTo, String resultWho, int requestCode,
1719 int flagsMask, int flagsValues) throws RemoteException {
1720 Parcel data = Parcel.obtain();
1721 Parcel reply = Parcel.obtain();
1722 data.writeInterfaceToken(IActivityManager.descriptor);
1723 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1724 intent.writeToParcel(data, 0);
1725 if (fillInIntent != null) {
1726 data.writeInt(1);
1727 fillInIntent.writeToParcel(data, 0);
1728 } else {
1729 data.writeInt(0);
1730 }
1731 data.writeString(resolvedType);
1732 data.writeStrongBinder(resultTo);
1733 data.writeString(resultWho);
1734 data.writeInt(requestCode);
1735 data.writeInt(flagsMask);
1736 data.writeInt(flagsValues);
Dianne Hackbornfa82f222009-09-17 15:14:12 -07001737 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07001738 reply.readException();
1739 int result = reply.readInt();
1740 reply.recycle();
1741 data.recycle();
1742 return result;
1743 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001744 public boolean startNextMatchingActivity(IBinder callingActivity,
1745 Intent intent) throws RemoteException {
1746 Parcel data = Parcel.obtain();
1747 Parcel reply = Parcel.obtain();
1748 data.writeInterfaceToken(IActivityManager.descriptor);
1749 data.writeStrongBinder(callingActivity);
1750 intent.writeToParcel(data, 0);
1751 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
1752 reply.readException();
1753 int result = reply.readInt();
1754 reply.recycle();
1755 data.recycle();
1756 return result != 0;
1757 }
1758 public boolean finishActivity(IBinder token, int resultCode, Intent resultData)
1759 throws RemoteException {
1760 Parcel data = Parcel.obtain();
1761 Parcel reply = Parcel.obtain();
1762 data.writeInterfaceToken(IActivityManager.descriptor);
1763 data.writeStrongBinder(token);
1764 data.writeInt(resultCode);
1765 if (resultData != null) {
1766 data.writeInt(1);
1767 resultData.writeToParcel(data, 0);
1768 } else {
1769 data.writeInt(0);
1770 }
1771 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
1772 reply.readException();
1773 boolean res = reply.readInt() != 0;
1774 data.recycle();
1775 reply.recycle();
1776 return res;
1777 }
1778 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
1779 {
1780 Parcel data = Parcel.obtain();
1781 Parcel reply = Parcel.obtain();
1782 data.writeInterfaceToken(IActivityManager.descriptor);
1783 data.writeStrongBinder(token);
1784 data.writeString(resultWho);
1785 data.writeInt(requestCode);
1786 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
1787 reply.readException();
1788 data.recycle();
1789 reply.recycle();
1790 }
Dianne Hackborn061d58a2010-03-12 15:07:06 -08001791 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
1792 Parcel data = Parcel.obtain();
1793 Parcel reply = Parcel.obtain();
1794 data.writeInterfaceToken(IActivityManager.descriptor);
1795 data.writeStrongBinder(token);
1796 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
1797 reply.readException();
1798 boolean res = reply.readInt() != 0;
1799 data.recycle();
1800 reply.recycle();
1801 return res;
1802 }
Dianne Hackborn6c418d52011-06-29 14:05:33 -07001803 public Intent registerReceiver(IApplicationThread caller, String packageName,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001804 IIntentReceiver receiver,
1805 IntentFilter filter, String perm) throws RemoteException
1806 {
1807 Parcel data = Parcel.obtain();
1808 Parcel reply = Parcel.obtain();
1809 data.writeInterfaceToken(IActivityManager.descriptor);
1810 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackborn6c418d52011-06-29 14:05:33 -07001811 data.writeString(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001812 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
1813 filter.writeToParcel(data, 0);
1814 data.writeString(perm);
1815 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
1816 reply.readException();
1817 Intent intent = null;
1818 int haveIntent = reply.readInt();
1819 if (haveIntent != 0) {
1820 intent = Intent.CREATOR.createFromParcel(reply);
1821 }
1822 reply.recycle();
1823 data.recycle();
1824 return intent;
1825 }
1826 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
1827 {
1828 Parcel data = Parcel.obtain();
1829 Parcel reply = Parcel.obtain();
1830 data.writeInterfaceToken(IActivityManager.descriptor);
1831 data.writeStrongBinder(receiver.asBinder());
1832 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
1833 reply.readException();
1834 data.recycle();
1835 reply.recycle();
1836 }
1837 public int broadcastIntent(IApplicationThread caller,
1838 Intent intent, String resolvedType, IIntentReceiver resultTo,
1839 int resultCode, String resultData, Bundle map,
1840 String requiredPermission, boolean serialized,
Amith Yamasani742a6712011-05-04 14:49:28 -07001841 boolean sticky, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001842 {
1843 Parcel data = Parcel.obtain();
1844 Parcel reply = Parcel.obtain();
1845 data.writeInterfaceToken(IActivityManager.descriptor);
1846 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1847 intent.writeToParcel(data, 0);
1848 data.writeString(resolvedType);
1849 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
1850 data.writeInt(resultCode);
1851 data.writeString(resultData);
1852 data.writeBundle(map);
1853 data.writeString(requiredPermission);
1854 data.writeInt(serialized ? 1 : 0);
1855 data.writeInt(sticky ? 1 : 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07001856 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001857 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
1858 reply.readException();
1859 int res = reply.readInt();
1860 reply.recycle();
1861 data.recycle();
1862 return res;
1863 }
Amith Yamasani742a6712011-05-04 14:49:28 -07001864 public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
1865 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001866 {
1867 Parcel data = Parcel.obtain();
1868 Parcel reply = Parcel.obtain();
1869 data.writeInterfaceToken(IActivityManager.descriptor);
1870 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
1871 intent.writeToParcel(data, 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07001872 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001873 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
1874 reply.readException();
1875 data.recycle();
1876 reply.recycle();
1877 }
1878 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, boolean abortBroadcast) throws RemoteException
1879 {
1880 Parcel data = Parcel.obtain();
1881 Parcel reply = Parcel.obtain();
1882 data.writeInterfaceToken(IActivityManager.descriptor);
1883 data.writeStrongBinder(who);
1884 data.writeInt(resultCode);
1885 data.writeString(resultData);
1886 data.writeBundle(map);
1887 data.writeInt(abortBroadcast ? 1 : 0);
1888 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
1889 reply.readException();
1890 data.recycle();
1891 reply.recycle();
1892 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001893 public void attachApplication(IApplicationThread app) throws RemoteException
1894 {
1895 Parcel data = Parcel.obtain();
1896 Parcel reply = Parcel.obtain();
1897 data.writeInterfaceToken(IActivityManager.descriptor);
1898 data.writeStrongBinder(app.asBinder());
1899 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
1900 reply.readException();
1901 data.recycle();
1902 reply.recycle();
1903 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07001904 public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
1905 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001906 {
1907 Parcel data = Parcel.obtain();
1908 Parcel reply = Parcel.obtain();
1909 data.writeInterfaceToken(IActivityManager.descriptor);
1910 data.writeStrongBinder(token);
Dianne Hackborne88846e2009-09-30 21:34:25 -07001911 if (config != null) {
1912 data.writeInt(1);
1913 config.writeToParcel(data, 0);
1914 } else {
1915 data.writeInt(0);
1916 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07001917 data.writeInt(stopProfiling ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001918 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
1919 reply.readException();
1920 data.recycle();
1921 reply.recycle();
1922 }
Dianne Hackborn0aae2d42010-12-07 23:51:29 -08001923 public void activityPaused(IBinder token) throws RemoteException
1924 {
1925 Parcel data = Parcel.obtain();
1926 Parcel reply = Parcel.obtain();
1927 data.writeInterfaceToken(IActivityManager.descriptor);
1928 data.writeStrongBinder(token);
1929 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
1930 reply.readException();
1931 data.recycle();
1932 reply.recycle();
1933 }
1934 public void activityStopped(IBinder token, Bundle state,
1935 Bitmap thumbnail, CharSequence description) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001936 {
1937 Parcel data = Parcel.obtain();
1938 Parcel reply = Parcel.obtain();
1939 data.writeInterfaceToken(IActivityManager.descriptor);
1940 data.writeStrongBinder(token);
1941 data.writeBundle(state);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001942 if (thumbnail != null) {
1943 data.writeInt(1);
1944 thumbnail.writeToParcel(data, 0);
1945 } else {
1946 data.writeInt(0);
1947 }
1948 TextUtils.writeToParcel(description, data, 0);
1949 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
1950 reply.readException();
1951 data.recycle();
1952 reply.recycle();
1953 }
Dianne Hackborn4eba96b2011-01-21 13:34:36 -08001954 public void activitySlept(IBinder token) throws RemoteException
1955 {
1956 Parcel data = Parcel.obtain();
1957 Parcel reply = Parcel.obtain();
1958 data.writeInterfaceToken(IActivityManager.descriptor);
1959 data.writeStrongBinder(token);
1960 mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
1961 reply.readException();
1962 data.recycle();
1963 reply.recycle();
1964 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001965 public void activityDestroyed(IBinder token) throws RemoteException
1966 {
1967 Parcel data = Parcel.obtain();
1968 Parcel reply = Parcel.obtain();
1969 data.writeInterfaceToken(IActivityManager.descriptor);
1970 data.writeStrongBinder(token);
1971 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
1972 reply.readException();
1973 data.recycle();
1974 reply.recycle();
1975 }
1976 public String getCallingPackage(IBinder token) throws RemoteException
1977 {
1978 Parcel data = Parcel.obtain();
1979 Parcel reply = Parcel.obtain();
1980 data.writeInterfaceToken(IActivityManager.descriptor);
1981 data.writeStrongBinder(token);
1982 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
1983 reply.readException();
1984 String res = reply.readString();
1985 data.recycle();
1986 reply.recycle();
1987 return res;
1988 }
1989 public ComponentName getCallingActivity(IBinder token)
1990 throws RemoteException {
1991 Parcel data = Parcel.obtain();
1992 Parcel reply = Parcel.obtain();
1993 data.writeInterfaceToken(IActivityManager.descriptor);
1994 data.writeStrongBinder(token);
1995 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
1996 reply.readException();
1997 ComponentName res = ComponentName.readFromParcel(reply);
1998 data.recycle();
1999 reply.recycle();
2000 return res;
2001 }
2002 public List getTasks(int maxNum, int flags,
2003 IThumbnailReceiver receiver) throws RemoteException {
2004 Parcel data = Parcel.obtain();
2005 Parcel reply = Parcel.obtain();
2006 data.writeInterfaceToken(IActivityManager.descriptor);
2007 data.writeInt(maxNum);
2008 data.writeInt(flags);
2009 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
2010 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
2011 reply.readException();
2012 ArrayList list = null;
2013 int N = reply.readInt();
2014 if (N >= 0) {
2015 list = new ArrayList();
2016 while (N > 0) {
2017 ActivityManager.RunningTaskInfo info =
2018 ActivityManager.RunningTaskInfo.CREATOR
2019 .createFromParcel(reply);
2020 list.add(info);
2021 N--;
2022 }
2023 }
2024 data.recycle();
2025 reply.recycle();
2026 return list;
2027 }
2028 public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
2029 int flags) throws RemoteException {
2030 Parcel data = Parcel.obtain();
2031 Parcel reply = Parcel.obtain();
2032 data.writeInterfaceToken(IActivityManager.descriptor);
2033 data.writeInt(maxNum);
2034 data.writeInt(flags);
2035 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
2036 reply.readException();
2037 ArrayList<ActivityManager.RecentTaskInfo> list
2038 = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR);
2039 data.recycle();
2040 reply.recycle();
2041 return list;
2042 }
Dianne Hackbornf26fd992011-04-08 18:14:09 -07002043 public ActivityManager.TaskThumbnails getTaskThumbnails(int id) throws RemoteException {
Dianne Hackbornd94df452011-02-16 18:53:31 -08002044 Parcel data = Parcel.obtain();
2045 Parcel reply = Parcel.obtain();
2046 data.writeInterfaceToken(IActivityManager.descriptor);
2047 data.writeInt(id);
Dianne Hackbornf26fd992011-04-08 18:14:09 -07002048 mRemote.transact(GET_TASK_THUMBNAILS_TRANSACTION, data, reply, 0);
Dianne Hackbornd94df452011-02-16 18:53:31 -08002049 reply.readException();
Dianne Hackbornf26fd992011-04-08 18:14:09 -07002050 ActivityManager.TaskThumbnails bm = null;
Dianne Hackbornd94df452011-02-16 18:53:31 -08002051 if (reply.readInt() != 0) {
Dianne Hackbornf26fd992011-04-08 18:14:09 -07002052 bm = ActivityManager.TaskThumbnails.CREATOR.createFromParcel(reply);
Dianne Hackbornd94df452011-02-16 18:53:31 -08002053 }
2054 data.recycle();
2055 reply.recycle();
2056 return bm;
2057 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002058 public List getServices(int maxNum, int flags) throws RemoteException {
2059 Parcel data = Parcel.obtain();
2060 Parcel reply = Parcel.obtain();
2061 data.writeInterfaceToken(IActivityManager.descriptor);
2062 data.writeInt(maxNum);
2063 data.writeInt(flags);
2064 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
2065 reply.readException();
2066 ArrayList list = null;
2067 int N = reply.readInt();
2068 if (N >= 0) {
2069 list = new ArrayList();
2070 while (N > 0) {
2071 ActivityManager.RunningServiceInfo info =
2072 ActivityManager.RunningServiceInfo.CREATOR
2073 .createFromParcel(reply);
2074 list.add(info);
2075 N--;
2076 }
2077 }
2078 data.recycle();
2079 reply.recycle();
2080 return list;
2081 }
2082 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
2083 throws RemoteException {
2084 Parcel data = Parcel.obtain();
2085 Parcel reply = Parcel.obtain();
2086 data.writeInterfaceToken(IActivityManager.descriptor);
2087 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
2088 reply.readException();
2089 ArrayList<ActivityManager.ProcessErrorStateInfo> list
2090 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
2091 data.recycle();
2092 reply.recycle();
2093 return list;
2094 }
2095 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
2096 throws RemoteException {
2097 Parcel data = Parcel.obtain();
2098 Parcel reply = Parcel.obtain();
2099 data.writeInterfaceToken(IActivityManager.descriptor);
2100 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
2101 reply.readException();
2102 ArrayList<ActivityManager.RunningAppProcessInfo> list
2103 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
2104 data.recycle();
2105 reply.recycle();
2106 return list;
2107 }
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -07002108 public List<ApplicationInfo> getRunningExternalApplications()
2109 throws RemoteException {
2110 Parcel data = Parcel.obtain();
2111 Parcel reply = Parcel.obtain();
2112 data.writeInterfaceToken(IActivityManager.descriptor);
2113 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
2114 reply.readException();
2115 ArrayList<ApplicationInfo> list
2116 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
2117 data.recycle();
2118 reply.recycle();
2119 return list;
2120 }
Dianne Hackborn621e17d2010-11-22 15:59:56 -08002121 public void moveTaskToFront(int task, int flags) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002122 {
2123 Parcel data = Parcel.obtain();
2124 Parcel reply = Parcel.obtain();
2125 data.writeInterfaceToken(IActivityManager.descriptor);
2126 data.writeInt(task);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08002127 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002128 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
2129 reply.readException();
2130 data.recycle();
2131 reply.recycle();
2132 }
2133 public void moveTaskToBack(int task) throws RemoteException
2134 {
2135 Parcel data = Parcel.obtain();
2136 Parcel reply = Parcel.obtain();
2137 data.writeInterfaceToken(IActivityManager.descriptor);
2138 data.writeInt(task);
2139 mRemote.transact(MOVE_TASK_TO_BACK_TRANSACTION, data, reply, 0);
2140 reply.readException();
2141 data.recycle();
2142 reply.recycle();
2143 }
2144 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
2145 throws RemoteException {
2146 Parcel data = Parcel.obtain();
2147 Parcel reply = Parcel.obtain();
2148 data.writeInterfaceToken(IActivityManager.descriptor);
2149 data.writeStrongBinder(token);
2150 data.writeInt(nonRoot ? 1 : 0);
2151 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
2152 reply.readException();
2153 boolean res = reply.readInt() != 0;
2154 data.recycle();
2155 reply.recycle();
2156 return res;
2157 }
2158 public void moveTaskBackwards(int task) throws RemoteException
2159 {
2160 Parcel data = Parcel.obtain();
2161 Parcel reply = Parcel.obtain();
2162 data.writeInterfaceToken(IActivityManager.descriptor);
2163 data.writeInt(task);
2164 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
2165 reply.readException();
2166 data.recycle();
2167 reply.recycle();
2168 }
2169 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
2170 {
2171 Parcel data = Parcel.obtain();
2172 Parcel reply = Parcel.obtain();
2173 data.writeInterfaceToken(IActivityManager.descriptor);
2174 data.writeStrongBinder(token);
2175 data.writeInt(onlyRoot ? 1 : 0);
2176 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
2177 reply.readException();
2178 int res = reply.readInt();
2179 data.recycle();
2180 reply.recycle();
2181 return res;
2182 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002183 public void reportThumbnail(IBinder token,
2184 Bitmap thumbnail, CharSequence description) throws RemoteException
2185 {
2186 Parcel data = Parcel.obtain();
2187 Parcel reply = Parcel.obtain();
2188 data.writeInterfaceToken(IActivityManager.descriptor);
2189 data.writeStrongBinder(token);
2190 if (thumbnail != null) {
2191 data.writeInt(1);
2192 thumbnail.writeToParcel(data, 0);
2193 } else {
2194 data.writeInt(0);
2195 }
2196 TextUtils.writeToParcel(description, data, 0);
2197 mRemote.transact(REPORT_THUMBNAIL_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2198 reply.readException();
2199 data.recycle();
2200 reply.recycle();
2201 }
2202 public ContentProviderHolder getContentProvider(IApplicationThread caller,
2203 String name) throws RemoteException
2204 {
2205 Parcel data = Parcel.obtain();
2206 Parcel reply = Parcel.obtain();
2207 data.writeInterfaceToken(IActivityManager.descriptor);
2208 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2209 data.writeString(name);
2210 mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
2211 reply.readException();
2212 int res = reply.readInt();
2213 ContentProviderHolder cph = null;
2214 if (res != 0) {
2215 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
2216 }
2217 data.recycle();
2218 reply.recycle();
2219 return cph;
2220 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08002221 public ContentProviderHolder getContentProviderExternal(String name, IBinder token)
2222 throws RemoteException
2223 {
2224 Parcel data = Parcel.obtain();
2225 Parcel reply = Parcel.obtain();
2226 data.writeInterfaceToken(IActivityManager.descriptor);
2227 data.writeString(name);
2228 data.writeStrongBinder(token);
2229 mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
2230 reply.readException();
2231 int res = reply.readInt();
2232 ContentProviderHolder cph = null;
2233 if (res != 0) {
2234 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
2235 }
2236 data.recycle();
2237 reply.recycle();
2238 return cph;
2239 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002240 public void publishContentProviders(IApplicationThread caller,
2241 List<ContentProviderHolder> providers) throws RemoteException
2242 {
2243 Parcel data = Parcel.obtain();
2244 Parcel reply = Parcel.obtain();
2245 data.writeInterfaceToken(IActivityManager.descriptor);
2246 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2247 data.writeTypedList(providers);
2248 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
2249 reply.readException();
2250 data.recycle();
2251 reply.recycle();
2252 }
2253
2254 public void removeContentProvider(IApplicationThread caller,
2255 String name) throws RemoteException {
2256 Parcel data = Parcel.obtain();
2257 Parcel reply = Parcel.obtain();
2258 data.writeInterfaceToken(IActivityManager.descriptor);
2259 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2260 data.writeString(name);
2261 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
2262 reply.readException();
2263 data.recycle();
2264 reply.recycle();
2265 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08002266
2267 public void removeContentProviderExternal(String name, IBinder token) throws RemoteException {
2268 Parcel data = Parcel.obtain();
2269 Parcel reply = Parcel.obtain();
2270 data.writeInterfaceToken(IActivityManager.descriptor);
2271 data.writeString(name);
2272 data.writeStrongBinder(token);
2273 mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
2274 reply.readException();
2275 data.recycle();
2276 reply.recycle();
2277 }
2278
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07002279 public PendingIntent getRunningServiceControlPanel(ComponentName service)
2280 throws RemoteException
2281 {
2282 Parcel data = Parcel.obtain();
2283 Parcel reply = Parcel.obtain();
2284 data.writeInterfaceToken(IActivityManager.descriptor);
2285 service.writeToParcel(data, 0);
2286 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
2287 reply.readException();
2288 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
2289 data.recycle();
2290 reply.recycle();
2291 return res;
2292 }
2293
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002294 public ComponentName startService(IApplicationThread caller, Intent service,
2295 String resolvedType) throws RemoteException
2296 {
2297 Parcel data = Parcel.obtain();
2298 Parcel reply = Parcel.obtain();
2299 data.writeInterfaceToken(IActivityManager.descriptor);
2300 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2301 service.writeToParcel(data, 0);
2302 data.writeString(resolvedType);
2303 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
2304 reply.readException();
2305 ComponentName res = ComponentName.readFromParcel(reply);
2306 data.recycle();
2307 reply.recycle();
2308 return res;
2309 }
2310 public int stopService(IApplicationThread caller, Intent service,
2311 String resolvedType) throws RemoteException
2312 {
2313 Parcel data = Parcel.obtain();
2314 Parcel reply = Parcel.obtain();
2315 data.writeInterfaceToken(IActivityManager.descriptor);
2316 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2317 service.writeToParcel(data, 0);
2318 data.writeString(resolvedType);
2319 mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0);
2320 reply.readException();
2321 int res = reply.readInt();
2322 reply.recycle();
2323 data.recycle();
2324 return res;
2325 }
2326 public boolean stopServiceToken(ComponentName className, IBinder token,
2327 int startId) throws RemoteException {
2328 Parcel data = Parcel.obtain();
2329 Parcel reply = Parcel.obtain();
2330 data.writeInterfaceToken(IActivityManager.descriptor);
2331 ComponentName.writeToParcel(className, data);
2332 data.writeStrongBinder(token);
2333 data.writeInt(startId);
2334 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
2335 reply.readException();
2336 boolean res = reply.readInt() != 0;
2337 data.recycle();
2338 reply.recycle();
2339 return res;
2340 }
2341 public void setServiceForeground(ComponentName className, IBinder token,
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07002342 int id, Notification notification, boolean removeNotification) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002343 Parcel data = Parcel.obtain();
2344 Parcel reply = Parcel.obtain();
2345 data.writeInterfaceToken(IActivityManager.descriptor);
2346 ComponentName.writeToParcel(className, data);
2347 data.writeStrongBinder(token);
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07002348 data.writeInt(id);
2349 if (notification != null) {
2350 data.writeInt(1);
2351 notification.writeToParcel(data, 0);
2352 } else {
2353 data.writeInt(0);
2354 }
2355 data.writeInt(removeNotification ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002356 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
2357 reply.readException();
2358 data.recycle();
2359 reply.recycle();
2360 }
2361 public int bindService(IApplicationThread caller, IBinder token,
2362 Intent service, String resolvedType, IServiceConnection connection,
Amith Yamasani37ce3a82012-02-06 12:04:42 -08002363 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002364 Parcel data = Parcel.obtain();
2365 Parcel reply = Parcel.obtain();
2366 data.writeInterfaceToken(IActivityManager.descriptor);
2367 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2368 data.writeStrongBinder(token);
2369 service.writeToParcel(data, 0);
2370 data.writeString(resolvedType);
2371 data.writeStrongBinder(connection.asBinder());
2372 data.writeInt(flags);
Amith Yamasani37ce3a82012-02-06 12:04:42 -08002373 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002374 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
2375 reply.readException();
2376 int res = reply.readInt();
2377 data.recycle();
2378 reply.recycle();
2379 return res;
2380 }
2381 public boolean unbindService(IServiceConnection connection) throws RemoteException
2382 {
2383 Parcel data = Parcel.obtain();
2384 Parcel reply = Parcel.obtain();
2385 data.writeInterfaceToken(IActivityManager.descriptor);
2386 data.writeStrongBinder(connection.asBinder());
2387 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
2388 reply.readException();
2389 boolean res = reply.readInt() != 0;
2390 data.recycle();
2391 reply.recycle();
2392 return res;
2393 }
2394
2395 public void publishService(IBinder token,
2396 Intent intent, IBinder service) throws RemoteException {
2397 Parcel data = Parcel.obtain();
2398 Parcel reply = Parcel.obtain();
2399 data.writeInterfaceToken(IActivityManager.descriptor);
2400 data.writeStrongBinder(token);
2401 intent.writeToParcel(data, 0);
2402 data.writeStrongBinder(service);
2403 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
2404 reply.readException();
2405 data.recycle();
2406 reply.recycle();
2407 }
2408
2409 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
2410 throws RemoteException {
2411 Parcel data = Parcel.obtain();
2412 Parcel reply = Parcel.obtain();
2413 data.writeInterfaceToken(IActivityManager.descriptor);
2414 data.writeStrongBinder(token);
2415 intent.writeToParcel(data, 0);
2416 data.writeInt(doRebind ? 1 : 0);
2417 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
2418 reply.readException();
2419 data.recycle();
2420 reply.recycle();
2421 }
2422
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07002423 public void serviceDoneExecuting(IBinder token, int type, int startId,
2424 int res) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002425 Parcel data = Parcel.obtain();
2426 Parcel reply = Parcel.obtain();
2427 data.writeInterfaceToken(IActivityManager.descriptor);
2428 data.writeStrongBinder(token);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07002429 data.writeInt(type);
2430 data.writeInt(startId);
2431 data.writeInt(res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002432 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2433 reply.readException();
2434 data.recycle();
2435 reply.recycle();
2436 }
2437
2438 public IBinder peekService(Intent service, String resolvedType) throws RemoteException {
2439 Parcel data = Parcel.obtain();
2440 Parcel reply = Parcel.obtain();
2441 data.writeInterfaceToken(IActivityManager.descriptor);
2442 service.writeToParcel(data, 0);
2443 data.writeString(resolvedType);
2444 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
2445 reply.readException();
2446 IBinder binder = reply.readStrongBinder();
2447 reply.recycle();
2448 data.recycle();
2449 return binder;
2450 }
2451
Christopher Tate181fafa2009-05-14 11:12:14 -07002452 public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
2453 throws RemoteException {
2454 Parcel data = Parcel.obtain();
2455 Parcel reply = Parcel.obtain();
2456 data.writeInterfaceToken(IActivityManager.descriptor);
2457 app.writeToParcel(data, 0);
2458 data.writeInt(backupRestoreMode);
2459 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
2460 reply.readException();
2461 boolean success = reply.readInt() != 0;
2462 reply.recycle();
2463 data.recycle();
2464 return success;
2465 }
2466
2467 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
2468 Parcel data = Parcel.obtain();
2469 Parcel reply = Parcel.obtain();
2470 data.writeInterfaceToken(IActivityManager.descriptor);
2471 data.writeString(packageName);
2472 data.writeStrongBinder(agent);
2473 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
2474 reply.recycle();
2475 data.recycle();
2476 }
2477
2478 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
2479 Parcel data = Parcel.obtain();
2480 Parcel reply = Parcel.obtain();
2481 data.writeInterfaceToken(IActivityManager.descriptor);
2482 app.writeToParcel(data, 0);
2483 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
2484 reply.readException();
2485 reply.recycle();
2486 data.recycle();
2487 }
2488
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002489 public boolean startInstrumentation(ComponentName className, String profileFile,
2490 int flags, Bundle arguments, IInstrumentationWatcher watcher)
2491 throws RemoteException {
2492 Parcel data = Parcel.obtain();
2493 Parcel reply = Parcel.obtain();
2494 data.writeInterfaceToken(IActivityManager.descriptor);
2495 ComponentName.writeToParcel(className, data);
2496 data.writeString(profileFile);
2497 data.writeInt(flags);
2498 data.writeBundle(arguments);
2499 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
2500 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
2501 reply.readException();
2502 boolean res = reply.readInt() != 0;
2503 reply.recycle();
2504 data.recycle();
2505 return res;
2506 }
2507
2508 public void finishInstrumentation(IApplicationThread target,
2509 int resultCode, Bundle results) throws RemoteException {
2510 Parcel data = Parcel.obtain();
2511 Parcel reply = Parcel.obtain();
2512 data.writeInterfaceToken(IActivityManager.descriptor);
2513 data.writeStrongBinder(target != null ? target.asBinder() : null);
2514 data.writeInt(resultCode);
2515 data.writeBundle(results);
2516 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
2517 reply.readException();
2518 data.recycle();
2519 reply.recycle();
2520 }
2521 public Configuration getConfiguration() throws RemoteException
2522 {
2523 Parcel data = Parcel.obtain();
2524 Parcel reply = Parcel.obtain();
2525 data.writeInterfaceToken(IActivityManager.descriptor);
2526 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
2527 reply.readException();
2528 Configuration res = Configuration.CREATOR.createFromParcel(reply);
2529 reply.recycle();
2530 data.recycle();
2531 return res;
2532 }
2533 public void updateConfiguration(Configuration values) throws RemoteException
2534 {
2535 Parcel data = Parcel.obtain();
2536 Parcel reply = Parcel.obtain();
2537 data.writeInterfaceToken(IActivityManager.descriptor);
2538 values.writeToParcel(data, 0);
2539 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
2540 reply.readException();
2541 data.recycle();
2542 reply.recycle();
2543 }
2544 public void setRequestedOrientation(IBinder token, int requestedOrientation)
2545 throws RemoteException {
2546 Parcel data = Parcel.obtain();
2547 Parcel reply = Parcel.obtain();
2548 data.writeInterfaceToken(IActivityManager.descriptor);
2549 data.writeStrongBinder(token);
2550 data.writeInt(requestedOrientation);
2551 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
2552 reply.readException();
2553 data.recycle();
2554 reply.recycle();
2555 }
2556 public int getRequestedOrientation(IBinder token) throws RemoteException {
2557 Parcel data = Parcel.obtain();
2558 Parcel reply = Parcel.obtain();
2559 data.writeInterfaceToken(IActivityManager.descriptor);
2560 data.writeStrongBinder(token);
2561 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
2562 reply.readException();
2563 int res = reply.readInt();
2564 data.recycle();
2565 reply.recycle();
2566 return res;
2567 }
2568 public ComponentName getActivityClassForToken(IBinder token)
2569 throws RemoteException {
2570 Parcel data = Parcel.obtain();
2571 Parcel reply = Parcel.obtain();
2572 data.writeInterfaceToken(IActivityManager.descriptor);
2573 data.writeStrongBinder(token);
2574 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
2575 reply.readException();
2576 ComponentName res = ComponentName.readFromParcel(reply);
2577 data.recycle();
2578 reply.recycle();
2579 return res;
2580 }
2581 public String getPackageForToken(IBinder token) throws RemoteException
2582 {
2583 Parcel data = Parcel.obtain();
2584 Parcel reply = Parcel.obtain();
2585 data.writeInterfaceToken(IActivityManager.descriptor);
2586 data.writeStrongBinder(token);
2587 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
2588 reply.readException();
2589 String res = reply.readString();
2590 data.recycle();
2591 reply.recycle();
2592 return res;
2593 }
2594 public IIntentSender getIntentSender(int type,
2595 String packageName, IBinder token, String resultWho,
Dianne Hackborn621e17d2010-11-22 15:59:56 -08002596 int requestCode, Intent[] intents, String[] resolvedTypes, int flags)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002597 throws RemoteException {
2598 Parcel data = Parcel.obtain();
2599 Parcel reply = Parcel.obtain();
2600 data.writeInterfaceToken(IActivityManager.descriptor);
2601 data.writeInt(type);
2602 data.writeString(packageName);
2603 data.writeStrongBinder(token);
2604 data.writeString(resultWho);
2605 data.writeInt(requestCode);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08002606 if (intents != null) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002607 data.writeInt(1);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08002608 data.writeTypedArray(intents, 0);
2609 data.writeStringArray(resolvedTypes);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002610 } else {
2611 data.writeInt(0);
2612 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002613 data.writeInt(flags);
2614 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
2615 reply.readException();
2616 IIntentSender res = IIntentSender.Stub.asInterface(
2617 reply.readStrongBinder());
2618 data.recycle();
2619 reply.recycle();
2620 return res;
2621 }
2622 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
2623 Parcel data = Parcel.obtain();
2624 Parcel reply = Parcel.obtain();
2625 data.writeInterfaceToken(IActivityManager.descriptor);
2626 data.writeStrongBinder(sender.asBinder());
2627 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
2628 reply.readException();
2629 data.recycle();
2630 reply.recycle();
2631 }
2632 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
2633 Parcel data = Parcel.obtain();
2634 Parcel reply = Parcel.obtain();
2635 data.writeInterfaceToken(IActivityManager.descriptor);
2636 data.writeStrongBinder(sender.asBinder());
2637 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
2638 reply.readException();
2639 String res = reply.readString();
2640 data.recycle();
2641 reply.recycle();
2642 return res;
2643 }
2644 public void setProcessLimit(int max) throws RemoteException
2645 {
2646 Parcel data = Parcel.obtain();
2647 Parcel reply = Parcel.obtain();
2648 data.writeInterfaceToken(IActivityManager.descriptor);
2649 data.writeInt(max);
2650 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
2651 reply.readException();
2652 data.recycle();
2653 reply.recycle();
2654 }
2655 public int getProcessLimit() throws RemoteException
2656 {
2657 Parcel data = Parcel.obtain();
2658 Parcel reply = Parcel.obtain();
2659 data.writeInterfaceToken(IActivityManager.descriptor);
2660 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
2661 reply.readException();
2662 int res = reply.readInt();
2663 data.recycle();
2664 reply.recycle();
2665 return res;
2666 }
2667 public void setProcessForeground(IBinder token, int pid,
2668 boolean isForeground) throws RemoteException {
2669 Parcel data = Parcel.obtain();
2670 Parcel reply = Parcel.obtain();
2671 data.writeInterfaceToken(IActivityManager.descriptor);
2672 data.writeStrongBinder(token);
2673 data.writeInt(pid);
2674 data.writeInt(isForeground ? 1 : 0);
2675 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
2676 reply.readException();
2677 data.recycle();
2678 reply.recycle();
2679 }
2680 public int checkPermission(String permission, int pid, int uid)
2681 throws RemoteException {
2682 Parcel data = Parcel.obtain();
2683 Parcel reply = Parcel.obtain();
2684 data.writeInterfaceToken(IActivityManager.descriptor);
2685 data.writeString(permission);
2686 data.writeInt(pid);
2687 data.writeInt(uid);
2688 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
2689 reply.readException();
2690 int res = reply.readInt();
2691 data.recycle();
2692 reply.recycle();
2693 return res;
2694 }
2695 public boolean clearApplicationUserData(final String packageName,
Amith Yamasani742a6712011-05-04 14:49:28 -07002696 final IPackageDataObserver observer, final int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002697 Parcel data = Parcel.obtain();
2698 Parcel reply = Parcel.obtain();
2699 data.writeInterfaceToken(IActivityManager.descriptor);
2700 data.writeString(packageName);
2701 data.writeStrongBinder(observer.asBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -07002702 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002703 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
2704 reply.readException();
2705 boolean res = reply.readInt() != 0;
2706 data.recycle();
2707 reply.recycle();
2708 return res;
2709 }
2710 public int checkUriPermission(Uri uri, int pid, int uid, int mode)
2711 throws RemoteException {
2712 Parcel data = Parcel.obtain();
2713 Parcel reply = Parcel.obtain();
2714 data.writeInterfaceToken(IActivityManager.descriptor);
2715 uri.writeToParcel(data, 0);
2716 data.writeInt(pid);
2717 data.writeInt(uid);
2718 data.writeInt(mode);
2719 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
2720 reply.readException();
2721 int res = reply.readInt();
2722 data.recycle();
2723 reply.recycle();
2724 return res;
2725 }
2726 public void grantUriPermission(IApplicationThread caller, String targetPkg,
2727 Uri uri, int mode) throws RemoteException {
2728 Parcel data = Parcel.obtain();
2729 Parcel reply = Parcel.obtain();
2730 data.writeInterfaceToken(IActivityManager.descriptor);
2731 data.writeStrongBinder(caller.asBinder());
2732 data.writeString(targetPkg);
2733 uri.writeToParcel(data, 0);
2734 data.writeInt(mode);
2735 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
2736 reply.readException();
2737 data.recycle();
2738 reply.recycle();
2739 }
2740 public void revokeUriPermission(IApplicationThread caller, Uri uri,
2741 int mode) throws RemoteException {
2742 Parcel data = Parcel.obtain();
2743 Parcel reply = Parcel.obtain();
2744 data.writeInterfaceToken(IActivityManager.descriptor);
2745 data.writeStrongBinder(caller.asBinder());
2746 uri.writeToParcel(data, 0);
2747 data.writeInt(mode);
2748 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
2749 reply.readException();
2750 data.recycle();
2751 reply.recycle();
2752 }
2753 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
2754 throws RemoteException {
2755 Parcel data = Parcel.obtain();
2756 Parcel reply = Parcel.obtain();
2757 data.writeInterfaceToken(IActivityManager.descriptor);
2758 data.writeStrongBinder(who.asBinder());
2759 data.writeInt(waiting ? 1 : 0);
2760 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
2761 reply.readException();
2762 data.recycle();
2763 reply.recycle();
2764 }
2765 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
2766 Parcel data = Parcel.obtain();
2767 Parcel reply = Parcel.obtain();
2768 data.writeInterfaceToken(IActivityManager.descriptor);
2769 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
2770 reply.readException();
2771 outInfo.readFromParcel(reply);
2772 data.recycle();
2773 reply.recycle();
2774 }
2775 public void unhandledBack() throws RemoteException
2776 {
2777 Parcel data = Parcel.obtain();
2778 Parcel reply = Parcel.obtain();
2779 data.writeInterfaceToken(IActivityManager.descriptor);
2780 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
2781 reply.readException();
2782 data.recycle();
2783 reply.recycle();
2784 }
2785 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
2786 {
2787 Parcel data = Parcel.obtain();
2788 Parcel reply = Parcel.obtain();
2789 data.writeInterfaceToken(IActivityManager.descriptor);
2790 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
2791 reply.readException();
2792 ParcelFileDescriptor pfd = null;
2793 if (reply.readInt() != 0) {
2794 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
2795 }
2796 data.recycle();
2797 reply.recycle();
2798 return pfd;
2799 }
2800 public void goingToSleep() throws RemoteException
2801 {
2802 Parcel data = Parcel.obtain();
2803 Parcel reply = Parcel.obtain();
2804 data.writeInterfaceToken(IActivityManager.descriptor);
2805 mRemote.transact(GOING_TO_SLEEP_TRANSACTION, data, reply, 0);
2806 reply.readException();
2807 data.recycle();
2808 reply.recycle();
2809 }
2810 public void wakingUp() throws RemoteException
2811 {
2812 Parcel data = Parcel.obtain();
2813 Parcel reply = Parcel.obtain();
2814 data.writeInterfaceToken(IActivityManager.descriptor);
2815 mRemote.transact(WAKING_UP_TRANSACTION, data, reply, 0);
2816 reply.readException();
2817 data.recycle();
2818 reply.recycle();
2819 }
2820 public void setDebugApp(
2821 String packageName, boolean waitForDebugger, boolean persistent)
2822 throws RemoteException
2823 {
2824 Parcel data = Parcel.obtain();
2825 Parcel reply = Parcel.obtain();
2826 data.writeInterfaceToken(IActivityManager.descriptor);
2827 data.writeString(packageName);
2828 data.writeInt(waitForDebugger ? 1 : 0);
2829 data.writeInt(persistent ? 1 : 0);
2830 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
2831 reply.readException();
2832 data.recycle();
2833 reply.recycle();
2834 }
2835 public void setAlwaysFinish(boolean enabled) throws RemoteException
2836 {
2837 Parcel data = Parcel.obtain();
2838 Parcel reply = Parcel.obtain();
2839 data.writeInterfaceToken(IActivityManager.descriptor);
2840 data.writeInt(enabled ? 1 : 0);
2841 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
2842 reply.readException();
2843 data.recycle();
2844 reply.recycle();
2845 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07002846 public void setActivityController(IActivityController watcher) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002847 {
2848 Parcel data = Parcel.obtain();
2849 Parcel reply = Parcel.obtain();
2850 data.writeInterfaceToken(IActivityManager.descriptor);
2851 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07002852 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002853 reply.readException();
2854 data.recycle();
2855 reply.recycle();
2856 }
2857 public void enterSafeMode() throws RemoteException {
2858 Parcel data = Parcel.obtain();
2859 data.writeInterfaceToken(IActivityManager.descriptor);
2860 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
2861 data.recycle();
2862 }
2863 public void noteWakeupAlarm(IIntentSender sender) throws RemoteException {
2864 Parcel data = Parcel.obtain();
2865 data.writeStrongBinder(sender.asBinder());
2866 data.writeInterfaceToken(IActivityManager.descriptor);
2867 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
2868 data.recycle();
2869 }
Dianne Hackborn64825172011-03-02 21:32:58 -08002870 public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002871 Parcel data = Parcel.obtain();
2872 Parcel reply = Parcel.obtain();
2873 data.writeInterfaceToken(IActivityManager.descriptor);
2874 data.writeIntArray(pids);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07002875 data.writeString(reason);
Dianne Hackborn64825172011-03-02 21:32:58 -08002876 data.writeInt(secure ? 1 : 0);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07002877 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002878 boolean res = reply.readInt() != 0;
2879 data.recycle();
2880 reply.recycle();
2881 return res;
2882 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002883 public void startRunning(String pkg, String cls, String action,
2884 String indata) throws RemoteException {
2885 Parcel data = Parcel.obtain();
2886 Parcel reply = Parcel.obtain();
2887 data.writeInterfaceToken(IActivityManager.descriptor);
2888 data.writeString(pkg);
2889 data.writeString(cls);
2890 data.writeString(action);
2891 data.writeString(indata);
2892 mRemote.transact(START_RUNNING_TRANSACTION, data, reply, 0);
2893 reply.readException();
2894 data.recycle();
2895 reply.recycle();
2896 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002897 public boolean testIsSystemReady()
2898 {
2899 /* this base class version is never called */
2900 return true;
2901 }
Dan Egnor60d87622009-12-16 16:32:58 -08002902 public void handleApplicationCrash(IBinder app,
2903 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
2904 {
2905 Parcel data = Parcel.obtain();
2906 Parcel reply = Parcel.obtain();
2907 data.writeInterfaceToken(IActivityManager.descriptor);
2908 data.writeStrongBinder(app);
2909 crashInfo.writeToParcel(data, 0);
2910 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
2911 reply.readException();
2912 reply.recycle();
2913 data.recycle();
2914 }
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07002915
Dan Egnor60d87622009-12-16 16:32:58 -08002916 public boolean handleApplicationWtf(IBinder app, String tag,
Dan Egnorb7f03672009-12-09 16:22:32 -08002917 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002918 {
2919 Parcel data = Parcel.obtain();
2920 Parcel reply = Parcel.obtain();
2921 data.writeInterfaceToken(IActivityManager.descriptor);
2922 data.writeStrongBinder(app);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002923 data.writeString(tag);
Dan Egnorb7f03672009-12-09 16:22:32 -08002924 crashInfo.writeToParcel(data, 0);
Dan Egnor60d87622009-12-16 16:32:58 -08002925 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002926 reply.readException();
Dan Egnor60d87622009-12-16 16:32:58 -08002927 boolean res = reply.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002928 reply.recycle();
2929 data.recycle();
Dan Egnor60d87622009-12-16 16:32:58 -08002930 return res;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002931 }
Dan Egnorb7f03672009-12-09 16:22:32 -08002932
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07002933 public void handleApplicationStrictModeViolation(IBinder app,
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07002934 int violationMask,
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07002935 StrictMode.ViolationInfo info) throws RemoteException
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07002936 {
2937 Parcel data = Parcel.obtain();
2938 Parcel reply = Parcel.obtain();
2939 data.writeInterfaceToken(IActivityManager.descriptor);
2940 data.writeStrongBinder(app);
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07002941 data.writeInt(violationMask);
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07002942 info.writeToParcel(data, 0);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07002943 mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0);
2944 reply.readException();
2945 reply.recycle();
2946 data.recycle();
2947 }
2948
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002949 public void signalPersistentProcesses(int sig) throws RemoteException {
2950 Parcel data = Parcel.obtain();
2951 Parcel reply = Parcel.obtain();
2952 data.writeInterfaceToken(IActivityManager.descriptor);
2953 data.writeInt(sig);
2954 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
2955 reply.readException();
2956 data.recycle();
2957 reply.recycle();
2958 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08002959
Dianne Hackborn03abb812010-01-04 18:43:19 -08002960 public void killBackgroundProcesses(String packageName) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002961 Parcel data = Parcel.obtain();
2962 Parcel reply = Parcel.obtain();
2963 data.writeInterfaceToken(IActivityManager.descriptor);
2964 data.writeString(packageName);
Dianne Hackborn03abb812010-01-04 18:43:19 -08002965 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
2966 reply.readException();
2967 data.recycle();
2968 reply.recycle();
2969 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08002970
2971 public void killAllBackgroundProcesses() throws RemoteException {
2972 Parcel data = Parcel.obtain();
2973 Parcel reply = Parcel.obtain();
2974 data.writeInterfaceToken(IActivityManager.descriptor);
2975 mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
2976 reply.readException();
2977 data.recycle();
2978 reply.recycle();
2979 }
2980
Dianne Hackborn03abb812010-01-04 18:43:19 -08002981 public void forceStopPackage(String packageName) throws RemoteException {
2982 Parcel data = Parcel.obtain();
2983 Parcel reply = Parcel.obtain();
2984 data.writeInterfaceToken(IActivityManager.descriptor);
2985 data.writeString(packageName);
2986 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002987 reply.readException();
2988 data.recycle();
2989 reply.recycle();
2990 }
2991
Dianne Hackborn27ff9132012-03-06 14:57:58 -08002992 public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
2993 throws RemoteException
2994 {
2995 Parcel data = Parcel.obtain();
2996 Parcel reply = Parcel.obtain();
2997 data.writeInterfaceToken(IActivityManager.descriptor);
2998 mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0);
2999 reply.readException();
3000 outInfo.readFromParcel(reply);
3001 reply.recycle();
3002 data.recycle();
3003 }
3004
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003005 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
3006 {
3007 Parcel data = Parcel.obtain();
3008 Parcel reply = Parcel.obtain();
3009 data.writeInterfaceToken(IActivityManager.descriptor);
3010 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
3011 reply.readException();
3012 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
3013 reply.recycle();
3014 data.recycle();
3015 return res;
3016 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003017
3018 public boolean profileControl(String process, boolean start,
Romain Guy7eabe552011-07-21 14:56:34 -07003019 String path, ParcelFileDescriptor fd, int profileType) throws RemoteException
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003020 {
3021 Parcel data = Parcel.obtain();
3022 Parcel reply = Parcel.obtain();
3023 data.writeInterfaceToken(IActivityManager.descriptor);
3024 data.writeString(process);
3025 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07003026 data.writeInt(profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003027 data.writeString(path);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07003028 if (fd != null) {
3029 data.writeInt(1);
3030 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
3031 } else {
3032 data.writeInt(0);
3033 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003034 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
3035 reply.readException();
3036 boolean res = reply.readInt() != 0;
3037 reply.recycle();
3038 data.recycle();
3039 return res;
3040 }
3041
Dianne Hackborn55280a92009-05-07 15:53:46 -07003042 public boolean shutdown(int timeout) throws RemoteException
3043 {
3044 Parcel data = Parcel.obtain();
3045 Parcel reply = Parcel.obtain();
3046 data.writeInterfaceToken(IActivityManager.descriptor);
3047 data.writeInt(timeout);
3048 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
3049 reply.readException();
3050 boolean res = reply.readInt() != 0;
3051 reply.recycle();
3052 data.recycle();
3053 return res;
3054 }
3055
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07003056 public void stopAppSwitches() throws RemoteException {
3057 Parcel data = Parcel.obtain();
3058 Parcel reply = Parcel.obtain();
3059 data.writeInterfaceToken(IActivityManager.descriptor);
3060 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
3061 reply.readException();
3062 reply.recycle();
3063 data.recycle();
3064 }
3065
3066 public void resumeAppSwitches() throws RemoteException {
3067 Parcel data = Parcel.obtain();
3068 Parcel reply = Parcel.obtain();
3069 data.writeInterfaceToken(IActivityManager.descriptor);
3070 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
3071 reply.readException();
3072 reply.recycle();
3073 data.recycle();
3074 }
3075
Dianne Hackborn2d91af02009-07-16 13:34:33 -07003076 public int startActivityInPackage(int uid,
3077 Intent intent, String resolvedType, IBinder resultTo,
3078 String resultWho, int requestCode, boolean onlyIfNeeded)
3079 throws RemoteException {
3080 Parcel data = Parcel.obtain();
3081 Parcel reply = Parcel.obtain();
3082 data.writeInterfaceToken(IActivityManager.descriptor);
3083 data.writeInt(uid);
3084 intent.writeToParcel(data, 0);
3085 data.writeString(resolvedType);
3086 data.writeStrongBinder(resultTo);
3087 data.writeString(resultWho);
3088 data.writeInt(requestCode);
3089 data.writeInt(onlyIfNeeded ? 1 : 0);
3090 mRemote.transact(START_ACTIVITY_IN_PACKAGE_TRANSACTION, data, reply, 0);
3091 reply.readException();
3092 int result = reply.readInt();
3093 reply.recycle();
3094 data.recycle();
3095 return result;
3096 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07003097
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07003098 public void killApplicationWithUid(String pkg, int uid) throws RemoteException {
3099 Parcel data = Parcel.obtain();
3100 Parcel reply = Parcel.obtain();
3101 data.writeInterfaceToken(IActivityManager.descriptor);
3102 data.writeString(pkg);
3103 data.writeInt(uid);
3104 mRemote.transact(KILL_APPLICATION_WITH_UID_TRANSACTION, data, reply, 0);
3105 reply.readException();
3106 data.recycle();
3107 reply.recycle();
3108 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07003109
3110 public void closeSystemDialogs(String reason) throws RemoteException {
3111 Parcel data = Parcel.obtain();
3112 Parcel reply = Parcel.obtain();
3113 data.writeInterfaceToken(IActivityManager.descriptor);
3114 data.writeString(reason);
3115 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
3116 reply.readException();
3117 data.recycle();
3118 reply.recycle();
3119 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003120
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07003121 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003122 throws RemoteException {
3123 Parcel data = Parcel.obtain();
3124 Parcel reply = Parcel.obtain();
3125 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07003126 data.writeIntArray(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003127 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
3128 reply.readException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07003129 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003130 data.recycle();
3131 reply.recycle();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07003132 return res;
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003133 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07003134
3135 public void killApplicationProcess(String processName, int uid) throws RemoteException {
3136 Parcel data = Parcel.obtain();
3137 Parcel reply = Parcel.obtain();
3138 data.writeInterfaceToken(IActivityManager.descriptor);
3139 data.writeString(processName);
3140 data.writeInt(uid);
3141 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
3142 reply.readException();
3143 data.recycle();
3144 reply.recycle();
3145 }
3146
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07003147 public void overridePendingTransition(IBinder token, String packageName,
3148 int enterAnim, int exitAnim) throws RemoteException {
3149 Parcel data = Parcel.obtain();
3150 Parcel reply = Parcel.obtain();
3151 data.writeInterfaceToken(IActivityManager.descriptor);
3152 data.writeStrongBinder(token);
3153 data.writeString(packageName);
3154 data.writeInt(enterAnim);
3155 data.writeInt(exitAnim);
3156 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
3157 reply.readException();
3158 data.recycle();
3159 reply.recycle();
3160 }
3161
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08003162 public boolean isUserAMonkey() throws RemoteException {
3163 Parcel data = Parcel.obtain();
3164 Parcel reply = Parcel.obtain();
3165 data.writeInterfaceToken(IActivityManager.descriptor);
3166 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
3167 reply.readException();
3168 boolean res = reply.readInt() != 0;
3169 data.recycle();
3170 reply.recycle();
3171 return res;
3172 }
3173
Dianne Hackborn860755f2010-06-03 18:47:52 -07003174 public void finishHeavyWeightApp() throws RemoteException {
3175 Parcel data = Parcel.obtain();
3176 Parcel reply = Parcel.obtain();
3177 data.writeInterfaceToken(IActivityManager.descriptor);
3178 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
3179 reply.readException();
3180 data.recycle();
3181 reply.recycle();
3182 }
3183
Daniel Sandler69a48172010-06-23 16:29:36 -04003184 public void setImmersive(IBinder token, boolean immersive)
3185 throws RemoteException {
3186 Parcel data = Parcel.obtain();
3187 Parcel reply = Parcel.obtain();
3188 data.writeInterfaceToken(IActivityManager.descriptor);
3189 data.writeStrongBinder(token);
3190 data.writeInt(immersive ? 1 : 0);
3191 mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
3192 reply.readException();
3193 data.recycle();
3194 reply.recycle();
3195 }
3196
3197 public boolean isImmersive(IBinder token)
3198 throws RemoteException {
3199 Parcel data = Parcel.obtain();
3200 Parcel reply = Parcel.obtain();
3201 data.writeInterfaceToken(IActivityManager.descriptor);
3202 data.writeStrongBinder(token);
3203 mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04003204 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07003205 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04003206 data.recycle();
3207 reply.recycle();
3208 return res;
3209 }
3210
3211 public boolean isTopActivityImmersive()
3212 throws RemoteException {
3213 Parcel data = Parcel.obtain();
3214 Parcel reply = Parcel.obtain();
3215 data.writeInterfaceToken(IActivityManager.descriptor);
3216 mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04003217 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07003218 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04003219 data.recycle();
3220 reply.recycle();
3221 return res;
3222 }
3223
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07003224 public void crashApplication(int uid, int initialPid, String packageName,
3225 String message) throws RemoteException {
3226 Parcel data = Parcel.obtain();
3227 Parcel reply = Parcel.obtain();
3228 data.writeInterfaceToken(IActivityManager.descriptor);
3229 data.writeInt(uid);
3230 data.writeInt(initialPid);
3231 data.writeString(packageName);
3232 data.writeString(message);
3233 mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0);
3234 reply.readException();
3235 data.recycle();
3236 reply.recycle();
3237 }
Andy McFadden824c5102010-07-09 16:26:57 -07003238
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07003239 public String getProviderMimeType(Uri uri)
3240 throws RemoteException {
3241 Parcel data = Parcel.obtain();
3242 Parcel reply = Parcel.obtain();
3243 data.writeInterfaceToken(IActivityManager.descriptor);
3244 uri.writeToParcel(data, 0);
3245 mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0);
3246 reply.readException();
3247 String res = reply.readString();
3248 data.recycle();
3249 reply.recycle();
3250 return res;
3251 }
3252
Dianne Hackborn7e269642010-08-25 19:50:20 -07003253 public IBinder newUriPermissionOwner(String name)
3254 throws RemoteException {
3255 Parcel data = Parcel.obtain();
3256 Parcel reply = Parcel.obtain();
3257 data.writeInterfaceToken(IActivityManager.descriptor);
3258 data.writeString(name);
3259 mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
3260 reply.readException();
3261 IBinder res = reply.readStrongBinder();
3262 data.recycle();
3263 reply.recycle();
3264 return res;
3265 }
3266
3267 public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
3268 Uri uri, int mode) throws RemoteException {
3269 Parcel data = Parcel.obtain();
3270 Parcel reply = Parcel.obtain();
3271 data.writeInterfaceToken(IActivityManager.descriptor);
3272 data.writeStrongBinder(owner);
3273 data.writeInt(fromUid);
3274 data.writeString(targetPkg);
3275 uri.writeToParcel(data, 0);
3276 data.writeInt(mode);
3277 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
3278 reply.readException();
3279 data.recycle();
3280 reply.recycle();
3281 }
3282
3283 public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
3284 int mode) throws RemoteException {
3285 Parcel data = Parcel.obtain();
3286 Parcel reply = Parcel.obtain();
3287 data.writeInterfaceToken(IActivityManager.descriptor);
3288 data.writeStrongBinder(owner);
3289 if (uri != null) {
3290 data.writeInt(1);
3291 uri.writeToParcel(data, 0);
3292 } else {
3293 data.writeInt(0);
3294 }
3295 data.writeInt(mode);
3296 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
3297 reply.readException();
3298 data.recycle();
3299 reply.recycle();
3300 }
Dianne Hackbornc8f84972010-08-25 23:14:44 -07003301
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07003302 public int checkGrantUriPermission(int callingUid, String targetPkg,
3303 Uri uri, int modeFlags) throws RemoteException {
3304 Parcel data = Parcel.obtain();
3305 Parcel reply = Parcel.obtain();
3306 data.writeInterfaceToken(IActivityManager.descriptor);
3307 data.writeInt(callingUid);
3308 data.writeString(targetPkg);
3309 uri.writeToParcel(data, 0);
3310 data.writeInt(modeFlags);
3311 mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
3312 reply.readException();
3313 int res = reply.readInt();
3314 data.recycle();
3315 reply.recycle();
3316 return res;
3317 }
3318
Andy McFadden824c5102010-07-09 16:26:57 -07003319 public boolean dumpHeap(String process, boolean managed,
3320 String path, ParcelFileDescriptor fd) throws RemoteException {
3321 Parcel data = Parcel.obtain();
3322 Parcel reply = Parcel.obtain();
3323 data.writeInterfaceToken(IActivityManager.descriptor);
3324 data.writeString(process);
3325 data.writeInt(managed ? 1 : 0);
3326 data.writeString(path);
3327 if (fd != null) {
3328 data.writeInt(1);
3329 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
3330 } else {
3331 data.writeInt(0);
3332 }
3333 mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
3334 reply.readException();
3335 boolean res = reply.readInt() != 0;
3336 reply.recycle();
3337 data.recycle();
3338 return res;
3339 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07003340
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003341 public int startActivities(IApplicationThread caller,
3342 Intent[] intents, String[] resolvedTypes, IBinder resultTo) throws RemoteException {
3343 Parcel data = Parcel.obtain();
3344 Parcel reply = Parcel.obtain();
3345 data.writeInterfaceToken(IActivityManager.descriptor);
3346 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3347 data.writeTypedArray(intents, 0);
3348 data.writeStringArray(resolvedTypes);
3349 data.writeStrongBinder(resultTo);
3350 mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0);
3351 reply.readException();
3352 int result = reply.readInt();
3353 reply.recycle();
3354 data.recycle();
3355 return result;
3356 }
3357
3358 public int startActivitiesInPackage(int uid,
3359 Intent[] intents, String[] resolvedTypes, IBinder resultTo) throws RemoteException {
3360 Parcel data = Parcel.obtain();
3361 Parcel reply = Parcel.obtain();
3362 data.writeInterfaceToken(IActivityManager.descriptor);
3363 data.writeInt(uid);
3364 data.writeTypedArray(intents, 0);
3365 data.writeStringArray(resolvedTypes);
3366 data.writeStrongBinder(resultTo);
3367 mRemote.transact(START_ACTIVITIES_IN_PACKAGE_TRANSACTION, data, reply, 0);
3368 reply.readException();
3369 int result = reply.readInt();
3370 reply.recycle();
3371 data.recycle();
3372 return result;
3373 }
3374
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07003375 public int getFrontActivityScreenCompatMode() throws RemoteException {
3376 Parcel data = Parcel.obtain();
3377 Parcel reply = Parcel.obtain();
3378 data.writeInterfaceToken(IActivityManager.descriptor);
3379 mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
3380 reply.readException();
3381 int mode = reply.readInt();
3382 reply.recycle();
3383 data.recycle();
3384 return mode;
3385 }
3386
3387 public void setFrontActivityScreenCompatMode(int mode) throws RemoteException {
3388 Parcel data = Parcel.obtain();
3389 Parcel reply = Parcel.obtain();
3390 data.writeInterfaceToken(IActivityManager.descriptor);
3391 data.writeInt(mode);
3392 mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
3393 reply.readException();
3394 reply.recycle();
3395 data.recycle();
3396 }
3397
3398 public int getPackageScreenCompatMode(String packageName) throws RemoteException {
3399 Parcel data = Parcel.obtain();
3400 Parcel reply = Parcel.obtain();
3401 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07003402 data.writeString(packageName);
3403 mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07003404 reply.readException();
3405 int mode = reply.readInt();
3406 reply.recycle();
3407 data.recycle();
3408 return mode;
3409 }
3410
3411 public void setPackageScreenCompatMode(String packageName, int mode)
Dianne Hackborne2515ee2011-04-27 18:52:56 -04003412 throws RemoteException {
3413 Parcel data = Parcel.obtain();
3414 Parcel reply = Parcel.obtain();
3415 data.writeInterfaceToken(IActivityManager.descriptor);
3416 data.writeString(packageName);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07003417 data.writeInt(mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04003418 mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
3419 reply.readException();
3420 reply.recycle();
3421 data.recycle();
3422 }
3423
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07003424 public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
3425 Parcel data = Parcel.obtain();
3426 Parcel reply = Parcel.obtain();
3427 data.writeInterfaceToken(IActivityManager.descriptor);
3428 data.writeString(packageName);
3429 mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
3430 reply.readException();
3431 boolean ask = reply.readInt() != 0;
3432 reply.recycle();
3433 data.recycle();
3434 return ask;
3435 }
3436
3437 public void setPackageAskScreenCompat(String packageName, boolean ask)
3438 throws RemoteException {
3439 Parcel data = Parcel.obtain();
3440 Parcel reply = Parcel.obtain();
3441 data.writeInterfaceToken(IActivityManager.descriptor);
3442 data.writeString(packageName);
3443 data.writeInt(ask ? 1 : 0);
3444 mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
3445 reply.readException();
3446 reply.recycle();
3447 data.recycle();
3448 }
3449
Amith Yamasani4b2e9342011-03-31 12:38:53 -07003450 public boolean switchUser(int userid) throws RemoteException {
3451 Parcel data = Parcel.obtain();
3452 Parcel reply = Parcel.obtain();
3453 data.writeInterfaceToken(IActivityManager.descriptor);
3454 data.writeInt(userid);
3455 mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0);
3456 reply.readException();
3457 boolean result = reply.readInt() != 0;
3458 reply.recycle();
3459 data.recycle();
3460 return result;
3461 }
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07003462
3463 public boolean removeSubTask(int taskId, int subTaskIndex) throws RemoteException {
3464 Parcel data = Parcel.obtain();
3465 Parcel reply = Parcel.obtain();
3466 data.writeInterfaceToken(IActivityManager.descriptor);
3467 data.writeInt(taskId);
3468 data.writeInt(subTaskIndex);
3469 mRemote.transact(REMOVE_SUB_TASK_TRANSACTION, data, reply, 0);
3470 reply.readException();
3471 boolean result = reply.readInt() != 0;
3472 reply.recycle();
3473 data.recycle();
3474 return result;
3475 }
3476
3477 public boolean removeTask(int taskId, int flags) throws RemoteException {
3478 Parcel data = Parcel.obtain();
3479 Parcel reply = Parcel.obtain();
3480 data.writeInterfaceToken(IActivityManager.descriptor);
3481 data.writeInt(taskId);
3482 data.writeInt(flags);
3483 mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
3484 reply.readException();
3485 boolean result = reply.readInt() != 0;
3486 reply.recycle();
3487 data.recycle();
3488 return result;
3489 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07003490
Jeff Sharkeya4620792011-05-20 15:29:23 -07003491 public void registerProcessObserver(IProcessObserver observer) throws RemoteException {
3492 Parcel data = Parcel.obtain();
3493 Parcel reply = Parcel.obtain();
3494 data.writeInterfaceToken(IActivityManager.descriptor);
3495 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
3496 mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
3497 reply.readException();
3498 data.recycle();
3499 reply.recycle();
3500 }
3501
3502 public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException {
3503 Parcel data = Parcel.obtain();
3504 Parcel reply = Parcel.obtain();
3505 data.writeInterfaceToken(IActivityManager.descriptor);
3506 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
3507 mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
3508 reply.readException();
3509 data.recycle();
3510 reply.recycle();
3511 }
3512
Dianne Hackborn6c418d52011-06-29 14:05:33 -07003513 public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException {
3514 Parcel data = Parcel.obtain();
3515 Parcel reply = Parcel.obtain();
3516 data.writeInterfaceToken(IActivityManager.descriptor);
3517 data.writeStrongBinder(sender.asBinder());
3518 mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0);
3519 reply.readException();
3520 boolean res = reply.readInt() != 0;
3521 data.recycle();
3522 reply.recycle();
3523 return res;
3524 }
3525
Dianne Hackborn31ca8542011-07-19 14:58:28 -07003526 public void updatePersistentConfiguration(Configuration values) throws RemoteException
3527 {
3528 Parcel data = Parcel.obtain();
3529 Parcel reply = Parcel.obtain();
3530 data.writeInterfaceToken(IActivityManager.descriptor);
3531 values.writeToParcel(data, 0);
3532 mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0);
3533 reply.readException();
3534 data.recycle();
3535 reply.recycle();
3536 }
3537
Dianne Hackbornb437e092011-08-05 17:50:29 -07003538 public long[] getProcessPss(int[] pids) throws RemoteException {
3539 Parcel data = Parcel.obtain();
3540 Parcel reply = Parcel.obtain();
3541 data.writeInterfaceToken(IActivityManager.descriptor);
3542 data.writeIntArray(pids);
3543 mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0);
3544 reply.readException();
3545 long[] res = reply.createLongArray();
3546 data.recycle();
3547 reply.recycle();
3548 return res;
3549 }
3550
Dianne Hackborn661cd522011-08-22 00:26:20 -07003551 public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
3552 Parcel data = Parcel.obtain();
3553 Parcel reply = Parcel.obtain();
3554 data.writeInterfaceToken(IActivityManager.descriptor);
3555 TextUtils.writeToParcel(msg, data, 0);
3556 data.writeInt(always ? 1 : 0);
3557 mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
3558 reply.readException();
3559 data.recycle();
3560 reply.recycle();
3561 }
3562
Dianne Hackborn90c52de2011-09-23 12:57:44 -07003563 public void dismissKeyguardOnNextActivity() throws RemoteException {
3564 Parcel data = Parcel.obtain();
3565 Parcel reply = Parcel.obtain();
3566 data.writeInterfaceToken(IActivityManager.descriptor);
3567 mRemote.transact(DISMISS_KEYGUARD_ON_NEXT_ACTIVITY_TRANSACTION, data, reply, 0);
3568 reply.readException();
3569 data.recycle();
3570 reply.recycle();
3571 }
3572
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003573 private IBinder mRemote;
3574}