blob: 3bc2ee60c10ad6e5a49ed1b8521ab559aebcdb96 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.app;
18
Craig Mautnerbdc748af2013-12-02 14:08:25 -080019import android.app.ActivityManager.StackInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080020import android.content.ComponentName;
Adam Powelldd8fab22012-03-22 17:47:27 -070021import android.content.IIntentReceiver;
22import android.content.IIntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023import android.content.Intent;
24import android.content.IntentFilter;
Dianne Hackbornfa82f222009-09-17 15:14:12 -070025import android.content.IntentSender;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070026import android.content.UriPermission;
Christopher Tate181fafa2009-05-14 11:12:14 -070027import android.content.pm.ApplicationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080028import android.content.pm.ConfigurationInfo;
29import android.content.pm.IPackageDataObserver;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070030import android.content.pm.ParceledListSlice;
Amith Yamasani52f1d752012-03-28 18:19:29 -070031import android.content.pm.UserInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080032import android.content.res.Configuration;
33import android.graphics.Bitmap;
Craig Mautnerbdc748af2013-12-02 14:08:25 -080034import android.graphics.Rect;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035import android.net.Uri;
36import android.os.Binder;
37import android.os.Bundle;
Dianne Hackborn3025ef32009-08-31 21:31:47 -070038import android.os.Debug;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080039import android.os.IBinder;
40import android.os.Parcel;
Adam Powelldd8fab22012-03-22 17:47:27 -070041import android.os.ParcelFileDescriptor;
42import android.os.Parcelable;
43import android.os.RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080044import android.os.ServiceManager;
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -070045import android.os.StrictMode;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080046import android.text.TextUtils;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080047import android.util.Log;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080048import android.util.Singleton;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080049
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080050import java.util.ArrayList;
51import java.util.List;
52
53/** {@hide} */
54public abstract class ActivityManagerNative extends Binder implements IActivityManager
55{
56 /**
57 * Cast a Binder object into an activity manager interface, generating
58 * a proxy if needed.
59 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080060 static public IActivityManager asInterface(IBinder obj) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080061 if (obj == null) {
62 return null;
63 }
64 IActivityManager in =
65 (IActivityManager)obj.queryLocalInterface(descriptor);
66 if (in != null) {
67 return in;
68 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080069
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080070 return new ActivityManagerProxy(obj);
71 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080072
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080073 /**
74 * Retrieve the system's default/global activity manager.
75 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080076 static public IActivityManager getDefault() {
77 return gDefault.get();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080078 }
79
80 /**
81 * Convenience for checking whether the system is ready. For internal use only.
82 */
83 static public boolean isSystemReady() {
84 if (!sSystemReady) {
85 sSystemReady = getDefault().testIsSystemReady();
86 }
87 return sSystemReady;
88 }
89 static boolean sSystemReady = false;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080090
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080091 /**
92 * Convenience for sending a sticky broadcast. For internal use only.
93 * If you don't care about permission, use null.
94 */
Dianne Hackborn5ac72a22012-08-29 18:32:08 -070095 static public void broadcastStickyIntent(Intent intent, String permission, int userId) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080096 try {
97 getDefault().broadcastIntent(
98 null, intent, null, null, Activity.RESULT_OK, null, null,
Dianne Hackbornf51f6122013-02-04 18:23:34 -080099 null /*permission*/, AppOpsManager.OP_NONE, false, true, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800100 } catch (RemoteException ex) {
101 }
102 }
103
104 static public void noteWakeupAlarm(PendingIntent ps) {
105 try {
106 getDefault().noteWakeupAlarm(ps.getTarget());
107 } catch (RemoteException ex) {
108 }
109 }
110
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -0800111 public ActivityManagerNative() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800112 attachInterface(this, descriptor);
113 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700114
115 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800116 public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
117 throws RemoteException {
118 switch (code) {
119 case START_ACTIVITY_TRANSACTION:
120 {
121 data.enforceInterface(IActivityManager.descriptor);
122 IBinder b = data.readStrongBinder();
123 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800124 String callingPackage = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800125 Intent intent = Intent.CREATOR.createFromParcel(data);
126 String resolvedType = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800127 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800128 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800129 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700130 int startFlags = data.readInt();
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700131 String profileFile = data.readString();
132 ParcelFileDescriptor profileFd = data.readInt() != 0
133 ? data.readFileDescriptor() : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700134 Bundle options = data.readInt() != 0
135 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800136 int result = startActivity(app, callingPackage, intent, resolvedType,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700137 resultTo, resultWho, requestCode, startFlags,
138 profileFile, profileFd, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800139 reply.writeNoException();
140 reply.writeInt(result);
141 return true;
142 }
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700143
Amith Yamasani82644082012-08-03 13:09:11 -0700144 case START_ACTIVITY_AS_USER_TRANSACTION:
145 {
146 data.enforceInterface(IActivityManager.descriptor);
147 IBinder b = data.readStrongBinder();
148 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800149 String callingPackage = data.readString();
Amith Yamasani82644082012-08-03 13:09:11 -0700150 Intent intent = Intent.CREATOR.createFromParcel(data);
151 String resolvedType = data.readString();
152 IBinder resultTo = data.readStrongBinder();
153 String resultWho = data.readString();
154 int requestCode = data.readInt();
155 int startFlags = data.readInt();
156 String profileFile = data.readString();
157 ParcelFileDescriptor profileFd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -0700158 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Amith Yamasani82644082012-08-03 13:09:11 -0700159 Bundle options = data.readInt() != 0
160 ? Bundle.CREATOR.createFromParcel(data) : null;
161 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800162 int result = startActivityAsUser(app, callingPackage, intent, resolvedType,
Amith Yamasani82644082012-08-03 13:09:11 -0700163 resultTo, resultWho, requestCode, startFlags,
164 profileFile, profileFd, options, userId);
165 reply.writeNoException();
166 reply.writeInt(result);
167 return true;
168 }
169
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800170 case START_ACTIVITY_AND_WAIT_TRANSACTION:
171 {
172 data.enforceInterface(IActivityManager.descriptor);
173 IBinder b = data.readStrongBinder();
174 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800175 String callingPackage = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800176 Intent intent = Intent.CREATOR.createFromParcel(data);
177 String resolvedType = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800178 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800179 String resultWho = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800180 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700181 int startFlags = data.readInt();
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700182 String profileFile = data.readString();
183 ParcelFileDescriptor profileFd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -0700184 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700185 Bundle options = data.readInt() != 0
186 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -0700187 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800188 WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700189 resultTo, resultWho, requestCode, startFlags,
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -0700190 profileFile, profileFd, options, userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800191 reply.writeNoException();
192 result.writeToParcel(reply, 0);
193 return true;
194 }
195
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700196 case START_ACTIVITY_WITH_CONFIG_TRANSACTION:
197 {
198 data.enforceInterface(IActivityManager.descriptor);
199 IBinder b = data.readStrongBinder();
200 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800201 String callingPackage = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700202 Intent intent = Intent.CREATOR.createFromParcel(data);
203 String resolvedType = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700204 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700205 String resultWho = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700206 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700207 int startFlags = data.readInt();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700208 Configuration config = Configuration.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700209 Bundle options = data.readInt() != 0
210 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -0700211 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800212 int result = startActivityWithConfig(app, callingPackage, intent, resolvedType,
Dianne Hackborn41203752012-08-31 14:05:51 -0700213 resultTo, resultWho, requestCode, startFlags, config, options, userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700214 reply.writeNoException();
215 reply.writeInt(result);
216 return true;
217 }
218
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700219 case START_ACTIVITY_INTENT_SENDER_TRANSACTION:
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700220 {
221 data.enforceInterface(IActivityManager.descriptor);
222 IBinder b = data.readStrongBinder();
223 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700224 IntentSender intent = IntentSender.CREATOR.createFromParcel(data);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700225 Intent fillInIntent = null;
226 if (data.readInt() != 0) {
227 fillInIntent = Intent.CREATOR.createFromParcel(data);
228 }
229 String resolvedType = data.readString();
230 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700231 String resultWho = data.readString();
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700232 int requestCode = data.readInt();
233 int flagsMask = data.readInt();
234 int flagsValues = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700235 Bundle options = data.readInt() != 0
236 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700237 int result = startActivityIntentSender(app, intent,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700238 fillInIntent, resolvedType, resultTo, resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700239 requestCode, flagsMask, flagsValues, options);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700240 reply.writeNoException();
241 reply.writeInt(result);
242 return true;
243 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700244
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800245 case START_NEXT_MATCHING_ACTIVITY_TRANSACTION:
246 {
247 data.enforceInterface(IActivityManager.descriptor);
248 IBinder callingActivity = data.readStrongBinder();
249 Intent intent = Intent.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700250 Bundle options = data.readInt() != 0
251 ? Bundle.CREATOR.createFromParcel(data) : null;
252 boolean result = startNextMatchingActivity(callingActivity, intent, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800253 reply.writeNoException();
254 reply.writeInt(result ? 1 : 0);
255 return true;
256 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700257
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800258 case FINISH_ACTIVITY_TRANSACTION: {
259 data.enforceInterface(IActivityManager.descriptor);
260 IBinder token = data.readStrongBinder();
261 Intent resultData = null;
262 int resultCode = data.readInt();
263 if (data.readInt() != 0) {
264 resultData = Intent.CREATOR.createFromParcel(data);
265 }
266 boolean res = finishActivity(token, resultCode, resultData);
267 reply.writeNoException();
268 reply.writeInt(res ? 1 : 0);
269 return true;
270 }
271
272 case FINISH_SUB_ACTIVITY_TRANSACTION: {
273 data.enforceInterface(IActivityManager.descriptor);
274 IBinder token = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700275 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800276 int requestCode = data.readInt();
277 finishSubActivity(token, resultWho, requestCode);
278 reply.writeNoException();
279 return true;
280 }
281
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700282 case FINISH_ACTIVITY_AFFINITY_TRANSACTION: {
283 data.enforceInterface(IActivityManager.descriptor);
284 IBinder token = data.readStrongBinder();
285 boolean res = finishActivityAffinity(token);
286 reply.writeNoException();
287 reply.writeInt(res ? 1 : 0);
288 return true;
289 }
290
Dianne Hackborn061d58a2010-03-12 15:07:06 -0800291 case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: {
292 data.enforceInterface(IActivityManager.descriptor);
293 IBinder token = data.readStrongBinder();
294 boolean res = willActivityBeVisible(token);
295 reply.writeNoException();
296 reply.writeInt(res ? 1 : 0);
297 return true;
298 }
299
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800300 case REGISTER_RECEIVER_TRANSACTION:
301 {
302 data.enforceInterface(IActivityManager.descriptor);
303 IBinder b = data.readStrongBinder();
304 IApplicationThread app =
305 b != null ? ApplicationThreadNative.asInterface(b) : null;
Dianne Hackborn6c418d52011-06-29 14:05:33 -0700306 String packageName = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800307 b = data.readStrongBinder();
308 IIntentReceiver rec
309 = b != null ? IIntentReceiver.Stub.asInterface(b) : null;
310 IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data);
311 String perm = data.readString();
Dianne Hackborn20e80982012-08-31 19:00:44 -0700312 int userId = data.readInt();
313 Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800314 reply.writeNoException();
315 if (intent != null) {
316 reply.writeInt(1);
317 intent.writeToParcel(reply, 0);
318 } else {
319 reply.writeInt(0);
320 }
321 return true;
322 }
323
324 case UNREGISTER_RECEIVER_TRANSACTION:
325 {
326 data.enforceInterface(IActivityManager.descriptor);
327 IBinder b = data.readStrongBinder();
328 if (b == null) {
329 return true;
330 }
331 IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b);
332 unregisterReceiver(rec);
333 reply.writeNoException();
334 return true;
335 }
336
337 case BROADCAST_INTENT_TRANSACTION:
338 {
339 data.enforceInterface(IActivityManager.descriptor);
340 IBinder b = data.readStrongBinder();
341 IApplicationThread app =
342 b != null ? ApplicationThreadNative.asInterface(b) : null;
343 Intent intent = Intent.CREATOR.createFromParcel(data);
344 String resolvedType = data.readString();
345 b = data.readStrongBinder();
346 IIntentReceiver resultTo =
347 b != null ? IIntentReceiver.Stub.asInterface(b) : null;
348 int resultCode = data.readInt();
349 String resultData = data.readString();
350 Bundle resultExtras = data.readBundle();
351 String perm = data.readString();
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800352 int appOp = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800353 boolean serialized = data.readInt() != 0;
354 boolean sticky = data.readInt() != 0;
Amith Yamasani742a6712011-05-04 14:49:28 -0700355 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800356 int res = broadcastIntent(app, intent, resolvedType, resultTo,
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800357 resultCode, resultData, resultExtras, perm, appOp,
Amith Yamasani742a6712011-05-04 14:49:28 -0700358 serialized, sticky, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800359 reply.writeNoException();
360 reply.writeInt(res);
361 return true;
362 }
363
364 case UNBROADCAST_INTENT_TRANSACTION:
365 {
366 data.enforceInterface(IActivityManager.descriptor);
367 IBinder b = data.readStrongBinder();
368 IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null;
369 Intent intent = Intent.CREATOR.createFromParcel(data);
Amith Yamasani742a6712011-05-04 14:49:28 -0700370 int userId = data.readInt();
371 unbroadcastIntent(app, intent, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800372 reply.writeNoException();
373 return true;
374 }
375
376 case FINISH_RECEIVER_TRANSACTION: {
377 data.enforceInterface(IActivityManager.descriptor);
378 IBinder who = data.readStrongBinder();
379 int resultCode = data.readInt();
380 String resultData = data.readString();
381 Bundle resultExtras = data.readBundle();
382 boolean resultAbort = data.readInt() != 0;
383 if (who != null) {
384 finishReceiver(who, resultCode, resultData, resultExtras, resultAbort);
385 }
386 reply.writeNoException();
387 return true;
388 }
389
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800390 case ATTACH_APPLICATION_TRANSACTION: {
391 data.enforceInterface(IActivityManager.descriptor);
392 IApplicationThread app = ApplicationThreadNative.asInterface(
393 data.readStrongBinder());
394 if (app != null) {
395 attachApplication(app);
396 }
397 reply.writeNoException();
398 return true;
399 }
400
401 case ACTIVITY_IDLE_TRANSACTION: {
402 data.enforceInterface(IActivityManager.descriptor);
403 IBinder token = data.readStrongBinder();
Dianne Hackborne88846e2009-09-30 21:34:25 -0700404 Configuration config = null;
405 if (data.readInt() != 0) {
406 config = Configuration.CREATOR.createFromParcel(data);
407 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700408 boolean stopProfiling = data.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800409 if (token != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700410 activityIdle(token, config, stopProfiling);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800411 }
412 reply.writeNoException();
413 return true;
414 }
415
Dianne Hackbornad9b32112012-09-17 15:35:01 -0700416 case ACTIVITY_RESUMED_TRANSACTION: {
417 data.enforceInterface(IActivityManager.descriptor);
418 IBinder token = data.readStrongBinder();
419 activityResumed(token);
420 reply.writeNoException();
421 return true;
422 }
423
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800424 case ACTIVITY_PAUSED_TRANSACTION: {
425 data.enforceInterface(IActivityManager.descriptor);
426 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800427 activityPaused(token);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800428 reply.writeNoException();
429 return true;
430 }
431
432 case ACTIVITY_STOPPED_TRANSACTION: {
433 data.enforceInterface(IActivityManager.descriptor);
434 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800435 Bundle map = data.readBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800436 Bitmap thumbnail = data.readInt() != 0
437 ? Bitmap.CREATOR.createFromParcel(data) : null;
438 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800439 activityStopped(token, map, thumbnail, description);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800440 reply.writeNoException();
441 return true;
442 }
443
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800444 case ACTIVITY_SLEPT_TRANSACTION: {
445 data.enforceInterface(IActivityManager.descriptor);
446 IBinder token = data.readStrongBinder();
447 activitySlept(token);
448 reply.writeNoException();
449 return true;
450 }
451
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800452 case ACTIVITY_DESTROYED_TRANSACTION: {
453 data.enforceInterface(IActivityManager.descriptor);
454 IBinder token = data.readStrongBinder();
455 activityDestroyed(token);
456 reply.writeNoException();
457 return true;
458 }
459
460 case GET_CALLING_PACKAGE_TRANSACTION: {
461 data.enforceInterface(IActivityManager.descriptor);
462 IBinder token = data.readStrongBinder();
463 String res = token != null ? getCallingPackage(token) : null;
464 reply.writeNoException();
465 reply.writeString(res);
466 return true;
467 }
468
469 case GET_CALLING_ACTIVITY_TRANSACTION: {
470 data.enforceInterface(IActivityManager.descriptor);
471 IBinder token = data.readStrongBinder();
472 ComponentName cn = getCallingActivity(token);
473 reply.writeNoException();
474 ComponentName.writeToParcel(cn, reply);
475 return true;
476 }
477
478 case GET_TASKS_TRANSACTION: {
479 data.enforceInterface(IActivityManager.descriptor);
480 int maxNum = data.readInt();
481 int fl = data.readInt();
482 IBinder receiverBinder = data.readStrongBinder();
483 IThumbnailReceiver receiver = receiverBinder != null
484 ? IThumbnailReceiver.Stub.asInterface(receiverBinder)
485 : null;
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700486 List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl, receiver);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800487 reply.writeNoException();
488 int N = list != null ? list.size() : -1;
489 reply.writeInt(N);
490 int i;
491 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700492 ActivityManager.RunningTaskInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800493 info.writeToParcel(reply, 0);
494 }
495 return true;
496 }
497
498 case GET_RECENT_TASKS_TRANSACTION: {
499 data.enforceInterface(IActivityManager.descriptor);
500 int maxNum = data.readInt();
501 int fl = data.readInt();
Amith Yamasani82644082012-08-03 13:09:11 -0700502 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800503 List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -0700504 fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800505 reply.writeNoException();
506 reply.writeTypedList(list);
507 return true;
508 }
Dianne Hackborn15491c62012-09-19 10:59:14 -0700509
Dianne Hackbornf26fd992011-04-08 18:14:09 -0700510 case GET_TASK_THUMBNAILS_TRANSACTION: {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800511 data.enforceInterface(IActivityManager.descriptor);
512 int id = data.readInt();
Dianne Hackbornf26fd992011-04-08 18:14:09 -0700513 ActivityManager.TaskThumbnails bm = getTaskThumbnails(id);
Dianne Hackbornd94df452011-02-16 18:53:31 -0800514 reply.writeNoException();
515 if (bm != null) {
516 reply.writeInt(1);
517 bm.writeToParcel(reply, 0);
518 } else {
519 reply.writeInt(0);
520 }
521 return true;
522 }
Dianne Hackborn15491c62012-09-19 10:59:14 -0700523
524 case GET_TASK_TOP_THUMBNAIL_TRANSACTION: {
525 data.enforceInterface(IActivityManager.descriptor);
526 int id = data.readInt();
527 Bitmap bm = getTaskTopThumbnail(id);
528 reply.writeNoException();
529 if (bm != null) {
530 reply.writeInt(1);
531 bm.writeToParcel(reply, 0);
532 } else {
533 reply.writeInt(0);
534 }
535 return true;
536 }
537
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800538 case GET_SERVICES_TRANSACTION: {
539 data.enforceInterface(IActivityManager.descriptor);
540 int maxNum = data.readInt();
541 int fl = data.readInt();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700542 List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800543 reply.writeNoException();
544 int N = list != null ? list.size() : -1;
545 reply.writeInt(N);
546 int i;
547 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700548 ActivityManager.RunningServiceInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800549 info.writeToParcel(reply, 0);
550 }
551 return true;
552 }
553
554 case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: {
555 data.enforceInterface(IActivityManager.descriptor);
556 List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState();
557 reply.writeNoException();
558 reply.writeTypedList(list);
559 return true;
560 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700561
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800562 case GET_RUNNING_APP_PROCESSES_TRANSACTION: {
563 data.enforceInterface(IActivityManager.descriptor);
564 List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses();
565 reply.writeNoException();
566 reply.writeTypedList(list);
567 return true;
568 }
569
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -0700570 case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: {
571 data.enforceInterface(IActivityManager.descriptor);
572 List<ApplicationInfo> list = getRunningExternalApplications();
573 reply.writeNoException();
574 reply.writeTypedList(list);
575 return true;
576 }
577
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800578 case MOVE_TASK_TO_FRONT_TRANSACTION: {
579 data.enforceInterface(IActivityManager.descriptor);
580 int task = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800581 int fl = data.readInt();
Dianne Hackborn8078d8c2012-03-20 11:11:26 -0700582 Bundle options = data.readInt() != 0
583 ? Bundle.CREATOR.createFromParcel(data) : null;
584 moveTaskToFront(task, fl, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800585 reply.writeNoException();
586 return true;
587 }
588
589 case MOVE_TASK_TO_BACK_TRANSACTION: {
590 data.enforceInterface(IActivityManager.descriptor);
591 int task = data.readInt();
592 moveTaskToBack(task);
593 reply.writeNoException();
594 return true;
595 }
596
597 case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: {
598 data.enforceInterface(IActivityManager.descriptor);
599 IBinder token = data.readStrongBinder();
600 boolean nonRoot = data.readInt() != 0;
601 boolean res = moveActivityTaskToBack(token, nonRoot);
602 reply.writeNoException();
603 reply.writeInt(res ? 1 : 0);
604 return true;
605 }
606
607 case MOVE_TASK_BACKWARDS_TRANSACTION: {
608 data.enforceInterface(IActivityManager.descriptor);
609 int task = data.readInt();
610 moveTaskBackwards(task);
611 reply.writeNoException();
612 return true;
613 }
614
Craig Mautnerc00204b2013-03-05 15:02:14 -0800615 case MOVE_TASK_TO_STACK_TRANSACTION: {
616 data.enforceInterface(IActivityManager.descriptor);
617 int taskId = data.readInt();
618 int stackId = data.readInt();
619 boolean toTop = data.readInt() != 0;
620 moveTaskToStack(taskId, stackId, toTop);
621 reply.writeNoException();
622 return true;
623 }
624
625 case RESIZE_STACK_TRANSACTION: {
626 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800627 int stackId = data.readInt();
Craig Mautnerc00204b2013-03-05 15:02:14 -0800628 float weight = data.readFloat();
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800629 Rect r = Rect.CREATOR.createFromParcel(data);
630 resizeStack(stackId, r);
Craig Mautnerc00204b2013-03-05 15:02:14 -0800631 reply.writeNoException();
632 return true;
633 }
634
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800635 case GET_ALL_STACK_INFOS_TRANSACTION: {
Craig Mautner5ff12102013-05-24 12:50:15 -0700636 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800637 List<StackInfo> list = getAllStackInfos();
Craig Mautner5ff12102013-05-24 12:50:15 -0700638 reply.writeNoException();
639 reply.writeTypedList(list);
640 return true;
641 }
642
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800643 case GET_STACK_INFO_TRANSACTION: {
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700644 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800645 int stackId = data.readInt();
646 StackInfo info = getStackInfo(stackId);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700647 reply.writeNoException();
648 if (info != null) {
649 reply.writeInt(1);
650 info.writeToParcel(reply, 0);
651 } else {
652 reply.writeInt(0);
653 }
654 return true;
655 }
656
Craig Mautnercf910b02013-04-23 11:23:27 -0700657 case SET_FOCUSED_STACK_TRANSACTION: {
658 data.enforceInterface(IActivityManager.descriptor);
659 int stackId = data.readInt();
660 setFocusedStack(stackId);
661 reply.writeNoException();
662 return true;
663 }
664
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800665 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
666 data.enforceInterface(IActivityManager.descriptor);
667 IBinder token = data.readStrongBinder();
668 boolean onlyRoot = data.readInt() != 0;
669 int res = token != null
670 ? getTaskForActivity(token, onlyRoot) : -1;
671 reply.writeNoException();
672 reply.writeInt(res);
673 return true;
674 }
675
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800676 case REPORT_THUMBNAIL_TRANSACTION: {
677 data.enforceInterface(IActivityManager.descriptor);
678 IBinder token = data.readStrongBinder();
679 Bitmap thumbnail = data.readInt() != 0
680 ? Bitmap.CREATOR.createFromParcel(data) : null;
681 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
682 reportThumbnail(token, thumbnail, description);
683 reply.writeNoException();
684 return true;
685 }
686
687 case GET_CONTENT_PROVIDER_TRANSACTION: {
688 data.enforceInterface(IActivityManager.descriptor);
689 IBinder b = data.readStrongBinder();
690 IApplicationThread app = ApplicationThreadNative.asInterface(b);
691 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700692 int userId = data.readInt();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700693 boolean stable = data.readInt() != 0;
Jeff Sharkey6d515712012-09-20 16:06:08 -0700694 ContentProviderHolder cph = getContentProvider(app, name, userId, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800695 reply.writeNoException();
696 if (cph != null) {
697 reply.writeInt(1);
698 cph.writeToParcel(reply, 0);
699 } else {
700 reply.writeInt(0);
701 }
702 return true;
703 }
704
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800705 case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
706 data.enforceInterface(IActivityManager.descriptor);
707 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700708 int userId = data.readInt();
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800709 IBinder token = data.readStrongBinder();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700710 ContentProviderHolder cph = getContentProviderExternal(name, userId, token);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800711 reply.writeNoException();
712 if (cph != null) {
713 reply.writeInt(1);
714 cph.writeToParcel(reply, 0);
715 } else {
716 reply.writeInt(0);
717 }
718 return true;
719 }
720
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800721 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
722 data.enforceInterface(IActivityManager.descriptor);
723 IBinder b = data.readStrongBinder();
724 IApplicationThread app = ApplicationThreadNative.asInterface(b);
725 ArrayList<ContentProviderHolder> providers =
726 data.createTypedArrayList(ContentProviderHolder.CREATOR);
727 publishContentProviders(app, providers);
728 reply.writeNoException();
729 return true;
730 }
731
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700732 case REF_CONTENT_PROVIDER_TRANSACTION: {
733 data.enforceInterface(IActivityManager.descriptor);
734 IBinder b = data.readStrongBinder();
735 int stable = data.readInt();
736 int unstable = data.readInt();
737 boolean res = refContentProvider(b, stable, unstable);
738 reply.writeNoException();
739 reply.writeInt(res ? 1 : 0);
740 return true;
741 }
742
743 case UNSTABLE_PROVIDER_DIED_TRANSACTION: {
744 data.enforceInterface(IActivityManager.descriptor);
745 IBinder b = data.readStrongBinder();
746 unstableProviderDied(b);
747 reply.writeNoException();
748 return true;
749 }
750
Jeff Sharkey7aa76012013-09-30 14:26:27 -0700751 case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: {
752 data.enforceInterface(IActivityManager.descriptor);
753 IBinder b = data.readStrongBinder();
754 appNotRespondingViaProvider(b);
755 reply.writeNoException();
756 return true;
757 }
758
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800759 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
760 data.enforceInterface(IActivityManager.descriptor);
761 IBinder b = data.readStrongBinder();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700762 boolean stable = data.readInt() != 0;
763 removeContentProvider(b, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800764 reply.writeNoException();
765 return true;
766 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800767
768 case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
769 data.enforceInterface(IActivityManager.descriptor);
770 String name = data.readString();
771 IBinder token = data.readStrongBinder();
772 removeContentProviderExternal(name, token);
773 reply.writeNoException();
774 return true;
775 }
776
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700777 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
778 data.enforceInterface(IActivityManager.descriptor);
779 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
780 PendingIntent pi = getRunningServiceControlPanel(comp);
781 reply.writeNoException();
782 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
783 return true;
784 }
785
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800786 case START_SERVICE_TRANSACTION: {
787 data.enforceInterface(IActivityManager.descriptor);
788 IBinder b = data.readStrongBinder();
789 IApplicationThread app = ApplicationThreadNative.asInterface(b);
790 Intent service = Intent.CREATOR.createFromParcel(data);
791 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700792 int userId = data.readInt();
793 ComponentName cn = startService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800794 reply.writeNoException();
795 ComponentName.writeToParcel(cn, reply);
796 return true;
797 }
798
799 case STOP_SERVICE_TRANSACTION: {
800 data.enforceInterface(IActivityManager.descriptor);
801 IBinder b = data.readStrongBinder();
802 IApplicationThread app = ApplicationThreadNative.asInterface(b);
803 Intent service = Intent.CREATOR.createFromParcel(data);
804 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700805 int userId = data.readInt();
806 int res = stopService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800807 reply.writeNoException();
808 reply.writeInt(res);
809 return true;
810 }
811
812 case STOP_SERVICE_TOKEN_TRANSACTION: {
813 data.enforceInterface(IActivityManager.descriptor);
814 ComponentName className = ComponentName.readFromParcel(data);
815 IBinder token = data.readStrongBinder();
816 int startId = data.readInt();
817 boolean res = stopServiceToken(className, token, startId);
818 reply.writeNoException();
819 reply.writeInt(res ? 1 : 0);
820 return true;
821 }
822
823 case SET_SERVICE_FOREGROUND_TRANSACTION: {
824 data.enforceInterface(IActivityManager.descriptor);
825 ComponentName className = ComponentName.readFromParcel(data);
826 IBinder token = data.readStrongBinder();
Dianne Hackbornd8a43f62009-08-17 23:33:56 -0700827 int id = data.readInt();
828 Notification notification = null;
829 if (data.readInt() != 0) {
830 notification = Notification.CREATOR.createFromParcel(data);
831 }
832 boolean removeNotification = data.readInt() != 0;
833 setServiceForeground(className, token, id, notification, removeNotification);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800834 reply.writeNoException();
835 return true;
836 }
837
838 case BIND_SERVICE_TRANSACTION: {
839 data.enforceInterface(IActivityManager.descriptor);
840 IBinder b = data.readStrongBinder();
841 IApplicationThread app = ApplicationThreadNative.asInterface(b);
842 IBinder token = data.readStrongBinder();
843 Intent service = Intent.CREATOR.createFromParcel(data);
844 String resolvedType = data.readString();
845 b = data.readStrongBinder();
846 int fl = data.readInt();
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800847 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800848 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800849 int res = bindService(app, token, service, resolvedType, conn, fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800850 reply.writeNoException();
851 reply.writeInt(res);
852 return true;
853 }
854
855 case UNBIND_SERVICE_TRANSACTION: {
856 data.enforceInterface(IActivityManager.descriptor);
857 IBinder b = data.readStrongBinder();
858 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
859 boolean res = unbindService(conn);
860 reply.writeNoException();
861 reply.writeInt(res ? 1 : 0);
862 return true;
863 }
864
865 case PUBLISH_SERVICE_TRANSACTION: {
866 data.enforceInterface(IActivityManager.descriptor);
867 IBinder token = data.readStrongBinder();
868 Intent intent = Intent.CREATOR.createFromParcel(data);
869 IBinder service = data.readStrongBinder();
870 publishService(token, intent, service);
871 reply.writeNoException();
872 return true;
873 }
874
875 case UNBIND_FINISHED_TRANSACTION: {
876 data.enforceInterface(IActivityManager.descriptor);
877 IBinder token = data.readStrongBinder();
878 Intent intent = Intent.CREATOR.createFromParcel(data);
879 boolean doRebind = data.readInt() != 0;
880 unbindFinished(token, intent, doRebind);
881 reply.writeNoException();
882 return true;
883 }
884
885 case SERVICE_DONE_EXECUTING_TRANSACTION: {
886 data.enforceInterface(IActivityManager.descriptor);
887 IBinder token = data.readStrongBinder();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -0700888 int type = data.readInt();
889 int startId = data.readInt();
890 int res = data.readInt();
891 serviceDoneExecuting(token, type, startId, res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800892 reply.writeNoException();
893 return true;
894 }
895
896 case START_INSTRUMENTATION_TRANSACTION: {
897 data.enforceInterface(IActivityManager.descriptor);
898 ComponentName className = ComponentName.readFromParcel(data);
899 String profileFile = data.readString();
900 int fl = data.readInt();
901 Bundle arguments = data.readBundle();
902 IBinder b = data.readStrongBinder();
903 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
Svetoslav Ganov80943d82013-01-02 10:25:37 -0800904 b = data.readStrongBinder();
905 IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -0700906 int userId = data.readInt();
Svetoslav Ganov80943d82013-01-02 10:25:37 -0800907 boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800908 reply.writeNoException();
909 reply.writeInt(res ? 1 : 0);
910 return true;
911 }
912
913
914 case FINISH_INSTRUMENTATION_TRANSACTION: {
915 data.enforceInterface(IActivityManager.descriptor);
916 IBinder b = data.readStrongBinder();
917 IApplicationThread app = ApplicationThreadNative.asInterface(b);
918 int resultCode = data.readInt();
919 Bundle results = data.readBundle();
920 finishInstrumentation(app, resultCode, results);
921 reply.writeNoException();
922 return true;
923 }
924
925 case GET_CONFIGURATION_TRANSACTION: {
926 data.enforceInterface(IActivityManager.descriptor);
927 Configuration config = getConfiguration();
928 reply.writeNoException();
929 config.writeToParcel(reply, 0);
930 return true;
931 }
932
933 case UPDATE_CONFIGURATION_TRANSACTION: {
934 data.enforceInterface(IActivityManager.descriptor);
935 Configuration config = Configuration.CREATOR.createFromParcel(data);
936 updateConfiguration(config);
937 reply.writeNoException();
938 return true;
939 }
940
941 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
942 data.enforceInterface(IActivityManager.descriptor);
943 IBinder token = data.readStrongBinder();
944 int requestedOrientation = data.readInt();
945 setRequestedOrientation(token, requestedOrientation);
946 reply.writeNoException();
947 return true;
948 }
949
950 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
951 data.enforceInterface(IActivityManager.descriptor);
952 IBinder token = data.readStrongBinder();
953 int req = getRequestedOrientation(token);
954 reply.writeNoException();
955 reply.writeInt(req);
956 return true;
957 }
958
959 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
960 data.enforceInterface(IActivityManager.descriptor);
961 IBinder token = data.readStrongBinder();
962 ComponentName cn = getActivityClassForToken(token);
963 reply.writeNoException();
964 ComponentName.writeToParcel(cn, reply);
965 return true;
966 }
967
968 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
969 data.enforceInterface(IActivityManager.descriptor);
970 IBinder token = data.readStrongBinder();
971 reply.writeNoException();
972 reply.writeString(getPackageForToken(token));
973 return true;
974 }
975
976 case GET_INTENT_SENDER_TRANSACTION: {
977 data.enforceInterface(IActivityManager.descriptor);
978 int type = data.readInt();
979 String packageName = data.readString();
980 IBinder token = data.readStrongBinder();
981 String resultWho = data.readString();
982 int requestCode = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800983 Intent[] requestIntents;
984 String[] requestResolvedTypes;
985 if (data.readInt() != 0) {
986 requestIntents = data.createTypedArray(Intent.CREATOR);
987 requestResolvedTypes = data.createStringArray();
988 } else {
989 requestIntents = null;
990 requestResolvedTypes = null;
991 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800992 int fl = data.readInt();
Dianne Hackborn7a2195c2012-03-19 17:38:00 -0700993 Bundle options = data.readInt() != 0
994 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -0700995 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800996 IIntentSender res = getIntentSender(type, packageName, token,
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800997 resultWho, requestCode, requestIntents,
Dianne Hackborn41203752012-08-31 14:05:51 -0700998 requestResolvedTypes, fl, options, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800999 reply.writeNoException();
1000 reply.writeStrongBinder(res != null ? res.asBinder() : null);
1001 return true;
1002 }
1003
1004 case CANCEL_INTENT_SENDER_TRANSACTION: {
1005 data.enforceInterface(IActivityManager.descriptor);
1006 IIntentSender r = IIntentSender.Stub.asInterface(
1007 data.readStrongBinder());
1008 cancelIntentSender(r);
1009 reply.writeNoException();
1010 return true;
1011 }
1012
1013 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
1014 data.enforceInterface(IActivityManager.descriptor);
1015 IIntentSender r = IIntentSender.Stub.asInterface(
1016 data.readStrongBinder());
1017 String res = getPackageForIntentSender(r);
1018 reply.writeNoException();
1019 reply.writeString(res);
1020 return true;
1021 }
1022
Christopher Tatec4a07d12012-04-06 14:19:13 -07001023 case GET_UID_FOR_INTENT_SENDER_TRANSACTION: {
1024 data.enforceInterface(IActivityManager.descriptor);
1025 IIntentSender r = IIntentSender.Stub.asInterface(
1026 data.readStrongBinder());
1027 int res = getUidForIntentSender(r);
1028 reply.writeNoException();
1029 reply.writeInt(res);
1030 return true;
1031 }
1032
Dianne Hackborn41203752012-08-31 14:05:51 -07001033 case HANDLE_INCOMING_USER_TRANSACTION: {
1034 data.enforceInterface(IActivityManager.descriptor);
1035 int callingPid = data.readInt();
1036 int callingUid = data.readInt();
1037 int userId = data.readInt();
1038 boolean allowAll = data.readInt() != 0 ;
1039 boolean requireFull = data.readInt() != 0;
1040 String name = data.readString();
1041 String callerPackage = data.readString();
1042 int res = handleIncomingUser(callingPid, callingUid, userId, allowAll,
1043 requireFull, name, callerPackage);
1044 reply.writeNoException();
1045 reply.writeInt(res);
1046 return true;
1047 }
1048
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001049 case SET_PROCESS_LIMIT_TRANSACTION: {
1050 data.enforceInterface(IActivityManager.descriptor);
1051 int max = data.readInt();
1052 setProcessLimit(max);
1053 reply.writeNoException();
1054 return true;
1055 }
1056
1057 case GET_PROCESS_LIMIT_TRANSACTION: {
1058 data.enforceInterface(IActivityManager.descriptor);
1059 int limit = getProcessLimit();
1060 reply.writeNoException();
1061 reply.writeInt(limit);
1062 return true;
1063 }
1064
1065 case SET_PROCESS_FOREGROUND_TRANSACTION: {
1066 data.enforceInterface(IActivityManager.descriptor);
1067 IBinder token = data.readStrongBinder();
1068 int pid = data.readInt();
1069 boolean isForeground = data.readInt() != 0;
1070 setProcessForeground(token, pid, isForeground);
1071 reply.writeNoException();
1072 return true;
1073 }
1074
1075 case CHECK_PERMISSION_TRANSACTION: {
1076 data.enforceInterface(IActivityManager.descriptor);
1077 String perm = data.readString();
1078 int pid = data.readInt();
1079 int uid = data.readInt();
1080 int res = checkPermission(perm, pid, uid);
1081 reply.writeNoException();
1082 reply.writeInt(res);
1083 return true;
1084 }
1085
1086 case CHECK_URI_PERMISSION_TRANSACTION: {
1087 data.enforceInterface(IActivityManager.descriptor);
1088 Uri uri = Uri.CREATOR.createFromParcel(data);
1089 int pid = data.readInt();
1090 int uid = data.readInt();
1091 int mode = data.readInt();
1092 int res = checkUriPermission(uri, pid, uid, mode);
1093 reply.writeNoException();
1094 reply.writeInt(res);
1095 return true;
1096 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001097
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001098 case CLEAR_APP_DATA_TRANSACTION: {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001099 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001100 String packageName = data.readString();
1101 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
1102 data.readStrongBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -07001103 int userId = data.readInt();
1104 boolean res = clearApplicationUserData(packageName, observer, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001105 reply.writeNoException();
1106 reply.writeInt(res ? 1 : 0);
1107 return true;
1108 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001109
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001110 case GRANT_URI_PERMISSION_TRANSACTION: {
1111 data.enforceInterface(IActivityManager.descriptor);
1112 IBinder b = data.readStrongBinder();
1113 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1114 String targetPkg = data.readString();
1115 Uri uri = Uri.CREATOR.createFromParcel(data);
1116 int mode = data.readInt();
1117 grantUriPermission(app, targetPkg, uri, mode);
1118 reply.writeNoException();
1119 return true;
1120 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001121
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001122 case REVOKE_URI_PERMISSION_TRANSACTION: {
1123 data.enforceInterface(IActivityManager.descriptor);
1124 IBinder b = data.readStrongBinder();
1125 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1126 Uri uri = Uri.CREATOR.createFromParcel(data);
1127 int mode = data.readInt();
1128 revokeUriPermission(app, uri, mode);
1129 reply.writeNoException();
1130 return true;
1131 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001132
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001133 case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1134 data.enforceInterface(IActivityManager.descriptor);
1135 Uri uri = Uri.CREATOR.createFromParcel(data);
1136 int mode = data.readInt();
1137 takePersistableUriPermission(uri, mode);
1138 reply.writeNoException();
1139 return true;
1140 }
1141
1142 case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1143 data.enforceInterface(IActivityManager.descriptor);
1144 Uri uri = Uri.CREATOR.createFromParcel(data);
1145 int mode = data.readInt();
1146 releasePersistableUriPermission(uri, mode);
1147 reply.writeNoException();
1148 return true;
1149 }
1150
1151 case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: {
1152 data.enforceInterface(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07001153 final String packageName = data.readString();
1154 final boolean incoming = data.readInt() != 0;
1155 final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions(
1156 packageName, incoming);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001157 reply.writeNoException();
1158 perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1159 return true;
1160 }
1161
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001162 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
1163 data.enforceInterface(IActivityManager.descriptor);
1164 IBinder b = data.readStrongBinder();
1165 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1166 boolean waiting = data.readInt() != 0;
1167 showWaitingForDebugger(app, waiting);
1168 reply.writeNoException();
1169 return true;
1170 }
1171
1172 case GET_MEMORY_INFO_TRANSACTION: {
1173 data.enforceInterface(IActivityManager.descriptor);
1174 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
1175 getMemoryInfo(mi);
1176 reply.writeNoException();
1177 mi.writeToParcel(reply, 0);
1178 return true;
1179 }
1180
1181 case UNHANDLED_BACK_TRANSACTION: {
1182 data.enforceInterface(IActivityManager.descriptor);
1183 unhandledBack();
1184 reply.writeNoException();
1185 return true;
1186 }
1187
1188 case OPEN_CONTENT_URI_TRANSACTION: {
1189 data.enforceInterface(IActivityManager.descriptor);
1190 Uri uri = Uri.parse(data.readString());
1191 ParcelFileDescriptor pfd = openContentUri(uri);
1192 reply.writeNoException();
1193 if (pfd != null) {
1194 reply.writeInt(1);
1195 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1196 } else {
1197 reply.writeInt(0);
1198 }
1199 return true;
1200 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001201
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001202 case GOING_TO_SLEEP_TRANSACTION: {
1203 data.enforceInterface(IActivityManager.descriptor);
1204 goingToSleep();
1205 reply.writeNoException();
1206 return true;
1207 }
1208
1209 case WAKING_UP_TRANSACTION: {
1210 data.enforceInterface(IActivityManager.descriptor);
1211 wakingUp();
1212 reply.writeNoException();
1213 return true;
1214 }
1215
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001216 case SET_LOCK_SCREEN_SHOWN_TRANSACTION: {
1217 data.enforceInterface(IActivityManager.descriptor);
1218 setLockScreenShown(data.readInt() != 0);
1219 reply.writeNoException();
1220 return true;
1221 }
1222
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001223 case SET_DEBUG_APP_TRANSACTION: {
1224 data.enforceInterface(IActivityManager.descriptor);
1225 String pn = data.readString();
1226 boolean wfd = data.readInt() != 0;
1227 boolean per = data.readInt() != 0;
1228 setDebugApp(pn, wfd, per);
1229 reply.writeNoException();
1230 return true;
1231 }
1232
1233 case SET_ALWAYS_FINISH_TRANSACTION: {
1234 data.enforceInterface(IActivityManager.descriptor);
1235 boolean enabled = data.readInt() != 0;
1236 setAlwaysFinish(enabled);
1237 reply.writeNoException();
1238 return true;
1239 }
1240
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001241 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001242 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001243 IActivityController watcher = IActivityController.Stub.asInterface(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001244 data.readStrongBinder());
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001245 setActivityController(watcher);
Sungmin Choicdb86bb2012-12-20 14:08:59 +09001246 reply.writeNoException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001247 return true;
1248 }
1249
1250 case ENTER_SAFE_MODE_TRANSACTION: {
1251 data.enforceInterface(IActivityManager.descriptor);
1252 enterSafeMode();
1253 reply.writeNoException();
1254 return true;
1255 }
1256
1257 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1258 data.enforceInterface(IActivityManager.descriptor);
1259 IIntentSender is = IIntentSender.Stub.asInterface(
1260 data.readStrongBinder());
1261 noteWakeupAlarm(is);
1262 reply.writeNoException();
1263 return true;
1264 }
1265
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001266 case KILL_PIDS_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001267 data.enforceInterface(IActivityManager.descriptor);
1268 int[] pids = data.createIntArray();
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001269 String reason = data.readString();
Dianne Hackborn64825172011-03-02 21:32:58 -08001270 boolean secure = data.readInt() != 0;
1271 boolean res = killPids(pids, reason, secure);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001272 reply.writeNoException();
1273 reply.writeInt(res ? 1 : 0);
1274 return true;
1275 }
1276
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07001277 case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: {
1278 data.enforceInterface(IActivityManager.descriptor);
1279 String reason = data.readString();
1280 boolean res = killProcessesBelowForeground(reason);
1281 reply.writeNoException();
1282 reply.writeInt(res ? 1 : 0);
1283 return true;
1284 }
1285
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001286 case START_RUNNING_TRANSACTION: {
1287 data.enforceInterface(IActivityManager.descriptor);
1288 String pkg = data.readString();
1289 String cls = data.readString();
1290 String action = data.readString();
1291 String indata = data.readString();
1292 startRunning(pkg, cls, action, indata);
1293 reply.writeNoException();
1294 return true;
1295 }
1296
Dan Egnor60d87622009-12-16 16:32:58 -08001297 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1298 data.enforceInterface(IActivityManager.descriptor);
1299 IBinder app = data.readStrongBinder();
1300 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1301 handleApplicationCrash(app, ci);
1302 reply.writeNoException();
1303 return true;
1304 }
1305
1306 case HANDLE_APPLICATION_WTF_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001307 data.enforceInterface(IActivityManager.descriptor);
1308 IBinder app = data.readStrongBinder();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001309 String tag = data.readString();
Dan Egnorb7f03672009-12-09 16:22:32 -08001310 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
Dan Egnor60d87622009-12-16 16:32:58 -08001311 boolean res = handleApplicationWtf(app, tag, ci);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001312 reply.writeNoException();
Dan Egnor60d87622009-12-16 16:32:58 -08001313 reply.writeInt(res ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001314 return true;
1315 }
Dan Egnorb7f03672009-12-09 16:22:32 -08001316
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001317 case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: {
1318 data.enforceInterface(IActivityManager.descriptor);
1319 IBinder app = data.readStrongBinder();
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07001320 int violationMask = data.readInt();
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07001321 StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data);
1322 handleApplicationStrictModeViolation(app, violationMask, info);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001323 reply.writeNoException();
1324 return true;
1325 }
1326
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001327 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1328 data.enforceInterface(IActivityManager.descriptor);
1329 int sig = data.readInt();
1330 signalPersistentProcesses(sig);
1331 reply.writeNoException();
1332 return true;
1333 }
1334
Dianne Hackborn03abb812010-01-04 18:43:19 -08001335 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1336 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001337 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001338 int userId = data.readInt();
1339 killBackgroundProcesses(packageName, userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08001340 reply.writeNoException();
1341 return true;
1342 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08001343
1344 case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
1345 data.enforceInterface(IActivityManager.descriptor);
1346 killAllBackgroundProcesses();
1347 reply.writeNoException();
1348 return true;
1349 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001350
Dianne Hackborn03abb812010-01-04 18:43:19 -08001351 case FORCE_STOP_PACKAGE_TRANSACTION: {
1352 data.enforceInterface(IActivityManager.descriptor);
1353 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001354 int userId = data.readInt();
1355 forceStopPackage(packageName, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001356 reply.writeNoException();
1357 return true;
1358 }
Dianne Hackborn27ff9132012-03-06 14:57:58 -08001359
1360 case GET_MY_MEMORY_STATE_TRANSACTION: {
1361 data.enforceInterface(IActivityManager.descriptor);
1362 ActivityManager.RunningAppProcessInfo info =
1363 new ActivityManager.RunningAppProcessInfo();
1364 getMyMemoryState(info);
1365 reply.writeNoException();
1366 info.writeToParcel(reply, 0);
1367 return true;
1368 }
1369
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001370 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1371 data.enforceInterface(IActivityManager.descriptor);
1372 ConfigurationInfo config = getDeviceConfigurationInfo();
1373 reply.writeNoException();
1374 config.writeToParcel(reply, 0);
1375 return true;
1376 }
1377
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001378 case PROFILE_CONTROL_TRANSACTION: {
1379 data.enforceInterface(IActivityManager.descriptor);
1380 String process = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001381 int userId = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001382 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001383 int profileType = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001384 String path = data.readString();
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07001385 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -07001386 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborn1676c852012-09-10 14:52:30 -07001387 boolean res = profileControl(process, userId, start, path, fd, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001388 reply.writeNoException();
1389 reply.writeInt(res ? 1 : 0);
1390 return true;
1391 }
1392
Dianne Hackborn55280a92009-05-07 15:53:46 -07001393 case SHUTDOWN_TRANSACTION: {
1394 data.enforceInterface(IActivityManager.descriptor);
1395 boolean res = shutdown(data.readInt());
1396 reply.writeNoException();
1397 reply.writeInt(res ? 1 : 0);
1398 return true;
1399 }
1400
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001401 case STOP_APP_SWITCHES_TRANSACTION: {
1402 data.enforceInterface(IActivityManager.descriptor);
1403 stopAppSwitches();
1404 reply.writeNoException();
1405 return true;
1406 }
1407
1408 case RESUME_APP_SWITCHES_TRANSACTION: {
1409 data.enforceInterface(IActivityManager.descriptor);
1410 resumeAppSwitches();
1411 reply.writeNoException();
1412 return true;
1413 }
1414
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001415 case PEEK_SERVICE_TRANSACTION: {
1416 data.enforceInterface(IActivityManager.descriptor);
1417 Intent service = Intent.CREATOR.createFromParcel(data);
1418 String resolvedType = data.readString();
1419 IBinder binder = peekService(service, resolvedType);
1420 reply.writeNoException();
1421 reply.writeStrongBinder(binder);
1422 return true;
1423 }
Christopher Tate181fafa2009-05-14 11:12:14 -07001424
1425 case START_BACKUP_AGENT_TRANSACTION: {
1426 data.enforceInterface(IActivityManager.descriptor);
1427 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1428 int backupRestoreMode = data.readInt();
1429 boolean success = bindBackupAgent(info, backupRestoreMode);
1430 reply.writeNoException();
1431 reply.writeInt(success ? 1 : 0);
1432 return true;
1433 }
1434
1435 case BACKUP_AGENT_CREATED_TRANSACTION: {
1436 data.enforceInterface(IActivityManager.descriptor);
1437 String packageName = data.readString();
1438 IBinder agent = data.readStrongBinder();
1439 backupAgentCreated(packageName, agent);
1440 reply.writeNoException();
1441 return true;
1442 }
1443
1444 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1445 data.enforceInterface(IActivityManager.descriptor);
1446 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1447 unbindBackupAgent(info);
1448 reply.writeNoException();
1449 return true;
1450 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001451
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001452 case KILL_APPLICATION_WITH_APPID_TRANSACTION: {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001453 data.enforceInterface(IActivityManager.descriptor);
1454 String pkg = data.readString();
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001455 int appid = data.readInt();
Dianne Hackborn21d9b562013-05-28 17:46:59 -07001456 String reason = data.readString();
1457 killApplicationWithAppId(pkg, appid, reason);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001458 reply.writeNoException();
1459 return true;
1460 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001461
1462 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1463 data.enforceInterface(IActivityManager.descriptor);
1464 String reason = data.readString();
1465 closeSystemDialogs(reason);
1466 reply.writeNoException();
1467 return true;
1468 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001469
1470 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1471 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001472 int[] pids = data.createIntArray();
1473 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001474 reply.writeNoException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001475 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001476 return true;
1477 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001478
1479 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1480 data.enforceInterface(IActivityManager.descriptor);
1481 String processName = data.readString();
1482 int uid = data.readInt();
1483 killApplicationProcess(processName, uid);
1484 reply.writeNoException();
1485 return true;
1486 }
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001487
1488 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1489 data.enforceInterface(IActivityManager.descriptor);
1490 IBinder token = data.readStrongBinder();
1491 String packageName = data.readString();
1492 int enterAnim = data.readInt();
1493 int exitAnim = data.readInt();
1494 overridePendingTransition(token, packageName, enterAnim, exitAnim);
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001495 reply.writeNoException();
1496 return true;
1497 }
1498
1499 case IS_USER_A_MONKEY_TRANSACTION: {
1500 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001501 boolean areThey = isUserAMonkey();
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001502 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001503 reply.writeInt(areThey ? 1 : 0);
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001504 return true;
1505 }
Dianne Hackborn860755f2010-06-03 18:47:52 -07001506
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07001507 case SET_USER_IS_MONKEY_TRANSACTION: {
1508 data.enforceInterface(IActivityManager.descriptor);
1509 final boolean monkey = (data.readInt() == 1);
1510 setUserIsMonkey(monkey);
1511 reply.writeNoException();
1512 return true;
1513 }
1514
Dianne Hackborn860755f2010-06-03 18:47:52 -07001515 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1516 data.enforceInterface(IActivityManager.descriptor);
1517 finishHeavyWeightApp();
1518 reply.writeNoException();
1519 return true;
1520 }
Daniel Sandler69a48172010-06-23 16:29:36 -04001521
1522 case IS_IMMERSIVE_TRANSACTION: {
1523 data.enforceInterface(IActivityManager.descriptor);
1524 IBinder token = data.readStrongBinder();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001525 boolean isit = isImmersive(token);
Daniel Sandler69a48172010-06-23 16:29:36 -04001526 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001527 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001528 return true;
1529 }
1530
Craig Mautner5eda9b32013-07-02 11:58:16 -07001531 case CONVERT_FROM_TRANSLUCENT_TRANSACTION: {
Craig Mautner4addfc52013-06-25 08:05:45 -07001532 data.enforceInterface(IActivityManager.descriptor);
1533 IBinder token = data.readStrongBinder();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001534 boolean converted = convertFromTranslucent(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001535 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001536 reply.writeInt(converted ? 1 : 0);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001537 return true;
1538 }
1539
1540 case CONVERT_TO_TRANSLUCENT_TRANSACTION: {
1541 data.enforceInterface(IActivityManager.descriptor);
1542 IBinder token = data.readStrongBinder();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001543 boolean converted = convertToTranslucent(token);
Craig Mautner4addfc52013-06-25 08:05:45 -07001544 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001545 reply.writeInt(converted ? 1 : 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07001546 return true;
1547 }
1548
Daniel Sandler69a48172010-06-23 16:29:36 -04001549 case SET_IMMERSIVE_TRANSACTION: {
1550 data.enforceInterface(IActivityManager.descriptor);
1551 IBinder token = data.readStrongBinder();
1552 boolean imm = data.readInt() == 1;
1553 setImmersive(token, imm);
1554 reply.writeNoException();
1555 return true;
1556 }
1557
1558 case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
1559 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001560 boolean isit = isTopActivityImmersive();
Daniel Sandler69a48172010-06-23 16:29:36 -04001561 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001562 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001563 return true;
1564 }
1565
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001566 case CRASH_APPLICATION_TRANSACTION: {
1567 data.enforceInterface(IActivityManager.descriptor);
1568 int uid = data.readInt();
1569 int initialPid = data.readInt();
1570 String packageName = data.readString();
1571 String message = data.readString();
1572 crashApplication(uid, initialPid, packageName, message);
1573 reply.writeNoException();
1574 return true;
1575 }
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001576
1577 case GET_PROVIDER_MIME_TYPE_TRANSACTION: {
1578 data.enforceInterface(IActivityManager.descriptor);
1579 Uri uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001580 int userId = data.readInt();
1581 String type = getProviderMimeType(uri, userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001582 reply.writeNoException();
1583 reply.writeString(type);
1584 return true;
1585 }
1586
Dianne Hackborn7e269642010-08-25 19:50:20 -07001587 case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
1588 data.enforceInterface(IActivityManager.descriptor);
1589 String name = data.readString();
1590 IBinder perm = newUriPermissionOwner(name);
1591 reply.writeNoException();
1592 reply.writeStrongBinder(perm);
1593 return true;
1594 }
1595
1596 case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1597 data.enforceInterface(IActivityManager.descriptor);
1598 IBinder owner = data.readStrongBinder();
1599 int fromUid = data.readInt();
1600 String targetPkg = data.readString();
1601 Uri uri = Uri.CREATOR.createFromParcel(data);
1602 int mode = data.readInt();
1603 grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode);
1604 reply.writeNoException();
1605 return true;
1606 }
1607
1608 case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1609 data.enforceInterface(IActivityManager.descriptor);
1610 IBinder owner = data.readStrongBinder();
1611 Uri uri = null;
1612 if (data.readInt() != 0) {
1613 Uri.CREATOR.createFromParcel(data);
1614 }
1615 int mode = data.readInt();
1616 revokeUriPermissionFromOwner(owner, uri, mode);
1617 reply.writeNoException();
1618 return true;
1619 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001620
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001621 case CHECK_GRANT_URI_PERMISSION_TRANSACTION: {
1622 data.enforceInterface(IActivityManager.descriptor);
1623 int callingUid = data.readInt();
1624 String targetPkg = data.readString();
1625 Uri uri = Uri.CREATOR.createFromParcel(data);
1626 int modeFlags = data.readInt();
1627 int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags);
1628 reply.writeNoException();
1629 reply.writeInt(res);
1630 return true;
1631 }
1632
Andy McFadden824c5102010-07-09 16:26:57 -07001633 case DUMP_HEAP_TRANSACTION: {
1634 data.enforceInterface(IActivityManager.descriptor);
1635 String process = data.readString();
Dianne Hackbornb12e1352012-09-26 11:39:20 -07001636 int userId = data.readInt();
Andy McFadden824c5102010-07-09 16:26:57 -07001637 boolean managed = data.readInt() != 0;
1638 String path = data.readString();
1639 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -07001640 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborn1676c852012-09-10 14:52:30 -07001641 boolean res = dumpHeap(process, userId, managed, path, fd);
Andy McFadden824c5102010-07-09 16:26:57 -07001642 reply.writeNoException();
1643 reply.writeInt(res ? 1 : 0);
1644 return true;
1645 }
1646
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001647 case START_ACTIVITIES_TRANSACTION:
1648 {
1649 data.enforceInterface(IActivityManager.descriptor);
1650 IBinder b = data.readStrongBinder();
1651 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001652 String callingPackage = data.readString();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001653 Intent[] intents = data.createTypedArray(Intent.CREATOR);
1654 String[] resolvedTypes = data.createStringArray();
1655 IBinder resultTo = data.readStrongBinder();
Dianne Hackborna4972e92012-03-14 10:38:05 -07001656 Bundle options = data.readInt() != 0
1657 ? Bundle.CREATOR.createFromParcel(data) : null;
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001658 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001659 int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001660 options, userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001661 reply.writeNoException();
1662 reply.writeInt(result);
1663 return true;
1664 }
1665
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001666 case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1667 {
1668 data.enforceInterface(IActivityManager.descriptor);
1669 int mode = getFrontActivityScreenCompatMode();
1670 reply.writeNoException();
1671 reply.writeInt(mode);
1672 return true;
1673 }
1674
1675 case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1676 {
1677 data.enforceInterface(IActivityManager.descriptor);
1678 int mode = data.readInt();
1679 setFrontActivityScreenCompatMode(mode);
1680 reply.writeNoException();
1681 reply.writeInt(mode);
1682 return true;
1683 }
1684
1685 case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1686 {
1687 data.enforceInterface(IActivityManager.descriptor);
1688 String pkg = data.readString();
1689 int mode = getPackageScreenCompatMode(pkg);
1690 reply.writeNoException();
1691 reply.writeInt(mode);
1692 return true;
1693 }
1694
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001695 case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1696 {
1697 data.enforceInterface(IActivityManager.descriptor);
1698 String pkg = data.readString();
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001699 int mode = data.readInt();
1700 setPackageScreenCompatMode(pkg, mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001701 reply.writeNoException();
1702 return true;
1703 }
Dianne Hackbornaa9d84c2011-05-09 19:00:59 -07001704
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001705 case SWITCH_USER_TRANSACTION: {
1706 data.enforceInterface(IActivityManager.descriptor);
1707 int userid = data.readInt();
1708 boolean result = switchUser(userid);
1709 reply.writeNoException();
1710 reply.writeInt(result ? 1 : 0);
1711 return true;
1712 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07001713
Dianne Hackborn80a4af22012-08-27 19:18:31 -07001714 case STOP_USER_TRANSACTION: {
1715 data.enforceInterface(IActivityManager.descriptor);
1716 int userid = data.readInt();
1717 IStopUserCallback callback = IStopUserCallback.Stub.asInterface(
1718 data.readStrongBinder());
1719 int result = stopUser(userid, callback);
1720 reply.writeNoException();
1721 reply.writeInt(result);
1722 return true;
1723 }
1724
Amith Yamasani52f1d752012-03-28 18:19:29 -07001725 case GET_CURRENT_USER_TRANSACTION: {
1726 data.enforceInterface(IActivityManager.descriptor);
1727 UserInfo userInfo = getCurrentUser();
1728 reply.writeNoException();
1729 userInfo.writeToParcel(reply, 0);
1730 return true;
1731 }
1732
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001733 case IS_USER_RUNNING_TRANSACTION: {
1734 data.enforceInterface(IActivityManager.descriptor);
1735 int userid = data.readInt();
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07001736 boolean orStopping = data.readInt() != 0;
1737 boolean result = isUserRunning(userid, orStopping);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001738 reply.writeNoException();
1739 reply.writeInt(result ? 1 : 0);
1740 return true;
1741 }
1742
Dianne Hackbornc72fc672012-09-20 13:12:03 -07001743 case GET_RUNNING_USER_IDS_TRANSACTION: {
1744 data.enforceInterface(IActivityManager.descriptor);
1745 int[] result = getRunningUserIds();
1746 reply.writeNoException();
1747 reply.writeIntArray(result);
1748 return true;
1749 }
1750
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001751 case REMOVE_SUB_TASK_TRANSACTION:
1752 {
1753 data.enforceInterface(IActivityManager.descriptor);
1754 int taskId = data.readInt();
1755 int subTaskIndex = data.readInt();
1756 boolean result = removeSubTask(taskId, subTaskIndex);
1757 reply.writeNoException();
1758 reply.writeInt(result ? 1 : 0);
1759 return true;
1760 }
1761
1762 case REMOVE_TASK_TRANSACTION:
1763 {
1764 data.enforceInterface(IActivityManager.descriptor);
1765 int taskId = data.readInt();
1766 int fl = data.readInt();
1767 boolean result = removeTask(taskId, fl);
1768 reply.writeNoException();
1769 reply.writeInt(result ? 1 : 0);
1770 return true;
1771 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001772
Jeff Sharkeya4620792011-05-20 15:29:23 -07001773 case REGISTER_PROCESS_OBSERVER_TRANSACTION: {
1774 data.enforceInterface(IActivityManager.descriptor);
1775 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1776 data.readStrongBinder());
1777 registerProcessObserver(observer);
1778 return true;
1779 }
1780
1781 case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: {
1782 data.enforceInterface(IActivityManager.descriptor);
1783 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1784 data.readStrongBinder());
1785 unregisterProcessObserver(observer);
1786 return true;
1787 }
1788
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07001789 case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1790 {
1791 data.enforceInterface(IActivityManager.descriptor);
1792 String pkg = data.readString();
1793 boolean ask = getPackageAskScreenCompat(pkg);
1794 reply.writeNoException();
1795 reply.writeInt(ask ? 1 : 0);
1796 return true;
1797 }
1798
1799 case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1800 {
1801 data.enforceInterface(IActivityManager.descriptor);
1802 String pkg = data.readString();
1803 boolean ask = data.readInt() != 0;
1804 setPackageAskScreenCompat(pkg, ask);
1805 reply.writeNoException();
1806 return true;
1807 }
1808
Dianne Hackborn6c418d52011-06-29 14:05:33 -07001809 case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: {
1810 data.enforceInterface(IActivityManager.descriptor);
1811 IIntentSender r = IIntentSender.Stub.asInterface(
1812 data.readStrongBinder());
1813 boolean res = isIntentSenderTargetedToPackage(r);
1814 reply.writeNoException();
1815 reply.writeInt(res ? 1 : 0);
1816 return true;
1817 }
1818
Dianne Hackborn1927ae82012-06-22 15:21:36 -07001819 case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: {
1820 data.enforceInterface(IActivityManager.descriptor);
1821 IIntentSender r = IIntentSender.Stub.asInterface(
1822 data.readStrongBinder());
1823 boolean res = isIntentSenderAnActivity(r);
1824 reply.writeNoException();
1825 reply.writeInt(res ? 1 : 0);
1826 return true;
1827 }
1828
Dianne Hackborn81038902012-11-26 17:04:09 -08001829 case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: {
1830 data.enforceInterface(IActivityManager.descriptor);
1831 IIntentSender r = IIntentSender.Stub.asInterface(
1832 data.readStrongBinder());
1833 Intent intent = getIntentForIntentSender(r);
1834 reply.writeNoException();
1835 if (intent != null) {
1836 reply.writeInt(1);
1837 intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1838 } else {
1839 reply.writeInt(0);
1840 }
1841 return true;
1842 }
1843
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001844 case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
1845 data.enforceInterface(IActivityManager.descriptor);
1846 Configuration config = Configuration.CREATOR.createFromParcel(data);
1847 updatePersistentConfiguration(config);
1848 reply.writeNoException();
1849 return true;
1850 }
1851
Dianne Hackbornb437e092011-08-05 17:50:29 -07001852 case GET_PROCESS_PSS_TRANSACTION: {
1853 data.enforceInterface(IActivityManager.descriptor);
1854 int[] pids = data.createIntArray();
1855 long[] pss = getProcessPss(pids);
1856 reply.writeNoException();
1857 reply.writeLongArray(pss);
1858 return true;
1859 }
1860
Dianne Hackborn661cd522011-08-22 00:26:20 -07001861 case SHOW_BOOT_MESSAGE_TRANSACTION: {
1862 data.enforceInterface(IActivityManager.descriptor);
1863 CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
1864 boolean always = data.readInt() != 0;
1865 showBootMessage(msg, always);
1866 reply.writeNoException();
1867 return true;
1868 }
1869
Dianne Hackborn90c52de2011-09-23 12:57:44 -07001870 case DISMISS_KEYGUARD_ON_NEXT_ACTIVITY_TRANSACTION: {
1871 data.enforceInterface(IActivityManager.descriptor);
1872 dismissKeyguardOnNextActivity();
1873 reply.writeNoException();
1874 return true;
1875 }
1876
Adam Powelldd8fab22012-03-22 17:47:27 -07001877 case TARGET_TASK_AFFINITY_MATCHES_ACTIVITY_TRANSACTION: {
1878 data.enforceInterface(IActivityManager.descriptor);
1879 IBinder token = data.readStrongBinder();
1880 String destAffinity = data.readString();
1881 boolean res = targetTaskAffinityMatchesActivity(token, destAffinity);
1882 reply.writeNoException();
1883 reply.writeInt(res ? 1 : 0);
1884 return true;
1885 }
1886
1887 case NAVIGATE_UP_TO_TRANSACTION: {
1888 data.enforceInterface(IActivityManager.descriptor);
1889 IBinder token = data.readStrongBinder();
1890 Intent target = Intent.CREATOR.createFromParcel(data);
1891 int resultCode = data.readInt();
1892 Intent resultData = null;
1893 if (data.readInt() != 0) {
1894 resultData = Intent.CREATOR.createFromParcel(data);
1895 }
1896 boolean res = navigateUpTo(token, target, resultCode, resultData);
1897 reply.writeNoException();
1898 reply.writeInt(res ? 1 : 0);
1899 return true;
1900 }
1901
Dianne Hackborn5320eb82012-05-18 12:05:04 -07001902 case GET_LAUNCHED_FROM_UID_TRANSACTION: {
1903 data.enforceInterface(IActivityManager.descriptor);
1904 IBinder token = data.readStrongBinder();
1905 int res = getLaunchedFromUid(token);
1906 reply.writeNoException();
1907 reply.writeInt(res);
1908 return true;
1909 }
1910
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001911 case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: {
1912 data.enforceInterface(IActivityManager.descriptor);
1913 IBinder token = data.readStrongBinder();
1914 String res = getLaunchedFromPackage(token);
1915 reply.writeNoException();
1916 reply.writeString(res);
1917 return true;
1918 }
1919
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07001920 case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
1921 data.enforceInterface(IActivityManager.descriptor);
1922 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
1923 data.readStrongBinder());
1924 registerUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07001925 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07001926 return true;
1927 }
1928
1929 case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
1930 data.enforceInterface(IActivityManager.descriptor);
1931 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
1932 data.readStrongBinder());
1933 unregisterUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07001934 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07001935 return true;
1936 }
1937
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07001938 case REQUEST_BUG_REPORT_TRANSACTION: {
1939 data.enforceInterface(IActivityManager.descriptor);
1940 requestBugReport();
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07001941 reply.writeNoException();
1942 return true;
1943 }
1944
1945 case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: {
1946 data.enforceInterface(IActivityManager.descriptor);
1947 int pid = data.readInt();
1948 boolean aboveSystem = data.readInt() != 0;
Jeff Brownbd181bb2013-09-10 16:44:24 -07001949 String reason = data.readString();
1950 long res = inputDispatchingTimedOut(pid, aboveSystem, reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07001951 reply.writeNoException();
1952 reply.writeLong(res);
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07001953 return true;
1954 }
1955
Adam Skorydfc7fd72013-08-05 19:23:41 -07001956 case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08001957 data.enforceInterface(IActivityManager.descriptor);
1958 int requestType = data.readInt();
Adam Skorydfc7fd72013-08-05 19:23:41 -07001959 Bundle res = getAssistContextExtras(requestType);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08001960 reply.writeNoException();
1961 reply.writeBundle(res);
1962 return true;
1963 }
1964
Adam Skorydfc7fd72013-08-05 19:23:41 -07001965 case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08001966 data.enforceInterface(IActivityManager.descriptor);
1967 IBinder token = data.readStrongBinder();
1968 Bundle extras = data.readBundle();
Adam Skory7140a252013-09-11 12:04:58 +01001969 reportAssistContextExtras(token, extras);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08001970 reply.writeNoException();
1971 return true;
1972 }
1973
Dianne Hackbornf1b78242013-04-08 22:28:59 -07001974 case KILL_UID_TRANSACTION: {
1975 data.enforceInterface(IActivityManager.descriptor);
1976 int uid = data.readInt();
1977 String reason = data.readString();
1978 killUid(uid, reason);
1979 reply.writeNoException();
1980 return true;
1981 }
1982
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07001983 case HANG_TRANSACTION: {
1984 data.enforceInterface(IActivityManager.descriptor);
1985 IBinder who = data.readStrongBinder();
1986 boolean allowRestart = data.readInt() != 0;
1987 hang(who, allowRestart);
1988 reply.writeNoException();
1989 return true;
1990 }
1991
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07001992 case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: {
1993 data.enforceInterface(IActivityManager.descriptor);
1994 IBinder token = data.readStrongBinder();
1995 reportActivityFullyDrawn(token);
1996 reply.writeNoException();
1997 return true;
1998 }
1999
Craig Mautner5eda9b32013-07-02 11:58:16 -07002000 case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: {
2001 data.enforceInterface(IActivityManager.descriptor);
2002 IBinder token = data.readStrongBinder();
2003 notifyActivityDrawn(token);
2004 reply.writeNoException();
2005 return true;
2006 }
Dianne Hackborn57a7f592013-07-22 18:21:32 -07002007
2008 case RESTART_TRANSACTION: {
2009 data.enforceInterface(IActivityManager.descriptor);
2010 restart();
2011 reply.writeNoException();
2012 return true;
2013 }
Jeff Sharkey08da7a12013-08-11 20:53:18 -07002014
Dianne Hackborn35f72be2013-09-16 10:57:39 -07002015 case PERFORM_IDLE_MAINTENANCE_TRANSACTION: {
2016 data.enforceInterface(IActivityManager.descriptor);
2017 performIdleMaintenance();
2018 reply.writeNoException();
2019 return true;
2020 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002021
2022 case CREATE_ACTIVITY_CONTAINER_TRANSACTION: {
2023 data.enforceInterface(IActivityManager.descriptor);
2024 IBinder parentActivityToken = data.readStrongBinder();
2025 IActivityContainerCallback callback =
2026 (IActivityContainerCallback) data.readStrongBinder();
2027 IActivityContainer activityContainer =
2028 createActivityContainer(parentActivityToken, callback);
2029 reply.writeNoException();
2030 reply.writeStrongBinder(activityContainer.asBinder());
2031 return true;
2032 }
2033
Craig Mautnere0a38842013-12-16 16:14:02 -08002034 case GET_ACTIVITY_CONTAINER_TRANSACTION: {
2035 data.enforceInterface(IActivityManager.descriptor);
2036 IBinder activityToken = data.readStrongBinder();
2037 IActivityContainer activityContainer = getEnclosingActivityContainer(activityToken);
2038 reply.writeNoException();
2039 reply.writeStrongBinder(activityContainer.asBinder());
2040 return true;
2041 }
2042
Craig Mautner4a1cb222013-12-04 16:14:06 -08002043 case GET_HOME_ACTIVITY_TOKEN_TRANSACTION: {
2044 data.enforceInterface(IActivityManager.descriptor);
2045 IBinder homeActivityToken = getHomeActivityToken();
2046 reply.writeNoException();
2047 reply.writeStrongBinder(homeActivityToken);
2048 return true;
2049 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002050 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002051
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002052 return super.onTransact(code, data, reply, flags);
2053 }
2054
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002055 public IBinder asBinder() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002056 return this;
2057 }
2058
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002059 private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
2060 protected IActivityManager create() {
2061 IBinder b = ServiceManager.getService("activity");
Joe Onorato43a17652011-04-06 19:22:23 -07002062 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002063 Log.v("ActivityManager", "default service binder = " + b);
2064 }
2065 IActivityManager am = asInterface(b);
Joe Onorato43a17652011-04-06 19:22:23 -07002066 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002067 Log.v("ActivityManager", "default service = " + am);
2068 }
2069 return am;
2070 }
2071 };
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002072}
2073
2074class ActivityManagerProxy implements IActivityManager
2075{
2076 public ActivityManagerProxy(IBinder remote)
2077 {
2078 mRemote = remote;
2079 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002080
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002081 public IBinder asBinder()
2082 {
2083 return mRemote;
2084 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002085
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002086 public int startActivity(IApplicationThread caller, String callingPackage, Intent intent,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002087 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
2088 int startFlags, String profileFile,
2089 ParcelFileDescriptor profileFd, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002090 Parcel data = Parcel.obtain();
2091 Parcel reply = Parcel.obtain();
2092 data.writeInterfaceToken(IActivityManager.descriptor);
2093 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002094 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002095 intent.writeToParcel(data, 0);
2096 data.writeString(resolvedType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002097 data.writeStrongBinder(resultTo);
2098 data.writeString(resultWho);
2099 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002100 data.writeInt(startFlags);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002101 data.writeString(profileFile);
2102 if (profileFd != null) {
2103 data.writeInt(1);
2104 profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2105 } else {
2106 data.writeInt(0);
2107 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002108 if (options != null) {
2109 data.writeInt(1);
2110 options.writeToParcel(data, 0);
2111 } else {
2112 data.writeInt(0);
2113 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002114 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2115 reply.readException();
2116 int result = reply.readInt();
2117 reply.recycle();
2118 data.recycle();
2119 return result;
2120 }
Amith Yamasani82644082012-08-03 13:09:11 -07002121
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002122 public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent,
Amith Yamasani82644082012-08-03 13:09:11 -07002123 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
2124 int startFlags, String profileFile,
2125 ParcelFileDescriptor profileFd, Bundle options, int userId) throws RemoteException {
2126 Parcel data = Parcel.obtain();
2127 Parcel reply = Parcel.obtain();
2128 data.writeInterfaceToken(IActivityManager.descriptor);
2129 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002130 data.writeString(callingPackage);
Amith Yamasani82644082012-08-03 13:09:11 -07002131 intent.writeToParcel(data, 0);
2132 data.writeString(resolvedType);
2133 data.writeStrongBinder(resultTo);
2134 data.writeString(resultWho);
2135 data.writeInt(requestCode);
2136 data.writeInt(startFlags);
2137 data.writeString(profileFile);
2138 if (profileFd != null) {
2139 data.writeInt(1);
2140 profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2141 } else {
2142 data.writeInt(0);
2143 }
2144 if (options != null) {
2145 data.writeInt(1);
2146 options.writeToParcel(data, 0);
2147 } else {
2148 data.writeInt(0);
2149 }
2150 data.writeInt(userId);
2151 mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0);
2152 reply.readException();
2153 int result = reply.readInt();
2154 reply.recycle();
2155 data.recycle();
2156 return result;
2157 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002158 public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage,
2159 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002160 int requestCode, int startFlags, String profileFile,
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002161 ParcelFileDescriptor profileFd, Bundle options, int userId) throws RemoteException {
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002162 Parcel data = Parcel.obtain();
2163 Parcel reply = Parcel.obtain();
2164 data.writeInterfaceToken(IActivityManager.descriptor);
2165 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002166 data.writeString(callingPackage);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002167 intent.writeToParcel(data, 0);
2168 data.writeString(resolvedType);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002169 data.writeStrongBinder(resultTo);
2170 data.writeString(resultWho);
2171 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002172 data.writeInt(startFlags);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002173 data.writeString(profileFile);
2174 if (profileFd != null) {
2175 data.writeInt(1);
2176 profileFd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2177 } else {
2178 data.writeInt(0);
2179 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002180 if (options != null) {
2181 data.writeInt(1);
2182 options.writeToParcel(data, 0);
2183 } else {
2184 data.writeInt(0);
2185 }
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002186 data.writeInt(userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002187 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
2188 reply.readException();
2189 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
2190 reply.recycle();
2191 data.recycle();
2192 return result;
2193 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002194 public int startActivityWithConfig(IApplicationThread caller, String callingPackage,
2195 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002196 int requestCode, int startFlags, Configuration config,
Dianne Hackborn41203752012-08-31 14:05:51 -07002197 Bundle options, int userId) throws RemoteException {
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002198 Parcel data = Parcel.obtain();
2199 Parcel reply = Parcel.obtain();
2200 data.writeInterfaceToken(IActivityManager.descriptor);
2201 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002202 data.writeString(callingPackage);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002203 intent.writeToParcel(data, 0);
2204 data.writeString(resolvedType);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002205 data.writeStrongBinder(resultTo);
2206 data.writeString(resultWho);
2207 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002208 data.writeInt(startFlags);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002209 config.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002210 if (options != null) {
2211 data.writeInt(1);
2212 options.writeToParcel(data, 0);
2213 } else {
2214 data.writeInt(0);
2215 }
Dianne Hackborn41203752012-08-31 14:05:51 -07002216 data.writeInt(userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002217 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2218 reply.readException();
2219 int result = reply.readInt();
2220 reply.recycle();
2221 data.recycle();
2222 return result;
2223 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002224 public int startActivityIntentSender(IApplicationThread caller,
2225 IntentSender intent, Intent fillInIntent, String resolvedType,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002226 IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002227 int flagsMask, int flagsValues, Bundle options) throws RemoteException {
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002228 Parcel data = Parcel.obtain();
2229 Parcel reply = Parcel.obtain();
2230 data.writeInterfaceToken(IActivityManager.descriptor);
2231 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2232 intent.writeToParcel(data, 0);
2233 if (fillInIntent != null) {
2234 data.writeInt(1);
2235 fillInIntent.writeToParcel(data, 0);
2236 } else {
2237 data.writeInt(0);
2238 }
2239 data.writeString(resolvedType);
2240 data.writeStrongBinder(resultTo);
2241 data.writeString(resultWho);
2242 data.writeInt(requestCode);
2243 data.writeInt(flagsMask);
2244 data.writeInt(flagsValues);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002245 if (options != null) {
2246 data.writeInt(1);
2247 options.writeToParcel(data, 0);
2248 } else {
2249 data.writeInt(0);
2250 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002251 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002252 reply.readException();
2253 int result = reply.readInt();
2254 reply.recycle();
2255 data.recycle();
2256 return result;
2257 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002258 public boolean startNextMatchingActivity(IBinder callingActivity,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002259 Intent intent, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002260 Parcel data = Parcel.obtain();
2261 Parcel reply = Parcel.obtain();
2262 data.writeInterfaceToken(IActivityManager.descriptor);
2263 data.writeStrongBinder(callingActivity);
2264 intent.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002265 if (options != null) {
2266 data.writeInt(1);
2267 options.writeToParcel(data, 0);
2268 } else {
2269 data.writeInt(0);
2270 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002271 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
2272 reply.readException();
2273 int result = reply.readInt();
2274 reply.recycle();
2275 data.recycle();
2276 return result != 0;
2277 }
2278 public boolean finishActivity(IBinder token, int resultCode, Intent resultData)
2279 throws RemoteException {
2280 Parcel data = Parcel.obtain();
2281 Parcel reply = Parcel.obtain();
2282 data.writeInterfaceToken(IActivityManager.descriptor);
2283 data.writeStrongBinder(token);
2284 data.writeInt(resultCode);
2285 if (resultData != null) {
2286 data.writeInt(1);
2287 resultData.writeToParcel(data, 0);
2288 } else {
2289 data.writeInt(0);
2290 }
2291 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
2292 reply.readException();
2293 boolean res = reply.readInt() != 0;
2294 data.recycle();
2295 reply.recycle();
2296 return res;
2297 }
2298 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
2299 {
2300 Parcel data = Parcel.obtain();
2301 Parcel reply = Parcel.obtain();
2302 data.writeInterfaceToken(IActivityManager.descriptor);
2303 data.writeStrongBinder(token);
2304 data.writeString(resultWho);
2305 data.writeInt(requestCode);
2306 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
2307 reply.readException();
2308 data.recycle();
2309 reply.recycle();
2310 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -07002311 public boolean finishActivityAffinity(IBinder token) throws RemoteException {
2312 Parcel data = Parcel.obtain();
2313 Parcel reply = Parcel.obtain();
2314 data.writeInterfaceToken(IActivityManager.descriptor);
2315 data.writeStrongBinder(token);
2316 mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0);
2317 reply.readException();
2318 boolean res = reply.readInt() != 0;
2319 data.recycle();
2320 reply.recycle();
2321 return res;
2322 }
Dianne Hackborn061d58a2010-03-12 15:07:06 -08002323 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
2324 Parcel data = Parcel.obtain();
2325 Parcel reply = Parcel.obtain();
2326 data.writeInterfaceToken(IActivityManager.descriptor);
2327 data.writeStrongBinder(token);
2328 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
2329 reply.readException();
2330 boolean res = reply.readInt() != 0;
2331 data.recycle();
2332 reply.recycle();
2333 return res;
2334 }
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002335 public Intent registerReceiver(IApplicationThread caller, String packageName,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002336 IIntentReceiver receiver,
Dianne Hackborn20e80982012-08-31 19:00:44 -07002337 IntentFilter filter, String perm, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002338 {
2339 Parcel data = Parcel.obtain();
2340 Parcel reply = Parcel.obtain();
2341 data.writeInterfaceToken(IActivityManager.descriptor);
2342 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002343 data.writeString(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002344 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
2345 filter.writeToParcel(data, 0);
2346 data.writeString(perm);
Dianne Hackborn20e80982012-08-31 19:00:44 -07002347 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002348 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2349 reply.readException();
2350 Intent intent = null;
2351 int haveIntent = reply.readInt();
2352 if (haveIntent != 0) {
2353 intent = Intent.CREATOR.createFromParcel(reply);
2354 }
2355 reply.recycle();
2356 data.recycle();
2357 return intent;
2358 }
2359 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
2360 {
2361 Parcel data = Parcel.obtain();
2362 Parcel reply = Parcel.obtain();
2363 data.writeInterfaceToken(IActivityManager.descriptor);
2364 data.writeStrongBinder(receiver.asBinder());
2365 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2366 reply.readException();
2367 data.recycle();
2368 reply.recycle();
2369 }
2370 public int broadcastIntent(IApplicationThread caller,
2371 Intent intent, String resolvedType, IIntentReceiver resultTo,
2372 int resultCode, String resultData, Bundle map,
Dianne Hackbornf51f6122013-02-04 18:23:34 -08002373 String requiredPermission, int appOp, boolean serialized,
Amith Yamasani742a6712011-05-04 14:49:28 -07002374 boolean sticky, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002375 {
2376 Parcel data = Parcel.obtain();
2377 Parcel reply = Parcel.obtain();
2378 data.writeInterfaceToken(IActivityManager.descriptor);
2379 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2380 intent.writeToParcel(data, 0);
2381 data.writeString(resolvedType);
2382 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
2383 data.writeInt(resultCode);
2384 data.writeString(resultData);
2385 data.writeBundle(map);
2386 data.writeString(requiredPermission);
Dianne Hackbornf51f6122013-02-04 18:23:34 -08002387 data.writeInt(appOp);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002388 data.writeInt(serialized ? 1 : 0);
2389 data.writeInt(sticky ? 1 : 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07002390 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002391 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
2392 reply.readException();
2393 int res = reply.readInt();
2394 reply.recycle();
2395 data.recycle();
2396 return res;
2397 }
Amith Yamasani742a6712011-05-04 14:49:28 -07002398 public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
2399 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002400 {
2401 Parcel data = Parcel.obtain();
2402 Parcel reply = Parcel.obtain();
2403 data.writeInterfaceToken(IActivityManager.descriptor);
2404 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2405 intent.writeToParcel(data, 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07002406 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002407 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
2408 reply.readException();
2409 data.recycle();
2410 reply.recycle();
2411 }
2412 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, boolean abortBroadcast) throws RemoteException
2413 {
2414 Parcel data = Parcel.obtain();
2415 Parcel reply = Parcel.obtain();
2416 data.writeInterfaceToken(IActivityManager.descriptor);
2417 data.writeStrongBinder(who);
2418 data.writeInt(resultCode);
2419 data.writeString(resultData);
2420 data.writeBundle(map);
2421 data.writeInt(abortBroadcast ? 1 : 0);
2422 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2423 reply.readException();
2424 data.recycle();
2425 reply.recycle();
2426 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002427 public void attachApplication(IApplicationThread app) throws RemoteException
2428 {
2429 Parcel data = Parcel.obtain();
2430 Parcel reply = Parcel.obtain();
2431 data.writeInterfaceToken(IActivityManager.descriptor);
2432 data.writeStrongBinder(app.asBinder());
2433 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
2434 reply.readException();
2435 data.recycle();
2436 reply.recycle();
2437 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002438 public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
2439 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002440 {
2441 Parcel data = Parcel.obtain();
2442 Parcel reply = Parcel.obtain();
2443 data.writeInterfaceToken(IActivityManager.descriptor);
2444 data.writeStrongBinder(token);
Dianne Hackborne88846e2009-09-30 21:34:25 -07002445 if (config != null) {
2446 data.writeInt(1);
2447 config.writeToParcel(data, 0);
2448 } else {
2449 data.writeInt(0);
2450 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002451 data.writeInt(stopProfiling ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002452 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2453 reply.readException();
2454 data.recycle();
2455 reply.recycle();
2456 }
Dianne Hackbornad9b32112012-09-17 15:35:01 -07002457 public void activityResumed(IBinder token) throws RemoteException
2458 {
2459 Parcel data = Parcel.obtain();
2460 Parcel reply = Parcel.obtain();
2461 data.writeInterfaceToken(IActivityManager.descriptor);
2462 data.writeStrongBinder(token);
2463 mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0);
2464 reply.readException();
2465 data.recycle();
2466 reply.recycle();
2467 }
Dianne Hackborn0aae2d42010-12-07 23:51:29 -08002468 public void activityPaused(IBinder token) throws RemoteException
2469 {
2470 Parcel data = Parcel.obtain();
2471 Parcel reply = Parcel.obtain();
2472 data.writeInterfaceToken(IActivityManager.descriptor);
2473 data.writeStrongBinder(token);
2474 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
2475 reply.readException();
2476 data.recycle();
2477 reply.recycle();
2478 }
2479 public void activityStopped(IBinder token, Bundle state,
2480 Bitmap thumbnail, CharSequence description) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002481 {
2482 Parcel data = Parcel.obtain();
2483 Parcel reply = Parcel.obtain();
2484 data.writeInterfaceToken(IActivityManager.descriptor);
2485 data.writeStrongBinder(token);
2486 data.writeBundle(state);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002487 if (thumbnail != null) {
2488 data.writeInt(1);
2489 thumbnail.writeToParcel(data, 0);
2490 } else {
2491 data.writeInt(0);
2492 }
2493 TextUtils.writeToParcel(description, data, 0);
2494 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2495 reply.readException();
2496 data.recycle();
2497 reply.recycle();
2498 }
Dianne Hackborn4eba96b2011-01-21 13:34:36 -08002499 public void activitySlept(IBinder token) throws RemoteException
2500 {
2501 Parcel data = Parcel.obtain();
2502 Parcel reply = Parcel.obtain();
2503 data.writeInterfaceToken(IActivityManager.descriptor);
2504 data.writeStrongBinder(token);
2505 mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2506 reply.readException();
2507 data.recycle();
2508 reply.recycle();
2509 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002510 public void activityDestroyed(IBinder token) throws RemoteException
2511 {
2512 Parcel data = Parcel.obtain();
2513 Parcel reply = Parcel.obtain();
2514 data.writeInterfaceToken(IActivityManager.descriptor);
2515 data.writeStrongBinder(token);
2516 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2517 reply.readException();
2518 data.recycle();
2519 reply.recycle();
2520 }
2521 public String getCallingPackage(IBinder token) throws RemoteException
2522 {
2523 Parcel data = Parcel.obtain();
2524 Parcel reply = Parcel.obtain();
2525 data.writeInterfaceToken(IActivityManager.descriptor);
2526 data.writeStrongBinder(token);
2527 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
2528 reply.readException();
2529 String res = reply.readString();
2530 data.recycle();
2531 reply.recycle();
2532 return res;
2533 }
2534 public ComponentName getCallingActivity(IBinder token)
2535 throws RemoteException {
2536 Parcel data = Parcel.obtain();
2537 Parcel reply = Parcel.obtain();
2538 data.writeInterfaceToken(IActivityManager.descriptor);
2539 data.writeStrongBinder(token);
2540 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
2541 reply.readException();
2542 ComponentName res = ComponentName.readFromParcel(reply);
2543 data.recycle();
2544 reply.recycle();
2545 return res;
2546 }
2547 public List getTasks(int maxNum, int flags,
2548 IThumbnailReceiver receiver) throws RemoteException {
2549 Parcel data = Parcel.obtain();
2550 Parcel reply = Parcel.obtain();
2551 data.writeInterfaceToken(IActivityManager.descriptor);
2552 data.writeInt(maxNum);
2553 data.writeInt(flags);
2554 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
2555 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
2556 reply.readException();
2557 ArrayList list = null;
2558 int N = reply.readInt();
2559 if (N >= 0) {
2560 list = new ArrayList();
2561 while (N > 0) {
2562 ActivityManager.RunningTaskInfo info =
2563 ActivityManager.RunningTaskInfo.CREATOR
2564 .createFromParcel(reply);
2565 list.add(info);
2566 N--;
2567 }
2568 }
2569 data.recycle();
2570 reply.recycle();
2571 return list;
2572 }
2573 public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -07002574 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002575 Parcel data = Parcel.obtain();
2576 Parcel reply = Parcel.obtain();
2577 data.writeInterfaceToken(IActivityManager.descriptor);
2578 data.writeInt(maxNum);
2579 data.writeInt(flags);
Amith Yamasani82644082012-08-03 13:09:11 -07002580 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002581 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
2582 reply.readException();
2583 ArrayList<ActivityManager.RecentTaskInfo> list
2584 = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR);
2585 data.recycle();
2586 reply.recycle();
2587 return list;
2588 }
Dianne Hackbornf26fd992011-04-08 18:14:09 -07002589 public ActivityManager.TaskThumbnails getTaskThumbnails(int id) throws RemoteException {
Dianne Hackbornd94df452011-02-16 18:53:31 -08002590 Parcel data = Parcel.obtain();
2591 Parcel reply = Parcel.obtain();
2592 data.writeInterfaceToken(IActivityManager.descriptor);
2593 data.writeInt(id);
Dianne Hackbornf26fd992011-04-08 18:14:09 -07002594 mRemote.transact(GET_TASK_THUMBNAILS_TRANSACTION, data, reply, 0);
Dianne Hackbornd94df452011-02-16 18:53:31 -08002595 reply.readException();
Dianne Hackbornf26fd992011-04-08 18:14:09 -07002596 ActivityManager.TaskThumbnails bm = null;
Dianne Hackbornd94df452011-02-16 18:53:31 -08002597 if (reply.readInt() != 0) {
Dianne Hackbornf26fd992011-04-08 18:14:09 -07002598 bm = ActivityManager.TaskThumbnails.CREATOR.createFromParcel(reply);
Dianne Hackbornd94df452011-02-16 18:53:31 -08002599 }
2600 data.recycle();
2601 reply.recycle();
2602 return bm;
2603 }
Dianne Hackborn15491c62012-09-19 10:59:14 -07002604 public Bitmap getTaskTopThumbnail(int id) throws RemoteException {
2605 Parcel data = Parcel.obtain();
2606 Parcel reply = Parcel.obtain();
2607 data.writeInterfaceToken(IActivityManager.descriptor);
2608 data.writeInt(id);
2609 mRemote.transact(GET_TASK_TOP_THUMBNAIL_TRANSACTION, data, reply, 0);
2610 reply.readException();
2611 Bitmap bm = null;
2612 if (reply.readInt() != 0) {
2613 bm = Bitmap.CREATOR.createFromParcel(reply);
2614 }
2615 data.recycle();
2616 reply.recycle();
2617 return bm;
2618 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002619 public List getServices(int maxNum, int flags) throws RemoteException {
2620 Parcel data = Parcel.obtain();
2621 Parcel reply = Parcel.obtain();
2622 data.writeInterfaceToken(IActivityManager.descriptor);
2623 data.writeInt(maxNum);
2624 data.writeInt(flags);
2625 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
2626 reply.readException();
2627 ArrayList list = null;
2628 int N = reply.readInt();
2629 if (N >= 0) {
2630 list = new ArrayList();
2631 while (N > 0) {
2632 ActivityManager.RunningServiceInfo info =
2633 ActivityManager.RunningServiceInfo.CREATOR
2634 .createFromParcel(reply);
2635 list.add(info);
2636 N--;
2637 }
2638 }
2639 data.recycle();
2640 reply.recycle();
2641 return list;
2642 }
2643 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
2644 throws RemoteException {
2645 Parcel data = Parcel.obtain();
2646 Parcel reply = Parcel.obtain();
2647 data.writeInterfaceToken(IActivityManager.descriptor);
2648 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
2649 reply.readException();
2650 ArrayList<ActivityManager.ProcessErrorStateInfo> list
2651 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
2652 data.recycle();
2653 reply.recycle();
2654 return list;
2655 }
2656 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
2657 throws RemoteException {
2658 Parcel data = Parcel.obtain();
2659 Parcel reply = Parcel.obtain();
2660 data.writeInterfaceToken(IActivityManager.descriptor);
2661 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
2662 reply.readException();
2663 ArrayList<ActivityManager.RunningAppProcessInfo> list
2664 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
2665 data.recycle();
2666 reply.recycle();
2667 return list;
2668 }
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -07002669 public List<ApplicationInfo> getRunningExternalApplications()
2670 throws RemoteException {
2671 Parcel data = Parcel.obtain();
2672 Parcel reply = Parcel.obtain();
2673 data.writeInterfaceToken(IActivityManager.descriptor);
2674 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
2675 reply.readException();
2676 ArrayList<ApplicationInfo> list
2677 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
2678 data.recycle();
2679 reply.recycle();
2680 return list;
2681 }
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07002682 public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002683 {
2684 Parcel data = Parcel.obtain();
2685 Parcel reply = Parcel.obtain();
2686 data.writeInterfaceToken(IActivityManager.descriptor);
2687 data.writeInt(task);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08002688 data.writeInt(flags);
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07002689 if (options != null) {
2690 data.writeInt(1);
2691 options.writeToParcel(data, 0);
2692 } else {
2693 data.writeInt(0);
2694 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002695 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
2696 reply.readException();
2697 data.recycle();
2698 reply.recycle();
2699 }
2700 public void moveTaskToBack(int task) throws RemoteException
2701 {
2702 Parcel data = Parcel.obtain();
2703 Parcel reply = Parcel.obtain();
2704 data.writeInterfaceToken(IActivityManager.descriptor);
2705 data.writeInt(task);
2706 mRemote.transact(MOVE_TASK_TO_BACK_TRANSACTION, data, reply, 0);
2707 reply.readException();
2708 data.recycle();
2709 reply.recycle();
2710 }
2711 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
2712 throws RemoteException {
2713 Parcel data = Parcel.obtain();
2714 Parcel reply = Parcel.obtain();
2715 data.writeInterfaceToken(IActivityManager.descriptor);
2716 data.writeStrongBinder(token);
2717 data.writeInt(nonRoot ? 1 : 0);
2718 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
2719 reply.readException();
2720 boolean res = reply.readInt() != 0;
2721 data.recycle();
2722 reply.recycle();
2723 return res;
2724 }
2725 public void moveTaskBackwards(int task) throws RemoteException
2726 {
2727 Parcel data = Parcel.obtain();
2728 Parcel reply = Parcel.obtain();
2729 data.writeInterfaceToken(IActivityManager.descriptor);
2730 data.writeInt(task);
2731 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
2732 reply.readException();
2733 data.recycle();
2734 reply.recycle();
2735 }
Craig Mautnerc00204b2013-03-05 15:02:14 -08002736 @Override
Craig Mautnerc00204b2013-03-05 15:02:14 -08002737 public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException
2738 {
2739 Parcel data = Parcel.obtain();
2740 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07002741 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerc00204b2013-03-05 15:02:14 -08002742 data.writeInt(taskId);
2743 data.writeInt(stackId);
2744 data.writeInt(toTop ? 1 : 0);
2745 mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0);
2746 reply.readException();
2747 data.recycle();
2748 reply.recycle();
2749 }
2750 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002751 public void resizeStack(int stackBoxId, Rect r) throws RemoteException
Craig Mautnerc00204b2013-03-05 15:02:14 -08002752 {
2753 Parcel data = Parcel.obtain();
2754 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07002755 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautner5a449152013-05-24 15:49:29 -07002756 data.writeInt(stackBoxId);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002757 r.writeToParcel(data, 0);
Craig Mautnercf910b02013-04-23 11:23:27 -07002758 mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
Craig Mautnerc00204b2013-03-05 15:02:14 -08002759 reply.readException();
2760 data.recycle();
2761 reply.recycle();
2762 }
Craig Mautner967212c2013-04-13 21:10:58 -07002763 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002764 public List<StackInfo> getAllStackInfos() throws RemoteException
Craig Mautner5ff12102013-05-24 12:50:15 -07002765 {
2766 Parcel data = Parcel.obtain();
2767 Parcel reply = Parcel.obtain();
2768 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002769 mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0);
Craig Mautner5ff12102013-05-24 12:50:15 -07002770 reply.readException();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002771 ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR);
Craig Mautner967212c2013-04-13 21:10:58 -07002772 data.recycle();
2773 reply.recycle();
2774 return list;
2775 }
Craig Mautnercf910b02013-04-23 11:23:27 -07002776 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002777 public StackInfo getStackInfo(int stackId) throws RemoteException
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07002778 {
2779 Parcel data = Parcel.obtain();
2780 Parcel reply = Parcel.obtain();
2781 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002782 data.writeInt(stackId);
2783 mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07002784 reply.readException();
2785 int res = reply.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002786 StackInfo info = null;
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07002787 if (res != 0) {
Craig Mautnerbdc748af2013-12-02 14:08:25 -08002788 info = StackInfo.CREATOR.createFromParcel(reply);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07002789 }
2790 data.recycle();
2791 reply.recycle();
2792 return info;
2793 }
2794 @Override
Craig Mautnercf910b02013-04-23 11:23:27 -07002795 public void setFocusedStack(int stackId) throws RemoteException
2796 {
2797 Parcel data = Parcel.obtain();
2798 Parcel reply = Parcel.obtain();
2799 data.writeInterfaceToken(IActivityManager.descriptor);
2800 data.writeInt(stackId);
2801 mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2802 reply.readException();
2803 data.recycle();
2804 reply.recycle();
2805 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002806 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
2807 {
2808 Parcel data = Parcel.obtain();
2809 Parcel reply = Parcel.obtain();
2810 data.writeInterfaceToken(IActivityManager.descriptor);
2811 data.writeStrongBinder(token);
2812 data.writeInt(onlyRoot ? 1 : 0);
2813 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
2814 reply.readException();
2815 int res = reply.readInt();
2816 data.recycle();
2817 reply.recycle();
2818 return res;
2819 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002820 public void reportThumbnail(IBinder token,
2821 Bitmap thumbnail, CharSequence description) throws RemoteException
2822 {
2823 Parcel data = Parcel.obtain();
2824 Parcel reply = Parcel.obtain();
2825 data.writeInterfaceToken(IActivityManager.descriptor);
2826 data.writeStrongBinder(token);
2827 if (thumbnail != null) {
2828 data.writeInt(1);
2829 thumbnail.writeToParcel(data, 0);
2830 } else {
2831 data.writeInt(0);
2832 }
2833 TextUtils.writeToParcel(description, data, 0);
2834 mRemote.transact(REPORT_THUMBNAIL_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2835 reply.readException();
2836 data.recycle();
2837 reply.recycle();
2838 }
2839 public ContentProviderHolder getContentProvider(IApplicationThread caller,
Jeff Sharkey6d515712012-09-20 16:06:08 -07002840 String name, int userId, boolean stable) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002841 Parcel data = Parcel.obtain();
2842 Parcel reply = Parcel.obtain();
2843 data.writeInterfaceToken(IActivityManager.descriptor);
2844 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2845 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07002846 data.writeInt(userId);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002847 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002848 mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
2849 reply.readException();
2850 int res = reply.readInt();
2851 ContentProviderHolder cph = null;
2852 if (res != 0) {
2853 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
2854 }
2855 data.recycle();
2856 reply.recycle();
2857 return cph;
2858 }
Jeff Sharkey6d515712012-09-20 16:06:08 -07002859 public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token)
2860 throws RemoteException {
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08002861 Parcel data = Parcel.obtain();
2862 Parcel reply = Parcel.obtain();
2863 data.writeInterfaceToken(IActivityManager.descriptor);
2864 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07002865 data.writeInt(userId);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08002866 data.writeStrongBinder(token);
2867 mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
2868 reply.readException();
2869 int res = reply.readInt();
2870 ContentProviderHolder cph = null;
2871 if (res != 0) {
2872 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
2873 }
2874 data.recycle();
2875 reply.recycle();
2876 return cph;
2877 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002878 public void publishContentProviders(IApplicationThread caller,
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002879 List<ContentProviderHolder> providers) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002880 {
2881 Parcel data = Parcel.obtain();
2882 Parcel reply = Parcel.obtain();
2883 data.writeInterfaceToken(IActivityManager.descriptor);
2884 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2885 data.writeTypedList(providers);
2886 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
2887 reply.readException();
2888 data.recycle();
2889 reply.recycle();
2890 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002891 public boolean refContentProvider(IBinder connection, int stable, int unstable)
2892 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002893 Parcel data = Parcel.obtain();
2894 Parcel reply = Parcel.obtain();
2895 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002896 data.writeStrongBinder(connection);
2897 data.writeInt(stable);
2898 data.writeInt(unstable);
2899 mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
2900 reply.readException();
2901 boolean res = reply.readInt() != 0;
2902 data.recycle();
2903 reply.recycle();
2904 return res;
2905 }
Jeff Sharkey7aa76012013-09-30 14:26:27 -07002906
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002907 public void unstableProviderDied(IBinder connection) throws RemoteException {
2908 Parcel data = Parcel.obtain();
2909 Parcel reply = Parcel.obtain();
2910 data.writeInterfaceToken(IActivityManager.descriptor);
2911 data.writeStrongBinder(connection);
2912 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0);
2913 reply.readException();
2914 data.recycle();
2915 reply.recycle();
2916 }
2917
Jeff Sharkey7aa76012013-09-30 14:26:27 -07002918 @Override
2919 public void appNotRespondingViaProvider(IBinder connection) throws RemoteException {
2920 Parcel data = Parcel.obtain();
2921 Parcel reply = Parcel.obtain();
2922 data.writeInterfaceToken(IActivityManager.descriptor);
2923 data.writeStrongBinder(connection);
2924 mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0);
2925 reply.readException();
2926 data.recycle();
2927 reply.recycle();
2928 }
2929
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07002930 public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException {
2931 Parcel data = Parcel.obtain();
2932 Parcel reply = Parcel.obtain();
2933 data.writeInterfaceToken(IActivityManager.descriptor);
2934 data.writeStrongBinder(connection);
2935 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002936 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
2937 reply.readException();
2938 data.recycle();
2939 reply.recycle();
2940 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08002941
2942 public void removeContentProviderExternal(String name, IBinder token) throws RemoteException {
2943 Parcel data = Parcel.obtain();
2944 Parcel reply = Parcel.obtain();
2945 data.writeInterfaceToken(IActivityManager.descriptor);
2946 data.writeString(name);
2947 data.writeStrongBinder(token);
2948 mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
2949 reply.readException();
2950 data.recycle();
2951 reply.recycle();
2952 }
2953
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07002954 public PendingIntent getRunningServiceControlPanel(ComponentName service)
2955 throws RemoteException
2956 {
2957 Parcel data = Parcel.obtain();
2958 Parcel reply = Parcel.obtain();
2959 data.writeInterfaceToken(IActivityManager.descriptor);
2960 service.writeToParcel(data, 0);
2961 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
2962 reply.readException();
2963 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
2964 data.recycle();
2965 reply.recycle();
2966 return res;
2967 }
2968
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002969 public ComponentName startService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07002970 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002971 {
2972 Parcel data = Parcel.obtain();
2973 Parcel reply = Parcel.obtain();
2974 data.writeInterfaceToken(IActivityManager.descriptor);
2975 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2976 service.writeToParcel(data, 0);
2977 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07002978 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002979 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
2980 reply.readException();
2981 ComponentName res = ComponentName.readFromParcel(reply);
2982 data.recycle();
2983 reply.recycle();
2984 return res;
2985 }
2986 public int stopService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07002987 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002988 {
2989 Parcel data = Parcel.obtain();
2990 Parcel reply = Parcel.obtain();
2991 data.writeInterfaceToken(IActivityManager.descriptor);
2992 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2993 service.writeToParcel(data, 0);
2994 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07002995 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002996 mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0);
2997 reply.readException();
2998 int res = reply.readInt();
2999 reply.recycle();
3000 data.recycle();
3001 return res;
3002 }
3003 public boolean stopServiceToken(ComponentName className, IBinder token,
3004 int startId) throws RemoteException {
3005 Parcel data = Parcel.obtain();
3006 Parcel reply = Parcel.obtain();
3007 data.writeInterfaceToken(IActivityManager.descriptor);
3008 ComponentName.writeToParcel(className, data);
3009 data.writeStrongBinder(token);
3010 data.writeInt(startId);
3011 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
3012 reply.readException();
3013 boolean res = reply.readInt() != 0;
3014 data.recycle();
3015 reply.recycle();
3016 return res;
3017 }
3018 public void setServiceForeground(ComponentName className, IBinder token,
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003019 int id, Notification notification, boolean removeNotification) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003020 Parcel data = Parcel.obtain();
3021 Parcel reply = Parcel.obtain();
3022 data.writeInterfaceToken(IActivityManager.descriptor);
3023 ComponentName.writeToParcel(className, data);
3024 data.writeStrongBinder(token);
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003025 data.writeInt(id);
3026 if (notification != null) {
3027 data.writeInt(1);
3028 notification.writeToParcel(data, 0);
3029 } else {
3030 data.writeInt(0);
3031 }
3032 data.writeInt(removeNotification ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003033 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
3034 reply.readException();
3035 data.recycle();
3036 reply.recycle();
3037 }
3038 public int bindService(IApplicationThread caller, IBinder token,
3039 Intent service, String resolvedType, IServiceConnection connection,
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003040 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003041 Parcel data = Parcel.obtain();
3042 Parcel reply = Parcel.obtain();
3043 data.writeInterfaceToken(IActivityManager.descriptor);
3044 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3045 data.writeStrongBinder(token);
3046 service.writeToParcel(data, 0);
3047 data.writeString(resolvedType);
3048 data.writeStrongBinder(connection.asBinder());
3049 data.writeInt(flags);
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003050 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003051 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
3052 reply.readException();
3053 int res = reply.readInt();
3054 data.recycle();
3055 reply.recycle();
3056 return res;
3057 }
3058 public boolean unbindService(IServiceConnection connection) throws RemoteException
3059 {
3060 Parcel data = Parcel.obtain();
3061 Parcel reply = Parcel.obtain();
3062 data.writeInterfaceToken(IActivityManager.descriptor);
3063 data.writeStrongBinder(connection.asBinder());
3064 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
3065 reply.readException();
3066 boolean res = reply.readInt() != 0;
3067 data.recycle();
3068 reply.recycle();
3069 return res;
3070 }
3071
3072 public void publishService(IBinder token,
3073 Intent intent, IBinder service) throws RemoteException {
3074 Parcel data = Parcel.obtain();
3075 Parcel reply = Parcel.obtain();
3076 data.writeInterfaceToken(IActivityManager.descriptor);
3077 data.writeStrongBinder(token);
3078 intent.writeToParcel(data, 0);
3079 data.writeStrongBinder(service);
3080 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
3081 reply.readException();
3082 data.recycle();
3083 reply.recycle();
3084 }
3085
3086 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
3087 throws RemoteException {
3088 Parcel data = Parcel.obtain();
3089 Parcel reply = Parcel.obtain();
3090 data.writeInterfaceToken(IActivityManager.descriptor);
3091 data.writeStrongBinder(token);
3092 intent.writeToParcel(data, 0);
3093 data.writeInt(doRebind ? 1 : 0);
3094 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
3095 reply.readException();
3096 data.recycle();
3097 reply.recycle();
3098 }
3099
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003100 public void serviceDoneExecuting(IBinder token, int type, int startId,
3101 int res) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003102 Parcel data = Parcel.obtain();
3103 Parcel reply = Parcel.obtain();
3104 data.writeInterfaceToken(IActivityManager.descriptor);
3105 data.writeStrongBinder(token);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003106 data.writeInt(type);
3107 data.writeInt(startId);
3108 data.writeInt(res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003109 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3110 reply.readException();
3111 data.recycle();
3112 reply.recycle();
3113 }
3114
3115 public IBinder peekService(Intent service, String resolvedType) throws RemoteException {
3116 Parcel data = Parcel.obtain();
3117 Parcel reply = Parcel.obtain();
3118 data.writeInterfaceToken(IActivityManager.descriptor);
3119 service.writeToParcel(data, 0);
3120 data.writeString(resolvedType);
3121 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
3122 reply.readException();
3123 IBinder binder = reply.readStrongBinder();
3124 reply.recycle();
3125 data.recycle();
3126 return binder;
3127 }
3128
Christopher Tate181fafa2009-05-14 11:12:14 -07003129 public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
3130 throws RemoteException {
3131 Parcel data = Parcel.obtain();
3132 Parcel reply = Parcel.obtain();
3133 data.writeInterfaceToken(IActivityManager.descriptor);
3134 app.writeToParcel(data, 0);
3135 data.writeInt(backupRestoreMode);
3136 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3137 reply.readException();
3138 boolean success = reply.readInt() != 0;
3139 reply.recycle();
3140 data.recycle();
3141 return success;
3142 }
3143
Christopher Tate346acb12012-10-15 19:20:25 -07003144 public void clearPendingBackup() throws RemoteException {
3145 Parcel data = Parcel.obtain();
3146 Parcel reply = Parcel.obtain();
3147 data.writeInterfaceToken(IActivityManager.descriptor);
3148 mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0);
3149 reply.recycle();
3150 data.recycle();
3151 }
3152
Christopher Tate181fafa2009-05-14 11:12:14 -07003153 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
3154 Parcel data = Parcel.obtain();
3155 Parcel reply = Parcel.obtain();
3156 data.writeInterfaceToken(IActivityManager.descriptor);
3157 data.writeString(packageName);
3158 data.writeStrongBinder(agent);
3159 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
3160 reply.recycle();
3161 data.recycle();
3162 }
3163
3164 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
3165 Parcel data = Parcel.obtain();
3166 Parcel reply = Parcel.obtain();
3167 data.writeInterfaceToken(IActivityManager.descriptor);
3168 app.writeToParcel(data, 0);
3169 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3170 reply.readException();
3171 reply.recycle();
3172 data.recycle();
3173 }
3174
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003175 public boolean startInstrumentation(ComponentName className, String profileFile,
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003176 int flags, Bundle arguments, IInstrumentationWatcher watcher,
3177 IUiAutomationConnection connection, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003178 Parcel data = Parcel.obtain();
3179 Parcel reply = Parcel.obtain();
3180 data.writeInterfaceToken(IActivityManager.descriptor);
3181 ComponentName.writeToParcel(className, data);
3182 data.writeString(profileFile);
3183 data.writeInt(flags);
3184 data.writeBundle(arguments);
3185 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003186 data.writeStrongBinder(connection != null ? connection.asBinder() : null);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07003187 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003188 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3189 reply.readException();
3190 boolean res = reply.readInt() != 0;
3191 reply.recycle();
3192 data.recycle();
3193 return res;
3194 }
3195
3196 public void finishInstrumentation(IApplicationThread target,
3197 int resultCode, Bundle results) throws RemoteException {
3198 Parcel data = Parcel.obtain();
3199 Parcel reply = Parcel.obtain();
3200 data.writeInterfaceToken(IActivityManager.descriptor);
3201 data.writeStrongBinder(target != null ? target.asBinder() : null);
3202 data.writeInt(resultCode);
3203 data.writeBundle(results);
3204 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3205 reply.readException();
3206 data.recycle();
3207 reply.recycle();
3208 }
3209 public Configuration getConfiguration() throws RemoteException
3210 {
3211 Parcel data = Parcel.obtain();
3212 Parcel reply = Parcel.obtain();
3213 data.writeInterfaceToken(IActivityManager.descriptor);
3214 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
3215 reply.readException();
3216 Configuration res = Configuration.CREATOR.createFromParcel(reply);
3217 reply.recycle();
3218 data.recycle();
3219 return res;
3220 }
3221 public void updateConfiguration(Configuration values) throws RemoteException
3222 {
3223 Parcel data = Parcel.obtain();
3224 Parcel reply = Parcel.obtain();
3225 data.writeInterfaceToken(IActivityManager.descriptor);
3226 values.writeToParcel(data, 0);
3227 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
3228 reply.readException();
3229 data.recycle();
3230 reply.recycle();
3231 }
3232 public void setRequestedOrientation(IBinder token, int requestedOrientation)
3233 throws RemoteException {
3234 Parcel data = Parcel.obtain();
3235 Parcel reply = Parcel.obtain();
3236 data.writeInterfaceToken(IActivityManager.descriptor);
3237 data.writeStrongBinder(token);
3238 data.writeInt(requestedOrientation);
3239 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3240 reply.readException();
3241 data.recycle();
3242 reply.recycle();
3243 }
3244 public int getRequestedOrientation(IBinder token) throws RemoteException {
3245 Parcel data = Parcel.obtain();
3246 Parcel reply = Parcel.obtain();
3247 data.writeInterfaceToken(IActivityManager.descriptor);
3248 data.writeStrongBinder(token);
3249 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3250 reply.readException();
3251 int res = reply.readInt();
3252 data.recycle();
3253 reply.recycle();
3254 return res;
3255 }
3256 public ComponentName getActivityClassForToken(IBinder token)
3257 throws RemoteException {
3258 Parcel data = Parcel.obtain();
3259 Parcel reply = Parcel.obtain();
3260 data.writeInterfaceToken(IActivityManager.descriptor);
3261 data.writeStrongBinder(token);
3262 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
3263 reply.readException();
3264 ComponentName res = ComponentName.readFromParcel(reply);
3265 data.recycle();
3266 reply.recycle();
3267 return res;
3268 }
3269 public String getPackageForToken(IBinder token) throws RemoteException
3270 {
3271 Parcel data = Parcel.obtain();
3272 Parcel reply = Parcel.obtain();
3273 data.writeInterfaceToken(IActivityManager.descriptor);
3274 data.writeStrongBinder(token);
3275 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
3276 reply.readException();
3277 String res = reply.readString();
3278 data.recycle();
3279 reply.recycle();
3280 return res;
3281 }
3282 public IIntentSender getIntentSender(int type,
3283 String packageName, IBinder token, String resultWho,
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003284 int requestCode, Intent[] intents, String[] resolvedTypes, int flags,
Dianne Hackborn41203752012-08-31 14:05:51 -07003285 Bundle options, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003286 Parcel data = Parcel.obtain();
3287 Parcel reply = Parcel.obtain();
3288 data.writeInterfaceToken(IActivityManager.descriptor);
3289 data.writeInt(type);
3290 data.writeString(packageName);
3291 data.writeStrongBinder(token);
3292 data.writeString(resultWho);
3293 data.writeInt(requestCode);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003294 if (intents != null) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003295 data.writeInt(1);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003296 data.writeTypedArray(intents, 0);
3297 data.writeStringArray(resolvedTypes);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003298 } else {
3299 data.writeInt(0);
3300 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003301 data.writeInt(flags);
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003302 if (options != null) {
3303 data.writeInt(1);
3304 options.writeToParcel(data, 0);
3305 } else {
3306 data.writeInt(0);
3307 }
Dianne Hackborn41203752012-08-31 14:05:51 -07003308 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003309 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
3310 reply.readException();
3311 IIntentSender res = IIntentSender.Stub.asInterface(
3312 reply.readStrongBinder());
3313 data.recycle();
3314 reply.recycle();
3315 return res;
3316 }
3317 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
3318 Parcel data = Parcel.obtain();
3319 Parcel reply = Parcel.obtain();
3320 data.writeInterfaceToken(IActivityManager.descriptor);
3321 data.writeStrongBinder(sender.asBinder());
3322 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
3323 reply.readException();
3324 data.recycle();
3325 reply.recycle();
3326 }
3327 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
3328 Parcel data = Parcel.obtain();
3329 Parcel reply = Parcel.obtain();
3330 data.writeInterfaceToken(IActivityManager.descriptor);
3331 data.writeStrongBinder(sender.asBinder());
3332 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
3333 reply.readException();
3334 String res = reply.readString();
3335 data.recycle();
3336 reply.recycle();
3337 return res;
3338 }
Christopher Tatec4a07d12012-04-06 14:19:13 -07003339 public int getUidForIntentSender(IIntentSender sender) throws RemoteException {
3340 Parcel data = Parcel.obtain();
3341 Parcel reply = Parcel.obtain();
3342 data.writeInterfaceToken(IActivityManager.descriptor);
3343 data.writeStrongBinder(sender.asBinder());
3344 mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
3345 reply.readException();
3346 int res = reply.readInt();
3347 data.recycle();
3348 reply.recycle();
3349 return res;
3350 }
Dianne Hackborn41203752012-08-31 14:05:51 -07003351 public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
3352 boolean requireFull, String name, String callerPackage) throws RemoteException {
3353 Parcel data = Parcel.obtain();
3354 Parcel reply = Parcel.obtain();
3355 data.writeInterfaceToken(IActivityManager.descriptor);
3356 data.writeInt(callingPid);
3357 data.writeInt(callingUid);
3358 data.writeInt(userId);
3359 data.writeInt(allowAll ? 1 : 0);
3360 data.writeInt(requireFull ? 1 : 0);
3361 data.writeString(name);
3362 data.writeString(callerPackage);
3363 mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0);
3364 reply.readException();
3365 int res = reply.readInt();
3366 data.recycle();
3367 reply.recycle();
3368 return res;
3369 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003370 public void setProcessLimit(int max) throws RemoteException
3371 {
3372 Parcel data = Parcel.obtain();
3373 Parcel reply = Parcel.obtain();
3374 data.writeInterfaceToken(IActivityManager.descriptor);
3375 data.writeInt(max);
3376 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
3377 reply.readException();
3378 data.recycle();
3379 reply.recycle();
3380 }
3381 public int getProcessLimit() throws RemoteException
3382 {
3383 Parcel data = Parcel.obtain();
3384 Parcel reply = Parcel.obtain();
3385 data.writeInterfaceToken(IActivityManager.descriptor);
3386 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
3387 reply.readException();
3388 int res = reply.readInt();
3389 data.recycle();
3390 reply.recycle();
3391 return res;
3392 }
3393 public void setProcessForeground(IBinder token, int pid,
3394 boolean isForeground) throws RemoteException {
3395 Parcel data = Parcel.obtain();
3396 Parcel reply = Parcel.obtain();
3397 data.writeInterfaceToken(IActivityManager.descriptor);
3398 data.writeStrongBinder(token);
3399 data.writeInt(pid);
3400 data.writeInt(isForeground ? 1 : 0);
3401 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
3402 reply.readException();
3403 data.recycle();
3404 reply.recycle();
3405 }
3406 public int checkPermission(String permission, int pid, int uid)
3407 throws RemoteException {
3408 Parcel data = Parcel.obtain();
3409 Parcel reply = Parcel.obtain();
3410 data.writeInterfaceToken(IActivityManager.descriptor);
3411 data.writeString(permission);
3412 data.writeInt(pid);
3413 data.writeInt(uid);
3414 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
3415 reply.readException();
3416 int res = reply.readInt();
3417 data.recycle();
3418 reply.recycle();
3419 return res;
3420 }
3421 public boolean clearApplicationUserData(final String packageName,
Amith Yamasani742a6712011-05-04 14:49:28 -07003422 final IPackageDataObserver observer, final int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003423 Parcel data = Parcel.obtain();
3424 Parcel reply = Parcel.obtain();
3425 data.writeInterfaceToken(IActivityManager.descriptor);
3426 data.writeString(packageName);
Christopher Tate31b65f92013-09-09 14:17:27 -07003427 data.writeStrongBinder((observer != null) ? observer.asBinder() : null);
Amith Yamasani742a6712011-05-04 14:49:28 -07003428 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003429 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
3430 reply.readException();
3431 boolean res = reply.readInt() != 0;
3432 data.recycle();
3433 reply.recycle();
3434 return res;
3435 }
3436 public int checkUriPermission(Uri uri, int pid, int uid, int mode)
3437 throws RemoteException {
3438 Parcel data = Parcel.obtain();
3439 Parcel reply = Parcel.obtain();
3440 data.writeInterfaceToken(IActivityManager.descriptor);
3441 uri.writeToParcel(data, 0);
3442 data.writeInt(pid);
3443 data.writeInt(uid);
3444 data.writeInt(mode);
3445 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
3446 reply.readException();
3447 int res = reply.readInt();
3448 data.recycle();
3449 reply.recycle();
3450 return res;
3451 }
3452 public void grantUriPermission(IApplicationThread caller, String targetPkg,
3453 Uri uri, int mode) throws RemoteException {
3454 Parcel data = Parcel.obtain();
3455 Parcel reply = Parcel.obtain();
3456 data.writeInterfaceToken(IActivityManager.descriptor);
3457 data.writeStrongBinder(caller.asBinder());
3458 data.writeString(targetPkg);
3459 uri.writeToParcel(data, 0);
3460 data.writeInt(mode);
3461 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
3462 reply.readException();
3463 data.recycle();
3464 reply.recycle();
3465 }
3466 public void revokeUriPermission(IApplicationThread caller, Uri uri,
3467 int mode) throws RemoteException {
3468 Parcel data = Parcel.obtain();
3469 Parcel reply = Parcel.obtain();
3470 data.writeInterfaceToken(IActivityManager.descriptor);
3471 data.writeStrongBinder(caller.asBinder());
3472 uri.writeToParcel(data, 0);
3473 data.writeInt(mode);
3474 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
3475 reply.readException();
3476 data.recycle();
3477 reply.recycle();
3478 }
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003479
3480 @Override
3481 public void takePersistableUriPermission(Uri uri, int mode) throws RemoteException {
3482 Parcel data = Parcel.obtain();
3483 Parcel reply = Parcel.obtain();
3484 data.writeInterfaceToken(IActivityManager.descriptor);
3485 uri.writeToParcel(data, 0);
3486 data.writeInt(mode);
3487 mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
3488 reply.readException();
3489 data.recycle();
3490 reply.recycle();
3491 }
3492
3493 @Override
3494 public void releasePersistableUriPermission(Uri uri, int mode) throws RemoteException {
3495 Parcel data = Parcel.obtain();
3496 Parcel reply = Parcel.obtain();
3497 data.writeInterfaceToken(IActivityManager.descriptor);
3498 uri.writeToParcel(data, 0);
3499 data.writeInt(mode);
3500 mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
3501 reply.readException();
3502 data.recycle();
3503 reply.recycle();
3504 }
3505
3506 @Override
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07003507 public ParceledListSlice<UriPermission> getPersistedUriPermissions(
3508 String packageName, boolean incoming) throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003509 Parcel data = Parcel.obtain();
3510 Parcel reply = Parcel.obtain();
3511 data.writeInterfaceToken(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07003512 data.writeString(packageName);
3513 data.writeInt(incoming ? 1 : 0);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003514 mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
3515 reply.readException();
3516 final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel(
3517 reply);
3518 data.recycle();
3519 reply.recycle();
3520 return perms;
3521 }
3522
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003523 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
3524 throws RemoteException {
3525 Parcel data = Parcel.obtain();
3526 Parcel reply = Parcel.obtain();
3527 data.writeInterfaceToken(IActivityManager.descriptor);
3528 data.writeStrongBinder(who.asBinder());
3529 data.writeInt(waiting ? 1 : 0);
3530 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
3531 reply.readException();
3532 data.recycle();
3533 reply.recycle();
3534 }
3535 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
3536 Parcel data = Parcel.obtain();
3537 Parcel reply = Parcel.obtain();
3538 data.writeInterfaceToken(IActivityManager.descriptor);
3539 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
3540 reply.readException();
3541 outInfo.readFromParcel(reply);
3542 data.recycle();
3543 reply.recycle();
3544 }
3545 public void unhandledBack() throws RemoteException
3546 {
3547 Parcel data = Parcel.obtain();
3548 Parcel reply = Parcel.obtain();
3549 data.writeInterfaceToken(IActivityManager.descriptor);
3550 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
3551 reply.readException();
3552 data.recycle();
3553 reply.recycle();
3554 }
3555 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
3556 {
3557 Parcel data = Parcel.obtain();
3558 Parcel reply = Parcel.obtain();
3559 data.writeInterfaceToken(IActivityManager.descriptor);
3560 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
3561 reply.readException();
3562 ParcelFileDescriptor pfd = null;
3563 if (reply.readInt() != 0) {
3564 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
3565 }
3566 data.recycle();
3567 reply.recycle();
3568 return pfd;
3569 }
3570 public void goingToSleep() throws RemoteException
3571 {
3572 Parcel data = Parcel.obtain();
3573 Parcel reply = Parcel.obtain();
3574 data.writeInterfaceToken(IActivityManager.descriptor);
3575 mRemote.transact(GOING_TO_SLEEP_TRANSACTION, data, reply, 0);
3576 reply.readException();
3577 data.recycle();
3578 reply.recycle();
3579 }
3580 public void wakingUp() throws RemoteException
3581 {
3582 Parcel data = Parcel.obtain();
3583 Parcel reply = Parcel.obtain();
3584 data.writeInterfaceToken(IActivityManager.descriptor);
3585 mRemote.transact(WAKING_UP_TRANSACTION, data, reply, 0);
3586 reply.readException();
3587 data.recycle();
3588 reply.recycle();
3589 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07003590 public void setLockScreenShown(boolean shown) throws RemoteException
3591 {
3592 Parcel data = Parcel.obtain();
3593 Parcel reply = Parcel.obtain();
3594 data.writeInterfaceToken(IActivityManager.descriptor);
3595 data.writeInt(shown ? 1 : 0);
3596 mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0);
3597 reply.readException();
3598 data.recycle();
3599 reply.recycle();
3600 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003601 public void setDebugApp(
3602 String packageName, boolean waitForDebugger, boolean persistent)
3603 throws RemoteException
3604 {
3605 Parcel data = Parcel.obtain();
3606 Parcel reply = Parcel.obtain();
3607 data.writeInterfaceToken(IActivityManager.descriptor);
3608 data.writeString(packageName);
3609 data.writeInt(waitForDebugger ? 1 : 0);
3610 data.writeInt(persistent ? 1 : 0);
3611 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
3612 reply.readException();
3613 data.recycle();
3614 reply.recycle();
3615 }
3616 public void setAlwaysFinish(boolean enabled) throws RemoteException
3617 {
3618 Parcel data = Parcel.obtain();
3619 Parcel reply = Parcel.obtain();
3620 data.writeInterfaceToken(IActivityManager.descriptor);
3621 data.writeInt(enabled ? 1 : 0);
3622 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
3623 reply.readException();
3624 data.recycle();
3625 reply.recycle();
3626 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07003627 public void setActivityController(IActivityController watcher) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003628 {
3629 Parcel data = Parcel.obtain();
3630 Parcel reply = Parcel.obtain();
3631 data.writeInterfaceToken(IActivityManager.descriptor);
3632 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07003633 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003634 reply.readException();
3635 data.recycle();
3636 reply.recycle();
3637 }
3638 public void enterSafeMode() throws RemoteException {
3639 Parcel data = Parcel.obtain();
3640 data.writeInterfaceToken(IActivityManager.descriptor);
3641 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
3642 data.recycle();
3643 }
3644 public void noteWakeupAlarm(IIntentSender sender) throws RemoteException {
3645 Parcel data = Parcel.obtain();
3646 data.writeStrongBinder(sender.asBinder());
3647 data.writeInterfaceToken(IActivityManager.descriptor);
3648 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
3649 data.recycle();
3650 }
Dianne Hackborn64825172011-03-02 21:32:58 -08003651 public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003652 Parcel data = Parcel.obtain();
3653 Parcel reply = Parcel.obtain();
3654 data.writeInterfaceToken(IActivityManager.descriptor);
3655 data.writeIntArray(pids);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07003656 data.writeString(reason);
Dianne Hackborn64825172011-03-02 21:32:58 -08003657 data.writeInt(secure ? 1 : 0);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07003658 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07003659 reply.readException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003660 boolean res = reply.readInt() != 0;
3661 data.recycle();
3662 reply.recycle();
3663 return res;
3664 }
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07003665 @Override
3666 public boolean killProcessesBelowForeground(String reason) throws RemoteException {
3667 Parcel data = Parcel.obtain();
3668 Parcel reply = Parcel.obtain();
3669 data.writeInterfaceToken(IActivityManager.descriptor);
3670 data.writeString(reason);
3671 mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0);
3672 boolean res = reply.readInt() != 0;
3673 data.recycle();
3674 reply.recycle();
3675 return res;
3676 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003677 public void startRunning(String pkg, String cls, String action,
3678 String indata) throws RemoteException {
3679 Parcel data = Parcel.obtain();
3680 Parcel reply = Parcel.obtain();
3681 data.writeInterfaceToken(IActivityManager.descriptor);
3682 data.writeString(pkg);
3683 data.writeString(cls);
3684 data.writeString(action);
3685 data.writeString(indata);
3686 mRemote.transact(START_RUNNING_TRANSACTION, data, reply, 0);
3687 reply.readException();
3688 data.recycle();
3689 reply.recycle();
3690 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003691 public boolean testIsSystemReady()
3692 {
3693 /* this base class version is never called */
3694 return true;
3695 }
Dan Egnor60d87622009-12-16 16:32:58 -08003696 public void handleApplicationCrash(IBinder app,
3697 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
3698 {
3699 Parcel data = Parcel.obtain();
3700 Parcel reply = Parcel.obtain();
3701 data.writeInterfaceToken(IActivityManager.descriptor);
3702 data.writeStrongBinder(app);
3703 crashInfo.writeToParcel(data, 0);
3704 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
3705 reply.readException();
3706 reply.recycle();
3707 data.recycle();
3708 }
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07003709
Dan Egnor60d87622009-12-16 16:32:58 -08003710 public boolean handleApplicationWtf(IBinder app, String tag,
Dan Egnorb7f03672009-12-09 16:22:32 -08003711 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003712 {
3713 Parcel data = Parcel.obtain();
3714 Parcel reply = Parcel.obtain();
3715 data.writeInterfaceToken(IActivityManager.descriptor);
3716 data.writeStrongBinder(app);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003717 data.writeString(tag);
Dan Egnorb7f03672009-12-09 16:22:32 -08003718 crashInfo.writeToParcel(data, 0);
Dan Egnor60d87622009-12-16 16:32:58 -08003719 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003720 reply.readException();
Dan Egnor60d87622009-12-16 16:32:58 -08003721 boolean res = reply.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003722 reply.recycle();
3723 data.recycle();
Dan Egnor60d87622009-12-16 16:32:58 -08003724 return res;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003725 }
Dan Egnorb7f03672009-12-09 16:22:32 -08003726
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07003727 public void handleApplicationStrictModeViolation(IBinder app,
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07003728 int violationMask,
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07003729 StrictMode.ViolationInfo info) throws RemoteException
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07003730 {
3731 Parcel data = Parcel.obtain();
3732 Parcel reply = Parcel.obtain();
3733 data.writeInterfaceToken(IActivityManager.descriptor);
3734 data.writeStrongBinder(app);
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07003735 data.writeInt(violationMask);
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07003736 info.writeToParcel(data, 0);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07003737 mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0);
3738 reply.readException();
3739 reply.recycle();
3740 data.recycle();
3741 }
3742
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003743 public void signalPersistentProcesses(int sig) throws RemoteException {
3744 Parcel data = Parcel.obtain();
3745 Parcel reply = Parcel.obtain();
3746 data.writeInterfaceToken(IActivityManager.descriptor);
3747 data.writeInt(sig);
3748 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
3749 reply.readException();
3750 data.recycle();
3751 reply.recycle();
3752 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08003753
Dianne Hackborn1676c852012-09-10 14:52:30 -07003754 public void killBackgroundProcesses(String packageName, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003755 Parcel data = Parcel.obtain();
3756 Parcel reply = Parcel.obtain();
3757 data.writeInterfaceToken(IActivityManager.descriptor);
3758 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07003759 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08003760 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
3761 reply.readException();
3762 data.recycle();
3763 reply.recycle();
3764 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08003765
3766 public void killAllBackgroundProcesses() throws RemoteException {
3767 Parcel data = Parcel.obtain();
3768 Parcel reply = Parcel.obtain();
3769 data.writeInterfaceToken(IActivityManager.descriptor);
3770 mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
3771 reply.readException();
3772 data.recycle();
3773 reply.recycle();
3774 }
3775
Dianne Hackborn1676c852012-09-10 14:52:30 -07003776 public void forceStopPackage(String packageName, int userId) throws RemoteException {
Dianne Hackborn03abb812010-01-04 18:43:19 -08003777 Parcel data = Parcel.obtain();
3778 Parcel reply = Parcel.obtain();
3779 data.writeInterfaceToken(IActivityManager.descriptor);
3780 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07003781 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08003782 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003783 reply.readException();
3784 data.recycle();
3785 reply.recycle();
3786 }
3787
Dianne Hackborn27ff9132012-03-06 14:57:58 -08003788 public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
3789 throws RemoteException
3790 {
3791 Parcel data = Parcel.obtain();
3792 Parcel reply = Parcel.obtain();
3793 data.writeInterfaceToken(IActivityManager.descriptor);
3794 mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0);
3795 reply.readException();
3796 outInfo.readFromParcel(reply);
3797 reply.recycle();
3798 data.recycle();
3799 }
3800
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003801 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
3802 {
3803 Parcel data = Parcel.obtain();
3804 Parcel reply = Parcel.obtain();
3805 data.writeInterfaceToken(IActivityManager.descriptor);
3806 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
3807 reply.readException();
3808 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
3809 reply.recycle();
3810 data.recycle();
3811 return res;
3812 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003813
Dianne Hackborn1676c852012-09-10 14:52:30 -07003814 public boolean profileControl(String process, int userId, boolean start,
Romain Guy7eabe552011-07-21 14:56:34 -07003815 String path, ParcelFileDescriptor fd, int profileType) throws RemoteException
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003816 {
3817 Parcel data = Parcel.obtain();
3818 Parcel reply = Parcel.obtain();
3819 data.writeInterfaceToken(IActivityManager.descriptor);
3820 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07003821 data.writeInt(userId);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003822 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07003823 data.writeInt(profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003824 data.writeString(path);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07003825 if (fd != null) {
3826 data.writeInt(1);
3827 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
3828 } else {
3829 data.writeInt(0);
3830 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08003831 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
3832 reply.readException();
3833 boolean res = reply.readInt() != 0;
3834 reply.recycle();
3835 data.recycle();
3836 return res;
3837 }
3838
Dianne Hackborn55280a92009-05-07 15:53:46 -07003839 public boolean shutdown(int timeout) throws RemoteException
3840 {
3841 Parcel data = Parcel.obtain();
3842 Parcel reply = Parcel.obtain();
3843 data.writeInterfaceToken(IActivityManager.descriptor);
3844 data.writeInt(timeout);
3845 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
3846 reply.readException();
3847 boolean res = reply.readInt() != 0;
3848 reply.recycle();
3849 data.recycle();
3850 return res;
3851 }
3852
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07003853 public void stopAppSwitches() throws RemoteException {
3854 Parcel data = Parcel.obtain();
3855 Parcel reply = Parcel.obtain();
3856 data.writeInterfaceToken(IActivityManager.descriptor);
3857 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
3858 reply.readException();
3859 reply.recycle();
3860 data.recycle();
3861 }
3862
3863 public void resumeAppSwitches() throws RemoteException {
3864 Parcel data = Parcel.obtain();
3865 Parcel reply = Parcel.obtain();
3866 data.writeInterfaceToken(IActivityManager.descriptor);
3867 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
3868 reply.readException();
3869 reply.recycle();
3870 data.recycle();
3871 }
3872
Dianne Hackborn21d9b562013-05-28 17:46:59 -07003873 public void killApplicationWithAppId(String pkg, int appid, String reason)
3874 throws RemoteException {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07003875 Parcel data = Parcel.obtain();
3876 Parcel reply = Parcel.obtain();
3877 data.writeInterfaceToken(IActivityManager.descriptor);
3878 data.writeString(pkg);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07003879 data.writeInt(appid);
Dianne Hackborn21d9b562013-05-28 17:46:59 -07003880 data.writeString(reason);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07003881 mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07003882 reply.readException();
3883 data.recycle();
3884 reply.recycle();
3885 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07003886
3887 public void closeSystemDialogs(String reason) throws RemoteException {
3888 Parcel data = Parcel.obtain();
3889 Parcel reply = Parcel.obtain();
3890 data.writeInterfaceToken(IActivityManager.descriptor);
3891 data.writeString(reason);
3892 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
3893 reply.readException();
3894 data.recycle();
3895 reply.recycle();
3896 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003897
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07003898 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003899 throws RemoteException {
3900 Parcel data = Parcel.obtain();
3901 Parcel reply = Parcel.obtain();
3902 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07003903 data.writeIntArray(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003904 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
3905 reply.readException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07003906 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003907 data.recycle();
3908 reply.recycle();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07003909 return res;
Dianne Hackborn3025ef32009-08-31 21:31:47 -07003910 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07003911
3912 public void killApplicationProcess(String processName, int uid) throws RemoteException {
3913 Parcel data = Parcel.obtain();
3914 Parcel reply = Parcel.obtain();
3915 data.writeInterfaceToken(IActivityManager.descriptor);
3916 data.writeString(processName);
3917 data.writeInt(uid);
3918 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
3919 reply.readException();
3920 data.recycle();
3921 reply.recycle();
3922 }
3923
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07003924 public void overridePendingTransition(IBinder token, String packageName,
3925 int enterAnim, int exitAnim) throws RemoteException {
3926 Parcel data = Parcel.obtain();
3927 Parcel reply = Parcel.obtain();
3928 data.writeInterfaceToken(IActivityManager.descriptor);
3929 data.writeStrongBinder(token);
3930 data.writeString(packageName);
3931 data.writeInt(enterAnim);
3932 data.writeInt(exitAnim);
3933 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
3934 reply.readException();
3935 data.recycle();
3936 reply.recycle();
3937 }
3938
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08003939 public boolean isUserAMonkey() throws RemoteException {
3940 Parcel data = Parcel.obtain();
3941 Parcel reply = Parcel.obtain();
3942 data.writeInterfaceToken(IActivityManager.descriptor);
3943 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
3944 reply.readException();
3945 boolean res = reply.readInt() != 0;
3946 data.recycle();
3947 reply.recycle();
3948 return res;
3949 }
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07003950
3951 public void setUserIsMonkey(boolean monkey) throws RemoteException {
3952 Parcel data = Parcel.obtain();
3953 Parcel reply = Parcel.obtain();
3954 data.writeInterfaceToken(IActivityManager.descriptor);
3955 data.writeInt(monkey ? 1 : 0);
3956 mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0);
3957 reply.readException();
3958 data.recycle();
3959 reply.recycle();
3960 }
3961
Dianne Hackborn860755f2010-06-03 18:47:52 -07003962 public void finishHeavyWeightApp() throws RemoteException {
3963 Parcel data = Parcel.obtain();
3964 Parcel reply = Parcel.obtain();
3965 data.writeInterfaceToken(IActivityManager.descriptor);
3966 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
3967 reply.readException();
3968 data.recycle();
3969 reply.recycle();
3970 }
Craig Mautner4addfc52013-06-25 08:05:45 -07003971
Craig Mautnerbc57cd12013-08-19 15:47:42 -07003972 public boolean convertFromTranslucent(IBinder token)
Craig Mautner4addfc52013-06-25 08:05:45 -07003973 throws RemoteException {
3974 Parcel data = Parcel.obtain();
3975 Parcel reply = Parcel.obtain();
3976 data.writeInterfaceToken(IActivityManager.descriptor);
3977 data.writeStrongBinder(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07003978 mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0);
3979 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07003980 boolean res = reply.readInt() != 0;
Craig Mautner5eda9b32013-07-02 11:58:16 -07003981 data.recycle();
3982 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07003983 return res;
Craig Mautner5eda9b32013-07-02 11:58:16 -07003984 }
3985
Craig Mautnerbc57cd12013-08-19 15:47:42 -07003986 public boolean convertToTranslucent(IBinder token)
Craig Mautner5eda9b32013-07-02 11:58:16 -07003987 throws RemoteException {
3988 Parcel data = Parcel.obtain();
3989 Parcel reply = Parcel.obtain();
3990 data.writeInterfaceToken(IActivityManager.descriptor);
3991 data.writeStrongBinder(token);
3992 mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07003993 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07003994 boolean res = reply.readInt() != 0;
Craig Mautner4addfc52013-06-25 08:05:45 -07003995 data.recycle();
3996 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07003997 return res;
Craig Mautner4addfc52013-06-25 08:05:45 -07003998 }
3999
Daniel Sandler69a48172010-06-23 16:29:36 -04004000 public void setImmersive(IBinder token, boolean immersive)
4001 throws RemoteException {
4002 Parcel data = Parcel.obtain();
4003 Parcel reply = Parcel.obtain();
4004 data.writeInterfaceToken(IActivityManager.descriptor);
4005 data.writeStrongBinder(token);
4006 data.writeInt(immersive ? 1 : 0);
4007 mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
4008 reply.readException();
4009 data.recycle();
4010 reply.recycle();
4011 }
4012
4013 public boolean isImmersive(IBinder token)
4014 throws RemoteException {
4015 Parcel data = Parcel.obtain();
4016 Parcel reply = Parcel.obtain();
4017 data.writeInterfaceToken(IActivityManager.descriptor);
4018 data.writeStrongBinder(token);
4019 mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004020 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004021 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004022 data.recycle();
4023 reply.recycle();
4024 return res;
4025 }
4026
4027 public boolean isTopActivityImmersive()
4028 throws RemoteException {
4029 Parcel data = Parcel.obtain();
4030 Parcel reply = Parcel.obtain();
4031 data.writeInterfaceToken(IActivityManager.descriptor);
4032 mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004033 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004034 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004035 data.recycle();
4036 reply.recycle();
4037 return res;
4038 }
4039
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004040 public void crashApplication(int uid, int initialPid, String packageName,
4041 String message) throws RemoteException {
4042 Parcel data = Parcel.obtain();
4043 Parcel reply = Parcel.obtain();
4044 data.writeInterfaceToken(IActivityManager.descriptor);
4045 data.writeInt(uid);
4046 data.writeInt(initialPid);
4047 data.writeString(packageName);
4048 data.writeString(message);
4049 mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0);
4050 reply.readException();
4051 data.recycle();
4052 reply.recycle();
4053 }
Andy McFadden824c5102010-07-09 16:26:57 -07004054
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004055 public String getProviderMimeType(Uri uri, int userId) throws RemoteException {
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004056 Parcel data = Parcel.obtain();
4057 Parcel reply = Parcel.obtain();
4058 data.writeInterfaceToken(IActivityManager.descriptor);
4059 uri.writeToParcel(data, 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004060 data.writeInt(userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004061 mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0);
4062 reply.readException();
4063 String res = reply.readString();
4064 data.recycle();
4065 reply.recycle();
4066 return res;
4067 }
4068
Dianne Hackborn7e269642010-08-25 19:50:20 -07004069 public IBinder newUriPermissionOwner(String name)
4070 throws RemoteException {
4071 Parcel data = Parcel.obtain();
4072 Parcel reply = Parcel.obtain();
4073 data.writeInterfaceToken(IActivityManager.descriptor);
4074 data.writeString(name);
4075 mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
4076 reply.readException();
4077 IBinder res = reply.readStrongBinder();
4078 data.recycle();
4079 reply.recycle();
4080 return res;
4081 }
4082
4083 public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
4084 Uri uri, int mode) throws RemoteException {
4085 Parcel data = Parcel.obtain();
4086 Parcel reply = Parcel.obtain();
4087 data.writeInterfaceToken(IActivityManager.descriptor);
4088 data.writeStrongBinder(owner);
4089 data.writeInt(fromUid);
4090 data.writeString(targetPkg);
4091 uri.writeToParcel(data, 0);
4092 data.writeInt(mode);
4093 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4094 reply.readException();
4095 data.recycle();
4096 reply.recycle();
4097 }
4098
4099 public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
4100 int mode) throws RemoteException {
4101 Parcel data = Parcel.obtain();
4102 Parcel reply = Parcel.obtain();
4103 data.writeInterfaceToken(IActivityManager.descriptor);
4104 data.writeStrongBinder(owner);
4105 if (uri != null) {
4106 data.writeInt(1);
4107 uri.writeToParcel(data, 0);
4108 } else {
4109 data.writeInt(0);
4110 }
4111 data.writeInt(mode);
4112 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4113 reply.readException();
4114 data.recycle();
4115 reply.recycle();
4116 }
Dianne Hackbornc8f84972010-08-25 23:14:44 -07004117
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004118 public int checkGrantUriPermission(int callingUid, String targetPkg,
4119 Uri uri, int modeFlags) throws RemoteException {
4120 Parcel data = Parcel.obtain();
4121 Parcel reply = Parcel.obtain();
4122 data.writeInterfaceToken(IActivityManager.descriptor);
4123 data.writeInt(callingUid);
4124 data.writeString(targetPkg);
4125 uri.writeToParcel(data, 0);
4126 data.writeInt(modeFlags);
4127 mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4128 reply.readException();
4129 int res = reply.readInt();
4130 data.recycle();
4131 reply.recycle();
4132 return res;
4133 }
4134
Dianne Hackborn1676c852012-09-10 14:52:30 -07004135 public boolean dumpHeap(String process, int userId, boolean managed,
Andy McFadden824c5102010-07-09 16:26:57 -07004136 String path, ParcelFileDescriptor fd) throws RemoteException {
4137 Parcel data = Parcel.obtain();
4138 Parcel reply = Parcel.obtain();
4139 data.writeInterfaceToken(IActivityManager.descriptor);
4140 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004141 data.writeInt(userId);
Andy McFadden824c5102010-07-09 16:26:57 -07004142 data.writeInt(managed ? 1 : 0);
4143 data.writeString(path);
4144 if (fd != null) {
4145 data.writeInt(1);
4146 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
4147 } else {
4148 data.writeInt(0);
4149 }
4150 mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
4151 reply.readException();
4152 boolean res = reply.readInt() != 0;
4153 reply.recycle();
4154 data.recycle();
4155 return res;
4156 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004157
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004158 public int startActivities(IApplicationThread caller, String callingPackage,
Dianne Hackborna4972e92012-03-14 10:38:05 -07004159 Intent[] intents, String[] resolvedTypes, IBinder resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004160 Bundle options, int userId) throws RemoteException {
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004161 Parcel data = Parcel.obtain();
4162 Parcel reply = Parcel.obtain();
4163 data.writeInterfaceToken(IActivityManager.descriptor);
4164 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004165 data.writeString(callingPackage);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004166 data.writeTypedArray(intents, 0);
4167 data.writeStringArray(resolvedTypes);
4168 data.writeStrongBinder(resultTo);
Dianne Hackborna4972e92012-03-14 10:38:05 -07004169 if (options != null) {
4170 data.writeInt(1);
4171 options.writeToParcel(data, 0);
4172 } else {
4173 data.writeInt(0);
4174 }
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004175 data.writeInt(userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004176 mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0);
4177 reply.readException();
4178 int result = reply.readInt();
4179 reply.recycle();
4180 data.recycle();
4181 return result;
4182 }
4183
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004184 public int getFrontActivityScreenCompatMode() throws RemoteException {
4185 Parcel data = Parcel.obtain();
4186 Parcel reply = Parcel.obtain();
4187 data.writeInterfaceToken(IActivityManager.descriptor);
4188 mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4189 reply.readException();
4190 int mode = reply.readInt();
4191 reply.recycle();
4192 data.recycle();
4193 return mode;
4194 }
4195
4196 public void setFrontActivityScreenCompatMode(int mode) throws RemoteException {
4197 Parcel data = Parcel.obtain();
4198 Parcel reply = Parcel.obtain();
4199 data.writeInterfaceToken(IActivityManager.descriptor);
4200 data.writeInt(mode);
4201 mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4202 reply.readException();
4203 reply.recycle();
4204 data.recycle();
4205 }
4206
4207 public int getPackageScreenCompatMode(String packageName) throws RemoteException {
4208 Parcel data = Parcel.obtain();
4209 Parcel reply = Parcel.obtain();
4210 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004211 data.writeString(packageName);
4212 mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004213 reply.readException();
4214 int mode = reply.readInt();
4215 reply.recycle();
4216 data.recycle();
4217 return mode;
4218 }
4219
4220 public void setPackageScreenCompatMode(String packageName, int mode)
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004221 throws RemoteException {
4222 Parcel data = Parcel.obtain();
4223 Parcel reply = Parcel.obtain();
4224 data.writeInterfaceToken(IActivityManager.descriptor);
4225 data.writeString(packageName);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004226 data.writeInt(mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004227 mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4228 reply.readException();
4229 reply.recycle();
4230 data.recycle();
4231 }
4232
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004233 public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
4234 Parcel data = Parcel.obtain();
4235 Parcel reply = Parcel.obtain();
4236 data.writeInterfaceToken(IActivityManager.descriptor);
4237 data.writeString(packageName);
4238 mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4239 reply.readException();
4240 boolean ask = reply.readInt() != 0;
4241 reply.recycle();
4242 data.recycle();
4243 return ask;
4244 }
4245
4246 public void setPackageAskScreenCompat(String packageName, boolean ask)
4247 throws RemoteException {
4248 Parcel data = Parcel.obtain();
4249 Parcel reply = Parcel.obtain();
4250 data.writeInterfaceToken(IActivityManager.descriptor);
4251 data.writeString(packageName);
4252 data.writeInt(ask ? 1 : 0);
4253 mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4254 reply.readException();
4255 reply.recycle();
4256 data.recycle();
4257 }
4258
Amith Yamasani4b2e9342011-03-31 12:38:53 -07004259 public boolean switchUser(int userid) throws RemoteException {
4260 Parcel data = Parcel.obtain();
4261 Parcel reply = Parcel.obtain();
4262 data.writeInterfaceToken(IActivityManager.descriptor);
4263 data.writeInt(userid);
4264 mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0);
4265 reply.readException();
4266 boolean result = reply.readInt() != 0;
4267 reply.recycle();
4268 data.recycle();
4269 return result;
4270 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07004271
Dianne Hackborn80a4af22012-08-27 19:18:31 -07004272 public int stopUser(int userid, IStopUserCallback callback) throws RemoteException {
4273 Parcel data = Parcel.obtain();
4274 Parcel reply = Parcel.obtain();
4275 data.writeInterfaceToken(IActivityManager.descriptor);
4276 data.writeInt(userid);
4277 data.writeStrongInterface(callback);
4278 mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0);
4279 reply.readException();
4280 int result = reply.readInt();
4281 reply.recycle();
4282 data.recycle();
4283 return result;
4284 }
4285
Amith Yamasani52f1d752012-03-28 18:19:29 -07004286 public UserInfo getCurrentUser() throws RemoteException {
4287 Parcel data = Parcel.obtain();
4288 Parcel reply = Parcel.obtain();
4289 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn80a4af22012-08-27 19:18:31 -07004290 mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0);
Amith Yamasani52f1d752012-03-28 18:19:29 -07004291 reply.readException();
4292 UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply);
4293 reply.recycle();
4294 data.recycle();
4295 return userInfo;
4296 }
4297
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07004298 public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException {
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004299 Parcel data = Parcel.obtain();
4300 Parcel reply = Parcel.obtain();
4301 data.writeInterfaceToken(IActivityManager.descriptor);
4302 data.writeInt(userid);
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07004303 data.writeInt(orStopping ? 1 : 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004304 mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0);
4305 reply.readException();
4306 boolean result = reply.readInt() != 0;
4307 reply.recycle();
4308 data.recycle();
4309 return result;
4310 }
4311
Dianne Hackbornc72fc672012-09-20 13:12:03 -07004312 public int[] getRunningUserIds() throws RemoteException {
4313 Parcel data = Parcel.obtain();
4314 Parcel reply = Parcel.obtain();
4315 data.writeInterfaceToken(IActivityManager.descriptor);
4316 mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0);
4317 reply.readException();
4318 int[] result = reply.createIntArray();
4319 reply.recycle();
4320 data.recycle();
4321 return result;
4322 }
4323
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07004324 public boolean removeSubTask(int taskId, int subTaskIndex) throws RemoteException {
4325 Parcel data = Parcel.obtain();
4326 Parcel reply = Parcel.obtain();
4327 data.writeInterfaceToken(IActivityManager.descriptor);
4328 data.writeInt(taskId);
4329 data.writeInt(subTaskIndex);
4330 mRemote.transact(REMOVE_SUB_TASK_TRANSACTION, data, reply, 0);
4331 reply.readException();
4332 boolean result = reply.readInt() != 0;
4333 reply.recycle();
4334 data.recycle();
4335 return result;
4336 }
4337
4338 public boolean removeTask(int taskId, int flags) throws RemoteException {
4339 Parcel data = Parcel.obtain();
4340 Parcel reply = Parcel.obtain();
4341 data.writeInterfaceToken(IActivityManager.descriptor);
4342 data.writeInt(taskId);
4343 data.writeInt(flags);
4344 mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
4345 reply.readException();
4346 boolean result = reply.readInt() != 0;
4347 reply.recycle();
4348 data.recycle();
4349 return result;
4350 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07004351
Jeff Sharkeya4620792011-05-20 15:29:23 -07004352 public void registerProcessObserver(IProcessObserver observer) throws RemoteException {
4353 Parcel data = Parcel.obtain();
4354 Parcel reply = Parcel.obtain();
4355 data.writeInterfaceToken(IActivityManager.descriptor);
4356 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
4357 mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
4358 reply.readException();
4359 data.recycle();
4360 reply.recycle();
4361 }
4362
4363 public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException {
4364 Parcel data = Parcel.obtain();
4365 Parcel reply = Parcel.obtain();
4366 data.writeInterfaceToken(IActivityManager.descriptor);
4367 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
4368 mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
4369 reply.readException();
4370 data.recycle();
4371 reply.recycle();
4372 }
4373
Dianne Hackborn6c418d52011-06-29 14:05:33 -07004374 public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException {
4375 Parcel data = Parcel.obtain();
4376 Parcel reply = Parcel.obtain();
4377 data.writeInterfaceToken(IActivityManager.descriptor);
4378 data.writeStrongBinder(sender.asBinder());
4379 mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0);
4380 reply.readException();
4381 boolean res = reply.readInt() != 0;
4382 data.recycle();
4383 reply.recycle();
4384 return res;
4385 }
4386
Dianne Hackborn1927ae82012-06-22 15:21:36 -07004387 public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException {
4388 Parcel data = Parcel.obtain();
4389 Parcel reply = Parcel.obtain();
4390 data.writeInterfaceToken(IActivityManager.descriptor);
4391 data.writeStrongBinder(sender.asBinder());
4392 mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0);
4393 reply.readException();
4394 boolean res = reply.readInt() != 0;
4395 data.recycle();
4396 reply.recycle();
4397 return res;
4398 }
4399
Dianne Hackborn81038902012-11-26 17:04:09 -08004400 public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException {
4401 Parcel data = Parcel.obtain();
4402 Parcel reply = Parcel.obtain();
4403 data.writeInterfaceToken(IActivityManager.descriptor);
4404 data.writeStrongBinder(sender.asBinder());
4405 mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4406 reply.readException();
4407 Intent res = reply.readInt() != 0
4408 ? Intent.CREATOR.createFromParcel(reply) : null;
4409 data.recycle();
4410 reply.recycle();
4411 return res;
4412 }
4413
Dianne Hackborn31ca8542011-07-19 14:58:28 -07004414 public void updatePersistentConfiguration(Configuration values) throws RemoteException
4415 {
4416 Parcel data = Parcel.obtain();
4417 Parcel reply = Parcel.obtain();
4418 data.writeInterfaceToken(IActivityManager.descriptor);
4419 values.writeToParcel(data, 0);
4420 mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0);
4421 reply.readException();
4422 data.recycle();
4423 reply.recycle();
4424 }
4425
Dianne Hackbornb437e092011-08-05 17:50:29 -07004426 public long[] getProcessPss(int[] pids) throws RemoteException {
4427 Parcel data = Parcel.obtain();
4428 Parcel reply = Parcel.obtain();
4429 data.writeInterfaceToken(IActivityManager.descriptor);
4430 data.writeIntArray(pids);
4431 mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0);
4432 reply.readException();
4433 long[] res = reply.createLongArray();
4434 data.recycle();
4435 reply.recycle();
4436 return res;
4437 }
4438
Dianne Hackborn661cd522011-08-22 00:26:20 -07004439 public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
4440 Parcel data = Parcel.obtain();
4441 Parcel reply = Parcel.obtain();
4442 data.writeInterfaceToken(IActivityManager.descriptor);
4443 TextUtils.writeToParcel(msg, data, 0);
4444 data.writeInt(always ? 1 : 0);
4445 mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
4446 reply.readException();
4447 data.recycle();
4448 reply.recycle();
4449 }
4450
Dianne Hackborn90c52de2011-09-23 12:57:44 -07004451 public void dismissKeyguardOnNextActivity() throws RemoteException {
4452 Parcel data = Parcel.obtain();
4453 Parcel reply = Parcel.obtain();
4454 data.writeInterfaceToken(IActivityManager.descriptor);
4455 mRemote.transact(DISMISS_KEYGUARD_ON_NEXT_ACTIVITY_TRANSACTION, data, reply, 0);
4456 reply.readException();
4457 data.recycle();
4458 reply.recycle();
4459 }
4460
Adam Powelldd8fab22012-03-22 17:47:27 -07004461 public boolean targetTaskAffinityMatchesActivity(IBinder token, String destAffinity)
4462 throws RemoteException {
4463 Parcel data = Parcel.obtain();
4464 Parcel reply = Parcel.obtain();
4465 data.writeInterfaceToken(IActivityManager.descriptor);
4466 data.writeStrongBinder(token);
4467 data.writeString(destAffinity);
4468 mRemote.transact(TARGET_TASK_AFFINITY_MATCHES_ACTIVITY_TRANSACTION, data, reply, 0);
4469 reply.readException();
4470 boolean result = reply.readInt() != 0;
4471 data.recycle();
4472 reply.recycle();
4473 return result;
4474 }
4475
4476 public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData)
4477 throws RemoteException {
4478 Parcel data = Parcel.obtain();
4479 Parcel reply = Parcel.obtain();
4480 data.writeInterfaceToken(IActivityManager.descriptor);
4481 data.writeStrongBinder(token);
4482 target.writeToParcel(data, 0);
4483 data.writeInt(resultCode);
4484 if (resultData != null) {
4485 data.writeInt(1);
4486 resultData.writeToParcel(data, 0);
4487 } else {
4488 data.writeInt(0);
4489 }
4490 mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0);
4491 reply.readException();
4492 boolean result = reply.readInt() != 0;
4493 data.recycle();
4494 reply.recycle();
4495 return result;
4496 }
4497
Dianne Hackborn5320eb82012-05-18 12:05:04 -07004498 public int getLaunchedFromUid(IBinder activityToken) throws RemoteException {
4499 Parcel data = Parcel.obtain();
4500 Parcel reply = Parcel.obtain();
4501 data.writeInterfaceToken(IActivityManager.descriptor);
4502 data.writeStrongBinder(activityToken);
4503 mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0);
4504 reply.readException();
4505 int result = reply.readInt();
4506 data.recycle();
4507 reply.recycle();
4508 return result;
4509 }
4510
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004511 public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException {
4512 Parcel data = Parcel.obtain();
4513 Parcel reply = Parcel.obtain();
4514 data.writeInterfaceToken(IActivityManager.descriptor);
4515 data.writeStrongBinder(activityToken);
4516 mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0);
4517 reply.readException();
4518 String result = reply.readString();
4519 data.recycle();
4520 reply.recycle();
4521 return result;
4522 }
4523
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07004524 public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
4525 Parcel data = Parcel.obtain();
4526 Parcel reply = Parcel.obtain();
4527 data.writeInterfaceToken(IActivityManager.descriptor);
4528 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
4529 mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
4530 reply.readException();
4531 data.recycle();
4532 reply.recycle();
4533 }
4534
4535 public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
4536 Parcel data = Parcel.obtain();
4537 Parcel reply = Parcel.obtain();
4538 data.writeInterfaceToken(IActivityManager.descriptor);
4539 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
4540 mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
4541 reply.readException();
4542 data.recycle();
4543 reply.recycle();
4544 }
4545
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07004546 public void requestBugReport() throws RemoteException {
4547 Parcel data = Parcel.obtain();
4548 Parcel reply = Parcel.obtain();
4549 data.writeInterfaceToken(IActivityManager.descriptor);
4550 mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0);
4551 reply.readException();
4552 data.recycle();
4553 reply.recycle();
4554 }
4555
Jeff Brownbd181bb2013-09-10 16:44:24 -07004556 public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason)
4557 throws RemoteException {
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07004558 Parcel data = Parcel.obtain();
4559 Parcel reply = Parcel.obtain();
4560 data.writeInterfaceToken(IActivityManager.descriptor);
4561 data.writeInt(pid);
4562 data.writeInt(aboveSystem ? 1 : 0);
Jeff Brownbd181bb2013-09-10 16:44:24 -07004563 data.writeString(reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07004564 mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0);
4565 reply.readException();
4566 long res = reply.readInt();
4567 data.recycle();
4568 reply.recycle();
4569 return res;
4570 }
4571
Adam Skorydfc7fd72013-08-05 19:23:41 -07004572 public Bundle getAssistContextExtras(int requestType) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08004573 Parcel data = Parcel.obtain();
4574 Parcel reply = Parcel.obtain();
4575 data.writeInterfaceToken(IActivityManager.descriptor);
4576 data.writeInt(requestType);
Adam Skorydfc7fd72013-08-05 19:23:41 -07004577 mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08004578 reply.readException();
4579 Bundle res = reply.readBundle();
4580 data.recycle();
4581 reply.recycle();
4582 return res;
4583 }
4584
Adam Skory7140a252013-09-11 12:04:58 +01004585 public void reportAssistContextExtras(IBinder token, Bundle extras)
Adam Skorydfc7fd72013-08-05 19:23:41 -07004586 throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08004587 Parcel data = Parcel.obtain();
4588 Parcel reply = Parcel.obtain();
4589 data.writeInterfaceToken(IActivityManager.descriptor);
4590 data.writeStrongBinder(token);
4591 data.writeBundle(extras);
Adam Skorydfc7fd72013-08-05 19:23:41 -07004592 mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08004593 reply.readException();
4594 data.recycle();
4595 reply.recycle();
4596 }
4597
Dianne Hackbornf1b78242013-04-08 22:28:59 -07004598 public void killUid(int uid, String reason) throws RemoteException {
4599 Parcel data = Parcel.obtain();
4600 Parcel reply = Parcel.obtain();
4601 data.writeInterfaceToken(IActivityManager.descriptor);
4602 data.writeInt(uid);
4603 data.writeString(reason);
4604 mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0);
4605 reply.readException();
4606 data.recycle();
4607 reply.recycle();
4608 }
4609
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07004610 public void hang(IBinder who, boolean allowRestart) throws RemoteException {
4611 Parcel data = Parcel.obtain();
4612 Parcel reply = Parcel.obtain();
4613 data.writeInterfaceToken(IActivityManager.descriptor);
4614 data.writeStrongBinder(who);
4615 data.writeInt(allowRestart ? 1 : 0);
4616 mRemote.transact(HANG_TRANSACTION, data, reply, 0);
4617 reply.readException();
4618 data.recycle();
4619 reply.recycle();
4620 }
4621
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07004622 public void reportActivityFullyDrawn(IBinder token) throws RemoteException {
4623 Parcel data = Parcel.obtain();
4624 Parcel reply = Parcel.obtain();
4625 data.writeInterfaceToken(IActivityManager.descriptor);
4626 data.writeStrongBinder(token);
4627 mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0);
4628 reply.readException();
4629 data.recycle();
4630 reply.recycle();
4631 }
4632
Craig Mautner5eda9b32013-07-02 11:58:16 -07004633 public void notifyActivityDrawn(IBinder token) throws RemoteException {
4634 Parcel data = Parcel.obtain();
4635 Parcel reply = Parcel.obtain();
4636 data.writeInterfaceToken(IActivityManager.descriptor);
4637 data.writeStrongBinder(token);
4638 mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
4639 reply.readException();
4640 data.recycle();
4641 reply.recycle();
4642 }
4643
Dianne Hackborn57a7f592013-07-22 18:21:32 -07004644 public void restart() throws RemoteException {
4645 Parcel data = Parcel.obtain();
4646 Parcel reply = Parcel.obtain();
4647 data.writeInterfaceToken(IActivityManager.descriptor);
4648 mRemote.transact(RESTART_TRANSACTION, data, reply, 0);
4649 reply.readException();
4650 data.recycle();
4651 reply.recycle();
4652 }
4653
Dianne Hackborn35f72be2013-09-16 10:57:39 -07004654 public void performIdleMaintenance() throws RemoteException {
4655 Parcel data = Parcel.obtain();
4656 Parcel reply = Parcel.obtain();
4657 data.writeInterfaceToken(IActivityManager.descriptor);
4658 mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0);
4659 reply.readException();
4660 data.recycle();
4661 reply.recycle();
4662 }
4663
Craig Mautner4a1cb222013-12-04 16:14:06 -08004664 public IActivityContainer createActivityContainer(IBinder parentActivityToken,
4665 IActivityContainerCallback callback) throws RemoteException {
4666 Parcel data = Parcel.obtain();
4667 Parcel reply = Parcel.obtain();
4668 data.writeInterfaceToken(IActivityManager.descriptor);
4669 data.writeStrongBinder(parentActivityToken);
4670 data.writeStrongBinder((IBinder)callback);
4671 mRemote.transact(CREATE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
4672 reply.readException();
4673 IActivityContainer res =
4674 IActivityContainer.Stub.asInterface(reply.readStrongBinder());
4675 data.recycle();
4676 reply.recycle();
4677 return res;
4678 }
4679
Craig Mautnere0a38842013-12-16 16:14:02 -08004680 public IActivityContainer getEnclosingActivityContainer(IBinder activityToken)
4681 throws RemoteException {
4682 Parcel data = Parcel.obtain();
4683 Parcel reply = Parcel.obtain();
4684 data.writeInterfaceToken(IActivityManager.descriptor);
4685 data.writeStrongBinder(activityToken);
4686 mRemote.transact(GET_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
4687 reply.readException();
4688 IActivityContainer res =
4689 IActivityContainer.Stub.asInterface(reply.readStrongBinder());
4690 data.recycle();
4691 reply.recycle();
4692 return res;
4693 }
4694
Craig Mautner4a1cb222013-12-04 16:14:06 -08004695 public IBinder getHomeActivityToken() throws RemoteException {
4696 Parcel data = Parcel.obtain();
4697 Parcel reply = Parcel.obtain();
4698 data.writeInterfaceToken(IActivityManager.descriptor);
4699 mRemote.transact(GET_HOME_ACTIVITY_TOKEN_TRANSACTION, data, reply, 0);
4700 reply.readException();
4701 IBinder res = reply.readStrongBinder();
4702 data.recycle();
4703 reply.recycle();
4704 return res;
4705 }
4706
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004707 private IBinder mRemote;
4708}