blob: 6ec48e5205f726370410033a810b4f7e91c09445 [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;
Jeff Hao1b012d32014-08-20 10:35:34 -070020import android.app.ProfilerInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080021import android.content.ComponentName;
Adam Powelldd8fab22012-03-22 17:47:27 -070022import android.content.IIntentReceiver;
23import android.content.IIntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080024import android.content.Intent;
25import android.content.IntentFilter;
Dianne Hackbornfa82f222009-09-17 15:14:12 -070026import android.content.IntentSender;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070027import android.content.UriPermission;
Christopher Tate181fafa2009-05-14 11:12:14 -070028import android.content.pm.ApplicationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080029import android.content.pm.ConfigurationInfo;
30import android.content.pm.IPackageDataObserver;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070031import android.content.pm.ParceledListSlice;
Amith Yamasani52f1d752012-03-28 18:19:29 -070032import android.content.pm.UserInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080033import android.content.res.Configuration;
Dianne Hackbornaec68bb2014-08-20 15:25:13 -070034import android.graphics.Bitmap;
35import android.graphics.Point;
Craig Mautnerbdc748af2013-12-02 14:08:25 -080036import android.graphics.Rect;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080037import android.net.Uri;
38import android.os.Binder;
39import android.os.Bundle;
Dianne Hackborn3025ef32009-08-31 21:31:47 -070040import android.os.Debug;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080041import android.os.IBinder;
42import android.os.Parcel;
Adam Powelldd8fab22012-03-22 17:47:27 -070043import android.os.ParcelFileDescriptor;
44import android.os.Parcelable;
Craig Mautnera0026042014-04-23 11:45:37 -070045import android.os.PersistableBundle;
Adam Powelldd8fab22012-03-22 17:47:27 -070046import android.os.RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080047import android.os.ServiceManager;
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -070048import android.os.StrictMode;
Dianne Hackborn91097de2014-04-04 18:02:06 -070049import android.service.voice.IVoiceInteractionSession;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080050import android.text.TextUtils;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080051import android.util.Log;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080052import android.util.Singleton;
Dianne Hackborn91097de2014-04-04 18:02:06 -070053import com.android.internal.app.IVoiceInteractor;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080054
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080055import java.util.ArrayList;
56import java.util.List;
57
58/** {@hide} */
59public abstract class ActivityManagerNative extends Binder implements IActivityManager
60{
61 /**
62 * Cast a Binder object into an activity manager interface, generating
63 * a proxy if needed.
64 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080065 static public IActivityManager asInterface(IBinder obj) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080066 if (obj == null) {
67 return null;
68 }
69 IActivityManager in =
70 (IActivityManager)obj.queryLocalInterface(descriptor);
71 if (in != null) {
72 return in;
73 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080074
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080075 return new ActivityManagerProxy(obj);
76 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080077
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080078 /**
79 * Retrieve the system's default/global activity manager.
80 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080081 static public IActivityManager getDefault() {
82 return gDefault.get();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080083 }
84
85 /**
86 * Convenience for checking whether the system is ready. For internal use only.
87 */
88 static public boolean isSystemReady() {
89 if (!sSystemReady) {
90 sSystemReady = getDefault().testIsSystemReady();
91 }
92 return sSystemReady;
93 }
94 static boolean sSystemReady = false;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080095
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080096 /**
97 * Convenience for sending a sticky broadcast. For internal use only.
98 * If you don't care about permission, use null.
99 */
Dianne Hackborn5ac72a22012-08-29 18:32:08 -0700100 static public void broadcastStickyIntent(Intent intent, String permission, int userId) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800101 try {
102 getDefault().broadcastIntent(
103 null, intent, null, null, Activity.RESULT_OK, null, null,
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800104 null /*permission*/, AppOpsManager.OP_NONE, false, true, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800105 } catch (RemoteException ex) {
106 }
107 }
108
Dianne Hackborn099bc622014-01-22 13:39:16 -0800109 static public void noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800110 try {
Dianne Hackborn099bc622014-01-22 13:39:16 -0800111 getDefault().noteWakeupAlarm(ps.getTarget(), sourceUid, sourcePkg);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800112 } catch (RemoteException ex) {
113 }
114 }
115
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -0800116 public ActivityManagerNative() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800117 attachInterface(this, descriptor);
118 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700119
120 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800121 public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
122 throws RemoteException {
123 switch (code) {
124 case START_ACTIVITY_TRANSACTION:
125 {
126 data.enforceInterface(IActivityManager.descriptor);
127 IBinder b = data.readStrongBinder();
128 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800129 String callingPackage = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800130 Intent intent = Intent.CREATOR.createFromParcel(data);
131 String resolvedType = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800132 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800133 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800134 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700135 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700136 ProfilerInfo profilerInfo = data.readInt() != 0
137 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700138 Bundle options = data.readInt() != 0
139 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800140 int result = startActivity(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700141 resultTo, resultWho, requestCode, startFlags, profilerInfo, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800142 reply.writeNoException();
143 reply.writeInt(result);
144 return true;
145 }
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700146
Amith Yamasani82644082012-08-03 13:09:11 -0700147 case START_ACTIVITY_AS_USER_TRANSACTION:
148 {
149 data.enforceInterface(IActivityManager.descriptor);
150 IBinder b = data.readStrongBinder();
151 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800152 String callingPackage = data.readString();
Amith Yamasani82644082012-08-03 13:09:11 -0700153 Intent intent = Intent.CREATOR.createFromParcel(data);
154 String resolvedType = data.readString();
155 IBinder resultTo = data.readStrongBinder();
156 String resultWho = data.readString();
157 int requestCode = data.readInt();
158 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700159 ProfilerInfo profilerInfo = data.readInt() != 0
160 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Amith Yamasani82644082012-08-03 13:09:11 -0700161 Bundle options = data.readInt() != 0
162 ? Bundle.CREATOR.createFromParcel(data) : null;
163 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800164 int result = startActivityAsUser(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700165 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Amith Yamasani82644082012-08-03 13:09:11 -0700166 reply.writeNoException();
167 reply.writeInt(result);
168 return true;
169 }
170
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700171 case START_ACTIVITY_AS_CALLER_TRANSACTION:
172 {
173 data.enforceInterface(IActivityManager.descriptor);
174 IBinder b = data.readStrongBinder();
175 IApplicationThread app = ApplicationThreadNative.asInterface(b);
176 String callingPackage = data.readString();
177 Intent intent = Intent.CREATOR.createFromParcel(data);
178 String resolvedType = data.readString();
179 IBinder resultTo = data.readStrongBinder();
180 String resultWho = data.readString();
181 int requestCode = data.readInt();
182 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700183 ProfilerInfo profilerInfo = data.readInt() != 0
184 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700185 Bundle options = data.readInt() != 0
186 ? Bundle.CREATOR.createFromParcel(data) : null;
Jeff Sharkey97978802014-10-14 10:48:18 -0700187 int userId = data.readInt();
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700188 int result = startActivityAsCaller(app, callingPackage, intent, resolvedType,
Jeff Sharkey97978802014-10-14 10:48:18 -0700189 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700190 reply.writeNoException();
191 reply.writeInt(result);
192 return true;
193 }
194
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800195 case START_ACTIVITY_AND_WAIT_TRANSACTION:
196 {
197 data.enforceInterface(IActivityManager.descriptor);
198 IBinder b = data.readStrongBinder();
199 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800200 String callingPackage = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800201 Intent intent = Intent.CREATOR.createFromParcel(data);
202 String resolvedType = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800203 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800204 String resultWho = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800205 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700206 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700207 ProfilerInfo profilerInfo = data.readInt() != 0
208 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700209 Bundle options = data.readInt() != 0
210 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -0700211 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800212 WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700213 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800214 reply.writeNoException();
215 result.writeToParcel(reply, 0);
216 return true;
217 }
218
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700219 case START_ACTIVITY_WITH_CONFIG_TRANSACTION:
220 {
221 data.enforceInterface(IActivityManager.descriptor);
222 IBinder b = data.readStrongBinder();
223 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800224 String callingPackage = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700225 Intent intent = Intent.CREATOR.createFromParcel(data);
226 String resolvedType = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700227 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700228 String resultWho = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700229 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700230 int startFlags = data.readInt();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700231 Configuration config = Configuration.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700232 Bundle options = data.readInt() != 0
233 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -0700234 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800235 int result = startActivityWithConfig(app, callingPackage, intent, resolvedType,
Dianne Hackborn41203752012-08-31 14:05:51 -0700236 resultTo, resultWho, requestCode, startFlags, config, options, userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700237 reply.writeNoException();
238 reply.writeInt(result);
239 return true;
240 }
241
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700242 case START_ACTIVITY_INTENT_SENDER_TRANSACTION:
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700243 {
244 data.enforceInterface(IActivityManager.descriptor);
245 IBinder b = data.readStrongBinder();
246 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700247 IntentSender intent = IntentSender.CREATOR.createFromParcel(data);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700248 Intent fillInIntent = null;
249 if (data.readInt() != 0) {
250 fillInIntent = Intent.CREATOR.createFromParcel(data);
251 }
252 String resolvedType = data.readString();
253 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700254 String resultWho = data.readString();
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700255 int requestCode = data.readInt();
256 int flagsMask = data.readInt();
257 int flagsValues = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700258 Bundle options = data.readInt() != 0
259 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700260 int result = startActivityIntentSender(app, intent,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700261 fillInIntent, resolvedType, resultTo, resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700262 requestCode, flagsMask, flagsValues, options);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700263 reply.writeNoException();
264 reply.writeInt(result);
265 return true;
266 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700267
Dianne Hackborn91097de2014-04-04 18:02:06 -0700268 case START_VOICE_ACTIVITY_TRANSACTION:
269 {
270 data.enforceInterface(IActivityManager.descriptor);
271 String callingPackage = data.readString();
272 int callingPid = data.readInt();
273 int callingUid = data.readInt();
274 Intent intent = Intent.CREATOR.createFromParcel(data);
275 String resolvedType = data.readString();
276 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
277 data.readStrongBinder());
278 IVoiceInteractor interactor = IVoiceInteractor.Stub.asInterface(
279 data.readStrongBinder());
280 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700281 ProfilerInfo profilerInfo = data.readInt() != 0
282 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborn91097de2014-04-04 18:02:06 -0700283 Bundle options = data.readInt() != 0
284 ? Bundle.CREATOR.createFromParcel(data) : null;
285 int userId = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700286 int result = startVoiceActivity(callingPackage, callingPid, callingUid, intent,
287 resolvedType, session, interactor, startFlags, profilerInfo, options, userId);
Dianne Hackborn91097de2014-04-04 18:02:06 -0700288 reply.writeNoException();
289 reply.writeInt(result);
290 return true;
291 }
292
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800293 case START_NEXT_MATCHING_ACTIVITY_TRANSACTION:
294 {
295 data.enforceInterface(IActivityManager.descriptor);
296 IBinder callingActivity = data.readStrongBinder();
297 Intent intent = Intent.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700298 Bundle options = data.readInt() != 0
299 ? Bundle.CREATOR.createFromParcel(data) : null;
300 boolean result = startNextMatchingActivity(callingActivity, intent, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800301 reply.writeNoException();
302 reply.writeInt(result ? 1 : 0);
303 return true;
304 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700305
Craig Mautnerdc00cbe2014-07-20 17:48:47 -0700306 case START_ACTIVITY_FROM_RECENTS_TRANSACTION:
307 {
308 data.enforceInterface(IActivityManager.descriptor);
309 int taskId = data.readInt();
310 Bundle options = data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data);
311 int result = startActivityFromRecents(taskId, options);
312 reply.writeNoException();
313 reply.writeInt(result);
314 return true;
315 }
316
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800317 case FINISH_ACTIVITY_TRANSACTION: {
318 data.enforceInterface(IActivityManager.descriptor);
319 IBinder token = data.readStrongBinder();
320 Intent resultData = null;
321 int resultCode = data.readInt();
322 if (data.readInt() != 0) {
323 resultData = Intent.CREATOR.createFromParcel(data);
324 }
Winson Chung3b3f4642014-04-22 10:08:18 -0700325 boolean finishTask = (data.readInt() != 0);
326 boolean res = finishActivity(token, resultCode, resultData, finishTask);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800327 reply.writeNoException();
328 reply.writeInt(res ? 1 : 0);
329 return true;
330 }
331
332 case FINISH_SUB_ACTIVITY_TRANSACTION: {
333 data.enforceInterface(IActivityManager.descriptor);
334 IBinder token = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700335 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800336 int requestCode = data.readInt();
337 finishSubActivity(token, resultWho, requestCode);
338 reply.writeNoException();
339 return true;
340 }
341
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700342 case FINISH_ACTIVITY_AFFINITY_TRANSACTION: {
343 data.enforceInterface(IActivityManager.descriptor);
344 IBinder token = data.readStrongBinder();
345 boolean res = finishActivityAffinity(token);
346 reply.writeNoException();
347 reply.writeInt(res ? 1 : 0);
348 return true;
349 }
350
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -0700351 case FINISH_VOICE_TASK_TRANSACTION: {
352 data.enforceInterface(IActivityManager.descriptor);
353 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
354 data.readStrongBinder());
355 finishVoiceTask(session);
356 reply.writeNoException();
357 return true;
358 }
359
Dianne Hackborn89ad4562014-08-24 16:45:38 -0700360 case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: {
361 data.enforceInterface(IActivityManager.descriptor);
362 IBinder token = data.readStrongBinder();
363 boolean res = releaseActivityInstance(token);
364 reply.writeNoException();
365 reply.writeInt(res ? 1 : 0);
366 return true;
367 }
368
369 case RELEASE_SOME_ACTIVITIES_TRANSACTION: {
370 data.enforceInterface(IActivityManager.descriptor);
371 IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder());
372 releaseSomeActivities(app);
373 reply.writeNoException();
374 return true;
375 }
376
Dianne Hackborn061d58a2010-03-12 15:07:06 -0800377 case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: {
378 data.enforceInterface(IActivityManager.descriptor);
379 IBinder token = data.readStrongBinder();
380 boolean res = willActivityBeVisible(token);
381 reply.writeNoException();
382 reply.writeInt(res ? 1 : 0);
383 return true;
384 }
385
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800386 case REGISTER_RECEIVER_TRANSACTION:
387 {
388 data.enforceInterface(IActivityManager.descriptor);
389 IBinder b = data.readStrongBinder();
390 IApplicationThread app =
391 b != null ? ApplicationThreadNative.asInterface(b) : null;
Dianne Hackborn6c418d52011-06-29 14:05:33 -0700392 String packageName = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800393 b = data.readStrongBinder();
394 IIntentReceiver rec
395 = b != null ? IIntentReceiver.Stub.asInterface(b) : null;
396 IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data);
397 String perm = data.readString();
Dianne Hackborn20e80982012-08-31 19:00:44 -0700398 int userId = data.readInt();
399 Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800400 reply.writeNoException();
401 if (intent != null) {
402 reply.writeInt(1);
403 intent.writeToParcel(reply, 0);
404 } else {
405 reply.writeInt(0);
406 }
407 return true;
408 }
409
410 case UNREGISTER_RECEIVER_TRANSACTION:
411 {
412 data.enforceInterface(IActivityManager.descriptor);
413 IBinder b = data.readStrongBinder();
414 if (b == null) {
415 return true;
416 }
417 IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b);
418 unregisterReceiver(rec);
419 reply.writeNoException();
420 return true;
421 }
422
423 case BROADCAST_INTENT_TRANSACTION:
424 {
425 data.enforceInterface(IActivityManager.descriptor);
426 IBinder b = data.readStrongBinder();
427 IApplicationThread app =
428 b != null ? ApplicationThreadNative.asInterface(b) : null;
429 Intent intent = Intent.CREATOR.createFromParcel(data);
430 String resolvedType = data.readString();
431 b = data.readStrongBinder();
432 IIntentReceiver resultTo =
433 b != null ? IIntentReceiver.Stub.asInterface(b) : null;
434 int resultCode = data.readInt();
435 String resultData = data.readString();
436 Bundle resultExtras = data.readBundle();
437 String perm = data.readString();
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800438 int appOp = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800439 boolean serialized = data.readInt() != 0;
440 boolean sticky = data.readInt() != 0;
Amith Yamasani742a6712011-05-04 14:49:28 -0700441 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800442 int res = broadcastIntent(app, intent, resolvedType, resultTo,
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800443 resultCode, resultData, resultExtras, perm, appOp,
Amith Yamasani742a6712011-05-04 14:49:28 -0700444 serialized, sticky, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800445 reply.writeNoException();
446 reply.writeInt(res);
447 return true;
448 }
449
450 case UNBROADCAST_INTENT_TRANSACTION:
451 {
452 data.enforceInterface(IActivityManager.descriptor);
453 IBinder b = data.readStrongBinder();
454 IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null;
455 Intent intent = Intent.CREATOR.createFromParcel(data);
Amith Yamasani742a6712011-05-04 14:49:28 -0700456 int userId = data.readInt();
457 unbroadcastIntent(app, intent, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800458 reply.writeNoException();
459 return true;
460 }
461
462 case FINISH_RECEIVER_TRANSACTION: {
463 data.enforceInterface(IActivityManager.descriptor);
464 IBinder who = data.readStrongBinder();
465 int resultCode = data.readInt();
466 String resultData = data.readString();
467 Bundle resultExtras = data.readBundle();
468 boolean resultAbort = data.readInt() != 0;
469 if (who != null) {
470 finishReceiver(who, resultCode, resultData, resultExtras, resultAbort);
471 }
472 reply.writeNoException();
473 return true;
474 }
475
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800476 case ATTACH_APPLICATION_TRANSACTION: {
477 data.enforceInterface(IActivityManager.descriptor);
478 IApplicationThread app = ApplicationThreadNative.asInterface(
479 data.readStrongBinder());
480 if (app != null) {
481 attachApplication(app);
482 }
483 reply.writeNoException();
484 return true;
485 }
486
487 case ACTIVITY_IDLE_TRANSACTION: {
488 data.enforceInterface(IActivityManager.descriptor);
489 IBinder token = data.readStrongBinder();
Dianne Hackborne88846e2009-09-30 21:34:25 -0700490 Configuration config = null;
491 if (data.readInt() != 0) {
492 config = Configuration.CREATOR.createFromParcel(data);
493 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700494 boolean stopProfiling = data.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800495 if (token != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700496 activityIdle(token, config, stopProfiling);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800497 }
498 reply.writeNoException();
499 return true;
500 }
501
Dianne Hackbornad9b32112012-09-17 15:35:01 -0700502 case ACTIVITY_RESUMED_TRANSACTION: {
503 data.enforceInterface(IActivityManager.descriptor);
504 IBinder token = data.readStrongBinder();
505 activityResumed(token);
506 reply.writeNoException();
507 return true;
508 }
509
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800510 case ACTIVITY_PAUSED_TRANSACTION: {
511 data.enforceInterface(IActivityManager.descriptor);
512 IBinder token = data.readStrongBinder();
Dianne Hackborna4e102e2014-09-04 22:52:27 -0700513 activityPaused(token);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800514 reply.writeNoException();
515 return true;
516 }
517
518 case ACTIVITY_STOPPED_TRANSACTION: {
519 data.enforceInterface(IActivityManager.descriptor);
520 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800521 Bundle map = data.readBundle();
Craig Mautnera0026042014-04-23 11:45:37 -0700522 PersistableBundle persistentState = data.readPersistableBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800523 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
Craig Mautnera0026042014-04-23 11:45:37 -0700524 activityStopped(token, map, persistentState, description);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800525 reply.writeNoException();
526 return true;
527 }
528
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800529 case ACTIVITY_SLEPT_TRANSACTION: {
530 data.enforceInterface(IActivityManager.descriptor);
531 IBinder token = data.readStrongBinder();
532 activitySlept(token);
533 reply.writeNoException();
534 return true;
535 }
536
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800537 case ACTIVITY_DESTROYED_TRANSACTION: {
538 data.enforceInterface(IActivityManager.descriptor);
539 IBinder token = data.readStrongBinder();
540 activityDestroyed(token);
541 reply.writeNoException();
542 return true;
543 }
544
545 case GET_CALLING_PACKAGE_TRANSACTION: {
546 data.enforceInterface(IActivityManager.descriptor);
547 IBinder token = data.readStrongBinder();
548 String res = token != null ? getCallingPackage(token) : null;
549 reply.writeNoException();
550 reply.writeString(res);
551 return true;
552 }
553
554 case GET_CALLING_ACTIVITY_TRANSACTION: {
555 data.enforceInterface(IActivityManager.descriptor);
556 IBinder token = data.readStrongBinder();
557 ComponentName cn = getCallingActivity(token);
558 reply.writeNoException();
559 ComponentName.writeToParcel(cn, reply);
560 return true;
561 }
562
Winson Chung1147c402014-05-14 11:05:00 -0700563 case GET_APP_TASKS_TRANSACTION: {
564 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -0700565 String callingPackage = data.readString();
566 List<IAppTask> list = getAppTasks(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -0700567 reply.writeNoException();
568 int N = list != null ? list.size() : -1;
569 reply.writeInt(N);
570 int i;
571 for (i=0; i<N; i++) {
572 IAppTask task = list.get(i);
573 reply.writeStrongBinder(task.asBinder());
574 }
575 return true;
576 }
577
Dianne Hackbornaec68bb2014-08-20 15:25:13 -0700578 case ADD_APP_TASK_TRANSACTION: {
579 data.enforceInterface(IActivityManager.descriptor);
580 IBinder activityToken = data.readStrongBinder();
581 Intent intent = Intent.CREATOR.createFromParcel(data);
582 ActivityManager.TaskDescription descr
583 = ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
584 Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data);
585 int res = addAppTask(activityToken, intent, descr, thumbnail);
586 reply.writeNoException();
587 reply.writeInt(res);
588 return true;
589 }
590
591 case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: {
592 data.enforceInterface(IActivityManager.descriptor);
593 Point size = getAppTaskThumbnailSize();
594 reply.writeNoException();
595 size.writeToParcel(reply, 0);
596 return true;
597 }
598
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800599 case GET_TASKS_TRANSACTION: {
600 data.enforceInterface(IActivityManager.descriptor);
601 int maxNum = data.readInt();
602 int fl = data.readInt();
Dianne Hackborn09233282014-04-30 11:33:59 -0700603 List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800604 reply.writeNoException();
605 int N = list != null ? list.size() : -1;
606 reply.writeInt(N);
607 int i;
608 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700609 ActivityManager.RunningTaskInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800610 info.writeToParcel(reply, 0);
611 }
612 return true;
613 }
614
615 case GET_RECENT_TASKS_TRANSACTION: {
616 data.enforceInterface(IActivityManager.descriptor);
617 int maxNum = data.readInt();
618 int fl = data.readInt();
Amith Yamasani82644082012-08-03 13:09:11 -0700619 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800620 List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -0700621 fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800622 reply.writeNoException();
623 reply.writeTypedList(list);
624 return true;
625 }
Dianne Hackborn15491c62012-09-19 10:59:14 -0700626
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700627 case GET_TASK_THUMBNAIL_TRANSACTION: {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800628 data.enforceInterface(IActivityManager.descriptor);
629 int id = data.readInt();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700630 ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id);
Dianne Hackbornd94df452011-02-16 18:53:31 -0800631 reply.writeNoException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700632 if (taskThumbnail != null) {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800633 reply.writeInt(1);
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700634 taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn15491c62012-09-19 10:59:14 -0700635 } else {
636 reply.writeInt(0);
637 }
638 return true;
639 }
640
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800641 case GET_SERVICES_TRANSACTION: {
642 data.enforceInterface(IActivityManager.descriptor);
643 int maxNum = data.readInt();
644 int fl = data.readInt();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700645 List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800646 reply.writeNoException();
647 int N = list != null ? list.size() : -1;
648 reply.writeInt(N);
649 int i;
650 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700651 ActivityManager.RunningServiceInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800652 info.writeToParcel(reply, 0);
653 }
654 return true;
655 }
656
657 case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: {
658 data.enforceInterface(IActivityManager.descriptor);
659 List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState();
660 reply.writeNoException();
661 reply.writeTypedList(list);
662 return true;
663 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700664
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800665 case GET_RUNNING_APP_PROCESSES_TRANSACTION: {
666 data.enforceInterface(IActivityManager.descriptor);
667 List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses();
668 reply.writeNoException();
669 reply.writeTypedList(list);
670 return true;
671 }
672
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -0700673 case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: {
674 data.enforceInterface(IActivityManager.descriptor);
675 List<ApplicationInfo> list = getRunningExternalApplications();
676 reply.writeNoException();
677 reply.writeTypedList(list);
678 return true;
679 }
680
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800681 case MOVE_TASK_TO_FRONT_TRANSACTION: {
682 data.enforceInterface(IActivityManager.descriptor);
683 int task = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800684 int fl = data.readInt();
Dianne Hackborn8078d8c2012-03-20 11:11:26 -0700685 Bundle options = data.readInt() != 0
686 ? Bundle.CREATOR.createFromParcel(data) : null;
687 moveTaskToFront(task, fl, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800688 reply.writeNoException();
689 return true;
690 }
691
692 case MOVE_TASK_TO_BACK_TRANSACTION: {
693 data.enforceInterface(IActivityManager.descriptor);
694 int task = data.readInt();
695 moveTaskToBack(task);
696 reply.writeNoException();
697 return true;
698 }
699
700 case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: {
701 data.enforceInterface(IActivityManager.descriptor);
702 IBinder token = data.readStrongBinder();
703 boolean nonRoot = data.readInt() != 0;
704 boolean res = moveActivityTaskToBack(token, nonRoot);
705 reply.writeNoException();
706 reply.writeInt(res ? 1 : 0);
707 return true;
708 }
709
710 case MOVE_TASK_BACKWARDS_TRANSACTION: {
711 data.enforceInterface(IActivityManager.descriptor);
712 int task = data.readInt();
713 moveTaskBackwards(task);
714 reply.writeNoException();
715 return true;
716 }
717
Craig Mautnerc00204b2013-03-05 15:02:14 -0800718 case MOVE_TASK_TO_STACK_TRANSACTION: {
719 data.enforceInterface(IActivityManager.descriptor);
720 int taskId = data.readInt();
721 int stackId = data.readInt();
722 boolean toTop = data.readInt() != 0;
723 moveTaskToStack(taskId, stackId, toTop);
724 reply.writeNoException();
725 return true;
726 }
727
728 case RESIZE_STACK_TRANSACTION: {
729 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800730 int stackId = data.readInt();
Craig Mautnerc00204b2013-03-05 15:02:14 -0800731 float weight = data.readFloat();
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800732 Rect r = Rect.CREATOR.createFromParcel(data);
733 resizeStack(stackId, r);
Craig Mautnerc00204b2013-03-05 15:02:14 -0800734 reply.writeNoException();
735 return true;
736 }
737
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800738 case GET_ALL_STACK_INFOS_TRANSACTION: {
Craig Mautner5ff12102013-05-24 12:50:15 -0700739 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800740 List<StackInfo> list = getAllStackInfos();
Craig Mautner5ff12102013-05-24 12:50:15 -0700741 reply.writeNoException();
742 reply.writeTypedList(list);
743 return true;
744 }
745
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800746 case GET_STACK_INFO_TRANSACTION: {
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700747 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800748 int stackId = data.readInt();
749 StackInfo info = getStackInfo(stackId);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700750 reply.writeNoException();
751 if (info != null) {
752 reply.writeInt(1);
753 info.writeToParcel(reply, 0);
754 } else {
755 reply.writeInt(0);
756 }
757 return true;
758 }
759
Winson Chung303e1ff2014-03-07 15:06:19 -0800760 case IS_IN_HOME_STACK_TRANSACTION: {
761 data.enforceInterface(IActivityManager.descriptor);
762 int taskId = data.readInt();
763 boolean isInHomeStack = isInHomeStack(taskId);
764 reply.writeNoException();
765 reply.writeInt(isInHomeStack ? 1 : 0);
766 return true;
767 }
768
Craig Mautnercf910b02013-04-23 11:23:27 -0700769 case SET_FOCUSED_STACK_TRANSACTION: {
770 data.enforceInterface(IActivityManager.descriptor);
771 int stackId = data.readInt();
772 setFocusedStack(stackId);
773 reply.writeNoException();
774 return true;
775 }
776
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800777 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
778 data.enforceInterface(IActivityManager.descriptor);
779 IBinder token = data.readStrongBinder();
780 boolean onlyRoot = data.readInt() != 0;
781 int res = token != null
782 ? getTaskForActivity(token, onlyRoot) : -1;
783 reply.writeNoException();
784 reply.writeInt(res);
785 return true;
786 }
787
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800788 case GET_CONTENT_PROVIDER_TRANSACTION: {
789 data.enforceInterface(IActivityManager.descriptor);
790 IBinder b = data.readStrongBinder();
791 IApplicationThread app = ApplicationThreadNative.asInterface(b);
792 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700793 int userId = data.readInt();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700794 boolean stable = data.readInt() != 0;
Jeff Sharkey6d515712012-09-20 16:06:08 -0700795 ContentProviderHolder cph = getContentProvider(app, name, userId, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800796 reply.writeNoException();
797 if (cph != null) {
798 reply.writeInt(1);
799 cph.writeToParcel(reply, 0);
800 } else {
801 reply.writeInt(0);
802 }
803 return true;
804 }
805
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800806 case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
807 data.enforceInterface(IActivityManager.descriptor);
808 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700809 int userId = data.readInt();
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800810 IBinder token = data.readStrongBinder();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700811 ContentProviderHolder cph = getContentProviderExternal(name, userId, token);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800812 reply.writeNoException();
813 if (cph != null) {
814 reply.writeInt(1);
815 cph.writeToParcel(reply, 0);
816 } else {
817 reply.writeInt(0);
818 }
819 return true;
820 }
821
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800822 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
823 data.enforceInterface(IActivityManager.descriptor);
824 IBinder b = data.readStrongBinder();
825 IApplicationThread app = ApplicationThreadNative.asInterface(b);
826 ArrayList<ContentProviderHolder> providers =
827 data.createTypedArrayList(ContentProviderHolder.CREATOR);
828 publishContentProviders(app, providers);
829 reply.writeNoException();
830 return true;
831 }
832
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700833 case REF_CONTENT_PROVIDER_TRANSACTION: {
834 data.enforceInterface(IActivityManager.descriptor);
835 IBinder b = data.readStrongBinder();
836 int stable = data.readInt();
837 int unstable = data.readInt();
838 boolean res = refContentProvider(b, stable, unstable);
839 reply.writeNoException();
840 reply.writeInt(res ? 1 : 0);
841 return true;
842 }
843
844 case UNSTABLE_PROVIDER_DIED_TRANSACTION: {
845 data.enforceInterface(IActivityManager.descriptor);
846 IBinder b = data.readStrongBinder();
847 unstableProviderDied(b);
848 reply.writeNoException();
849 return true;
850 }
851
Jeff Sharkey7aa76012013-09-30 14:26:27 -0700852 case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: {
853 data.enforceInterface(IActivityManager.descriptor);
854 IBinder b = data.readStrongBinder();
855 appNotRespondingViaProvider(b);
856 reply.writeNoException();
857 return true;
858 }
859
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800860 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
861 data.enforceInterface(IActivityManager.descriptor);
862 IBinder b = data.readStrongBinder();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700863 boolean stable = data.readInt() != 0;
864 removeContentProvider(b, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800865 reply.writeNoException();
866 return true;
867 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800868
869 case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
870 data.enforceInterface(IActivityManager.descriptor);
871 String name = data.readString();
872 IBinder token = data.readStrongBinder();
873 removeContentProviderExternal(name, token);
874 reply.writeNoException();
875 return true;
876 }
877
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700878 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
879 data.enforceInterface(IActivityManager.descriptor);
880 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
881 PendingIntent pi = getRunningServiceControlPanel(comp);
882 reply.writeNoException();
883 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
884 return true;
885 }
886
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800887 case START_SERVICE_TRANSACTION: {
888 data.enforceInterface(IActivityManager.descriptor);
889 IBinder b = data.readStrongBinder();
890 IApplicationThread app = ApplicationThreadNative.asInterface(b);
891 Intent service = Intent.CREATOR.createFromParcel(data);
892 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700893 int userId = data.readInt();
894 ComponentName cn = startService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800895 reply.writeNoException();
896 ComponentName.writeToParcel(cn, reply);
897 return true;
898 }
899
900 case STOP_SERVICE_TRANSACTION: {
901 data.enforceInterface(IActivityManager.descriptor);
902 IBinder b = data.readStrongBinder();
903 IApplicationThread app = ApplicationThreadNative.asInterface(b);
904 Intent service = Intent.CREATOR.createFromParcel(data);
905 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700906 int userId = data.readInt();
907 int res = stopService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800908 reply.writeNoException();
909 reply.writeInt(res);
910 return true;
911 }
912
913 case STOP_SERVICE_TOKEN_TRANSACTION: {
914 data.enforceInterface(IActivityManager.descriptor);
915 ComponentName className = ComponentName.readFromParcel(data);
916 IBinder token = data.readStrongBinder();
917 int startId = data.readInt();
918 boolean res = stopServiceToken(className, token, startId);
919 reply.writeNoException();
920 reply.writeInt(res ? 1 : 0);
921 return true;
922 }
923
924 case SET_SERVICE_FOREGROUND_TRANSACTION: {
925 data.enforceInterface(IActivityManager.descriptor);
926 ComponentName className = ComponentName.readFromParcel(data);
927 IBinder token = data.readStrongBinder();
Dianne Hackbornd8a43f62009-08-17 23:33:56 -0700928 int id = data.readInt();
929 Notification notification = null;
930 if (data.readInt() != 0) {
931 notification = Notification.CREATOR.createFromParcel(data);
932 }
933 boolean removeNotification = data.readInt() != 0;
934 setServiceForeground(className, token, id, notification, removeNotification);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800935 reply.writeNoException();
936 return true;
937 }
938
939 case BIND_SERVICE_TRANSACTION: {
940 data.enforceInterface(IActivityManager.descriptor);
941 IBinder b = data.readStrongBinder();
942 IApplicationThread app = ApplicationThreadNative.asInterface(b);
943 IBinder token = data.readStrongBinder();
944 Intent service = Intent.CREATOR.createFromParcel(data);
945 String resolvedType = data.readString();
946 b = data.readStrongBinder();
947 int fl = data.readInt();
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800948 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800949 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800950 int res = bindService(app, token, service, resolvedType, conn, fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800951 reply.writeNoException();
952 reply.writeInt(res);
953 return true;
954 }
955
956 case UNBIND_SERVICE_TRANSACTION: {
957 data.enforceInterface(IActivityManager.descriptor);
958 IBinder b = data.readStrongBinder();
959 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
960 boolean res = unbindService(conn);
961 reply.writeNoException();
962 reply.writeInt(res ? 1 : 0);
963 return true;
964 }
965
966 case PUBLISH_SERVICE_TRANSACTION: {
967 data.enforceInterface(IActivityManager.descriptor);
968 IBinder token = data.readStrongBinder();
969 Intent intent = Intent.CREATOR.createFromParcel(data);
970 IBinder service = data.readStrongBinder();
971 publishService(token, intent, service);
972 reply.writeNoException();
973 return true;
974 }
975
976 case UNBIND_FINISHED_TRANSACTION: {
977 data.enforceInterface(IActivityManager.descriptor);
978 IBinder token = data.readStrongBinder();
979 Intent intent = Intent.CREATOR.createFromParcel(data);
980 boolean doRebind = data.readInt() != 0;
981 unbindFinished(token, intent, doRebind);
982 reply.writeNoException();
983 return true;
984 }
985
986 case SERVICE_DONE_EXECUTING_TRANSACTION: {
987 data.enforceInterface(IActivityManager.descriptor);
988 IBinder token = data.readStrongBinder();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -0700989 int type = data.readInt();
990 int startId = data.readInt();
991 int res = data.readInt();
992 serviceDoneExecuting(token, type, startId, res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800993 reply.writeNoException();
994 return true;
995 }
996
997 case START_INSTRUMENTATION_TRANSACTION: {
998 data.enforceInterface(IActivityManager.descriptor);
999 ComponentName className = ComponentName.readFromParcel(data);
1000 String profileFile = data.readString();
1001 int fl = data.readInt();
1002 Bundle arguments = data.readBundle();
1003 IBinder b = data.readStrongBinder();
1004 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08001005 b = data.readStrongBinder();
1006 IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001007 int userId = data.readInt();
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01001008 String abiOverride = data.readString();
1009 boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId,
1010 abiOverride);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001011 reply.writeNoException();
1012 reply.writeInt(res ? 1 : 0);
1013 return true;
1014 }
1015
1016
1017 case FINISH_INSTRUMENTATION_TRANSACTION: {
1018 data.enforceInterface(IActivityManager.descriptor);
1019 IBinder b = data.readStrongBinder();
1020 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1021 int resultCode = data.readInt();
1022 Bundle results = data.readBundle();
1023 finishInstrumentation(app, resultCode, results);
1024 reply.writeNoException();
1025 return true;
1026 }
1027
1028 case GET_CONFIGURATION_TRANSACTION: {
1029 data.enforceInterface(IActivityManager.descriptor);
1030 Configuration config = getConfiguration();
1031 reply.writeNoException();
1032 config.writeToParcel(reply, 0);
1033 return true;
1034 }
1035
1036 case UPDATE_CONFIGURATION_TRANSACTION: {
1037 data.enforceInterface(IActivityManager.descriptor);
1038 Configuration config = Configuration.CREATOR.createFromParcel(data);
1039 updateConfiguration(config);
1040 reply.writeNoException();
1041 return true;
1042 }
1043
1044 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
1045 data.enforceInterface(IActivityManager.descriptor);
1046 IBinder token = data.readStrongBinder();
1047 int requestedOrientation = data.readInt();
1048 setRequestedOrientation(token, requestedOrientation);
1049 reply.writeNoException();
1050 return true;
1051 }
1052
1053 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
1054 data.enforceInterface(IActivityManager.descriptor);
1055 IBinder token = data.readStrongBinder();
1056 int req = getRequestedOrientation(token);
1057 reply.writeNoException();
1058 reply.writeInt(req);
1059 return true;
1060 }
1061
1062 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
1063 data.enforceInterface(IActivityManager.descriptor);
1064 IBinder token = data.readStrongBinder();
1065 ComponentName cn = getActivityClassForToken(token);
1066 reply.writeNoException();
1067 ComponentName.writeToParcel(cn, reply);
1068 return true;
1069 }
1070
1071 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
1072 data.enforceInterface(IActivityManager.descriptor);
1073 IBinder token = data.readStrongBinder();
1074 reply.writeNoException();
1075 reply.writeString(getPackageForToken(token));
1076 return true;
1077 }
1078
1079 case GET_INTENT_SENDER_TRANSACTION: {
1080 data.enforceInterface(IActivityManager.descriptor);
1081 int type = data.readInt();
1082 String packageName = data.readString();
1083 IBinder token = data.readStrongBinder();
1084 String resultWho = data.readString();
1085 int requestCode = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001086 Intent[] requestIntents;
1087 String[] requestResolvedTypes;
1088 if (data.readInt() != 0) {
1089 requestIntents = data.createTypedArray(Intent.CREATOR);
1090 requestResolvedTypes = data.createStringArray();
1091 } else {
1092 requestIntents = null;
1093 requestResolvedTypes = null;
1094 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001095 int fl = data.readInt();
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07001096 Bundle options = data.readInt() != 0
1097 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -07001098 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001099 IIntentSender res = getIntentSender(type, packageName, token,
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001100 resultWho, requestCode, requestIntents,
Dianne Hackborn41203752012-08-31 14:05:51 -07001101 requestResolvedTypes, fl, options, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001102 reply.writeNoException();
1103 reply.writeStrongBinder(res != null ? res.asBinder() : null);
1104 return true;
1105 }
1106
1107 case CANCEL_INTENT_SENDER_TRANSACTION: {
1108 data.enforceInterface(IActivityManager.descriptor);
1109 IIntentSender r = IIntentSender.Stub.asInterface(
1110 data.readStrongBinder());
1111 cancelIntentSender(r);
1112 reply.writeNoException();
1113 return true;
1114 }
1115
1116 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
1117 data.enforceInterface(IActivityManager.descriptor);
1118 IIntentSender r = IIntentSender.Stub.asInterface(
1119 data.readStrongBinder());
1120 String res = getPackageForIntentSender(r);
1121 reply.writeNoException();
1122 reply.writeString(res);
1123 return true;
1124 }
1125
Christopher Tatec4a07d12012-04-06 14:19:13 -07001126 case GET_UID_FOR_INTENT_SENDER_TRANSACTION: {
1127 data.enforceInterface(IActivityManager.descriptor);
1128 IIntentSender r = IIntentSender.Stub.asInterface(
1129 data.readStrongBinder());
1130 int res = getUidForIntentSender(r);
1131 reply.writeNoException();
1132 reply.writeInt(res);
1133 return true;
1134 }
1135
Dianne Hackborn41203752012-08-31 14:05:51 -07001136 case HANDLE_INCOMING_USER_TRANSACTION: {
1137 data.enforceInterface(IActivityManager.descriptor);
1138 int callingPid = data.readInt();
1139 int callingUid = data.readInt();
1140 int userId = data.readInt();
1141 boolean allowAll = data.readInt() != 0 ;
1142 boolean requireFull = data.readInt() != 0;
1143 String name = data.readString();
1144 String callerPackage = data.readString();
1145 int res = handleIncomingUser(callingPid, callingUid, userId, allowAll,
1146 requireFull, name, callerPackage);
1147 reply.writeNoException();
1148 reply.writeInt(res);
1149 return true;
1150 }
1151
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001152 case SET_PROCESS_LIMIT_TRANSACTION: {
1153 data.enforceInterface(IActivityManager.descriptor);
1154 int max = data.readInt();
1155 setProcessLimit(max);
1156 reply.writeNoException();
1157 return true;
1158 }
1159
1160 case GET_PROCESS_LIMIT_TRANSACTION: {
1161 data.enforceInterface(IActivityManager.descriptor);
1162 int limit = getProcessLimit();
1163 reply.writeNoException();
1164 reply.writeInt(limit);
1165 return true;
1166 }
1167
1168 case SET_PROCESS_FOREGROUND_TRANSACTION: {
1169 data.enforceInterface(IActivityManager.descriptor);
1170 IBinder token = data.readStrongBinder();
1171 int pid = data.readInt();
1172 boolean isForeground = data.readInt() != 0;
1173 setProcessForeground(token, pid, isForeground);
1174 reply.writeNoException();
1175 return true;
1176 }
1177
1178 case CHECK_PERMISSION_TRANSACTION: {
1179 data.enforceInterface(IActivityManager.descriptor);
1180 String perm = data.readString();
1181 int pid = data.readInt();
1182 int uid = data.readInt();
1183 int res = checkPermission(perm, pid, uid);
1184 reply.writeNoException();
1185 reply.writeInt(res);
1186 return true;
1187 }
1188
Dianne Hackbornff170242014-11-19 10:59:01 -08001189 case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: {
1190 data.enforceInterface(IActivityManager.descriptor);
1191 String perm = data.readString();
1192 int pid = data.readInt();
1193 int uid = data.readInt();
1194 IBinder token = data.readStrongBinder();
1195 int res = checkPermissionWithToken(perm, pid, uid, token);
1196 reply.writeNoException();
1197 reply.writeInt(res);
1198 return true;
1199 }
1200
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001201 case CHECK_URI_PERMISSION_TRANSACTION: {
1202 data.enforceInterface(IActivityManager.descriptor);
1203 Uri uri = Uri.CREATOR.createFromParcel(data);
1204 int pid = data.readInt();
1205 int uid = data.readInt();
1206 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001207 int userId = data.readInt();
Dianne Hackbornff170242014-11-19 10:59:01 -08001208 IBinder callerToken = data.readStrongBinder();
1209 int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001210 reply.writeNoException();
1211 reply.writeInt(res);
1212 return true;
1213 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001214
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001215 case CLEAR_APP_DATA_TRANSACTION: {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001216 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001217 String packageName = data.readString();
1218 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
1219 data.readStrongBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -07001220 int userId = data.readInt();
1221 boolean res = clearApplicationUserData(packageName, observer, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001222 reply.writeNoException();
1223 reply.writeInt(res ? 1 : 0);
1224 return true;
1225 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001226
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001227 case GRANT_URI_PERMISSION_TRANSACTION: {
1228 data.enforceInterface(IActivityManager.descriptor);
1229 IBinder b = data.readStrongBinder();
1230 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1231 String targetPkg = data.readString();
1232 Uri uri = Uri.CREATOR.createFromParcel(data);
1233 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001234 int userId = data.readInt();
1235 grantUriPermission(app, targetPkg, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001236 reply.writeNoException();
1237 return true;
1238 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001239
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001240 case REVOKE_URI_PERMISSION_TRANSACTION: {
1241 data.enforceInterface(IActivityManager.descriptor);
1242 IBinder b = data.readStrongBinder();
1243 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1244 Uri uri = Uri.CREATOR.createFromParcel(data);
1245 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001246 int userId = data.readInt();
1247 revokeUriPermission(app, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001248 reply.writeNoException();
1249 return true;
1250 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001251
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001252 case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1253 data.enforceInterface(IActivityManager.descriptor);
1254 Uri uri = Uri.CREATOR.createFromParcel(data);
1255 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001256 int userId = data.readInt();
1257 takePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001258 reply.writeNoException();
1259 return true;
1260 }
1261
1262 case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1263 data.enforceInterface(IActivityManager.descriptor);
1264 Uri uri = Uri.CREATOR.createFromParcel(data);
1265 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001266 int userId = data.readInt();
1267 releasePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001268 reply.writeNoException();
1269 return true;
1270 }
1271
1272 case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: {
1273 data.enforceInterface(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07001274 final String packageName = data.readString();
1275 final boolean incoming = data.readInt() != 0;
1276 final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions(
1277 packageName, incoming);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001278 reply.writeNoException();
1279 perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1280 return true;
1281 }
1282
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001283 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
1284 data.enforceInterface(IActivityManager.descriptor);
1285 IBinder b = data.readStrongBinder();
1286 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1287 boolean waiting = data.readInt() != 0;
1288 showWaitingForDebugger(app, waiting);
1289 reply.writeNoException();
1290 return true;
1291 }
1292
1293 case GET_MEMORY_INFO_TRANSACTION: {
1294 data.enforceInterface(IActivityManager.descriptor);
1295 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
1296 getMemoryInfo(mi);
1297 reply.writeNoException();
1298 mi.writeToParcel(reply, 0);
1299 return true;
1300 }
1301
1302 case UNHANDLED_BACK_TRANSACTION: {
1303 data.enforceInterface(IActivityManager.descriptor);
1304 unhandledBack();
1305 reply.writeNoException();
1306 return true;
1307 }
1308
1309 case OPEN_CONTENT_URI_TRANSACTION: {
1310 data.enforceInterface(IActivityManager.descriptor);
1311 Uri uri = Uri.parse(data.readString());
1312 ParcelFileDescriptor pfd = openContentUri(uri);
1313 reply.writeNoException();
1314 if (pfd != null) {
1315 reply.writeInt(1);
1316 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1317 } else {
1318 reply.writeInt(0);
1319 }
1320 return true;
1321 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001322
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001323 case SET_LOCK_SCREEN_SHOWN_TRANSACTION: {
1324 data.enforceInterface(IActivityManager.descriptor);
1325 setLockScreenShown(data.readInt() != 0);
1326 reply.writeNoException();
1327 return true;
1328 }
1329
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001330 case SET_DEBUG_APP_TRANSACTION: {
1331 data.enforceInterface(IActivityManager.descriptor);
1332 String pn = data.readString();
1333 boolean wfd = data.readInt() != 0;
1334 boolean per = data.readInt() != 0;
1335 setDebugApp(pn, wfd, per);
1336 reply.writeNoException();
1337 return true;
1338 }
1339
1340 case SET_ALWAYS_FINISH_TRANSACTION: {
1341 data.enforceInterface(IActivityManager.descriptor);
1342 boolean enabled = data.readInt() != 0;
1343 setAlwaysFinish(enabled);
1344 reply.writeNoException();
1345 return true;
1346 }
1347
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001348 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001349 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001350 IActivityController watcher = IActivityController.Stub.asInterface(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001351 data.readStrongBinder());
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001352 setActivityController(watcher);
Sungmin Choicdb86bb2012-12-20 14:08:59 +09001353 reply.writeNoException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001354 return true;
1355 }
1356
1357 case ENTER_SAFE_MODE_TRANSACTION: {
1358 data.enforceInterface(IActivityManager.descriptor);
1359 enterSafeMode();
1360 reply.writeNoException();
1361 return true;
1362 }
1363
1364 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1365 data.enforceInterface(IActivityManager.descriptor);
1366 IIntentSender is = IIntentSender.Stub.asInterface(
1367 data.readStrongBinder());
Dianne Hackborn099bc622014-01-22 13:39:16 -08001368 int sourceUid = data.readInt();
1369 String sourcePkg = data.readString();
1370 noteWakeupAlarm(is, sourceUid, sourcePkg);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001371 reply.writeNoException();
1372 return true;
1373 }
1374
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001375 case KILL_PIDS_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001376 data.enforceInterface(IActivityManager.descriptor);
1377 int[] pids = data.createIntArray();
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001378 String reason = data.readString();
Dianne Hackborn64825172011-03-02 21:32:58 -08001379 boolean secure = data.readInt() != 0;
1380 boolean res = killPids(pids, reason, secure);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001381 reply.writeNoException();
1382 reply.writeInt(res ? 1 : 0);
1383 return true;
1384 }
1385
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07001386 case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: {
1387 data.enforceInterface(IActivityManager.descriptor);
1388 String reason = data.readString();
1389 boolean res = killProcessesBelowForeground(reason);
1390 reply.writeNoException();
1391 reply.writeInt(res ? 1 : 0);
1392 return true;
1393 }
1394
Dan Egnor60d87622009-12-16 16:32:58 -08001395 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1396 data.enforceInterface(IActivityManager.descriptor);
1397 IBinder app = data.readStrongBinder();
1398 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1399 handleApplicationCrash(app, ci);
1400 reply.writeNoException();
1401 return true;
1402 }
1403
1404 case HANDLE_APPLICATION_WTF_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001405 data.enforceInterface(IActivityManager.descriptor);
1406 IBinder app = data.readStrongBinder();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001407 String tag = data.readString();
Dianne Hackborn52322712014-08-26 22:47:26 -07001408 boolean system = data.readInt() != 0;
Dan Egnorb7f03672009-12-09 16:22:32 -08001409 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
Dianne Hackborn52322712014-08-26 22:47:26 -07001410 boolean res = handleApplicationWtf(app, tag, system, ci);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001411 reply.writeNoException();
Dan Egnor60d87622009-12-16 16:32:58 -08001412 reply.writeInt(res ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001413 return true;
1414 }
Dan Egnorb7f03672009-12-09 16:22:32 -08001415
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001416 case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: {
1417 data.enforceInterface(IActivityManager.descriptor);
1418 IBinder app = data.readStrongBinder();
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07001419 int violationMask = data.readInt();
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07001420 StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data);
1421 handleApplicationStrictModeViolation(app, violationMask, info);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001422 reply.writeNoException();
1423 return true;
1424 }
1425
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001426 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1427 data.enforceInterface(IActivityManager.descriptor);
1428 int sig = data.readInt();
1429 signalPersistentProcesses(sig);
1430 reply.writeNoException();
1431 return true;
1432 }
1433
Dianne Hackborn03abb812010-01-04 18:43:19 -08001434 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1435 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001436 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001437 int userId = data.readInt();
1438 killBackgroundProcesses(packageName, userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08001439 reply.writeNoException();
1440 return true;
1441 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08001442
1443 case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
1444 data.enforceInterface(IActivityManager.descriptor);
1445 killAllBackgroundProcesses();
1446 reply.writeNoException();
1447 return true;
1448 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001449
Dianne Hackborn03abb812010-01-04 18:43:19 -08001450 case FORCE_STOP_PACKAGE_TRANSACTION: {
1451 data.enforceInterface(IActivityManager.descriptor);
1452 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001453 int userId = data.readInt();
1454 forceStopPackage(packageName, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001455 reply.writeNoException();
1456 return true;
1457 }
Dianne Hackborn27ff9132012-03-06 14:57:58 -08001458
1459 case GET_MY_MEMORY_STATE_TRANSACTION: {
1460 data.enforceInterface(IActivityManager.descriptor);
1461 ActivityManager.RunningAppProcessInfo info =
1462 new ActivityManager.RunningAppProcessInfo();
1463 getMyMemoryState(info);
1464 reply.writeNoException();
1465 info.writeToParcel(reply, 0);
1466 return true;
1467 }
1468
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001469 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1470 data.enforceInterface(IActivityManager.descriptor);
1471 ConfigurationInfo config = getDeviceConfigurationInfo();
1472 reply.writeNoException();
1473 config.writeToParcel(reply, 0);
1474 return true;
1475 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001476
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001477 case PROFILE_CONTROL_TRANSACTION: {
1478 data.enforceInterface(IActivityManager.descriptor);
1479 String process = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001480 int userId = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001481 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001482 int profileType = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -07001483 ProfilerInfo profilerInfo = data.readInt() != 0
1484 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
1485 boolean res = profileControl(process, userId, start, profilerInfo, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001486 reply.writeNoException();
1487 reply.writeInt(res ? 1 : 0);
1488 return true;
1489 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001490
Dianne Hackborn55280a92009-05-07 15:53:46 -07001491 case SHUTDOWN_TRANSACTION: {
1492 data.enforceInterface(IActivityManager.descriptor);
1493 boolean res = shutdown(data.readInt());
1494 reply.writeNoException();
1495 reply.writeInt(res ? 1 : 0);
1496 return true;
1497 }
1498
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001499 case STOP_APP_SWITCHES_TRANSACTION: {
1500 data.enforceInterface(IActivityManager.descriptor);
1501 stopAppSwitches();
1502 reply.writeNoException();
1503 return true;
1504 }
1505
1506 case RESUME_APP_SWITCHES_TRANSACTION: {
1507 data.enforceInterface(IActivityManager.descriptor);
1508 resumeAppSwitches();
1509 reply.writeNoException();
1510 return true;
1511 }
1512
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001513 case PEEK_SERVICE_TRANSACTION: {
1514 data.enforceInterface(IActivityManager.descriptor);
1515 Intent service = Intent.CREATOR.createFromParcel(data);
1516 String resolvedType = data.readString();
1517 IBinder binder = peekService(service, resolvedType);
1518 reply.writeNoException();
1519 reply.writeStrongBinder(binder);
1520 return true;
1521 }
Christopher Tate181fafa2009-05-14 11:12:14 -07001522
1523 case START_BACKUP_AGENT_TRANSACTION: {
1524 data.enforceInterface(IActivityManager.descriptor);
1525 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1526 int backupRestoreMode = data.readInt();
1527 boolean success = bindBackupAgent(info, backupRestoreMode);
1528 reply.writeNoException();
1529 reply.writeInt(success ? 1 : 0);
1530 return true;
1531 }
1532
1533 case BACKUP_AGENT_CREATED_TRANSACTION: {
1534 data.enforceInterface(IActivityManager.descriptor);
1535 String packageName = data.readString();
1536 IBinder agent = data.readStrongBinder();
1537 backupAgentCreated(packageName, agent);
1538 reply.writeNoException();
1539 return true;
1540 }
1541
1542 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1543 data.enforceInterface(IActivityManager.descriptor);
1544 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1545 unbindBackupAgent(info);
1546 reply.writeNoException();
1547 return true;
1548 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001549
1550 case ADD_PACKAGE_DEPENDENCY_TRANSACTION: {
1551 data.enforceInterface(IActivityManager.descriptor);
1552 String packageName = data.readString();
1553 addPackageDependency(packageName);
1554 reply.writeNoException();
1555 return true;
1556 }
1557
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001558 case KILL_APPLICATION_WITH_APPID_TRANSACTION: {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001559 data.enforceInterface(IActivityManager.descriptor);
1560 String pkg = data.readString();
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001561 int appid = data.readInt();
Dianne Hackborn21d9b562013-05-28 17:46:59 -07001562 String reason = data.readString();
1563 killApplicationWithAppId(pkg, appid, reason);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001564 reply.writeNoException();
1565 return true;
1566 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001567
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001568 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1569 data.enforceInterface(IActivityManager.descriptor);
1570 String reason = data.readString();
1571 closeSystemDialogs(reason);
1572 reply.writeNoException();
1573 return true;
1574 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001575
1576 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1577 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001578 int[] pids = data.createIntArray();
1579 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001580 reply.writeNoException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001581 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001582 return true;
1583 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001584
1585 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1586 data.enforceInterface(IActivityManager.descriptor);
1587 String processName = data.readString();
1588 int uid = data.readInt();
1589 killApplicationProcess(processName, uid);
1590 reply.writeNoException();
1591 return true;
1592 }
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001593
1594 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1595 data.enforceInterface(IActivityManager.descriptor);
1596 IBinder token = data.readStrongBinder();
1597 String packageName = data.readString();
1598 int enterAnim = data.readInt();
1599 int exitAnim = data.readInt();
1600 overridePendingTransition(token, packageName, enterAnim, exitAnim);
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001601 reply.writeNoException();
1602 return true;
1603 }
1604
1605 case IS_USER_A_MONKEY_TRANSACTION: {
1606 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001607 boolean areThey = isUserAMonkey();
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001608 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001609 reply.writeInt(areThey ? 1 : 0);
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001610 return true;
1611 }
Dianne Hackborn860755f2010-06-03 18:47:52 -07001612
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07001613 case SET_USER_IS_MONKEY_TRANSACTION: {
1614 data.enforceInterface(IActivityManager.descriptor);
1615 final boolean monkey = (data.readInt() == 1);
1616 setUserIsMonkey(monkey);
1617 reply.writeNoException();
1618 return true;
1619 }
1620
Dianne Hackborn860755f2010-06-03 18:47:52 -07001621 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1622 data.enforceInterface(IActivityManager.descriptor);
1623 finishHeavyWeightApp();
1624 reply.writeNoException();
1625 return true;
1626 }
Daniel Sandler69a48172010-06-23 16:29:36 -04001627
1628 case IS_IMMERSIVE_TRANSACTION: {
1629 data.enforceInterface(IActivityManager.descriptor);
1630 IBinder token = data.readStrongBinder();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001631 boolean isit = isImmersive(token);
Daniel Sandler69a48172010-06-23 16:29:36 -04001632 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001633 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001634 return true;
1635 }
1636
Craig Mautnerd61dc202014-07-07 11:09:11 -07001637 case IS_TOP_OF_TASK_TRANSACTION: {
1638 data.enforceInterface(IActivityManager.descriptor);
1639 IBinder token = data.readStrongBinder();
1640 final boolean isTopOfTask = isTopOfTask(token);
1641 reply.writeNoException();
1642 reply.writeInt(isTopOfTask ? 1 : 0);
1643 return true;
1644 }
1645
Craig Mautner5eda9b32013-07-02 11:58:16 -07001646 case CONVERT_FROM_TRANSLUCENT_TRANSACTION: {
Craig Mautner4addfc52013-06-25 08:05:45 -07001647 data.enforceInterface(IActivityManager.descriptor);
1648 IBinder token = data.readStrongBinder();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001649 boolean converted = convertFromTranslucent(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001650 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001651 reply.writeInt(converted ? 1 : 0);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001652 return true;
1653 }
1654
1655 case CONVERT_TO_TRANSLUCENT_TRANSACTION: {
1656 data.enforceInterface(IActivityManager.descriptor);
1657 IBinder token = data.readStrongBinder();
Craig Mautner233ceee2014-05-09 17:05:11 -07001658 final Bundle bundle;
1659 if (data.readInt() == 0) {
1660 bundle = null;
1661 } else {
1662 bundle = data.readBundle();
1663 }
1664 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
1665 boolean converted = convertToTranslucent(token, options);
Craig Mautner4addfc52013-06-25 08:05:45 -07001666 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001667 reply.writeInt(converted ? 1 : 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07001668 return true;
1669 }
1670
Craig Mautner233ceee2014-05-09 17:05:11 -07001671 case GET_ACTIVITY_OPTIONS_TRANSACTION: {
1672 data.enforceInterface(IActivityManager.descriptor);
1673 IBinder token = data.readStrongBinder();
1674 final ActivityOptions options = getActivityOptions(token);
1675 reply.writeNoException();
1676 reply.writeBundle(options == null ? null : options.toBundle());
1677 return true;
1678 }
1679
Daniel Sandler69a48172010-06-23 16:29:36 -04001680 case SET_IMMERSIVE_TRANSACTION: {
1681 data.enforceInterface(IActivityManager.descriptor);
1682 IBinder token = data.readStrongBinder();
1683 boolean imm = data.readInt() == 1;
1684 setImmersive(token, imm);
1685 reply.writeNoException();
1686 return true;
1687 }
1688
1689 case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
1690 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001691 boolean isit = isTopActivityImmersive();
Daniel Sandler69a48172010-06-23 16:29:36 -04001692 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001693 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001694 return true;
1695 }
1696
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001697 case CRASH_APPLICATION_TRANSACTION: {
1698 data.enforceInterface(IActivityManager.descriptor);
1699 int uid = data.readInt();
1700 int initialPid = data.readInt();
1701 String packageName = data.readString();
1702 String message = data.readString();
1703 crashApplication(uid, initialPid, packageName, message);
1704 reply.writeNoException();
1705 return true;
1706 }
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001707
1708 case GET_PROVIDER_MIME_TYPE_TRANSACTION: {
1709 data.enforceInterface(IActivityManager.descriptor);
1710 Uri uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001711 int userId = data.readInt();
1712 String type = getProviderMimeType(uri, userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001713 reply.writeNoException();
1714 reply.writeString(type);
1715 return true;
1716 }
1717
Dianne Hackborn7e269642010-08-25 19:50:20 -07001718 case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
1719 data.enforceInterface(IActivityManager.descriptor);
1720 String name = data.readString();
1721 IBinder perm = newUriPermissionOwner(name);
1722 reply.writeNoException();
1723 reply.writeStrongBinder(perm);
1724 return true;
1725 }
1726
1727 case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1728 data.enforceInterface(IActivityManager.descriptor);
1729 IBinder owner = data.readStrongBinder();
1730 int fromUid = data.readInt();
1731 String targetPkg = data.readString();
1732 Uri uri = Uri.CREATOR.createFromParcel(data);
1733 int mode = data.readInt();
Nicolas Prevotf1939902014-06-25 09:29:02 +01001734 int sourceUserId = data.readInt();
1735 int targetUserId = data.readInt();
1736 grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId,
1737 targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001738 reply.writeNoException();
1739 return true;
1740 }
1741
1742 case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1743 data.enforceInterface(IActivityManager.descriptor);
1744 IBinder owner = data.readStrongBinder();
1745 Uri uri = null;
1746 if (data.readInt() != 0) {
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001747 uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001748 }
1749 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001750 int userId = data.readInt();
1751 revokeUriPermissionFromOwner(owner, uri, mode, userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001752 reply.writeNoException();
1753 return true;
1754 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001755
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001756 case CHECK_GRANT_URI_PERMISSION_TRANSACTION: {
1757 data.enforceInterface(IActivityManager.descriptor);
1758 int callingUid = data.readInt();
1759 String targetPkg = data.readString();
1760 Uri uri = Uri.CREATOR.createFromParcel(data);
1761 int modeFlags = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001762 int userId = data.readInt();
1763 int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001764 reply.writeNoException();
1765 reply.writeInt(res);
1766 return true;
1767 }
1768
Andy McFadden824c5102010-07-09 16:26:57 -07001769 case DUMP_HEAP_TRANSACTION: {
1770 data.enforceInterface(IActivityManager.descriptor);
1771 String process = data.readString();
Dianne Hackbornb12e1352012-09-26 11:39:20 -07001772 int userId = data.readInt();
Andy McFadden824c5102010-07-09 16:26:57 -07001773 boolean managed = data.readInt() != 0;
1774 String path = data.readString();
1775 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -07001776 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborn1676c852012-09-10 14:52:30 -07001777 boolean res = dumpHeap(process, userId, managed, path, fd);
Andy McFadden824c5102010-07-09 16:26:57 -07001778 reply.writeNoException();
1779 reply.writeInt(res ? 1 : 0);
1780 return true;
1781 }
1782
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001783 case START_ACTIVITIES_TRANSACTION:
1784 {
1785 data.enforceInterface(IActivityManager.descriptor);
1786 IBinder b = data.readStrongBinder();
1787 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001788 String callingPackage = data.readString();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001789 Intent[] intents = data.createTypedArray(Intent.CREATOR);
1790 String[] resolvedTypes = data.createStringArray();
1791 IBinder resultTo = data.readStrongBinder();
Dianne Hackborna4972e92012-03-14 10:38:05 -07001792 Bundle options = data.readInt() != 0
1793 ? Bundle.CREATOR.createFromParcel(data) : null;
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001794 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001795 int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001796 options, userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001797 reply.writeNoException();
1798 reply.writeInt(result);
1799 return true;
1800 }
1801
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001802 case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1803 {
1804 data.enforceInterface(IActivityManager.descriptor);
1805 int mode = getFrontActivityScreenCompatMode();
1806 reply.writeNoException();
1807 reply.writeInt(mode);
1808 return true;
1809 }
1810
1811 case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1812 {
1813 data.enforceInterface(IActivityManager.descriptor);
1814 int mode = data.readInt();
1815 setFrontActivityScreenCompatMode(mode);
1816 reply.writeNoException();
1817 reply.writeInt(mode);
1818 return true;
1819 }
1820
1821 case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1822 {
1823 data.enforceInterface(IActivityManager.descriptor);
1824 String pkg = data.readString();
1825 int mode = getPackageScreenCompatMode(pkg);
1826 reply.writeNoException();
1827 reply.writeInt(mode);
1828 return true;
1829 }
1830
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001831 case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1832 {
1833 data.enforceInterface(IActivityManager.descriptor);
1834 String pkg = data.readString();
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001835 int mode = data.readInt();
1836 setPackageScreenCompatMode(pkg, mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001837 reply.writeNoException();
1838 return true;
1839 }
Dianne Hackbornaa9d84c2011-05-09 19:00:59 -07001840
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001841 case SWITCH_USER_TRANSACTION: {
1842 data.enforceInterface(IActivityManager.descriptor);
1843 int userid = data.readInt();
1844 boolean result = switchUser(userid);
1845 reply.writeNoException();
1846 reply.writeInt(result ? 1 : 0);
1847 return true;
1848 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07001849
Kenny Guy08488bf2014-02-21 17:40:37 +00001850 case START_USER_IN_BACKGROUND_TRANSACTION: {
1851 data.enforceInterface(IActivityManager.descriptor);
1852 int userid = data.readInt();
1853 boolean result = startUserInBackground(userid);
1854 reply.writeNoException();
1855 reply.writeInt(result ? 1 : 0);
1856 return true;
1857 }
1858
Dianne Hackborn80a4af22012-08-27 19:18:31 -07001859 case STOP_USER_TRANSACTION: {
1860 data.enforceInterface(IActivityManager.descriptor);
1861 int userid = data.readInt();
1862 IStopUserCallback callback = IStopUserCallback.Stub.asInterface(
1863 data.readStrongBinder());
1864 int result = stopUser(userid, callback);
1865 reply.writeNoException();
1866 reply.writeInt(result);
1867 return true;
1868 }
1869
Amith Yamasani52f1d752012-03-28 18:19:29 -07001870 case GET_CURRENT_USER_TRANSACTION: {
1871 data.enforceInterface(IActivityManager.descriptor);
1872 UserInfo userInfo = getCurrentUser();
1873 reply.writeNoException();
1874 userInfo.writeToParcel(reply, 0);
1875 return true;
1876 }
1877
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001878 case IS_USER_RUNNING_TRANSACTION: {
1879 data.enforceInterface(IActivityManager.descriptor);
1880 int userid = data.readInt();
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07001881 boolean orStopping = data.readInt() != 0;
1882 boolean result = isUserRunning(userid, orStopping);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001883 reply.writeNoException();
1884 reply.writeInt(result ? 1 : 0);
1885 return true;
1886 }
1887
Dianne Hackbornc72fc672012-09-20 13:12:03 -07001888 case GET_RUNNING_USER_IDS_TRANSACTION: {
1889 data.enforceInterface(IActivityManager.descriptor);
1890 int[] result = getRunningUserIds();
1891 reply.writeNoException();
1892 reply.writeIntArray(result);
1893 return true;
1894 }
1895
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001896 case REMOVE_TASK_TRANSACTION:
1897 {
1898 data.enforceInterface(IActivityManager.descriptor);
1899 int taskId = data.readInt();
Wale Ogunwaled54b5782014-10-23 15:55:23 -07001900 boolean result = removeTask(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001901 reply.writeNoException();
1902 reply.writeInt(result ? 1 : 0);
1903 return true;
1904 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001905
Jeff Sharkeya4620792011-05-20 15:29:23 -07001906 case REGISTER_PROCESS_OBSERVER_TRANSACTION: {
1907 data.enforceInterface(IActivityManager.descriptor);
1908 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1909 data.readStrongBinder());
1910 registerProcessObserver(observer);
1911 return true;
1912 }
1913
1914 case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: {
1915 data.enforceInterface(IActivityManager.descriptor);
1916 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1917 data.readStrongBinder());
1918 unregisterProcessObserver(observer);
1919 return true;
1920 }
1921
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07001922 case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1923 {
1924 data.enforceInterface(IActivityManager.descriptor);
1925 String pkg = data.readString();
1926 boolean ask = getPackageAskScreenCompat(pkg);
1927 reply.writeNoException();
1928 reply.writeInt(ask ? 1 : 0);
1929 return true;
1930 }
1931
1932 case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1933 {
1934 data.enforceInterface(IActivityManager.descriptor);
1935 String pkg = data.readString();
1936 boolean ask = data.readInt() != 0;
1937 setPackageAskScreenCompat(pkg, ask);
1938 reply.writeNoException();
1939 return true;
1940 }
1941
Dianne Hackborn6c418d52011-06-29 14:05:33 -07001942 case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: {
1943 data.enforceInterface(IActivityManager.descriptor);
1944 IIntentSender r = IIntentSender.Stub.asInterface(
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07001945 data.readStrongBinder());
Dianne Hackborn6c418d52011-06-29 14:05:33 -07001946 boolean res = isIntentSenderTargetedToPackage(r);
1947 reply.writeNoException();
1948 reply.writeInt(res ? 1 : 0);
1949 return true;
1950 }
1951
Dianne Hackborn1927ae82012-06-22 15:21:36 -07001952 case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: {
1953 data.enforceInterface(IActivityManager.descriptor);
1954 IIntentSender r = IIntentSender.Stub.asInterface(
1955 data.readStrongBinder());
1956 boolean res = isIntentSenderAnActivity(r);
1957 reply.writeNoException();
1958 reply.writeInt(res ? 1 : 0);
1959 return true;
1960 }
1961
Dianne Hackborn81038902012-11-26 17:04:09 -08001962 case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: {
1963 data.enforceInterface(IActivityManager.descriptor);
1964 IIntentSender r = IIntentSender.Stub.asInterface(
1965 data.readStrongBinder());
1966 Intent intent = getIntentForIntentSender(r);
1967 reply.writeNoException();
1968 if (intent != null) {
1969 reply.writeInt(1);
1970 intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1971 } else {
1972 reply.writeInt(0);
1973 }
1974 return true;
1975 }
1976
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08001977 case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: {
1978 data.enforceInterface(IActivityManager.descriptor);
1979 IIntentSender r = IIntentSender.Stub.asInterface(
1980 data.readStrongBinder());
1981 String prefix = data.readString();
1982 String tag = getTagForIntentSender(r, prefix);
1983 reply.writeNoException();
1984 reply.writeString(tag);
1985 return true;
1986 }
1987
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001988 case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
1989 data.enforceInterface(IActivityManager.descriptor);
1990 Configuration config = Configuration.CREATOR.createFromParcel(data);
1991 updatePersistentConfiguration(config);
1992 reply.writeNoException();
1993 return true;
1994 }
1995
Dianne Hackbornb437e092011-08-05 17:50:29 -07001996 case GET_PROCESS_PSS_TRANSACTION: {
1997 data.enforceInterface(IActivityManager.descriptor);
1998 int[] pids = data.createIntArray();
1999 long[] pss = getProcessPss(pids);
2000 reply.writeNoException();
2001 reply.writeLongArray(pss);
2002 return true;
2003 }
2004
Dianne Hackborn661cd522011-08-22 00:26:20 -07002005 case SHOW_BOOT_MESSAGE_TRANSACTION: {
2006 data.enforceInterface(IActivityManager.descriptor);
2007 CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
2008 boolean always = data.readInt() != 0;
2009 showBootMessage(msg, always);
2010 reply.writeNoException();
2011 return true;
2012 }
2013
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002014 case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002015 data.enforceInterface(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002016 keyguardWaitingForActivityDrawn();
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002017 reply.writeNoException();
2018 return true;
2019 }
2020
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002021 case SHOULD_UP_RECREATE_TASK_TRANSACTION: {
Adam Powelldd8fab22012-03-22 17:47:27 -07002022 data.enforceInterface(IActivityManager.descriptor);
2023 IBinder token = data.readStrongBinder();
2024 String destAffinity = data.readString();
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002025 boolean res = shouldUpRecreateTask(token, destAffinity);
Adam Powelldd8fab22012-03-22 17:47:27 -07002026 reply.writeNoException();
2027 reply.writeInt(res ? 1 : 0);
2028 return true;
2029 }
2030
2031 case NAVIGATE_UP_TO_TRANSACTION: {
2032 data.enforceInterface(IActivityManager.descriptor);
2033 IBinder token = data.readStrongBinder();
2034 Intent target = Intent.CREATOR.createFromParcel(data);
2035 int resultCode = data.readInt();
2036 Intent resultData = null;
2037 if (data.readInt() != 0) {
2038 resultData = Intent.CREATOR.createFromParcel(data);
2039 }
2040 boolean res = navigateUpTo(token, target, resultCode, resultData);
2041 reply.writeNoException();
2042 reply.writeInt(res ? 1 : 0);
2043 return true;
2044 }
2045
Dianne Hackborn5320eb82012-05-18 12:05:04 -07002046 case GET_LAUNCHED_FROM_UID_TRANSACTION: {
2047 data.enforceInterface(IActivityManager.descriptor);
2048 IBinder token = data.readStrongBinder();
2049 int res = getLaunchedFromUid(token);
2050 reply.writeNoException();
2051 reply.writeInt(res);
2052 return true;
2053 }
2054
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002055 case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: {
2056 data.enforceInterface(IActivityManager.descriptor);
2057 IBinder token = data.readStrongBinder();
2058 String res = getLaunchedFromPackage(token);
2059 reply.writeNoException();
2060 reply.writeString(res);
2061 return true;
2062 }
2063
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002064 case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2065 data.enforceInterface(IActivityManager.descriptor);
2066 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2067 data.readStrongBinder());
2068 registerUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002069 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002070 return true;
2071 }
2072
2073 case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2074 data.enforceInterface(IActivityManager.descriptor);
2075 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2076 data.readStrongBinder());
2077 unregisterUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002078 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002079 return true;
2080 }
2081
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002082 case REQUEST_BUG_REPORT_TRANSACTION: {
2083 data.enforceInterface(IActivityManager.descriptor);
2084 requestBugReport();
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002085 reply.writeNoException();
2086 return true;
2087 }
2088
2089 case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: {
2090 data.enforceInterface(IActivityManager.descriptor);
2091 int pid = data.readInt();
2092 boolean aboveSystem = data.readInt() != 0;
Jeff Brownbd181bb2013-09-10 16:44:24 -07002093 String reason = data.readString();
2094 long res = inputDispatchingTimedOut(pid, aboveSystem, reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002095 reply.writeNoException();
2096 reply.writeLong(res);
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002097 return true;
2098 }
2099
Adam Skorydfc7fd72013-08-05 19:23:41 -07002100 case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002101 data.enforceInterface(IActivityManager.descriptor);
2102 int requestType = data.readInt();
Adam Skorydfc7fd72013-08-05 19:23:41 -07002103 Bundle res = getAssistContextExtras(requestType);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002104 reply.writeNoException();
2105 reply.writeBundle(res);
2106 return true;
2107 }
2108
Adam Skorydfc7fd72013-08-05 19:23:41 -07002109 case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002110 data.enforceInterface(IActivityManager.descriptor);
2111 IBinder token = data.readStrongBinder();
2112 Bundle extras = data.readBundle();
Adam Skory7140a252013-09-11 12:04:58 +01002113 reportAssistContextExtras(token, extras);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002114 reply.writeNoException();
2115 return true;
2116 }
2117
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002118 case LAUNCH_ASSIST_INTENT_TRANSACTION: {
2119 data.enforceInterface(IActivityManager.descriptor);
2120 Intent intent = Intent.CREATOR.createFromParcel(data);
2121 int requestType = data.readInt();
2122 String hint = data.readString();
2123 int userHandle = data.readInt();
2124 boolean res = launchAssistIntent(intent, requestType, hint, userHandle);
2125 reply.writeNoException();
2126 reply.writeInt(res ? 1 : 0);
2127 return true;
2128 }
2129
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002130 case KILL_UID_TRANSACTION: {
2131 data.enforceInterface(IActivityManager.descriptor);
2132 int uid = data.readInt();
2133 String reason = data.readString();
2134 killUid(uid, reason);
2135 reply.writeNoException();
2136 return true;
2137 }
2138
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07002139 case HANG_TRANSACTION: {
2140 data.enforceInterface(IActivityManager.descriptor);
2141 IBinder who = data.readStrongBinder();
2142 boolean allowRestart = data.readInt() != 0;
2143 hang(who, allowRestart);
2144 reply.writeNoException();
2145 return true;
2146 }
2147
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07002148 case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: {
2149 data.enforceInterface(IActivityManager.descriptor);
2150 IBinder token = data.readStrongBinder();
2151 reportActivityFullyDrawn(token);
2152 reply.writeNoException();
2153 return true;
2154 }
2155
Craig Mautner5eda9b32013-07-02 11:58:16 -07002156 case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: {
2157 data.enforceInterface(IActivityManager.descriptor);
2158 IBinder token = data.readStrongBinder();
2159 notifyActivityDrawn(token);
2160 reply.writeNoException();
2161 return true;
2162 }
Dianne Hackborn57a7f592013-07-22 18:21:32 -07002163
2164 case RESTART_TRANSACTION: {
2165 data.enforceInterface(IActivityManager.descriptor);
2166 restart();
2167 reply.writeNoException();
2168 return true;
2169 }
Jeff Sharkey08da7a12013-08-11 20:53:18 -07002170
Dianne Hackborn35f72be2013-09-16 10:57:39 -07002171 case PERFORM_IDLE_MAINTENANCE_TRANSACTION: {
2172 data.enforceInterface(IActivityManager.descriptor);
2173 performIdleMaintenance();
2174 reply.writeNoException();
2175 return true;
2176 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002177
2178 case CREATE_ACTIVITY_CONTAINER_TRANSACTION: {
2179 data.enforceInterface(IActivityManager.descriptor);
2180 IBinder parentActivityToken = data.readStrongBinder();
2181 IActivityContainerCallback callback =
Craig Mautnere3a00d72014-04-16 08:31:19 -07002182 IActivityContainerCallback.Stub.asInterface(data.readStrongBinder());
Craig Mautner4a1cb222013-12-04 16:14:06 -08002183 IActivityContainer activityContainer =
2184 createActivityContainer(parentActivityToken, callback);
2185 reply.writeNoException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08002186 if (activityContainer != null) {
2187 reply.writeInt(1);
2188 reply.writeStrongBinder(activityContainer.asBinder());
2189 } else {
2190 reply.writeInt(0);
2191 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002192 return true;
2193 }
2194
Craig Mautner95da1082014-02-24 17:54:35 -08002195 case DELETE_ACTIVITY_CONTAINER_TRANSACTION: {
2196 data.enforceInterface(IActivityManager.descriptor);
2197 IActivityContainer activityContainer =
2198 IActivityContainer.Stub.asInterface(data.readStrongBinder());
2199 deleteActivityContainer(activityContainer);
2200 reply.writeNoException();
2201 return true;
2202 }
2203
Craig Mautnere0a38842013-12-16 16:14:02 -08002204 case GET_ACTIVITY_CONTAINER_TRANSACTION: {
2205 data.enforceInterface(IActivityManager.descriptor);
2206 IBinder activityToken = data.readStrongBinder();
2207 IActivityContainer activityContainer = getEnclosingActivityContainer(activityToken);
2208 reply.writeNoException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08002209 if (activityContainer != null) {
2210 reply.writeInt(1);
2211 reply.writeStrongBinder(activityContainer.asBinder());
2212 } else {
2213 reply.writeInt(0);
2214 }
Craig Mautnere0a38842013-12-16 16:14:02 -08002215 return true;
2216 }
2217
Craig Mautner4a1cb222013-12-04 16:14:06 -08002218 case GET_HOME_ACTIVITY_TOKEN_TRANSACTION: {
2219 data.enforceInterface(IActivityManager.descriptor);
2220 IBinder homeActivityToken = getHomeActivityToken();
2221 reply.writeNoException();
2222 reply.writeStrongBinder(homeActivityToken);
2223 return true;
2224 }
Craig Mautneraea74a52014-03-08 14:23:10 -08002225
2226 case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: {
2227 data.enforceInterface(IActivityManager.descriptor);
2228 final int taskId = data.readInt();
2229 startLockTaskMode(taskId);
2230 reply.writeNoException();
2231 return true;
2232 }
2233
2234 case START_LOCK_TASK_BY_TOKEN_TRANSACTION: {
2235 data.enforceInterface(IActivityManager.descriptor);
2236 IBinder token = data.readStrongBinder();
2237 startLockTaskMode(token);
2238 reply.writeNoException();
2239 return true;
2240 }
2241
Craig Mautnerd61dc202014-07-07 11:09:11 -07002242 case START_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002243 data.enforceInterface(IActivityManager.descriptor);
2244 startLockTaskModeOnCurrent();
2245 reply.writeNoException();
2246 return true;
2247 }
2248
Craig Mautneraea74a52014-03-08 14:23:10 -08002249 case STOP_LOCK_TASK_MODE_TRANSACTION: {
2250 data.enforceInterface(IActivityManager.descriptor);
2251 stopLockTaskMode();
2252 reply.writeNoException();
2253 return true;
2254 }
2255
Craig Mautnerd61dc202014-07-07 11:09:11 -07002256 case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002257 data.enforceInterface(IActivityManager.descriptor);
2258 stopLockTaskModeOnCurrent();
2259 reply.writeNoException();
2260 return true;
2261 }
2262
Craig Mautneraea74a52014-03-08 14:23:10 -08002263 case IS_IN_LOCK_TASK_MODE_TRANSACTION: {
2264 data.enforceInterface(IActivityManager.descriptor);
2265 final boolean isInLockTaskMode = isInLockTaskMode();
2266 reply.writeNoException();
2267 reply.writeInt(isInLockTaskMode ? 1 : 0);
2268 return true;
2269 }
Craig Mautner2fbd7542014-03-21 09:34:07 -07002270
Winson Chunga449dc02014-05-16 11:15:04 -07002271 case SET_TASK_DESCRIPTION_TRANSACTION: {
Craig Mautner2fbd7542014-03-21 09:34:07 -07002272 data.enforceInterface(IActivityManager.descriptor);
2273 IBinder token = data.readStrongBinder();
Winson Chunga449dc02014-05-16 11:15:04 -07002274 ActivityManager.TaskDescription values =
2275 ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
2276 setTaskDescription(token, values);
Craig Mautner2fbd7542014-03-21 09:34:07 -07002277 reply.writeNoException();
2278 return true;
2279 }
Craig Mautneree2e45a2014-06-27 12:10:03 -07002280
Craig Mautner648f69b2014-09-18 14:16:26 -07002281 case GET_TASK_DESCRIPTION_ICON_TRANSACTION: {
2282 data.enforceInterface(IActivityManager.descriptor);
2283 String filename = data.readString();
2284 Bitmap icon = getTaskDescriptionIcon(filename);
2285 reply.writeNoException();
2286 if (icon == null) {
2287 reply.writeInt(0);
2288 } else {
2289 reply.writeInt(1);
2290 icon.writeToParcel(reply, 0);
2291 }
2292 return true;
2293 }
2294
Winson Chung044d5292014-11-06 11:05:19 -08002295 case START_IN_PLACE_ANIMATION_TRANSACTION: {
2296 data.enforceInterface(IActivityManager.descriptor);
2297 final Bundle bundle;
2298 if (data.readInt() == 0) {
2299 bundle = null;
2300 } else {
2301 bundle = data.readBundle();
2302 }
2303 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
2304 startInPlaceAnimationOnFrontMostApplication(options);
2305 reply.writeNoException();
2306 return true;
2307 }
2308
Jose Lima4b6c6692014-08-12 17:41:12 -07002309 case REQUEST_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002310 data.enforceInterface(IActivityManager.descriptor);
2311 IBinder token = data.readStrongBinder();
2312 boolean enable = data.readInt() > 0;
Jose Lima4b6c6692014-08-12 17:41:12 -07002313 boolean success = requestVisibleBehind(token, enable);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002314 reply.writeNoException();
2315 reply.writeInt(success ? 1 : 0);
2316 return true;
2317 }
2318
Jose Lima4b6c6692014-08-12 17:41:12 -07002319 case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002320 data.enforceInterface(IActivityManager.descriptor);
2321 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002322 final boolean enabled = isBackgroundVisibleBehind(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002323 reply.writeNoException();
2324 reply.writeInt(enabled ? 1 : 0);
2325 return true;
2326 }
2327
Jose Lima4b6c6692014-08-12 17:41:12 -07002328 case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002329 data.enforceInterface(IActivityManager.descriptor);
2330 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002331 backgroundResourcesReleased(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002332 reply.writeNoException();
2333 return true;
2334 }
Craig Mautnerbb742462014-07-07 15:28:55 -07002335
2336 case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: {
2337 data.enforceInterface(IActivityManager.descriptor);
2338 IBinder token = data.readStrongBinder();
2339 notifyLaunchTaskBehindComplete(token);
2340 reply.writeNoException();
2341 return true;
2342 }
Craig Mautner8746a472014-07-24 15:12:54 -07002343
2344 case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: {
2345 data.enforceInterface(IActivityManager.descriptor);
2346 IBinder token = data.readStrongBinder();
2347 notifyEnterAnimationComplete(token);
2348 reply.writeNoException();
2349 return true;
2350 }
Craig Mautner6e2f3952014-09-09 14:26:41 -07002351
2352 case BOOT_ANIMATION_COMPLETE_TRANSACTION: {
2353 data.enforceInterface(IActivityManager.descriptor);
2354 bootAnimationComplete();
2355 reply.writeNoException();
2356 return true;
2357 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002358 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002359
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002360 return super.onTransact(code, data, reply, flags);
2361 }
2362
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002363 public IBinder asBinder() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002364 return this;
2365 }
2366
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002367 private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
2368 protected IActivityManager create() {
2369 IBinder b = ServiceManager.getService("activity");
Joe Onorato43a17652011-04-06 19:22:23 -07002370 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002371 Log.v("ActivityManager", "default service binder = " + b);
2372 }
2373 IActivityManager am = asInterface(b);
Joe Onorato43a17652011-04-06 19:22:23 -07002374 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002375 Log.v("ActivityManager", "default service = " + am);
2376 }
2377 return am;
2378 }
2379 };
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002380}
2381
2382class ActivityManagerProxy implements IActivityManager
2383{
2384 public ActivityManagerProxy(IBinder remote)
2385 {
2386 mRemote = remote;
2387 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002388
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002389 public IBinder asBinder()
2390 {
2391 return mRemote;
2392 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002393
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002394 public int startActivity(IApplicationThread caller, String callingPackage, Intent intent,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002395 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002396 int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002397 Parcel data = Parcel.obtain();
2398 Parcel reply = Parcel.obtain();
2399 data.writeInterfaceToken(IActivityManager.descriptor);
2400 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002401 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002402 intent.writeToParcel(data, 0);
2403 data.writeString(resolvedType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002404 data.writeStrongBinder(resultTo);
2405 data.writeString(resultWho);
2406 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002407 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002408 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002409 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002410 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002411 } else {
2412 data.writeInt(0);
2413 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002414 if (options != null) {
2415 data.writeInt(1);
2416 options.writeToParcel(data, 0);
2417 } else {
2418 data.writeInt(0);
2419 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002420 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2421 reply.readException();
2422 int result = reply.readInt();
2423 reply.recycle();
2424 data.recycle();
2425 return result;
2426 }
Amith Yamasani82644082012-08-03 13:09:11 -07002427
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002428 public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent,
Amith Yamasani82644082012-08-03 13:09:11 -07002429 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002430 int startFlags, ProfilerInfo profilerInfo, Bundle options,
2431 int userId) throws RemoteException {
Amith Yamasani82644082012-08-03 13:09:11 -07002432 Parcel data = Parcel.obtain();
2433 Parcel reply = Parcel.obtain();
2434 data.writeInterfaceToken(IActivityManager.descriptor);
2435 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002436 data.writeString(callingPackage);
Amith Yamasani82644082012-08-03 13:09:11 -07002437 intent.writeToParcel(data, 0);
2438 data.writeString(resolvedType);
2439 data.writeStrongBinder(resultTo);
2440 data.writeString(resultWho);
2441 data.writeInt(requestCode);
2442 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002443 if (profilerInfo != null) {
Amith Yamasani82644082012-08-03 13:09:11 -07002444 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002445 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Amith Yamasani82644082012-08-03 13:09:11 -07002446 } else {
2447 data.writeInt(0);
2448 }
2449 if (options != null) {
2450 data.writeInt(1);
2451 options.writeToParcel(data, 0);
2452 } else {
2453 data.writeInt(0);
2454 }
2455 data.writeInt(userId);
2456 mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0);
2457 reply.readException();
2458 int result = reply.readInt();
2459 reply.recycle();
2460 data.recycle();
2461 return result;
2462 }
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002463 public int startActivityAsCaller(IApplicationThread caller, String callingPackage,
2464 Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Sharkey97978802014-10-14 10:48:18 -07002465 int startFlags, ProfilerInfo profilerInfo, Bundle options, int userId) throws RemoteException {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002466 Parcel data = Parcel.obtain();
2467 Parcel reply = Parcel.obtain();
2468 data.writeInterfaceToken(IActivityManager.descriptor);
2469 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2470 data.writeString(callingPackage);
2471 intent.writeToParcel(data, 0);
2472 data.writeString(resolvedType);
2473 data.writeStrongBinder(resultTo);
2474 data.writeString(resultWho);
2475 data.writeInt(requestCode);
2476 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002477 if (profilerInfo != null) {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002478 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002479 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002480 } else {
2481 data.writeInt(0);
2482 }
2483 if (options != null) {
2484 data.writeInt(1);
2485 options.writeToParcel(data, 0);
2486 } else {
2487 data.writeInt(0);
2488 }
Jeff Sharkey97978802014-10-14 10:48:18 -07002489 data.writeInt(userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002490 mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0);
2491 reply.readException();
2492 int result = reply.readInt();
2493 reply.recycle();
2494 data.recycle();
2495 return result;
2496 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002497 public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage,
2498 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Jeff Hao1b012d32014-08-20 10:35:34 -07002499 int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options,
2500 int userId) throws RemoteException {
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002501 Parcel data = Parcel.obtain();
2502 Parcel reply = Parcel.obtain();
2503 data.writeInterfaceToken(IActivityManager.descriptor);
2504 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002505 data.writeString(callingPackage);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002506 intent.writeToParcel(data, 0);
2507 data.writeString(resolvedType);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002508 data.writeStrongBinder(resultTo);
2509 data.writeString(resultWho);
2510 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002511 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002512 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002513 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002514 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002515 } else {
2516 data.writeInt(0);
2517 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002518 if (options != null) {
2519 data.writeInt(1);
2520 options.writeToParcel(data, 0);
2521 } else {
2522 data.writeInt(0);
2523 }
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002524 data.writeInt(userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002525 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
2526 reply.readException();
2527 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
2528 reply.recycle();
2529 data.recycle();
2530 return result;
2531 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002532 public int startActivityWithConfig(IApplicationThread caller, String callingPackage,
2533 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002534 int requestCode, int startFlags, Configuration config,
Dianne Hackborn41203752012-08-31 14:05:51 -07002535 Bundle options, int userId) throws RemoteException {
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002536 Parcel data = Parcel.obtain();
2537 Parcel reply = Parcel.obtain();
2538 data.writeInterfaceToken(IActivityManager.descriptor);
2539 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002540 data.writeString(callingPackage);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002541 intent.writeToParcel(data, 0);
2542 data.writeString(resolvedType);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002543 data.writeStrongBinder(resultTo);
2544 data.writeString(resultWho);
2545 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002546 data.writeInt(startFlags);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002547 config.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002548 if (options != null) {
2549 data.writeInt(1);
2550 options.writeToParcel(data, 0);
2551 } else {
2552 data.writeInt(0);
2553 }
Dianne Hackborn41203752012-08-31 14:05:51 -07002554 data.writeInt(userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002555 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2556 reply.readException();
2557 int result = reply.readInt();
2558 reply.recycle();
2559 data.recycle();
2560 return result;
2561 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002562 public int startActivityIntentSender(IApplicationThread caller,
2563 IntentSender intent, Intent fillInIntent, String resolvedType,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002564 IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002565 int flagsMask, int flagsValues, Bundle options) throws RemoteException {
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002566 Parcel data = Parcel.obtain();
2567 Parcel reply = Parcel.obtain();
2568 data.writeInterfaceToken(IActivityManager.descriptor);
2569 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2570 intent.writeToParcel(data, 0);
2571 if (fillInIntent != null) {
2572 data.writeInt(1);
2573 fillInIntent.writeToParcel(data, 0);
2574 } else {
2575 data.writeInt(0);
2576 }
2577 data.writeString(resolvedType);
2578 data.writeStrongBinder(resultTo);
2579 data.writeString(resultWho);
2580 data.writeInt(requestCode);
2581 data.writeInt(flagsMask);
2582 data.writeInt(flagsValues);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002583 if (options != null) {
2584 data.writeInt(1);
2585 options.writeToParcel(data, 0);
2586 } else {
2587 data.writeInt(0);
2588 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002589 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002590 reply.readException();
2591 int result = reply.readInt();
2592 reply.recycle();
2593 data.recycle();
2594 return result;
2595 }
Dianne Hackborn91097de2014-04-04 18:02:06 -07002596 public int startVoiceActivity(String callingPackage, int callingPid, int callingUid,
2597 Intent intent, String resolvedType, IVoiceInteractionSession session,
Jeff Hao1b012d32014-08-20 10:35:34 -07002598 IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo,
2599 Bundle options, int userId) throws RemoteException {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002600 Parcel data = Parcel.obtain();
2601 Parcel reply = Parcel.obtain();
2602 data.writeInterfaceToken(IActivityManager.descriptor);
2603 data.writeString(callingPackage);
2604 data.writeInt(callingPid);
2605 data.writeInt(callingUid);
2606 intent.writeToParcel(data, 0);
2607 data.writeString(resolvedType);
2608 data.writeStrongBinder(session.asBinder());
2609 data.writeStrongBinder(interactor.asBinder());
2610 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002611 if (profilerInfo != null) {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002612 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002613 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn91097de2014-04-04 18:02:06 -07002614 } else {
2615 data.writeInt(0);
2616 }
2617 if (options != null) {
2618 data.writeInt(1);
2619 options.writeToParcel(data, 0);
2620 } else {
2621 data.writeInt(0);
2622 }
2623 data.writeInt(userId);
2624 mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0);
2625 reply.readException();
2626 int result = reply.readInt();
2627 reply.recycle();
2628 data.recycle();
2629 return result;
2630 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002631 public boolean startNextMatchingActivity(IBinder callingActivity,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002632 Intent intent, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002633 Parcel data = Parcel.obtain();
2634 Parcel reply = Parcel.obtain();
2635 data.writeInterfaceToken(IActivityManager.descriptor);
2636 data.writeStrongBinder(callingActivity);
2637 intent.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002638 if (options != null) {
2639 data.writeInt(1);
2640 options.writeToParcel(data, 0);
2641 } else {
2642 data.writeInt(0);
2643 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002644 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
2645 reply.readException();
2646 int result = reply.readInt();
2647 reply.recycle();
2648 data.recycle();
2649 return result != 0;
2650 }
Craig Mautnerdc00cbe2014-07-20 17:48:47 -07002651 public int startActivityFromRecents(int taskId, Bundle options) throws RemoteException {
2652 Parcel data = Parcel.obtain();
2653 Parcel reply = Parcel.obtain();
2654 data.writeInterfaceToken(IActivityManager.descriptor);
2655 data.writeInt(taskId);
2656 if (options == null) {
2657 data.writeInt(0);
2658 } else {
2659 data.writeInt(1);
2660 options.writeToParcel(data, 0);
2661 }
2662 mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0);
2663 reply.readException();
2664 int result = reply.readInt();
2665 reply.recycle();
2666 data.recycle();
2667 return result;
2668 }
Winson Chung3b3f4642014-04-22 10:08:18 -07002669 public boolean finishActivity(IBinder token, int resultCode, Intent resultData, boolean finishTask)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002670 throws RemoteException {
2671 Parcel data = Parcel.obtain();
2672 Parcel reply = Parcel.obtain();
2673 data.writeInterfaceToken(IActivityManager.descriptor);
2674 data.writeStrongBinder(token);
2675 data.writeInt(resultCode);
2676 if (resultData != null) {
2677 data.writeInt(1);
2678 resultData.writeToParcel(data, 0);
2679 } else {
2680 data.writeInt(0);
2681 }
Winson Chung3b3f4642014-04-22 10:08:18 -07002682 data.writeInt(finishTask ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002683 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
2684 reply.readException();
2685 boolean res = reply.readInt() != 0;
2686 data.recycle();
2687 reply.recycle();
2688 return res;
2689 }
2690 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
2691 {
2692 Parcel data = Parcel.obtain();
2693 Parcel reply = Parcel.obtain();
2694 data.writeInterfaceToken(IActivityManager.descriptor);
2695 data.writeStrongBinder(token);
2696 data.writeString(resultWho);
2697 data.writeInt(requestCode);
2698 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
2699 reply.readException();
2700 data.recycle();
2701 reply.recycle();
2702 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -07002703 public boolean finishActivityAffinity(IBinder token) throws RemoteException {
2704 Parcel data = Parcel.obtain();
2705 Parcel reply = Parcel.obtain();
2706 data.writeInterfaceToken(IActivityManager.descriptor);
2707 data.writeStrongBinder(token);
2708 mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0);
2709 reply.readException();
2710 boolean res = reply.readInt() != 0;
2711 data.recycle();
2712 reply.recycle();
2713 return res;
2714 }
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -07002715 public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException {
2716 Parcel data = Parcel.obtain();
2717 Parcel reply = Parcel.obtain();
2718 data.writeInterfaceToken(IActivityManager.descriptor);
2719 data.writeStrongBinder(session.asBinder());
2720 mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0);
2721 reply.readException();
2722 data.recycle();
2723 reply.recycle();
2724 }
Dianne Hackborn89ad4562014-08-24 16:45:38 -07002725 public boolean releaseActivityInstance(IBinder token) throws RemoteException {
2726 Parcel data = Parcel.obtain();
2727 Parcel reply = Parcel.obtain();
2728 data.writeInterfaceToken(IActivityManager.descriptor);
2729 data.writeStrongBinder(token);
2730 mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0);
2731 reply.readException();
2732 boolean res = reply.readInt() != 0;
2733 data.recycle();
2734 reply.recycle();
2735 return res;
2736 }
2737 public void releaseSomeActivities(IApplicationThread app) throws RemoteException {
2738 Parcel data = Parcel.obtain();
2739 Parcel reply = Parcel.obtain();
2740 data.writeInterfaceToken(IActivityManager.descriptor);
2741 data.writeStrongBinder(app.asBinder());
2742 mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0);
2743 reply.readException();
2744 data.recycle();
2745 reply.recycle();
2746 }
Dianne Hackborn061d58a2010-03-12 15:07:06 -08002747 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
2748 Parcel data = Parcel.obtain();
2749 Parcel reply = Parcel.obtain();
2750 data.writeInterfaceToken(IActivityManager.descriptor);
2751 data.writeStrongBinder(token);
2752 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
2753 reply.readException();
2754 boolean res = reply.readInt() != 0;
2755 data.recycle();
2756 reply.recycle();
2757 return res;
2758 }
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002759 public Intent registerReceiver(IApplicationThread caller, String packageName,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002760 IIntentReceiver receiver,
Dianne Hackborn20e80982012-08-31 19:00:44 -07002761 IntentFilter filter, String perm, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002762 {
2763 Parcel data = Parcel.obtain();
2764 Parcel reply = Parcel.obtain();
2765 data.writeInterfaceToken(IActivityManager.descriptor);
2766 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002767 data.writeString(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002768 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
2769 filter.writeToParcel(data, 0);
2770 data.writeString(perm);
Dianne Hackborn20e80982012-08-31 19:00:44 -07002771 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002772 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2773 reply.readException();
2774 Intent intent = null;
2775 int haveIntent = reply.readInt();
2776 if (haveIntent != 0) {
2777 intent = Intent.CREATOR.createFromParcel(reply);
2778 }
2779 reply.recycle();
2780 data.recycle();
2781 return intent;
2782 }
2783 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
2784 {
2785 Parcel data = Parcel.obtain();
2786 Parcel reply = Parcel.obtain();
2787 data.writeInterfaceToken(IActivityManager.descriptor);
2788 data.writeStrongBinder(receiver.asBinder());
2789 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2790 reply.readException();
2791 data.recycle();
2792 reply.recycle();
2793 }
2794 public int broadcastIntent(IApplicationThread caller,
2795 Intent intent, String resolvedType, IIntentReceiver resultTo,
2796 int resultCode, String resultData, Bundle map,
Dianne Hackbornf51f6122013-02-04 18:23:34 -08002797 String requiredPermission, int appOp, boolean serialized,
Amith Yamasani742a6712011-05-04 14:49:28 -07002798 boolean sticky, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002799 {
2800 Parcel data = Parcel.obtain();
2801 Parcel reply = Parcel.obtain();
2802 data.writeInterfaceToken(IActivityManager.descriptor);
2803 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2804 intent.writeToParcel(data, 0);
2805 data.writeString(resolvedType);
2806 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
2807 data.writeInt(resultCode);
2808 data.writeString(resultData);
2809 data.writeBundle(map);
2810 data.writeString(requiredPermission);
Dianne Hackbornf51f6122013-02-04 18:23:34 -08002811 data.writeInt(appOp);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002812 data.writeInt(serialized ? 1 : 0);
2813 data.writeInt(sticky ? 1 : 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07002814 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002815 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
2816 reply.readException();
2817 int res = reply.readInt();
2818 reply.recycle();
2819 data.recycle();
2820 return res;
2821 }
Amith Yamasani742a6712011-05-04 14:49:28 -07002822 public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
2823 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002824 {
2825 Parcel data = Parcel.obtain();
2826 Parcel reply = Parcel.obtain();
2827 data.writeInterfaceToken(IActivityManager.descriptor);
2828 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2829 intent.writeToParcel(data, 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07002830 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002831 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
2832 reply.readException();
2833 data.recycle();
2834 reply.recycle();
2835 }
2836 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, boolean abortBroadcast) throws RemoteException
2837 {
2838 Parcel data = Parcel.obtain();
2839 Parcel reply = Parcel.obtain();
2840 data.writeInterfaceToken(IActivityManager.descriptor);
2841 data.writeStrongBinder(who);
2842 data.writeInt(resultCode);
2843 data.writeString(resultData);
2844 data.writeBundle(map);
2845 data.writeInt(abortBroadcast ? 1 : 0);
2846 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2847 reply.readException();
2848 data.recycle();
2849 reply.recycle();
2850 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002851 public void attachApplication(IApplicationThread app) throws RemoteException
2852 {
2853 Parcel data = Parcel.obtain();
2854 Parcel reply = Parcel.obtain();
2855 data.writeInterfaceToken(IActivityManager.descriptor);
2856 data.writeStrongBinder(app.asBinder());
2857 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
2858 reply.readException();
2859 data.recycle();
2860 reply.recycle();
2861 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002862 public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
2863 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002864 {
2865 Parcel data = Parcel.obtain();
2866 Parcel reply = Parcel.obtain();
2867 data.writeInterfaceToken(IActivityManager.descriptor);
2868 data.writeStrongBinder(token);
Dianne Hackborne88846e2009-09-30 21:34:25 -07002869 if (config != null) {
2870 data.writeInt(1);
2871 config.writeToParcel(data, 0);
2872 } else {
2873 data.writeInt(0);
2874 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002875 data.writeInt(stopProfiling ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002876 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2877 reply.readException();
2878 data.recycle();
2879 reply.recycle();
2880 }
Dianne Hackbornad9b32112012-09-17 15:35:01 -07002881 public void activityResumed(IBinder token) throws RemoteException
2882 {
2883 Parcel data = Parcel.obtain();
2884 Parcel reply = Parcel.obtain();
2885 data.writeInterfaceToken(IActivityManager.descriptor);
2886 data.writeStrongBinder(token);
2887 mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0);
2888 reply.readException();
2889 data.recycle();
2890 reply.recycle();
2891 }
Dianne Hackborna4e102e2014-09-04 22:52:27 -07002892 public void activityPaused(IBinder token) throws RemoteException
Dianne Hackborn0aae2d42010-12-07 23:51:29 -08002893 {
2894 Parcel data = Parcel.obtain();
2895 Parcel reply = Parcel.obtain();
2896 data.writeInterfaceToken(IActivityManager.descriptor);
2897 data.writeStrongBinder(token);
2898 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
2899 reply.readException();
2900 data.recycle();
2901 reply.recycle();
2902 }
2903 public void activityStopped(IBinder token, Bundle state,
Craig Mautnera0026042014-04-23 11:45:37 -07002904 PersistableBundle persistentState, CharSequence description) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002905 {
2906 Parcel data = Parcel.obtain();
2907 Parcel reply = Parcel.obtain();
2908 data.writeInterfaceToken(IActivityManager.descriptor);
2909 data.writeStrongBinder(token);
2910 data.writeBundle(state);
Craig Mautnera0026042014-04-23 11:45:37 -07002911 data.writePersistableBundle(persistentState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002912 TextUtils.writeToParcel(description, data, 0);
2913 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2914 reply.readException();
2915 data.recycle();
2916 reply.recycle();
2917 }
Dianne Hackborn4eba96b2011-01-21 13:34:36 -08002918 public void activitySlept(IBinder token) throws RemoteException
2919 {
2920 Parcel data = Parcel.obtain();
2921 Parcel reply = Parcel.obtain();
2922 data.writeInterfaceToken(IActivityManager.descriptor);
2923 data.writeStrongBinder(token);
2924 mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2925 reply.readException();
2926 data.recycle();
2927 reply.recycle();
2928 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002929 public void activityDestroyed(IBinder token) throws RemoteException
2930 {
2931 Parcel data = Parcel.obtain();
2932 Parcel reply = Parcel.obtain();
2933 data.writeInterfaceToken(IActivityManager.descriptor);
2934 data.writeStrongBinder(token);
2935 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2936 reply.readException();
2937 data.recycle();
2938 reply.recycle();
2939 }
2940 public String getCallingPackage(IBinder token) throws RemoteException
2941 {
2942 Parcel data = Parcel.obtain();
2943 Parcel reply = Parcel.obtain();
2944 data.writeInterfaceToken(IActivityManager.descriptor);
2945 data.writeStrongBinder(token);
2946 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
2947 reply.readException();
2948 String res = reply.readString();
2949 data.recycle();
2950 reply.recycle();
2951 return res;
2952 }
2953 public ComponentName getCallingActivity(IBinder token)
2954 throws RemoteException {
2955 Parcel data = Parcel.obtain();
2956 Parcel reply = Parcel.obtain();
2957 data.writeInterfaceToken(IActivityManager.descriptor);
2958 data.writeStrongBinder(token);
2959 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
2960 reply.readException();
2961 ComponentName res = ComponentName.readFromParcel(reply);
2962 data.recycle();
2963 reply.recycle();
2964 return res;
2965 }
Dianne Hackborn885fbe52014-08-23 15:23:58 -07002966 public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException {
Winson Chung1147c402014-05-14 11:05:00 -07002967 Parcel data = Parcel.obtain();
2968 Parcel reply = Parcel.obtain();
2969 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -07002970 data.writeString(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -07002971 mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0);
2972 reply.readException();
2973 ArrayList<IAppTask> list = null;
2974 int N = reply.readInt();
2975 if (N >= 0) {
2976 list = new ArrayList<IAppTask>();
2977 while (N > 0) {
2978 IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder());
2979 list.add(task);
2980 N--;
2981 }
2982 }
2983 data.recycle();
2984 reply.recycle();
2985 return list;
2986 }
Dianne Hackbornaec68bb2014-08-20 15:25:13 -07002987 public int addAppTask(IBinder activityToken, Intent intent,
2988 ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException {
2989 Parcel data = Parcel.obtain();
2990 Parcel reply = Parcel.obtain();
2991 data.writeInterfaceToken(IActivityManager.descriptor);
2992 data.writeStrongBinder(activityToken);
2993 intent.writeToParcel(data, 0);
2994 description.writeToParcel(data, 0);
2995 thumbnail.writeToParcel(data, 0);
2996 mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0);
2997 reply.readException();
2998 int res = reply.readInt();
2999 data.recycle();
3000 reply.recycle();
3001 return res;
3002 }
3003 public Point getAppTaskThumbnailSize() throws RemoteException {
3004 Parcel data = Parcel.obtain();
3005 Parcel reply = Parcel.obtain();
3006 data.writeInterfaceToken(IActivityManager.descriptor);
3007 mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0);
3008 reply.readException();
3009 Point size = Point.CREATOR.createFromParcel(reply);
3010 data.recycle();
3011 reply.recycle();
3012 return size;
3013 }
Dianne Hackborn09233282014-04-30 11:33:59 -07003014 public List getTasks(int maxNum, int flags) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003015 Parcel data = Parcel.obtain();
3016 Parcel reply = Parcel.obtain();
3017 data.writeInterfaceToken(IActivityManager.descriptor);
3018 data.writeInt(maxNum);
3019 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003020 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
3021 reply.readException();
3022 ArrayList list = null;
3023 int N = reply.readInt();
3024 if (N >= 0) {
3025 list = new ArrayList();
3026 while (N > 0) {
3027 ActivityManager.RunningTaskInfo info =
3028 ActivityManager.RunningTaskInfo.CREATOR
Winson Chung1147c402014-05-14 11:05:00 -07003029 .createFromParcel(reply);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003030 list.add(info);
3031 N--;
3032 }
3033 }
3034 data.recycle();
3035 reply.recycle();
3036 return list;
3037 }
3038 public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -07003039 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003040 Parcel data = Parcel.obtain();
3041 Parcel reply = Parcel.obtain();
3042 data.writeInterfaceToken(IActivityManager.descriptor);
3043 data.writeInt(maxNum);
3044 data.writeInt(flags);
Amith Yamasani82644082012-08-03 13:09:11 -07003045 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003046 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
3047 reply.readException();
3048 ArrayList<ActivityManager.RecentTaskInfo> list
3049 = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR);
3050 data.recycle();
3051 reply.recycle();
3052 return list;
3053 }
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003054 public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException {
Dianne Hackbornd94df452011-02-16 18:53:31 -08003055 Parcel data = Parcel.obtain();
3056 Parcel reply = Parcel.obtain();
3057 data.writeInterfaceToken(IActivityManager.descriptor);
3058 data.writeInt(id);
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003059 mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003060 reply.readException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003061 ActivityManager.TaskThumbnail taskThumbnail = null;
Dianne Hackbornd94df452011-02-16 18:53:31 -08003062 if (reply.readInt() != 0) {
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003063 taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003064 }
3065 data.recycle();
3066 reply.recycle();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003067 return taskThumbnail;
Dianne Hackborn15491c62012-09-19 10:59:14 -07003068 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003069 public List getServices(int maxNum, int flags) throws RemoteException {
3070 Parcel data = Parcel.obtain();
3071 Parcel reply = Parcel.obtain();
3072 data.writeInterfaceToken(IActivityManager.descriptor);
3073 data.writeInt(maxNum);
3074 data.writeInt(flags);
3075 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
3076 reply.readException();
3077 ArrayList list = null;
3078 int N = reply.readInt();
3079 if (N >= 0) {
3080 list = new ArrayList();
3081 while (N > 0) {
3082 ActivityManager.RunningServiceInfo info =
3083 ActivityManager.RunningServiceInfo.CREATOR
3084 .createFromParcel(reply);
3085 list.add(info);
3086 N--;
3087 }
3088 }
3089 data.recycle();
3090 reply.recycle();
3091 return list;
3092 }
3093 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
3094 throws RemoteException {
3095 Parcel data = Parcel.obtain();
3096 Parcel reply = Parcel.obtain();
3097 data.writeInterfaceToken(IActivityManager.descriptor);
3098 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
3099 reply.readException();
3100 ArrayList<ActivityManager.ProcessErrorStateInfo> list
3101 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
3102 data.recycle();
3103 reply.recycle();
3104 return list;
3105 }
3106 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
3107 throws RemoteException {
3108 Parcel data = Parcel.obtain();
3109 Parcel reply = Parcel.obtain();
3110 data.writeInterfaceToken(IActivityManager.descriptor);
3111 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
3112 reply.readException();
3113 ArrayList<ActivityManager.RunningAppProcessInfo> list
3114 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
3115 data.recycle();
3116 reply.recycle();
3117 return list;
3118 }
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -07003119 public List<ApplicationInfo> getRunningExternalApplications()
3120 throws RemoteException {
3121 Parcel data = Parcel.obtain();
3122 Parcel reply = Parcel.obtain();
3123 data.writeInterfaceToken(IActivityManager.descriptor);
3124 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
3125 reply.readException();
3126 ArrayList<ApplicationInfo> list
3127 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
3128 data.recycle();
3129 reply.recycle();
3130 return list;
3131 }
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003132 public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003133 {
3134 Parcel data = Parcel.obtain();
3135 Parcel reply = Parcel.obtain();
3136 data.writeInterfaceToken(IActivityManager.descriptor);
3137 data.writeInt(task);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003138 data.writeInt(flags);
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003139 if (options != null) {
3140 data.writeInt(1);
3141 options.writeToParcel(data, 0);
3142 } else {
3143 data.writeInt(0);
3144 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003145 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
3146 reply.readException();
3147 data.recycle();
3148 reply.recycle();
3149 }
3150 public void moveTaskToBack(int task) throws RemoteException
3151 {
3152 Parcel data = Parcel.obtain();
3153 Parcel reply = Parcel.obtain();
3154 data.writeInterfaceToken(IActivityManager.descriptor);
3155 data.writeInt(task);
3156 mRemote.transact(MOVE_TASK_TO_BACK_TRANSACTION, data, reply, 0);
3157 reply.readException();
3158 data.recycle();
3159 reply.recycle();
3160 }
3161 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
3162 throws RemoteException {
3163 Parcel data = Parcel.obtain();
3164 Parcel reply = Parcel.obtain();
3165 data.writeInterfaceToken(IActivityManager.descriptor);
3166 data.writeStrongBinder(token);
3167 data.writeInt(nonRoot ? 1 : 0);
3168 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
3169 reply.readException();
3170 boolean res = reply.readInt() != 0;
3171 data.recycle();
3172 reply.recycle();
3173 return res;
3174 }
3175 public void moveTaskBackwards(int task) throws RemoteException
3176 {
3177 Parcel data = Parcel.obtain();
3178 Parcel reply = Parcel.obtain();
3179 data.writeInterfaceToken(IActivityManager.descriptor);
3180 data.writeInt(task);
3181 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
3182 reply.readException();
3183 data.recycle();
3184 reply.recycle();
3185 }
Craig Mautnerc00204b2013-03-05 15:02:14 -08003186 @Override
Craig Mautnerc00204b2013-03-05 15:02:14 -08003187 public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException
3188 {
3189 Parcel data = Parcel.obtain();
3190 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003191 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003192 data.writeInt(taskId);
3193 data.writeInt(stackId);
3194 data.writeInt(toTop ? 1 : 0);
3195 mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0);
3196 reply.readException();
3197 data.recycle();
3198 reply.recycle();
3199 }
3200 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003201 public void resizeStack(int stackBoxId, Rect r) throws RemoteException
Craig Mautnerc00204b2013-03-05 15:02:14 -08003202 {
3203 Parcel data = Parcel.obtain();
3204 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003205 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautner5a449152013-05-24 15:49:29 -07003206 data.writeInt(stackBoxId);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003207 r.writeToParcel(data, 0);
Craig Mautnercf910b02013-04-23 11:23:27 -07003208 mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003209 reply.readException();
3210 data.recycle();
3211 reply.recycle();
3212 }
Craig Mautner967212c2013-04-13 21:10:58 -07003213 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003214 public List<StackInfo> getAllStackInfos() throws RemoteException
Craig Mautner5ff12102013-05-24 12:50:15 -07003215 {
3216 Parcel data = Parcel.obtain();
3217 Parcel reply = Parcel.obtain();
3218 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003219 mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0);
Craig Mautner5ff12102013-05-24 12:50:15 -07003220 reply.readException();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003221 ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR);
Craig Mautner967212c2013-04-13 21:10:58 -07003222 data.recycle();
3223 reply.recycle();
3224 return list;
3225 }
Craig Mautnercf910b02013-04-23 11:23:27 -07003226 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003227 public StackInfo getStackInfo(int stackId) throws RemoteException
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003228 {
3229 Parcel data = Parcel.obtain();
3230 Parcel reply = Parcel.obtain();
3231 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003232 data.writeInt(stackId);
3233 mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003234 reply.readException();
3235 int res = reply.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003236 StackInfo info = null;
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003237 if (res != 0) {
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003238 info = StackInfo.CREATOR.createFromParcel(reply);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003239 }
3240 data.recycle();
3241 reply.recycle();
3242 return info;
3243 }
3244 @Override
Winson Chung303e1ff2014-03-07 15:06:19 -08003245 public boolean isInHomeStack(int taskId) throws RemoteException {
3246 Parcel data = Parcel.obtain();
3247 Parcel reply = Parcel.obtain();
3248 data.writeInterfaceToken(IActivityManager.descriptor);
3249 data.writeInt(taskId);
3250 mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0);
3251 reply.readException();
3252 boolean isInHomeStack = reply.readInt() > 0;
3253 data.recycle();
3254 reply.recycle();
3255 return isInHomeStack;
3256 }
3257 @Override
Craig Mautnercf910b02013-04-23 11:23:27 -07003258 public void setFocusedStack(int stackId) throws RemoteException
3259 {
3260 Parcel data = Parcel.obtain();
3261 Parcel reply = Parcel.obtain();
3262 data.writeInterfaceToken(IActivityManager.descriptor);
3263 data.writeInt(stackId);
3264 mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3265 reply.readException();
3266 data.recycle();
3267 reply.recycle();
3268 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003269 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
3270 {
3271 Parcel data = Parcel.obtain();
3272 Parcel reply = Parcel.obtain();
3273 data.writeInterfaceToken(IActivityManager.descriptor);
3274 data.writeStrongBinder(token);
3275 data.writeInt(onlyRoot ? 1 : 0);
3276 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
3277 reply.readException();
3278 int res = reply.readInt();
3279 data.recycle();
3280 reply.recycle();
3281 return res;
3282 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003283 public ContentProviderHolder getContentProvider(IApplicationThread caller,
Jeff Sharkey6d515712012-09-20 16:06:08 -07003284 String name, int userId, boolean stable) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003285 Parcel data = Parcel.obtain();
3286 Parcel reply = Parcel.obtain();
3287 data.writeInterfaceToken(IActivityManager.descriptor);
3288 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3289 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003290 data.writeInt(userId);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003291 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003292 mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3293 reply.readException();
3294 int res = reply.readInt();
3295 ContentProviderHolder cph = null;
3296 if (res != 0) {
3297 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3298 }
3299 data.recycle();
3300 reply.recycle();
3301 return cph;
3302 }
Jeff Sharkey6d515712012-09-20 16:06:08 -07003303 public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token)
3304 throws RemoteException {
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003305 Parcel data = Parcel.obtain();
3306 Parcel reply = Parcel.obtain();
3307 data.writeInterfaceToken(IActivityManager.descriptor);
3308 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003309 data.writeInt(userId);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003310 data.writeStrongBinder(token);
3311 mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3312 reply.readException();
3313 int res = reply.readInt();
3314 ContentProviderHolder cph = null;
3315 if (res != 0) {
3316 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3317 }
3318 data.recycle();
3319 reply.recycle();
3320 return cph;
3321 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003322 public void publishContentProviders(IApplicationThread caller,
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003323 List<ContentProviderHolder> providers) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003324 {
3325 Parcel data = Parcel.obtain();
3326 Parcel reply = Parcel.obtain();
3327 data.writeInterfaceToken(IActivityManager.descriptor);
3328 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3329 data.writeTypedList(providers);
3330 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
3331 reply.readException();
3332 data.recycle();
3333 reply.recycle();
3334 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003335 public boolean refContentProvider(IBinder connection, int stable, int unstable)
3336 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003337 Parcel data = Parcel.obtain();
3338 Parcel reply = Parcel.obtain();
3339 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003340 data.writeStrongBinder(connection);
3341 data.writeInt(stable);
3342 data.writeInt(unstable);
3343 mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3344 reply.readException();
3345 boolean res = reply.readInt() != 0;
3346 data.recycle();
3347 reply.recycle();
3348 return res;
3349 }
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003350
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003351 public void unstableProviderDied(IBinder connection) throws RemoteException {
3352 Parcel data = Parcel.obtain();
3353 Parcel reply = Parcel.obtain();
3354 data.writeInterfaceToken(IActivityManager.descriptor);
3355 data.writeStrongBinder(connection);
3356 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0);
3357 reply.readException();
3358 data.recycle();
3359 reply.recycle();
3360 }
3361
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003362 @Override
3363 public void appNotRespondingViaProvider(IBinder connection) throws RemoteException {
3364 Parcel data = Parcel.obtain();
3365 Parcel reply = Parcel.obtain();
3366 data.writeInterfaceToken(IActivityManager.descriptor);
3367 data.writeStrongBinder(connection);
3368 mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0);
3369 reply.readException();
3370 data.recycle();
3371 reply.recycle();
3372 }
3373
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003374 public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException {
3375 Parcel data = Parcel.obtain();
3376 Parcel reply = Parcel.obtain();
3377 data.writeInterfaceToken(IActivityManager.descriptor);
3378 data.writeStrongBinder(connection);
3379 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003380 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3381 reply.readException();
3382 data.recycle();
3383 reply.recycle();
3384 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003385
3386 public void removeContentProviderExternal(String name, IBinder token) throws RemoteException {
3387 Parcel data = Parcel.obtain();
3388 Parcel reply = Parcel.obtain();
3389 data.writeInterfaceToken(IActivityManager.descriptor);
3390 data.writeString(name);
3391 data.writeStrongBinder(token);
3392 mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3393 reply.readException();
3394 data.recycle();
3395 reply.recycle();
3396 }
3397
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07003398 public PendingIntent getRunningServiceControlPanel(ComponentName service)
3399 throws RemoteException
3400 {
3401 Parcel data = Parcel.obtain();
3402 Parcel reply = Parcel.obtain();
3403 data.writeInterfaceToken(IActivityManager.descriptor);
3404 service.writeToParcel(data, 0);
3405 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
3406 reply.readException();
3407 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
3408 data.recycle();
3409 reply.recycle();
3410 return res;
3411 }
3412
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003413 public ComponentName startService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003414 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003415 {
3416 Parcel data = Parcel.obtain();
3417 Parcel reply = Parcel.obtain();
3418 data.writeInterfaceToken(IActivityManager.descriptor);
3419 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3420 service.writeToParcel(data, 0);
3421 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003422 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003423 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
3424 reply.readException();
3425 ComponentName res = ComponentName.readFromParcel(reply);
3426 data.recycle();
3427 reply.recycle();
3428 return res;
3429 }
3430 public int stopService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003431 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003432 {
3433 Parcel data = Parcel.obtain();
3434 Parcel reply = Parcel.obtain();
3435 data.writeInterfaceToken(IActivityManager.descriptor);
3436 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3437 service.writeToParcel(data, 0);
3438 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003439 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003440 mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0);
3441 reply.readException();
3442 int res = reply.readInt();
3443 reply.recycle();
3444 data.recycle();
3445 return res;
3446 }
3447 public boolean stopServiceToken(ComponentName className, IBinder token,
3448 int startId) throws RemoteException {
3449 Parcel data = Parcel.obtain();
3450 Parcel reply = Parcel.obtain();
3451 data.writeInterfaceToken(IActivityManager.descriptor);
3452 ComponentName.writeToParcel(className, data);
3453 data.writeStrongBinder(token);
3454 data.writeInt(startId);
3455 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
3456 reply.readException();
3457 boolean res = reply.readInt() != 0;
3458 data.recycle();
3459 reply.recycle();
3460 return res;
3461 }
3462 public void setServiceForeground(ComponentName className, IBinder token,
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003463 int id, Notification notification, boolean removeNotification) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003464 Parcel data = Parcel.obtain();
3465 Parcel reply = Parcel.obtain();
3466 data.writeInterfaceToken(IActivityManager.descriptor);
3467 ComponentName.writeToParcel(className, data);
3468 data.writeStrongBinder(token);
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003469 data.writeInt(id);
3470 if (notification != null) {
3471 data.writeInt(1);
3472 notification.writeToParcel(data, 0);
3473 } else {
3474 data.writeInt(0);
3475 }
3476 data.writeInt(removeNotification ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003477 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
3478 reply.readException();
3479 data.recycle();
3480 reply.recycle();
3481 }
3482 public int bindService(IApplicationThread caller, IBinder token,
3483 Intent service, String resolvedType, IServiceConnection connection,
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003484 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003485 Parcel data = Parcel.obtain();
3486 Parcel reply = Parcel.obtain();
3487 data.writeInterfaceToken(IActivityManager.descriptor);
3488 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3489 data.writeStrongBinder(token);
3490 service.writeToParcel(data, 0);
3491 data.writeString(resolvedType);
3492 data.writeStrongBinder(connection.asBinder());
3493 data.writeInt(flags);
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003494 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003495 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
3496 reply.readException();
3497 int res = reply.readInt();
3498 data.recycle();
3499 reply.recycle();
3500 return res;
3501 }
3502 public boolean unbindService(IServiceConnection connection) throws RemoteException
3503 {
3504 Parcel data = Parcel.obtain();
3505 Parcel reply = Parcel.obtain();
3506 data.writeInterfaceToken(IActivityManager.descriptor);
3507 data.writeStrongBinder(connection.asBinder());
3508 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
3509 reply.readException();
3510 boolean res = reply.readInt() != 0;
3511 data.recycle();
3512 reply.recycle();
3513 return res;
3514 }
3515
3516 public void publishService(IBinder token,
3517 Intent intent, IBinder service) throws RemoteException {
3518 Parcel data = Parcel.obtain();
3519 Parcel reply = Parcel.obtain();
3520 data.writeInterfaceToken(IActivityManager.descriptor);
3521 data.writeStrongBinder(token);
3522 intent.writeToParcel(data, 0);
3523 data.writeStrongBinder(service);
3524 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
3525 reply.readException();
3526 data.recycle();
3527 reply.recycle();
3528 }
3529
3530 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
3531 throws RemoteException {
3532 Parcel data = Parcel.obtain();
3533 Parcel reply = Parcel.obtain();
3534 data.writeInterfaceToken(IActivityManager.descriptor);
3535 data.writeStrongBinder(token);
3536 intent.writeToParcel(data, 0);
3537 data.writeInt(doRebind ? 1 : 0);
3538 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
3539 reply.readException();
3540 data.recycle();
3541 reply.recycle();
3542 }
3543
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003544 public void serviceDoneExecuting(IBinder token, int type, int startId,
3545 int res) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003546 Parcel data = Parcel.obtain();
3547 Parcel reply = Parcel.obtain();
3548 data.writeInterfaceToken(IActivityManager.descriptor);
3549 data.writeStrongBinder(token);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003550 data.writeInt(type);
3551 data.writeInt(startId);
3552 data.writeInt(res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003553 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3554 reply.readException();
3555 data.recycle();
3556 reply.recycle();
3557 }
3558
3559 public IBinder peekService(Intent service, String resolvedType) throws RemoteException {
3560 Parcel data = Parcel.obtain();
3561 Parcel reply = Parcel.obtain();
3562 data.writeInterfaceToken(IActivityManager.descriptor);
3563 service.writeToParcel(data, 0);
3564 data.writeString(resolvedType);
3565 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
3566 reply.readException();
3567 IBinder binder = reply.readStrongBinder();
3568 reply.recycle();
3569 data.recycle();
3570 return binder;
3571 }
3572
Christopher Tate181fafa2009-05-14 11:12:14 -07003573 public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
3574 throws RemoteException {
3575 Parcel data = Parcel.obtain();
3576 Parcel reply = Parcel.obtain();
3577 data.writeInterfaceToken(IActivityManager.descriptor);
3578 app.writeToParcel(data, 0);
3579 data.writeInt(backupRestoreMode);
3580 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3581 reply.readException();
3582 boolean success = reply.readInt() != 0;
3583 reply.recycle();
3584 data.recycle();
3585 return success;
3586 }
3587
Christopher Tate346acb12012-10-15 19:20:25 -07003588 public void clearPendingBackup() throws RemoteException {
3589 Parcel data = Parcel.obtain();
3590 Parcel reply = Parcel.obtain();
3591 data.writeInterfaceToken(IActivityManager.descriptor);
3592 mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0);
3593 reply.recycle();
3594 data.recycle();
3595 }
3596
Christopher Tate181fafa2009-05-14 11:12:14 -07003597 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
3598 Parcel data = Parcel.obtain();
3599 Parcel reply = Parcel.obtain();
3600 data.writeInterfaceToken(IActivityManager.descriptor);
3601 data.writeString(packageName);
3602 data.writeStrongBinder(agent);
3603 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
3604 reply.recycle();
3605 data.recycle();
3606 }
3607
3608 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
3609 Parcel data = Parcel.obtain();
3610 Parcel reply = Parcel.obtain();
3611 data.writeInterfaceToken(IActivityManager.descriptor);
3612 app.writeToParcel(data, 0);
3613 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3614 reply.readException();
3615 reply.recycle();
3616 data.recycle();
3617 }
3618
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003619 public boolean startInstrumentation(ComponentName className, String profileFile,
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003620 int flags, Bundle arguments, IInstrumentationWatcher watcher,
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01003621 IUiAutomationConnection connection, int userId, String instructionSet)
3622 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003623 Parcel data = Parcel.obtain();
3624 Parcel reply = Parcel.obtain();
3625 data.writeInterfaceToken(IActivityManager.descriptor);
3626 ComponentName.writeToParcel(className, data);
3627 data.writeString(profileFile);
3628 data.writeInt(flags);
3629 data.writeBundle(arguments);
3630 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003631 data.writeStrongBinder(connection != null ? connection.asBinder() : null);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07003632 data.writeInt(userId);
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01003633 data.writeString(instructionSet);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003634 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3635 reply.readException();
3636 boolean res = reply.readInt() != 0;
3637 reply.recycle();
3638 data.recycle();
3639 return res;
3640 }
3641
3642 public void finishInstrumentation(IApplicationThread target,
3643 int resultCode, Bundle results) throws RemoteException {
3644 Parcel data = Parcel.obtain();
3645 Parcel reply = Parcel.obtain();
3646 data.writeInterfaceToken(IActivityManager.descriptor);
3647 data.writeStrongBinder(target != null ? target.asBinder() : null);
3648 data.writeInt(resultCode);
3649 data.writeBundle(results);
3650 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3651 reply.readException();
3652 data.recycle();
3653 reply.recycle();
3654 }
3655 public Configuration getConfiguration() throws RemoteException
3656 {
3657 Parcel data = Parcel.obtain();
3658 Parcel reply = Parcel.obtain();
3659 data.writeInterfaceToken(IActivityManager.descriptor);
3660 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
3661 reply.readException();
3662 Configuration res = Configuration.CREATOR.createFromParcel(reply);
3663 reply.recycle();
3664 data.recycle();
3665 return res;
3666 }
3667 public void updateConfiguration(Configuration values) throws RemoteException
3668 {
3669 Parcel data = Parcel.obtain();
3670 Parcel reply = Parcel.obtain();
3671 data.writeInterfaceToken(IActivityManager.descriptor);
3672 values.writeToParcel(data, 0);
3673 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
3674 reply.readException();
3675 data.recycle();
3676 reply.recycle();
3677 }
3678 public void setRequestedOrientation(IBinder token, int requestedOrientation)
3679 throws RemoteException {
3680 Parcel data = Parcel.obtain();
3681 Parcel reply = Parcel.obtain();
3682 data.writeInterfaceToken(IActivityManager.descriptor);
3683 data.writeStrongBinder(token);
3684 data.writeInt(requestedOrientation);
3685 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3686 reply.readException();
3687 data.recycle();
3688 reply.recycle();
3689 }
3690 public int getRequestedOrientation(IBinder token) throws RemoteException {
3691 Parcel data = Parcel.obtain();
3692 Parcel reply = Parcel.obtain();
3693 data.writeInterfaceToken(IActivityManager.descriptor);
3694 data.writeStrongBinder(token);
3695 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3696 reply.readException();
3697 int res = reply.readInt();
3698 data.recycle();
3699 reply.recycle();
3700 return res;
3701 }
3702 public ComponentName getActivityClassForToken(IBinder token)
3703 throws RemoteException {
3704 Parcel data = Parcel.obtain();
3705 Parcel reply = Parcel.obtain();
3706 data.writeInterfaceToken(IActivityManager.descriptor);
3707 data.writeStrongBinder(token);
3708 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
3709 reply.readException();
3710 ComponentName res = ComponentName.readFromParcel(reply);
3711 data.recycle();
3712 reply.recycle();
3713 return res;
3714 }
3715 public String getPackageForToken(IBinder token) throws RemoteException
3716 {
3717 Parcel data = Parcel.obtain();
3718 Parcel reply = Parcel.obtain();
3719 data.writeInterfaceToken(IActivityManager.descriptor);
3720 data.writeStrongBinder(token);
3721 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
3722 reply.readException();
3723 String res = reply.readString();
3724 data.recycle();
3725 reply.recycle();
3726 return res;
3727 }
3728 public IIntentSender getIntentSender(int type,
3729 String packageName, IBinder token, String resultWho,
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003730 int requestCode, Intent[] intents, String[] resolvedTypes, int flags,
Dianne Hackborn41203752012-08-31 14:05:51 -07003731 Bundle options, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003732 Parcel data = Parcel.obtain();
3733 Parcel reply = Parcel.obtain();
3734 data.writeInterfaceToken(IActivityManager.descriptor);
3735 data.writeInt(type);
3736 data.writeString(packageName);
3737 data.writeStrongBinder(token);
3738 data.writeString(resultWho);
3739 data.writeInt(requestCode);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003740 if (intents != null) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003741 data.writeInt(1);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003742 data.writeTypedArray(intents, 0);
3743 data.writeStringArray(resolvedTypes);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003744 } else {
3745 data.writeInt(0);
3746 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003747 data.writeInt(flags);
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003748 if (options != null) {
3749 data.writeInt(1);
3750 options.writeToParcel(data, 0);
3751 } else {
3752 data.writeInt(0);
3753 }
Dianne Hackborn41203752012-08-31 14:05:51 -07003754 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003755 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
3756 reply.readException();
3757 IIntentSender res = IIntentSender.Stub.asInterface(
Dianne Hackbornff170242014-11-19 10:59:01 -08003758 reply.readStrongBinder());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003759 data.recycle();
3760 reply.recycle();
3761 return res;
3762 }
3763 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
3764 Parcel data = Parcel.obtain();
3765 Parcel reply = Parcel.obtain();
3766 data.writeInterfaceToken(IActivityManager.descriptor);
3767 data.writeStrongBinder(sender.asBinder());
3768 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
3769 reply.readException();
3770 data.recycle();
3771 reply.recycle();
3772 }
3773 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
3774 Parcel data = Parcel.obtain();
3775 Parcel reply = Parcel.obtain();
3776 data.writeInterfaceToken(IActivityManager.descriptor);
3777 data.writeStrongBinder(sender.asBinder());
3778 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
3779 reply.readException();
3780 String res = reply.readString();
3781 data.recycle();
3782 reply.recycle();
3783 return res;
3784 }
Christopher Tatec4a07d12012-04-06 14:19:13 -07003785 public int getUidForIntentSender(IIntentSender sender) throws RemoteException {
3786 Parcel data = Parcel.obtain();
3787 Parcel reply = Parcel.obtain();
3788 data.writeInterfaceToken(IActivityManager.descriptor);
3789 data.writeStrongBinder(sender.asBinder());
3790 mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
3791 reply.readException();
3792 int res = reply.readInt();
3793 data.recycle();
3794 reply.recycle();
3795 return res;
3796 }
Dianne Hackborn41203752012-08-31 14:05:51 -07003797 public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
3798 boolean requireFull, String name, String callerPackage) throws RemoteException {
3799 Parcel data = Parcel.obtain();
3800 Parcel reply = Parcel.obtain();
3801 data.writeInterfaceToken(IActivityManager.descriptor);
3802 data.writeInt(callingPid);
3803 data.writeInt(callingUid);
3804 data.writeInt(userId);
3805 data.writeInt(allowAll ? 1 : 0);
3806 data.writeInt(requireFull ? 1 : 0);
3807 data.writeString(name);
3808 data.writeString(callerPackage);
3809 mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0);
3810 reply.readException();
3811 int res = reply.readInt();
3812 data.recycle();
3813 reply.recycle();
3814 return res;
3815 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003816 public void setProcessLimit(int max) throws RemoteException
3817 {
3818 Parcel data = Parcel.obtain();
3819 Parcel reply = Parcel.obtain();
3820 data.writeInterfaceToken(IActivityManager.descriptor);
3821 data.writeInt(max);
3822 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
3823 reply.readException();
3824 data.recycle();
3825 reply.recycle();
3826 }
3827 public int getProcessLimit() throws RemoteException
3828 {
3829 Parcel data = Parcel.obtain();
3830 Parcel reply = Parcel.obtain();
3831 data.writeInterfaceToken(IActivityManager.descriptor);
3832 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
3833 reply.readException();
3834 int res = reply.readInt();
3835 data.recycle();
3836 reply.recycle();
3837 return res;
3838 }
3839 public void setProcessForeground(IBinder token, int pid,
3840 boolean isForeground) throws RemoteException {
3841 Parcel data = Parcel.obtain();
3842 Parcel reply = Parcel.obtain();
3843 data.writeInterfaceToken(IActivityManager.descriptor);
3844 data.writeStrongBinder(token);
3845 data.writeInt(pid);
3846 data.writeInt(isForeground ? 1 : 0);
3847 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
3848 reply.readException();
3849 data.recycle();
3850 reply.recycle();
3851 }
3852 public int checkPermission(String permission, int pid, int uid)
3853 throws RemoteException {
3854 Parcel data = Parcel.obtain();
3855 Parcel reply = Parcel.obtain();
3856 data.writeInterfaceToken(IActivityManager.descriptor);
3857 data.writeString(permission);
3858 data.writeInt(pid);
3859 data.writeInt(uid);
3860 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
3861 reply.readException();
3862 int res = reply.readInt();
3863 data.recycle();
3864 reply.recycle();
3865 return res;
3866 }
Dianne Hackbornff170242014-11-19 10:59:01 -08003867 public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken)
3868 throws RemoteException {
3869 Parcel data = Parcel.obtain();
3870 Parcel reply = Parcel.obtain();
3871 data.writeInterfaceToken(IActivityManager.descriptor);
3872 data.writeString(permission);
3873 data.writeInt(pid);
3874 data.writeInt(uid);
3875 data.writeStrongBinder(callerToken);
3876 mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0);
3877 reply.readException();
3878 int res = reply.readInt();
3879 data.recycle();
3880 reply.recycle();
3881 return res;
3882 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003883 public boolean clearApplicationUserData(final String packageName,
Amith Yamasani742a6712011-05-04 14:49:28 -07003884 final IPackageDataObserver observer, final int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003885 Parcel data = Parcel.obtain();
3886 Parcel reply = Parcel.obtain();
3887 data.writeInterfaceToken(IActivityManager.descriptor);
3888 data.writeString(packageName);
Christopher Tate31b65f92013-09-09 14:17:27 -07003889 data.writeStrongBinder((observer != null) ? observer.asBinder() : null);
Amith Yamasani742a6712011-05-04 14:49:28 -07003890 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003891 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
3892 reply.readException();
3893 boolean res = reply.readInt() != 0;
3894 data.recycle();
3895 reply.recycle();
3896 return res;
3897 }
Dianne Hackbornff170242014-11-19 10:59:01 -08003898 public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId,
3899 IBinder callerToken) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003900 Parcel data = Parcel.obtain();
3901 Parcel reply = Parcel.obtain();
3902 data.writeInterfaceToken(IActivityManager.descriptor);
3903 uri.writeToParcel(data, 0);
3904 data.writeInt(pid);
3905 data.writeInt(uid);
3906 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003907 data.writeInt(userId);
Dianne Hackbornff170242014-11-19 10:59:01 -08003908 data.writeStrongBinder(callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003909 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
3910 reply.readException();
3911 int res = reply.readInt();
3912 data.recycle();
3913 reply.recycle();
3914 return res;
3915 }
3916 public void grantUriPermission(IApplicationThread caller, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003917 Uri uri, int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003918 Parcel data = Parcel.obtain();
3919 Parcel reply = Parcel.obtain();
3920 data.writeInterfaceToken(IActivityManager.descriptor);
3921 data.writeStrongBinder(caller.asBinder());
3922 data.writeString(targetPkg);
3923 uri.writeToParcel(data, 0);
3924 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003925 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003926 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
3927 reply.readException();
3928 data.recycle();
3929 reply.recycle();
3930 }
3931 public void revokeUriPermission(IApplicationThread caller, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003932 int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003933 Parcel data = Parcel.obtain();
3934 Parcel reply = Parcel.obtain();
3935 data.writeInterfaceToken(IActivityManager.descriptor);
3936 data.writeStrongBinder(caller.asBinder());
3937 uri.writeToParcel(data, 0);
3938 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003939 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003940 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
3941 reply.readException();
3942 data.recycle();
3943 reply.recycle();
3944 }
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003945
3946 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003947 public void takePersistableUriPermission(Uri uri, int mode, int userId)
3948 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003949 Parcel data = Parcel.obtain();
3950 Parcel reply = Parcel.obtain();
3951 data.writeInterfaceToken(IActivityManager.descriptor);
3952 uri.writeToParcel(data, 0);
3953 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003954 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003955 mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
3956 reply.readException();
3957 data.recycle();
3958 reply.recycle();
3959 }
3960
3961 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003962 public void releasePersistableUriPermission(Uri uri, int mode, int userId)
3963 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003964 Parcel data = Parcel.obtain();
3965 Parcel reply = Parcel.obtain();
3966 data.writeInterfaceToken(IActivityManager.descriptor);
3967 uri.writeToParcel(data, 0);
3968 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003969 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003970 mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
3971 reply.readException();
3972 data.recycle();
3973 reply.recycle();
3974 }
3975
3976 @Override
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07003977 public ParceledListSlice<UriPermission> getPersistedUriPermissions(
3978 String packageName, boolean incoming) throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003979 Parcel data = Parcel.obtain();
3980 Parcel reply = Parcel.obtain();
3981 data.writeInterfaceToken(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07003982 data.writeString(packageName);
3983 data.writeInt(incoming ? 1 : 0);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003984 mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
3985 reply.readException();
3986 final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel(
3987 reply);
3988 data.recycle();
3989 reply.recycle();
3990 return perms;
3991 }
3992
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003993 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
3994 throws RemoteException {
3995 Parcel data = Parcel.obtain();
3996 Parcel reply = Parcel.obtain();
3997 data.writeInterfaceToken(IActivityManager.descriptor);
3998 data.writeStrongBinder(who.asBinder());
3999 data.writeInt(waiting ? 1 : 0);
4000 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
4001 reply.readException();
4002 data.recycle();
4003 reply.recycle();
4004 }
4005 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
4006 Parcel data = Parcel.obtain();
4007 Parcel reply = Parcel.obtain();
4008 data.writeInterfaceToken(IActivityManager.descriptor);
4009 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
4010 reply.readException();
4011 outInfo.readFromParcel(reply);
4012 data.recycle();
4013 reply.recycle();
4014 }
4015 public void unhandledBack() throws RemoteException
4016 {
4017 Parcel data = Parcel.obtain();
4018 Parcel reply = Parcel.obtain();
4019 data.writeInterfaceToken(IActivityManager.descriptor);
4020 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
4021 reply.readException();
4022 data.recycle();
4023 reply.recycle();
4024 }
4025 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
4026 {
4027 Parcel data = Parcel.obtain();
4028 Parcel reply = Parcel.obtain();
4029 data.writeInterfaceToken(IActivityManager.descriptor);
4030 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
4031 reply.readException();
4032 ParcelFileDescriptor pfd = null;
4033 if (reply.readInt() != 0) {
4034 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
4035 }
4036 data.recycle();
4037 reply.recycle();
4038 return pfd;
4039 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07004040 public void setLockScreenShown(boolean shown) throws RemoteException
4041 {
4042 Parcel data = Parcel.obtain();
4043 Parcel reply = Parcel.obtain();
4044 data.writeInterfaceToken(IActivityManager.descriptor);
4045 data.writeInt(shown ? 1 : 0);
4046 mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0);
4047 reply.readException();
4048 data.recycle();
4049 reply.recycle();
4050 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004051 public void setDebugApp(
4052 String packageName, boolean waitForDebugger, boolean persistent)
4053 throws RemoteException
4054 {
4055 Parcel data = Parcel.obtain();
4056 Parcel reply = Parcel.obtain();
4057 data.writeInterfaceToken(IActivityManager.descriptor);
4058 data.writeString(packageName);
4059 data.writeInt(waitForDebugger ? 1 : 0);
4060 data.writeInt(persistent ? 1 : 0);
4061 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
4062 reply.readException();
4063 data.recycle();
4064 reply.recycle();
4065 }
4066 public void setAlwaysFinish(boolean enabled) throws RemoteException
4067 {
4068 Parcel data = Parcel.obtain();
4069 Parcel reply = Parcel.obtain();
4070 data.writeInterfaceToken(IActivityManager.descriptor);
4071 data.writeInt(enabled ? 1 : 0);
4072 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
4073 reply.readException();
4074 data.recycle();
4075 reply.recycle();
4076 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004077 public void setActivityController(IActivityController watcher) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004078 {
4079 Parcel data = Parcel.obtain();
4080 Parcel reply = Parcel.obtain();
4081 data.writeInterfaceToken(IActivityManager.descriptor);
4082 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004083 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004084 reply.readException();
4085 data.recycle();
4086 reply.recycle();
4087 }
4088 public void enterSafeMode() throws RemoteException {
4089 Parcel data = Parcel.obtain();
4090 data.writeInterfaceToken(IActivityManager.descriptor);
4091 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
4092 data.recycle();
4093 }
Dianne Hackborn099bc622014-01-22 13:39:16 -08004094 public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg)
4095 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004096 Parcel data = Parcel.obtain();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004097 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn099bc622014-01-22 13:39:16 -08004098 data.writeStrongBinder(sender.asBinder());
4099 data.writeInt(sourceUid);
4100 data.writeString(sourcePkg);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004101 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
4102 data.recycle();
4103 }
Dianne Hackborn64825172011-03-02 21:32:58 -08004104 public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004105 Parcel data = Parcel.obtain();
4106 Parcel reply = Parcel.obtain();
4107 data.writeInterfaceToken(IActivityManager.descriptor);
4108 data.writeIntArray(pids);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004109 data.writeString(reason);
Dianne Hackborn64825172011-03-02 21:32:58 -08004110 data.writeInt(secure ? 1 : 0);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004111 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07004112 reply.readException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004113 boolean res = reply.readInt() != 0;
4114 data.recycle();
4115 reply.recycle();
4116 return res;
4117 }
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07004118 @Override
4119 public boolean killProcessesBelowForeground(String reason) throws RemoteException {
4120 Parcel data = Parcel.obtain();
4121 Parcel reply = Parcel.obtain();
4122 data.writeInterfaceToken(IActivityManager.descriptor);
4123 data.writeString(reason);
4124 mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0);
4125 boolean res = reply.readInt() != 0;
4126 data.recycle();
4127 reply.recycle();
4128 return res;
4129 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004130 public boolean testIsSystemReady()
4131 {
4132 /* this base class version is never called */
4133 return true;
4134 }
Dan Egnor60d87622009-12-16 16:32:58 -08004135 public void handleApplicationCrash(IBinder app,
4136 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
4137 {
4138 Parcel data = Parcel.obtain();
4139 Parcel reply = Parcel.obtain();
4140 data.writeInterfaceToken(IActivityManager.descriptor);
4141 data.writeStrongBinder(app);
4142 crashInfo.writeToParcel(data, 0);
4143 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
4144 reply.readException();
4145 reply.recycle();
4146 data.recycle();
4147 }
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004148
Dianne Hackborn52322712014-08-26 22:47:26 -07004149 public boolean handleApplicationWtf(IBinder app, String tag, boolean system,
Dan Egnorb7f03672009-12-09 16:22:32 -08004150 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004151 {
4152 Parcel data = Parcel.obtain();
4153 Parcel reply = Parcel.obtain();
4154 data.writeInterfaceToken(IActivityManager.descriptor);
4155 data.writeStrongBinder(app);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004156 data.writeString(tag);
Dianne Hackborn52322712014-08-26 22:47:26 -07004157 data.writeInt(system ? 1 : 0);
Dan Egnorb7f03672009-12-09 16:22:32 -08004158 crashInfo.writeToParcel(data, 0);
Dan Egnor60d87622009-12-16 16:32:58 -08004159 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004160 reply.readException();
Dan Egnor60d87622009-12-16 16:32:58 -08004161 boolean res = reply.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004162 reply.recycle();
4163 data.recycle();
Dan Egnor60d87622009-12-16 16:32:58 -08004164 return res;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004165 }
Dan Egnorb7f03672009-12-09 16:22:32 -08004166
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004167 public void handleApplicationStrictModeViolation(IBinder app,
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004168 int violationMask,
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004169 StrictMode.ViolationInfo info) throws RemoteException
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004170 {
4171 Parcel data = Parcel.obtain();
4172 Parcel reply = Parcel.obtain();
4173 data.writeInterfaceToken(IActivityManager.descriptor);
4174 data.writeStrongBinder(app);
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004175 data.writeInt(violationMask);
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004176 info.writeToParcel(data, 0);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004177 mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0);
4178 reply.readException();
4179 reply.recycle();
4180 data.recycle();
4181 }
4182
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004183 public void signalPersistentProcesses(int sig) throws RemoteException {
4184 Parcel data = Parcel.obtain();
4185 Parcel reply = Parcel.obtain();
4186 data.writeInterfaceToken(IActivityManager.descriptor);
4187 data.writeInt(sig);
4188 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
4189 reply.readException();
4190 data.recycle();
4191 reply.recycle();
4192 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004193
Dianne Hackborn1676c852012-09-10 14:52:30 -07004194 public void killBackgroundProcesses(String packageName, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004195 Parcel data = Parcel.obtain();
4196 Parcel reply = Parcel.obtain();
4197 data.writeInterfaceToken(IActivityManager.descriptor);
4198 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004199 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004200 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4201 reply.readException();
4202 data.recycle();
4203 reply.recycle();
4204 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004205
4206 public void killAllBackgroundProcesses() throws RemoteException {
4207 Parcel data = Parcel.obtain();
4208 Parcel reply = Parcel.obtain();
4209 data.writeInterfaceToken(IActivityManager.descriptor);
4210 mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4211 reply.readException();
4212 data.recycle();
4213 reply.recycle();
4214 }
4215
Dianne Hackborn1676c852012-09-10 14:52:30 -07004216 public void forceStopPackage(String packageName, int userId) throws RemoteException {
Dianne Hackborn03abb812010-01-04 18:43:19 -08004217 Parcel data = Parcel.obtain();
4218 Parcel reply = Parcel.obtain();
4219 data.writeInterfaceToken(IActivityManager.descriptor);
4220 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004221 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004222 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004223 reply.readException();
4224 data.recycle();
4225 reply.recycle();
4226 }
4227
Dianne Hackborn27ff9132012-03-06 14:57:58 -08004228 public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
4229 throws RemoteException
4230 {
4231 Parcel data = Parcel.obtain();
4232 Parcel reply = Parcel.obtain();
4233 data.writeInterfaceToken(IActivityManager.descriptor);
4234 mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0);
4235 reply.readException();
4236 outInfo.readFromParcel(reply);
4237 reply.recycle();
4238 data.recycle();
4239 }
4240
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004241 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
4242 {
4243 Parcel data = Parcel.obtain();
4244 Parcel reply = Parcel.obtain();
4245 data.writeInterfaceToken(IActivityManager.descriptor);
4246 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
4247 reply.readException();
4248 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
4249 reply.recycle();
4250 data.recycle();
4251 return res;
4252 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004253
Dianne Hackborn1676c852012-09-10 14:52:30 -07004254 public boolean profileControl(String process, int userId, boolean start,
Jeff Hao1b012d32014-08-20 10:35:34 -07004255 ProfilerInfo profilerInfo, int profileType) throws RemoteException
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004256 {
4257 Parcel data = Parcel.obtain();
4258 Parcel reply = Parcel.obtain();
4259 data.writeInterfaceToken(IActivityManager.descriptor);
4260 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004261 data.writeInt(userId);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004262 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07004263 data.writeInt(profileType);
Jeff Hao1b012d32014-08-20 10:35:34 -07004264 if (profilerInfo != null) {
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004265 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07004266 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004267 } else {
4268 data.writeInt(0);
4269 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004270 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
4271 reply.readException();
4272 boolean res = reply.readInt() != 0;
4273 reply.recycle();
4274 data.recycle();
4275 return res;
4276 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004277
Dianne Hackborn55280a92009-05-07 15:53:46 -07004278 public boolean shutdown(int timeout) throws RemoteException
4279 {
4280 Parcel data = Parcel.obtain();
4281 Parcel reply = Parcel.obtain();
4282 data.writeInterfaceToken(IActivityManager.descriptor);
4283 data.writeInt(timeout);
4284 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
4285 reply.readException();
4286 boolean res = reply.readInt() != 0;
4287 reply.recycle();
4288 data.recycle();
4289 return res;
4290 }
4291
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07004292 public void stopAppSwitches() throws RemoteException {
4293 Parcel data = Parcel.obtain();
4294 Parcel reply = Parcel.obtain();
4295 data.writeInterfaceToken(IActivityManager.descriptor);
4296 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
4297 reply.readException();
4298 reply.recycle();
4299 data.recycle();
4300 }
4301
4302 public void resumeAppSwitches() throws RemoteException {
4303 Parcel data = Parcel.obtain();
4304 Parcel reply = Parcel.obtain();
4305 data.writeInterfaceToken(IActivityManager.descriptor);
4306 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
4307 reply.readException();
4308 reply.recycle();
4309 data.recycle();
4310 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07004311
4312 public void addPackageDependency(String packageName) throws RemoteException {
4313 Parcel data = Parcel.obtain();
4314 Parcel reply = Parcel.obtain();
4315 data.writeInterfaceToken(IActivityManager.descriptor);
4316 data.writeString(packageName);
4317 mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0);
4318 reply.readException();
4319 data.recycle();
4320 reply.recycle();
4321 }
4322
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004323 public void killApplicationWithAppId(String pkg, int appid, String reason)
4324 throws RemoteException {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004325 Parcel data = Parcel.obtain();
4326 Parcel reply = Parcel.obtain();
4327 data.writeInterfaceToken(IActivityManager.descriptor);
4328 data.writeString(pkg);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004329 data.writeInt(appid);
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004330 data.writeString(reason);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004331 mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004332 reply.readException();
4333 data.recycle();
4334 reply.recycle();
4335 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07004336
4337 public void closeSystemDialogs(String reason) throws RemoteException {
4338 Parcel data = Parcel.obtain();
4339 Parcel reply = Parcel.obtain();
4340 data.writeInterfaceToken(IActivityManager.descriptor);
4341 data.writeString(reason);
4342 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
4343 reply.readException();
4344 data.recycle();
4345 reply.recycle();
4346 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004347
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004348 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004349 throws RemoteException {
4350 Parcel data = Parcel.obtain();
4351 Parcel reply = Parcel.obtain();
4352 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004353 data.writeIntArray(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004354 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
4355 reply.readException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004356 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004357 data.recycle();
4358 reply.recycle();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004359 return res;
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004360 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07004361
4362 public void killApplicationProcess(String processName, int uid) throws RemoteException {
4363 Parcel data = Parcel.obtain();
4364 Parcel reply = Parcel.obtain();
4365 data.writeInterfaceToken(IActivityManager.descriptor);
4366 data.writeString(processName);
4367 data.writeInt(uid);
4368 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
4369 reply.readException();
4370 data.recycle();
4371 reply.recycle();
4372 }
4373
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07004374 public void overridePendingTransition(IBinder token, String packageName,
4375 int enterAnim, int exitAnim) throws RemoteException {
4376 Parcel data = Parcel.obtain();
4377 Parcel reply = Parcel.obtain();
4378 data.writeInterfaceToken(IActivityManager.descriptor);
4379 data.writeStrongBinder(token);
4380 data.writeString(packageName);
4381 data.writeInt(enterAnim);
4382 data.writeInt(exitAnim);
4383 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
4384 reply.readException();
4385 data.recycle();
4386 reply.recycle();
4387 }
4388
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08004389 public boolean isUserAMonkey() throws RemoteException {
4390 Parcel data = Parcel.obtain();
4391 Parcel reply = Parcel.obtain();
4392 data.writeInterfaceToken(IActivityManager.descriptor);
4393 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
4394 reply.readException();
4395 boolean res = reply.readInt() != 0;
4396 data.recycle();
4397 reply.recycle();
4398 return res;
4399 }
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07004400
4401 public void setUserIsMonkey(boolean monkey) throws RemoteException {
4402 Parcel data = Parcel.obtain();
4403 Parcel reply = Parcel.obtain();
4404 data.writeInterfaceToken(IActivityManager.descriptor);
4405 data.writeInt(monkey ? 1 : 0);
4406 mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0);
4407 reply.readException();
4408 data.recycle();
4409 reply.recycle();
4410 }
4411
Dianne Hackborn860755f2010-06-03 18:47:52 -07004412 public void finishHeavyWeightApp() throws RemoteException {
4413 Parcel data = Parcel.obtain();
4414 Parcel reply = Parcel.obtain();
4415 data.writeInterfaceToken(IActivityManager.descriptor);
4416 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
4417 reply.readException();
4418 data.recycle();
4419 reply.recycle();
4420 }
Craig Mautner4addfc52013-06-25 08:05:45 -07004421
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004422 public boolean convertFromTranslucent(IBinder token)
Craig Mautner4addfc52013-06-25 08:05:45 -07004423 throws RemoteException {
4424 Parcel data = Parcel.obtain();
4425 Parcel reply = Parcel.obtain();
4426 data.writeInterfaceToken(IActivityManager.descriptor);
4427 data.writeStrongBinder(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07004428 mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0);
4429 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004430 boolean res = reply.readInt() != 0;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004431 data.recycle();
4432 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004433 return res;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004434 }
4435
Craig Mautner233ceee2014-05-09 17:05:11 -07004436 public boolean convertToTranslucent(IBinder token, ActivityOptions options)
Craig Mautner5eda9b32013-07-02 11:58:16 -07004437 throws RemoteException {
4438 Parcel data = Parcel.obtain();
4439 Parcel reply = Parcel.obtain();
4440 data.writeInterfaceToken(IActivityManager.descriptor);
4441 data.writeStrongBinder(token);
Craig Mautner233ceee2014-05-09 17:05:11 -07004442 if (options == null) {
4443 data.writeInt(0);
4444 } else {
4445 data.writeInt(1);
4446 data.writeBundle(options.toBundle());
4447 }
Craig Mautner5eda9b32013-07-02 11:58:16 -07004448 mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07004449 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004450 boolean res = reply.readInt() != 0;
Craig Mautner4addfc52013-06-25 08:05:45 -07004451 data.recycle();
4452 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004453 return res;
Craig Mautner4addfc52013-06-25 08:05:45 -07004454 }
4455
Craig Mautner233ceee2014-05-09 17:05:11 -07004456 public ActivityOptions getActivityOptions(IBinder token) throws RemoteException {
4457 Parcel data = Parcel.obtain();
4458 Parcel reply = Parcel.obtain();
4459 data.writeInterfaceToken(IActivityManager.descriptor);
4460 data.writeStrongBinder(token);
4461 mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0);
4462 reply.readException();
4463 Bundle bundle = reply.readBundle();
4464 ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
4465 data.recycle();
4466 reply.recycle();
4467 return options;
4468 }
4469
Daniel Sandler69a48172010-06-23 16:29:36 -04004470 public void setImmersive(IBinder token, boolean immersive)
4471 throws RemoteException {
4472 Parcel data = Parcel.obtain();
4473 Parcel reply = Parcel.obtain();
4474 data.writeInterfaceToken(IActivityManager.descriptor);
4475 data.writeStrongBinder(token);
4476 data.writeInt(immersive ? 1 : 0);
4477 mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
4478 reply.readException();
4479 data.recycle();
4480 reply.recycle();
4481 }
4482
4483 public boolean isImmersive(IBinder token)
4484 throws RemoteException {
4485 Parcel data = Parcel.obtain();
4486 Parcel reply = Parcel.obtain();
4487 data.writeInterfaceToken(IActivityManager.descriptor);
4488 data.writeStrongBinder(token);
4489 mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004490 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004491 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004492 data.recycle();
4493 reply.recycle();
4494 return res;
4495 }
4496
Craig Mautnerd61dc202014-07-07 11:09:11 -07004497 public boolean isTopOfTask(IBinder token) throws RemoteException {
4498 Parcel data = Parcel.obtain();
4499 Parcel reply = Parcel.obtain();
4500 data.writeInterfaceToken(IActivityManager.descriptor);
4501 data.writeStrongBinder(token);
4502 mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0);
4503 reply.readException();
4504 boolean res = reply.readInt() == 1;
4505 data.recycle();
4506 reply.recycle();
4507 return res;
4508 }
4509
Daniel Sandler69a48172010-06-23 16:29:36 -04004510 public boolean isTopActivityImmersive()
4511 throws RemoteException {
4512 Parcel data = Parcel.obtain();
4513 Parcel reply = Parcel.obtain();
4514 data.writeInterfaceToken(IActivityManager.descriptor);
4515 mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004516 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004517 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004518 data.recycle();
4519 reply.recycle();
4520 return res;
4521 }
4522
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004523 public void crashApplication(int uid, int initialPid, String packageName,
4524 String message) throws RemoteException {
4525 Parcel data = Parcel.obtain();
4526 Parcel reply = Parcel.obtain();
4527 data.writeInterfaceToken(IActivityManager.descriptor);
4528 data.writeInt(uid);
4529 data.writeInt(initialPid);
4530 data.writeString(packageName);
4531 data.writeString(message);
4532 mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0);
4533 reply.readException();
4534 data.recycle();
4535 reply.recycle();
4536 }
Andy McFadden824c5102010-07-09 16:26:57 -07004537
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004538 public String getProviderMimeType(Uri uri, int userId) throws RemoteException {
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004539 Parcel data = Parcel.obtain();
4540 Parcel reply = Parcel.obtain();
4541 data.writeInterfaceToken(IActivityManager.descriptor);
4542 uri.writeToParcel(data, 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004543 data.writeInt(userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004544 mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0);
4545 reply.readException();
4546 String res = reply.readString();
4547 data.recycle();
4548 reply.recycle();
4549 return res;
4550 }
4551
Dianne Hackborn7e269642010-08-25 19:50:20 -07004552 public IBinder newUriPermissionOwner(String name)
4553 throws RemoteException {
4554 Parcel data = Parcel.obtain();
4555 Parcel reply = Parcel.obtain();
4556 data.writeInterfaceToken(IActivityManager.descriptor);
4557 data.writeString(name);
4558 mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
4559 reply.readException();
4560 IBinder res = reply.readStrongBinder();
4561 data.recycle();
4562 reply.recycle();
4563 return res;
4564 }
4565
4566 public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
Nicolas Prevotf1939902014-06-25 09:29:02 +01004567 Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07004568 Parcel data = Parcel.obtain();
4569 Parcel reply = Parcel.obtain();
4570 data.writeInterfaceToken(IActivityManager.descriptor);
4571 data.writeStrongBinder(owner);
4572 data.writeInt(fromUid);
4573 data.writeString(targetPkg);
4574 uri.writeToParcel(data, 0);
4575 data.writeInt(mode);
Nicolas Prevotf1939902014-06-25 09:29:02 +01004576 data.writeInt(sourceUserId);
4577 data.writeInt(targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07004578 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4579 reply.readException();
4580 data.recycle();
4581 reply.recycle();
4582 }
4583
4584 public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004585 int mode, int userId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07004586 Parcel data = Parcel.obtain();
4587 Parcel reply = Parcel.obtain();
4588 data.writeInterfaceToken(IActivityManager.descriptor);
4589 data.writeStrongBinder(owner);
4590 if (uri != null) {
4591 data.writeInt(1);
4592 uri.writeToParcel(data, 0);
4593 } else {
4594 data.writeInt(0);
4595 }
4596 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004597 data.writeInt(userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07004598 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4599 reply.readException();
4600 data.recycle();
4601 reply.recycle();
4602 }
Dianne Hackbornc8f84972010-08-25 23:14:44 -07004603
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004604 public int checkGrantUriPermission(int callingUid, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004605 Uri uri, int modeFlags, int userId) throws RemoteException {
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004606 Parcel data = Parcel.obtain();
4607 Parcel reply = Parcel.obtain();
4608 data.writeInterfaceToken(IActivityManager.descriptor);
4609 data.writeInt(callingUid);
4610 data.writeString(targetPkg);
4611 uri.writeToParcel(data, 0);
4612 data.writeInt(modeFlags);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004613 data.writeInt(userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004614 mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4615 reply.readException();
4616 int res = reply.readInt();
4617 data.recycle();
4618 reply.recycle();
4619 return res;
4620 }
4621
Dianne Hackborn1676c852012-09-10 14:52:30 -07004622 public boolean dumpHeap(String process, int userId, boolean managed,
Andy McFadden824c5102010-07-09 16:26:57 -07004623 String path, ParcelFileDescriptor fd) throws RemoteException {
4624 Parcel data = Parcel.obtain();
4625 Parcel reply = Parcel.obtain();
4626 data.writeInterfaceToken(IActivityManager.descriptor);
4627 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004628 data.writeInt(userId);
Andy McFadden824c5102010-07-09 16:26:57 -07004629 data.writeInt(managed ? 1 : 0);
4630 data.writeString(path);
4631 if (fd != null) {
4632 data.writeInt(1);
4633 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
4634 } else {
4635 data.writeInt(0);
4636 }
4637 mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
4638 reply.readException();
4639 boolean res = reply.readInt() != 0;
4640 reply.recycle();
4641 data.recycle();
4642 return res;
4643 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004644
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004645 public int startActivities(IApplicationThread caller, String callingPackage,
Dianne Hackborna4972e92012-03-14 10:38:05 -07004646 Intent[] intents, String[] resolvedTypes, IBinder resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004647 Bundle options, int userId) throws RemoteException {
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004648 Parcel data = Parcel.obtain();
4649 Parcel reply = Parcel.obtain();
4650 data.writeInterfaceToken(IActivityManager.descriptor);
4651 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004652 data.writeString(callingPackage);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004653 data.writeTypedArray(intents, 0);
4654 data.writeStringArray(resolvedTypes);
4655 data.writeStrongBinder(resultTo);
Dianne Hackborna4972e92012-03-14 10:38:05 -07004656 if (options != null) {
4657 data.writeInt(1);
4658 options.writeToParcel(data, 0);
4659 } else {
4660 data.writeInt(0);
4661 }
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004662 data.writeInt(userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004663 mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0);
4664 reply.readException();
4665 int result = reply.readInt();
4666 reply.recycle();
4667 data.recycle();
4668 return result;
4669 }
4670
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004671 public int getFrontActivityScreenCompatMode() throws RemoteException {
4672 Parcel data = Parcel.obtain();
4673 Parcel reply = Parcel.obtain();
4674 data.writeInterfaceToken(IActivityManager.descriptor);
4675 mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4676 reply.readException();
4677 int mode = reply.readInt();
4678 reply.recycle();
4679 data.recycle();
4680 return mode;
4681 }
4682
4683 public void setFrontActivityScreenCompatMode(int mode) throws RemoteException {
4684 Parcel data = Parcel.obtain();
4685 Parcel reply = Parcel.obtain();
4686 data.writeInterfaceToken(IActivityManager.descriptor);
4687 data.writeInt(mode);
4688 mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4689 reply.readException();
4690 reply.recycle();
4691 data.recycle();
4692 }
4693
4694 public int getPackageScreenCompatMode(String packageName) throws RemoteException {
4695 Parcel data = Parcel.obtain();
4696 Parcel reply = Parcel.obtain();
4697 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004698 data.writeString(packageName);
4699 mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004700 reply.readException();
4701 int mode = reply.readInt();
4702 reply.recycle();
4703 data.recycle();
4704 return mode;
4705 }
4706
4707 public void setPackageScreenCompatMode(String packageName, int mode)
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004708 throws RemoteException {
4709 Parcel data = Parcel.obtain();
4710 Parcel reply = Parcel.obtain();
4711 data.writeInterfaceToken(IActivityManager.descriptor);
4712 data.writeString(packageName);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004713 data.writeInt(mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004714 mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4715 reply.readException();
4716 reply.recycle();
4717 data.recycle();
4718 }
4719
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004720 public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
4721 Parcel data = Parcel.obtain();
4722 Parcel reply = Parcel.obtain();
4723 data.writeInterfaceToken(IActivityManager.descriptor);
4724 data.writeString(packageName);
4725 mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4726 reply.readException();
4727 boolean ask = reply.readInt() != 0;
4728 reply.recycle();
4729 data.recycle();
4730 return ask;
4731 }
4732
4733 public void setPackageAskScreenCompat(String packageName, boolean ask)
4734 throws RemoteException {
4735 Parcel data = Parcel.obtain();
4736 Parcel reply = Parcel.obtain();
4737 data.writeInterfaceToken(IActivityManager.descriptor);
4738 data.writeString(packageName);
4739 data.writeInt(ask ? 1 : 0);
4740 mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4741 reply.readException();
4742 reply.recycle();
4743 data.recycle();
4744 }
4745
Amith Yamasani4b2e9342011-03-31 12:38:53 -07004746 public boolean switchUser(int userid) throws RemoteException {
4747 Parcel data = Parcel.obtain();
4748 Parcel reply = Parcel.obtain();
4749 data.writeInterfaceToken(IActivityManager.descriptor);
4750 data.writeInt(userid);
4751 mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0);
4752 reply.readException();
4753 boolean result = reply.readInt() != 0;
4754 reply.recycle();
4755 data.recycle();
4756 return result;
4757 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07004758
Kenny Guy08488bf2014-02-21 17:40:37 +00004759 public boolean startUserInBackground(int userid) throws RemoteException {
4760 Parcel data = Parcel.obtain();
4761 Parcel reply = Parcel.obtain();
4762 data.writeInterfaceToken(IActivityManager.descriptor);
4763 data.writeInt(userid);
4764 mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0);
4765 reply.readException();
4766 boolean result = reply.readInt() != 0;
4767 reply.recycle();
4768 data.recycle();
4769 return result;
4770 }
4771
Dianne Hackborn80a4af22012-08-27 19:18:31 -07004772 public int stopUser(int userid, IStopUserCallback callback) throws RemoteException {
4773 Parcel data = Parcel.obtain();
4774 Parcel reply = Parcel.obtain();
4775 data.writeInterfaceToken(IActivityManager.descriptor);
4776 data.writeInt(userid);
4777 data.writeStrongInterface(callback);
4778 mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0);
4779 reply.readException();
4780 int result = reply.readInt();
4781 reply.recycle();
4782 data.recycle();
4783 return result;
4784 }
4785
Amith Yamasani52f1d752012-03-28 18:19:29 -07004786 public UserInfo getCurrentUser() throws RemoteException {
4787 Parcel data = Parcel.obtain();
4788 Parcel reply = Parcel.obtain();
4789 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn80a4af22012-08-27 19:18:31 -07004790 mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0);
Amith Yamasani52f1d752012-03-28 18:19:29 -07004791 reply.readException();
4792 UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply);
4793 reply.recycle();
4794 data.recycle();
4795 return userInfo;
4796 }
4797
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07004798 public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException {
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004799 Parcel data = Parcel.obtain();
4800 Parcel reply = Parcel.obtain();
4801 data.writeInterfaceToken(IActivityManager.descriptor);
4802 data.writeInt(userid);
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07004803 data.writeInt(orStopping ? 1 : 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004804 mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0);
4805 reply.readException();
4806 boolean result = reply.readInt() != 0;
4807 reply.recycle();
4808 data.recycle();
4809 return result;
4810 }
4811
Dianne Hackbornc72fc672012-09-20 13:12:03 -07004812 public int[] getRunningUserIds() throws RemoteException {
4813 Parcel data = Parcel.obtain();
4814 Parcel reply = Parcel.obtain();
4815 data.writeInterfaceToken(IActivityManager.descriptor);
4816 mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0);
4817 reply.readException();
4818 int[] result = reply.createIntArray();
4819 reply.recycle();
4820 data.recycle();
4821 return result;
4822 }
4823
Wale Ogunwaled54b5782014-10-23 15:55:23 -07004824 public boolean removeTask(int taskId) throws RemoteException {
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07004825 Parcel data = Parcel.obtain();
4826 Parcel reply = Parcel.obtain();
4827 data.writeInterfaceToken(IActivityManager.descriptor);
4828 data.writeInt(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07004829 mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
4830 reply.readException();
4831 boolean result = reply.readInt() != 0;
4832 reply.recycle();
4833 data.recycle();
4834 return result;
4835 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07004836
Jeff Sharkeya4620792011-05-20 15:29:23 -07004837 public void registerProcessObserver(IProcessObserver observer) throws RemoteException {
4838 Parcel data = Parcel.obtain();
4839 Parcel reply = Parcel.obtain();
4840 data.writeInterfaceToken(IActivityManager.descriptor);
4841 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
4842 mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
4843 reply.readException();
4844 data.recycle();
4845 reply.recycle();
4846 }
4847
4848 public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException {
4849 Parcel data = Parcel.obtain();
4850 Parcel reply = Parcel.obtain();
4851 data.writeInterfaceToken(IActivityManager.descriptor);
4852 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
4853 mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
4854 reply.readException();
4855 data.recycle();
4856 reply.recycle();
4857 }
4858
Dianne Hackborn6c418d52011-06-29 14:05:33 -07004859 public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException {
4860 Parcel data = Parcel.obtain();
4861 Parcel reply = Parcel.obtain();
4862 data.writeInterfaceToken(IActivityManager.descriptor);
4863 data.writeStrongBinder(sender.asBinder());
4864 mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0);
4865 reply.readException();
4866 boolean res = reply.readInt() != 0;
4867 data.recycle();
4868 reply.recycle();
4869 return res;
4870 }
4871
Dianne Hackborn1927ae82012-06-22 15:21:36 -07004872 public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException {
4873 Parcel data = Parcel.obtain();
4874 Parcel reply = Parcel.obtain();
4875 data.writeInterfaceToken(IActivityManager.descriptor);
4876 data.writeStrongBinder(sender.asBinder());
4877 mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0);
4878 reply.readException();
4879 boolean res = reply.readInt() != 0;
4880 data.recycle();
4881 reply.recycle();
4882 return res;
4883 }
4884
Dianne Hackborn81038902012-11-26 17:04:09 -08004885 public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException {
4886 Parcel data = Parcel.obtain();
4887 Parcel reply = Parcel.obtain();
4888 data.writeInterfaceToken(IActivityManager.descriptor);
4889 data.writeStrongBinder(sender.asBinder());
4890 mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4891 reply.readException();
4892 Intent res = reply.readInt() != 0
4893 ? Intent.CREATOR.createFromParcel(reply) : null;
4894 data.recycle();
4895 reply.recycle();
4896 return res;
4897 }
4898
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08004899 public String getTagForIntentSender(IIntentSender sender, String prefix)
4900 throws RemoteException {
4901 Parcel data = Parcel.obtain();
4902 Parcel reply = Parcel.obtain();
4903 data.writeInterfaceToken(IActivityManager.descriptor);
4904 data.writeStrongBinder(sender.asBinder());
4905 data.writeString(prefix);
4906 mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4907 reply.readException();
4908 String res = reply.readString();
4909 data.recycle();
4910 reply.recycle();
4911 return res;
4912 }
4913
Dianne Hackborn31ca8542011-07-19 14:58:28 -07004914 public void updatePersistentConfiguration(Configuration values) throws RemoteException
4915 {
4916 Parcel data = Parcel.obtain();
4917 Parcel reply = Parcel.obtain();
4918 data.writeInterfaceToken(IActivityManager.descriptor);
4919 values.writeToParcel(data, 0);
4920 mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0);
4921 reply.readException();
4922 data.recycle();
4923 reply.recycle();
4924 }
4925
Dianne Hackbornb437e092011-08-05 17:50:29 -07004926 public long[] getProcessPss(int[] pids) throws RemoteException {
4927 Parcel data = Parcel.obtain();
4928 Parcel reply = Parcel.obtain();
4929 data.writeInterfaceToken(IActivityManager.descriptor);
4930 data.writeIntArray(pids);
4931 mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0);
4932 reply.readException();
4933 long[] res = reply.createLongArray();
4934 data.recycle();
4935 reply.recycle();
4936 return res;
4937 }
4938
Dianne Hackborn661cd522011-08-22 00:26:20 -07004939 public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
4940 Parcel data = Parcel.obtain();
4941 Parcel reply = Parcel.obtain();
4942 data.writeInterfaceToken(IActivityManager.descriptor);
4943 TextUtils.writeToParcel(msg, data, 0);
4944 data.writeInt(always ? 1 : 0);
4945 mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
4946 reply.readException();
4947 data.recycle();
4948 reply.recycle();
4949 }
4950
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02004951 public void keyguardWaitingForActivityDrawn() throws RemoteException {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07004952 Parcel data = Parcel.obtain();
4953 Parcel reply = Parcel.obtain();
4954 data.writeInterfaceToken(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02004955 mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
Dianne Hackborn90c52de2011-09-23 12:57:44 -07004956 reply.readException();
4957 data.recycle();
4958 reply.recycle();
4959 }
4960
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07004961 public boolean shouldUpRecreateTask(IBinder token, String destAffinity)
Adam Powelldd8fab22012-03-22 17:47:27 -07004962 throws RemoteException {
4963 Parcel data = Parcel.obtain();
4964 Parcel reply = Parcel.obtain();
4965 data.writeInterfaceToken(IActivityManager.descriptor);
4966 data.writeStrongBinder(token);
4967 data.writeString(destAffinity);
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07004968 mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0);
Adam Powelldd8fab22012-03-22 17:47:27 -07004969 reply.readException();
4970 boolean result = reply.readInt() != 0;
4971 data.recycle();
4972 reply.recycle();
4973 return result;
4974 }
4975
4976 public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData)
4977 throws RemoteException {
4978 Parcel data = Parcel.obtain();
4979 Parcel reply = Parcel.obtain();
4980 data.writeInterfaceToken(IActivityManager.descriptor);
4981 data.writeStrongBinder(token);
4982 target.writeToParcel(data, 0);
4983 data.writeInt(resultCode);
4984 if (resultData != null) {
4985 data.writeInt(1);
4986 resultData.writeToParcel(data, 0);
4987 } else {
4988 data.writeInt(0);
4989 }
4990 mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0);
4991 reply.readException();
4992 boolean result = reply.readInt() != 0;
4993 data.recycle();
4994 reply.recycle();
4995 return result;
4996 }
4997
Dianne Hackborn5320eb82012-05-18 12:05:04 -07004998 public int getLaunchedFromUid(IBinder activityToken) throws RemoteException {
4999 Parcel data = Parcel.obtain();
5000 Parcel reply = Parcel.obtain();
5001 data.writeInterfaceToken(IActivityManager.descriptor);
5002 data.writeStrongBinder(activityToken);
5003 mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0);
5004 reply.readException();
5005 int result = reply.readInt();
5006 data.recycle();
5007 reply.recycle();
5008 return result;
5009 }
5010
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005011 public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException {
5012 Parcel data = Parcel.obtain();
5013 Parcel reply = Parcel.obtain();
5014 data.writeInterfaceToken(IActivityManager.descriptor);
5015 data.writeStrongBinder(activityToken);
5016 mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0);
5017 reply.readException();
5018 String result = reply.readString();
5019 data.recycle();
5020 reply.recycle();
5021 return result;
5022 }
5023
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07005024 public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5025 Parcel data = Parcel.obtain();
5026 Parcel reply = Parcel.obtain();
5027 data.writeInterfaceToken(IActivityManager.descriptor);
5028 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5029 mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5030 reply.readException();
5031 data.recycle();
5032 reply.recycle();
5033 }
5034
5035 public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5036 Parcel data = Parcel.obtain();
5037 Parcel reply = Parcel.obtain();
5038 data.writeInterfaceToken(IActivityManager.descriptor);
5039 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5040 mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5041 reply.readException();
5042 data.recycle();
5043 reply.recycle();
5044 }
5045
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07005046 public void requestBugReport() throws RemoteException {
5047 Parcel data = Parcel.obtain();
5048 Parcel reply = Parcel.obtain();
5049 data.writeInterfaceToken(IActivityManager.descriptor);
5050 mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0);
5051 reply.readException();
5052 data.recycle();
5053 reply.recycle();
5054 }
5055
Jeff Brownbd181bb2013-09-10 16:44:24 -07005056 public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason)
5057 throws RemoteException {
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005058 Parcel data = Parcel.obtain();
5059 Parcel reply = Parcel.obtain();
5060 data.writeInterfaceToken(IActivityManager.descriptor);
5061 data.writeInt(pid);
5062 data.writeInt(aboveSystem ? 1 : 0);
Jeff Brownbd181bb2013-09-10 16:44:24 -07005063 data.writeString(reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005064 mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0);
5065 reply.readException();
5066 long res = reply.readInt();
5067 data.recycle();
5068 reply.recycle();
5069 return res;
5070 }
5071
Adam Skorydfc7fd72013-08-05 19:23:41 -07005072 public Bundle getAssistContextExtras(int requestType) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005073 Parcel data = Parcel.obtain();
5074 Parcel reply = Parcel.obtain();
5075 data.writeInterfaceToken(IActivityManager.descriptor);
5076 data.writeInt(requestType);
Adam Skorydfc7fd72013-08-05 19:23:41 -07005077 mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005078 reply.readException();
5079 Bundle res = reply.readBundle();
5080 data.recycle();
5081 reply.recycle();
5082 return res;
5083 }
5084
Adam Skory7140a252013-09-11 12:04:58 +01005085 public void reportAssistContextExtras(IBinder token, Bundle extras)
Adam Skorydfc7fd72013-08-05 19:23:41 -07005086 throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005087 Parcel data = Parcel.obtain();
5088 Parcel reply = Parcel.obtain();
5089 data.writeInterfaceToken(IActivityManager.descriptor);
5090 data.writeStrongBinder(token);
5091 data.writeBundle(extras);
Adam Skorydfc7fd72013-08-05 19:23:41 -07005092 mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005093 reply.readException();
5094 data.recycle();
5095 reply.recycle();
5096 }
5097
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07005098 public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle)
5099 throws RemoteException {
5100 Parcel data = Parcel.obtain();
5101 Parcel reply = Parcel.obtain();
5102 data.writeInterfaceToken(IActivityManager.descriptor);
5103 intent.writeToParcel(data, 0);
5104 data.writeInt(requestType);
5105 data.writeString(hint);
5106 data.writeInt(userHandle);
5107 mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0);
5108 reply.readException();
5109 boolean res = reply.readInt() != 0;
5110 data.recycle();
5111 reply.recycle();
5112 return res;
5113 }
5114
Dianne Hackbornf1b78242013-04-08 22:28:59 -07005115 public void killUid(int uid, String reason) throws RemoteException {
5116 Parcel data = Parcel.obtain();
5117 Parcel reply = Parcel.obtain();
5118 data.writeInterfaceToken(IActivityManager.descriptor);
5119 data.writeInt(uid);
5120 data.writeString(reason);
5121 mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0);
5122 reply.readException();
5123 data.recycle();
5124 reply.recycle();
5125 }
5126
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07005127 public void hang(IBinder who, boolean allowRestart) throws RemoteException {
5128 Parcel data = Parcel.obtain();
5129 Parcel reply = Parcel.obtain();
5130 data.writeInterfaceToken(IActivityManager.descriptor);
5131 data.writeStrongBinder(who);
5132 data.writeInt(allowRestart ? 1 : 0);
5133 mRemote.transact(HANG_TRANSACTION, data, reply, 0);
5134 reply.readException();
5135 data.recycle();
5136 reply.recycle();
5137 }
5138
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07005139 public void reportActivityFullyDrawn(IBinder token) throws RemoteException {
5140 Parcel data = Parcel.obtain();
5141 Parcel reply = Parcel.obtain();
5142 data.writeInterfaceToken(IActivityManager.descriptor);
5143 data.writeStrongBinder(token);
5144 mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0);
5145 reply.readException();
5146 data.recycle();
5147 reply.recycle();
5148 }
5149
Craig Mautner5eda9b32013-07-02 11:58:16 -07005150 public void notifyActivityDrawn(IBinder token) throws RemoteException {
5151 Parcel data = Parcel.obtain();
5152 Parcel reply = Parcel.obtain();
5153 data.writeInterfaceToken(IActivityManager.descriptor);
5154 data.writeStrongBinder(token);
5155 mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
5156 reply.readException();
5157 data.recycle();
5158 reply.recycle();
5159 }
5160
Dianne Hackborn57a7f592013-07-22 18:21:32 -07005161 public void restart() throws RemoteException {
5162 Parcel data = Parcel.obtain();
5163 Parcel reply = Parcel.obtain();
5164 data.writeInterfaceToken(IActivityManager.descriptor);
5165 mRemote.transact(RESTART_TRANSACTION, data, reply, 0);
5166 reply.readException();
5167 data.recycle();
5168 reply.recycle();
5169 }
5170
Dianne Hackborn35f72be2013-09-16 10:57:39 -07005171 public void performIdleMaintenance() throws RemoteException {
5172 Parcel data = Parcel.obtain();
5173 Parcel reply = Parcel.obtain();
5174 data.writeInterfaceToken(IActivityManager.descriptor);
5175 mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0);
5176 reply.readException();
5177 data.recycle();
5178 reply.recycle();
5179 }
5180
Craig Mautner4a1cb222013-12-04 16:14:06 -08005181 public IActivityContainer createActivityContainer(IBinder parentActivityToken,
5182 IActivityContainerCallback callback) throws RemoteException {
5183 Parcel data = Parcel.obtain();
5184 Parcel reply = Parcel.obtain();
5185 data.writeInterfaceToken(IActivityManager.descriptor);
5186 data.writeStrongBinder(parentActivityToken);
Craig Mautnere3a00d72014-04-16 08:31:19 -07005187 data.writeStrongBinder(callback == null ? null : callback.asBinder());
Craig Mautner4a1cb222013-12-04 16:14:06 -08005188 mRemote.transact(CREATE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
5189 reply.readException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08005190 final int result = reply.readInt();
5191 final IActivityContainer res;
5192 if (result == 1) {
5193 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5194 } else {
5195 res = null;
5196 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08005197 data.recycle();
5198 reply.recycle();
5199 return res;
5200 }
5201
Craig Mautner95da1082014-02-24 17:54:35 -08005202 public void deleteActivityContainer(IActivityContainer activityContainer)
5203 throws RemoteException {
5204 Parcel data = Parcel.obtain();
5205 Parcel reply = Parcel.obtain();
5206 data.writeInterfaceToken(IActivityManager.descriptor);
5207 data.writeStrongBinder(activityContainer.asBinder());
5208 mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
5209 reply.readException();
5210 data.recycle();
5211 reply.recycle();
5212 }
5213
Craig Mautnere0a38842013-12-16 16:14:02 -08005214 public IActivityContainer getEnclosingActivityContainer(IBinder activityToken)
5215 throws RemoteException {
5216 Parcel data = Parcel.obtain();
5217 Parcel reply = Parcel.obtain();
5218 data.writeInterfaceToken(IActivityManager.descriptor);
5219 data.writeStrongBinder(activityToken);
5220 mRemote.transact(GET_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
5221 reply.readException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08005222 final int result = reply.readInt();
5223 final IActivityContainer res;
5224 if (result == 1) {
5225 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5226 } else {
5227 res = null;
5228 }
Craig Mautnere0a38842013-12-16 16:14:02 -08005229 data.recycle();
5230 reply.recycle();
5231 return res;
5232 }
5233
Craig Mautner4a1cb222013-12-04 16:14:06 -08005234 public IBinder getHomeActivityToken() throws RemoteException {
5235 Parcel data = Parcel.obtain();
5236 Parcel reply = Parcel.obtain();
5237 data.writeInterfaceToken(IActivityManager.descriptor);
5238 mRemote.transact(GET_HOME_ACTIVITY_TOKEN_TRANSACTION, data, reply, 0);
5239 reply.readException();
5240 IBinder res = reply.readStrongBinder();
5241 data.recycle();
5242 reply.recycle();
5243 return res;
5244 }
5245
Craig Mautneraea74a52014-03-08 14:23:10 -08005246 @Override
5247 public void startLockTaskMode(int taskId) throws RemoteException {
5248 Parcel data = Parcel.obtain();
5249 Parcel reply = Parcel.obtain();
5250 data.writeInterfaceToken(IActivityManager.descriptor);
5251 data.writeInt(taskId);
5252 mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0);
5253 reply.readException();
5254 data.recycle();
5255 reply.recycle();
5256 }
5257
5258 @Override
5259 public void startLockTaskMode(IBinder token) throws RemoteException {
5260 Parcel data = Parcel.obtain();
5261 Parcel reply = Parcel.obtain();
5262 data.writeInterfaceToken(IActivityManager.descriptor);
5263 data.writeStrongBinder(token);
5264 mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0);
5265 reply.readException();
5266 data.recycle();
5267 reply.recycle();
5268 }
5269
5270 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005271 public void startLockTaskModeOnCurrent() throws RemoteException {
5272 Parcel data = Parcel.obtain();
5273 Parcel reply = Parcel.obtain();
5274 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005275 mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005276 reply.readException();
5277 data.recycle();
5278 reply.recycle();
5279 }
5280
5281 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005282 public void stopLockTaskMode() throws RemoteException {
5283 Parcel data = Parcel.obtain();
5284 Parcel reply = Parcel.obtain();
5285 data.writeInterfaceToken(IActivityManager.descriptor);
5286 mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5287 reply.readException();
5288 data.recycle();
5289 reply.recycle();
5290 }
5291
5292 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005293 public void stopLockTaskModeOnCurrent() throws RemoteException {
5294 Parcel data = Parcel.obtain();
5295 Parcel reply = Parcel.obtain();
5296 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005297 mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005298 reply.readException();
5299 data.recycle();
5300 reply.recycle();
5301 }
5302
5303 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005304 public boolean isInLockTaskMode() throws RemoteException {
5305 Parcel data = Parcel.obtain();
5306 Parcel reply = Parcel.obtain();
5307 data.writeInterfaceToken(IActivityManager.descriptor);
5308 mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5309 reply.readException();
5310 boolean isInLockTaskMode = reply.readInt() == 1;
5311 data.recycle();
5312 reply.recycle();
5313 return isInLockTaskMode;
5314 }
5315
Craig Mautner688b5102014-03-27 16:55:03 -07005316 @Override
Winson Chunga449dc02014-05-16 11:15:04 -07005317 public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values)
Winson Chung03a9bae2014-05-02 09:56:12 -07005318 throws RemoteException {
Craig Mautner2fbd7542014-03-21 09:34:07 -07005319 Parcel data = Parcel.obtain();
5320 Parcel reply = Parcel.obtain();
5321 data.writeInterfaceToken(IActivityManager.descriptor);
5322 data.writeStrongBinder(token);
Winson Chung03a9bae2014-05-02 09:56:12 -07005323 values.writeToParcel(data, 0);
Winson Chunga449dc02014-05-16 11:15:04 -07005324 mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
Craig Mautner2fbd7542014-03-21 09:34:07 -07005325 reply.readException();
5326 data.recycle();
5327 reply.recycle();
5328 }
5329
Craig Mautneree2e45a2014-06-27 12:10:03 -07005330 @Override
Craig Mautner648f69b2014-09-18 14:16:26 -07005331 public Bitmap getTaskDescriptionIcon(String filename) throws RemoteException {
5332 Parcel data = Parcel.obtain();
5333 Parcel reply = Parcel.obtain();
5334 data.writeInterfaceToken(IActivityManager.descriptor);
5335 data.writeString(filename);
5336 mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0);
5337 reply.readException();
5338 final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply);
5339 data.recycle();
5340 reply.recycle();
5341 return icon;
5342 }
5343
5344 @Override
Winson Chung044d5292014-11-06 11:05:19 -08005345 public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options)
5346 throws RemoteException {
5347 Parcel data = Parcel.obtain();
5348 Parcel reply = Parcel.obtain();
5349 data.writeInterfaceToken(IActivityManager.descriptor);
5350 if (options == null) {
5351 data.writeInt(0);
5352 } else {
5353 data.writeInt(1);
5354 data.writeBundle(options.toBundle());
5355 }
5356 mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
5357 reply.readException();
5358 data.recycle();
5359 reply.recycle();
5360 }
5361
5362 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005363 public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005364 Parcel data = Parcel.obtain();
5365 Parcel reply = Parcel.obtain();
5366 data.writeInterfaceToken(IActivityManager.descriptor);
5367 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07005368 data.writeInt(visible ? 1 : 0);
5369 mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005370 reply.readException();
5371 boolean success = reply.readInt() > 0;
5372 data.recycle();
5373 reply.recycle();
5374 return success;
5375 }
5376
5377 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005378 public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005379 Parcel data = Parcel.obtain();
5380 Parcel reply = Parcel.obtain();
5381 data.writeInterfaceToken(IActivityManager.descriptor);
5382 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07005383 mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005384 reply.readException();
Jose Lima4b6c6692014-08-12 17:41:12 -07005385 final boolean visible = reply.readInt() > 0;
Craig Mautneree2e45a2014-06-27 12:10:03 -07005386 data.recycle();
5387 reply.recycle();
Jose Lima4b6c6692014-08-12 17:41:12 -07005388 return visible;
Craig Mautneree2e45a2014-06-27 12:10:03 -07005389 }
5390
5391 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005392 public void backgroundResourcesReleased(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005393 Parcel data = Parcel.obtain();
5394 Parcel reply = Parcel.obtain();
5395 data.writeInterfaceToken(IActivityManager.descriptor);
5396 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07005397 mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply,
5398 IBinder.FLAG_ONEWAY);
Craig Mautnerbb742462014-07-07 15:28:55 -07005399 reply.readException();
5400 data.recycle();
5401 reply.recycle();
5402 }
5403
5404 @Override
5405 public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException {
5406 Parcel data = Parcel.obtain();
5407 Parcel reply = Parcel.obtain();
5408 data.writeInterfaceToken(IActivityManager.descriptor);
5409 data.writeStrongBinder(token);
5410 mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply,
5411 IBinder.FLAG_ONEWAY);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005412 reply.readException();
5413 data.recycle();
5414 reply.recycle();
5415 }
5416
Craig Mautner8746a472014-07-24 15:12:54 -07005417 @Override
5418 public void notifyEnterAnimationComplete(IBinder token) throws RemoteException {
5419 Parcel data = Parcel.obtain();
5420 Parcel reply = Parcel.obtain();
5421 data.writeInterfaceToken(IActivityManager.descriptor);
5422 data.writeStrongBinder(token);
5423 mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply,
5424 IBinder.FLAG_ONEWAY);
5425 reply.readException();
5426 data.recycle();
5427 reply.recycle();
5428 }
5429
Craig Mautner6e2f3952014-09-09 14:26:41 -07005430 @Override
5431 public void bootAnimationComplete() throws RemoteException {
5432 Parcel data = Parcel.obtain();
5433 Parcel reply = Parcel.obtain();
5434 data.writeInterfaceToken(IActivityManager.descriptor);
5435 mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
5436 reply.readException();
5437 data.recycle();
5438 reply.recycle();
5439 }
5440
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005441 private IBinder mRemote;
5442}