blob: adac15bfd26378ca05212eedb428fc805719bbe5 [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
Winson Chung740c3ac2014-11-12 16:14:38 -0800777 case REGISTER_TASK_STACK_LISTENER_TRANSACTION: {
778 data.enforceInterface(IActivityManager.descriptor);
779 IBinder token = data.readStrongBinder();
780 registerTaskStackListener(ITaskStackListener.Stub.asInterface(token));
781 reply.writeNoException();
782 return true;
783 }
784
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800785 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
786 data.enforceInterface(IActivityManager.descriptor);
787 IBinder token = data.readStrongBinder();
788 boolean onlyRoot = data.readInt() != 0;
789 int res = token != null
790 ? getTaskForActivity(token, onlyRoot) : -1;
791 reply.writeNoException();
792 reply.writeInt(res);
793 return true;
794 }
795
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800796 case GET_CONTENT_PROVIDER_TRANSACTION: {
797 data.enforceInterface(IActivityManager.descriptor);
798 IBinder b = data.readStrongBinder();
799 IApplicationThread app = ApplicationThreadNative.asInterface(b);
800 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700801 int userId = data.readInt();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700802 boolean stable = data.readInt() != 0;
Jeff Sharkey6d515712012-09-20 16:06:08 -0700803 ContentProviderHolder cph = getContentProvider(app, name, userId, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800804 reply.writeNoException();
805 if (cph != null) {
806 reply.writeInt(1);
807 cph.writeToParcel(reply, 0);
808 } else {
809 reply.writeInt(0);
810 }
811 return true;
812 }
813
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800814 case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
815 data.enforceInterface(IActivityManager.descriptor);
816 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700817 int userId = data.readInt();
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800818 IBinder token = data.readStrongBinder();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700819 ContentProviderHolder cph = getContentProviderExternal(name, userId, token);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800820 reply.writeNoException();
821 if (cph != null) {
822 reply.writeInt(1);
823 cph.writeToParcel(reply, 0);
824 } else {
825 reply.writeInt(0);
826 }
827 return true;
828 }
829
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800830 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
831 data.enforceInterface(IActivityManager.descriptor);
832 IBinder b = data.readStrongBinder();
833 IApplicationThread app = ApplicationThreadNative.asInterface(b);
834 ArrayList<ContentProviderHolder> providers =
835 data.createTypedArrayList(ContentProviderHolder.CREATOR);
836 publishContentProviders(app, providers);
837 reply.writeNoException();
838 return true;
839 }
840
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700841 case REF_CONTENT_PROVIDER_TRANSACTION: {
842 data.enforceInterface(IActivityManager.descriptor);
843 IBinder b = data.readStrongBinder();
844 int stable = data.readInt();
845 int unstable = data.readInt();
846 boolean res = refContentProvider(b, stable, unstable);
847 reply.writeNoException();
848 reply.writeInt(res ? 1 : 0);
849 return true;
850 }
851
852 case UNSTABLE_PROVIDER_DIED_TRANSACTION: {
853 data.enforceInterface(IActivityManager.descriptor);
854 IBinder b = data.readStrongBinder();
855 unstableProviderDied(b);
856 reply.writeNoException();
857 return true;
858 }
859
Jeff Sharkey7aa76012013-09-30 14:26:27 -0700860 case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: {
861 data.enforceInterface(IActivityManager.descriptor);
862 IBinder b = data.readStrongBinder();
863 appNotRespondingViaProvider(b);
864 reply.writeNoException();
865 return true;
866 }
867
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800868 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
869 data.enforceInterface(IActivityManager.descriptor);
870 IBinder b = data.readStrongBinder();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700871 boolean stable = data.readInt() != 0;
872 removeContentProvider(b, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800873 reply.writeNoException();
874 return true;
875 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800876
877 case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
878 data.enforceInterface(IActivityManager.descriptor);
879 String name = data.readString();
880 IBinder token = data.readStrongBinder();
881 removeContentProviderExternal(name, token);
882 reply.writeNoException();
883 return true;
884 }
885
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700886 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
887 data.enforceInterface(IActivityManager.descriptor);
888 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
889 PendingIntent pi = getRunningServiceControlPanel(comp);
890 reply.writeNoException();
891 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
892 return true;
893 }
894
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800895 case START_SERVICE_TRANSACTION: {
896 data.enforceInterface(IActivityManager.descriptor);
897 IBinder b = data.readStrongBinder();
898 IApplicationThread app = ApplicationThreadNative.asInterface(b);
899 Intent service = Intent.CREATOR.createFromParcel(data);
900 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700901 int userId = data.readInt();
902 ComponentName cn = startService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800903 reply.writeNoException();
904 ComponentName.writeToParcel(cn, reply);
905 return true;
906 }
907
908 case STOP_SERVICE_TRANSACTION: {
909 data.enforceInterface(IActivityManager.descriptor);
910 IBinder b = data.readStrongBinder();
911 IApplicationThread app = ApplicationThreadNative.asInterface(b);
912 Intent service = Intent.CREATOR.createFromParcel(data);
913 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700914 int userId = data.readInt();
915 int res = stopService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800916 reply.writeNoException();
917 reply.writeInt(res);
918 return true;
919 }
920
921 case STOP_SERVICE_TOKEN_TRANSACTION: {
922 data.enforceInterface(IActivityManager.descriptor);
923 ComponentName className = ComponentName.readFromParcel(data);
924 IBinder token = data.readStrongBinder();
925 int startId = data.readInt();
926 boolean res = stopServiceToken(className, token, startId);
927 reply.writeNoException();
928 reply.writeInt(res ? 1 : 0);
929 return true;
930 }
931
932 case SET_SERVICE_FOREGROUND_TRANSACTION: {
933 data.enforceInterface(IActivityManager.descriptor);
934 ComponentName className = ComponentName.readFromParcel(data);
935 IBinder token = data.readStrongBinder();
Dianne Hackbornd8a43f62009-08-17 23:33:56 -0700936 int id = data.readInt();
937 Notification notification = null;
938 if (data.readInt() != 0) {
939 notification = Notification.CREATOR.createFromParcel(data);
940 }
941 boolean removeNotification = data.readInt() != 0;
942 setServiceForeground(className, token, id, notification, removeNotification);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800943 reply.writeNoException();
944 return true;
945 }
946
947 case BIND_SERVICE_TRANSACTION: {
948 data.enforceInterface(IActivityManager.descriptor);
949 IBinder b = data.readStrongBinder();
950 IApplicationThread app = ApplicationThreadNative.asInterface(b);
951 IBinder token = data.readStrongBinder();
952 Intent service = Intent.CREATOR.createFromParcel(data);
953 String resolvedType = data.readString();
954 b = data.readStrongBinder();
955 int fl = data.readInt();
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800956 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800957 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800958 int res = bindService(app, token, service, resolvedType, conn, fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800959 reply.writeNoException();
960 reply.writeInt(res);
961 return true;
962 }
963
964 case UNBIND_SERVICE_TRANSACTION: {
965 data.enforceInterface(IActivityManager.descriptor);
966 IBinder b = data.readStrongBinder();
967 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
968 boolean res = unbindService(conn);
969 reply.writeNoException();
970 reply.writeInt(res ? 1 : 0);
971 return true;
972 }
973
974 case PUBLISH_SERVICE_TRANSACTION: {
975 data.enforceInterface(IActivityManager.descriptor);
976 IBinder token = data.readStrongBinder();
977 Intent intent = Intent.CREATOR.createFromParcel(data);
978 IBinder service = data.readStrongBinder();
979 publishService(token, intent, service);
980 reply.writeNoException();
981 return true;
982 }
983
984 case UNBIND_FINISHED_TRANSACTION: {
985 data.enforceInterface(IActivityManager.descriptor);
986 IBinder token = data.readStrongBinder();
987 Intent intent = Intent.CREATOR.createFromParcel(data);
988 boolean doRebind = data.readInt() != 0;
989 unbindFinished(token, intent, doRebind);
990 reply.writeNoException();
991 return true;
992 }
993
994 case SERVICE_DONE_EXECUTING_TRANSACTION: {
995 data.enforceInterface(IActivityManager.descriptor);
996 IBinder token = data.readStrongBinder();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -0700997 int type = data.readInt();
998 int startId = data.readInt();
999 int res = data.readInt();
1000 serviceDoneExecuting(token, type, startId, res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001001 reply.writeNoException();
1002 return true;
1003 }
1004
1005 case START_INSTRUMENTATION_TRANSACTION: {
1006 data.enforceInterface(IActivityManager.descriptor);
1007 ComponentName className = ComponentName.readFromParcel(data);
1008 String profileFile = data.readString();
1009 int fl = data.readInt();
1010 Bundle arguments = data.readBundle();
1011 IBinder b = data.readStrongBinder();
1012 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08001013 b = data.readStrongBinder();
1014 IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001015 int userId = data.readInt();
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01001016 String abiOverride = data.readString();
1017 boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId,
1018 abiOverride);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001019 reply.writeNoException();
1020 reply.writeInt(res ? 1 : 0);
1021 return true;
1022 }
1023
1024
1025 case FINISH_INSTRUMENTATION_TRANSACTION: {
1026 data.enforceInterface(IActivityManager.descriptor);
1027 IBinder b = data.readStrongBinder();
1028 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1029 int resultCode = data.readInt();
1030 Bundle results = data.readBundle();
1031 finishInstrumentation(app, resultCode, results);
1032 reply.writeNoException();
1033 return true;
1034 }
1035
1036 case GET_CONFIGURATION_TRANSACTION: {
1037 data.enforceInterface(IActivityManager.descriptor);
1038 Configuration config = getConfiguration();
1039 reply.writeNoException();
1040 config.writeToParcel(reply, 0);
1041 return true;
1042 }
1043
1044 case UPDATE_CONFIGURATION_TRANSACTION: {
1045 data.enforceInterface(IActivityManager.descriptor);
1046 Configuration config = Configuration.CREATOR.createFromParcel(data);
1047 updateConfiguration(config);
1048 reply.writeNoException();
1049 return true;
1050 }
1051
1052 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
1053 data.enforceInterface(IActivityManager.descriptor);
1054 IBinder token = data.readStrongBinder();
1055 int requestedOrientation = data.readInt();
1056 setRequestedOrientation(token, requestedOrientation);
1057 reply.writeNoException();
1058 return true;
1059 }
1060
1061 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
1062 data.enforceInterface(IActivityManager.descriptor);
1063 IBinder token = data.readStrongBinder();
1064 int req = getRequestedOrientation(token);
1065 reply.writeNoException();
1066 reply.writeInt(req);
1067 return true;
1068 }
1069
1070 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
1071 data.enforceInterface(IActivityManager.descriptor);
1072 IBinder token = data.readStrongBinder();
1073 ComponentName cn = getActivityClassForToken(token);
1074 reply.writeNoException();
1075 ComponentName.writeToParcel(cn, reply);
1076 return true;
1077 }
1078
1079 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
1080 data.enforceInterface(IActivityManager.descriptor);
1081 IBinder token = data.readStrongBinder();
1082 reply.writeNoException();
1083 reply.writeString(getPackageForToken(token));
1084 return true;
1085 }
1086
1087 case GET_INTENT_SENDER_TRANSACTION: {
1088 data.enforceInterface(IActivityManager.descriptor);
1089 int type = data.readInt();
1090 String packageName = data.readString();
1091 IBinder token = data.readStrongBinder();
1092 String resultWho = data.readString();
1093 int requestCode = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001094 Intent[] requestIntents;
1095 String[] requestResolvedTypes;
1096 if (data.readInt() != 0) {
1097 requestIntents = data.createTypedArray(Intent.CREATOR);
1098 requestResolvedTypes = data.createStringArray();
1099 } else {
1100 requestIntents = null;
1101 requestResolvedTypes = null;
1102 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001103 int fl = data.readInt();
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07001104 Bundle options = data.readInt() != 0
1105 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -07001106 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001107 IIntentSender res = getIntentSender(type, packageName, token,
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001108 resultWho, requestCode, requestIntents,
Dianne Hackborn41203752012-08-31 14:05:51 -07001109 requestResolvedTypes, fl, options, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001110 reply.writeNoException();
1111 reply.writeStrongBinder(res != null ? res.asBinder() : null);
1112 return true;
1113 }
1114
1115 case CANCEL_INTENT_SENDER_TRANSACTION: {
1116 data.enforceInterface(IActivityManager.descriptor);
1117 IIntentSender r = IIntentSender.Stub.asInterface(
1118 data.readStrongBinder());
1119 cancelIntentSender(r);
1120 reply.writeNoException();
1121 return true;
1122 }
1123
1124 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
1125 data.enforceInterface(IActivityManager.descriptor);
1126 IIntentSender r = IIntentSender.Stub.asInterface(
1127 data.readStrongBinder());
1128 String res = getPackageForIntentSender(r);
1129 reply.writeNoException();
1130 reply.writeString(res);
1131 return true;
1132 }
1133
Christopher Tatec4a07d12012-04-06 14:19:13 -07001134 case GET_UID_FOR_INTENT_SENDER_TRANSACTION: {
1135 data.enforceInterface(IActivityManager.descriptor);
1136 IIntentSender r = IIntentSender.Stub.asInterface(
1137 data.readStrongBinder());
1138 int res = getUidForIntentSender(r);
1139 reply.writeNoException();
1140 reply.writeInt(res);
1141 return true;
1142 }
1143
Dianne Hackborn41203752012-08-31 14:05:51 -07001144 case HANDLE_INCOMING_USER_TRANSACTION: {
1145 data.enforceInterface(IActivityManager.descriptor);
1146 int callingPid = data.readInt();
1147 int callingUid = data.readInt();
1148 int userId = data.readInt();
1149 boolean allowAll = data.readInt() != 0 ;
1150 boolean requireFull = data.readInt() != 0;
1151 String name = data.readString();
1152 String callerPackage = data.readString();
1153 int res = handleIncomingUser(callingPid, callingUid, userId, allowAll,
1154 requireFull, name, callerPackage);
1155 reply.writeNoException();
1156 reply.writeInt(res);
1157 return true;
1158 }
1159
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001160 case SET_PROCESS_LIMIT_TRANSACTION: {
1161 data.enforceInterface(IActivityManager.descriptor);
1162 int max = data.readInt();
1163 setProcessLimit(max);
1164 reply.writeNoException();
1165 return true;
1166 }
1167
1168 case GET_PROCESS_LIMIT_TRANSACTION: {
1169 data.enforceInterface(IActivityManager.descriptor);
1170 int limit = getProcessLimit();
1171 reply.writeNoException();
1172 reply.writeInt(limit);
1173 return true;
1174 }
1175
1176 case SET_PROCESS_FOREGROUND_TRANSACTION: {
1177 data.enforceInterface(IActivityManager.descriptor);
1178 IBinder token = data.readStrongBinder();
1179 int pid = data.readInt();
1180 boolean isForeground = data.readInt() != 0;
1181 setProcessForeground(token, pid, isForeground);
1182 reply.writeNoException();
1183 return true;
1184 }
1185
1186 case CHECK_PERMISSION_TRANSACTION: {
1187 data.enforceInterface(IActivityManager.descriptor);
1188 String perm = data.readString();
1189 int pid = data.readInt();
1190 int uid = data.readInt();
1191 int res = checkPermission(perm, pid, uid);
1192 reply.writeNoException();
1193 reply.writeInt(res);
1194 return true;
1195 }
1196
Dianne Hackbornff170242014-11-19 10:59:01 -08001197 case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: {
1198 data.enforceInterface(IActivityManager.descriptor);
1199 String perm = data.readString();
1200 int pid = data.readInt();
1201 int uid = data.readInt();
1202 IBinder token = data.readStrongBinder();
1203 int res = checkPermissionWithToken(perm, pid, uid, token);
1204 reply.writeNoException();
1205 reply.writeInt(res);
1206 return true;
1207 }
1208
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001209 case CHECK_URI_PERMISSION_TRANSACTION: {
1210 data.enforceInterface(IActivityManager.descriptor);
1211 Uri uri = Uri.CREATOR.createFromParcel(data);
1212 int pid = data.readInt();
1213 int uid = data.readInt();
1214 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001215 int userId = data.readInt();
Dianne Hackbornff170242014-11-19 10:59:01 -08001216 IBinder callerToken = data.readStrongBinder();
1217 int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001218 reply.writeNoException();
1219 reply.writeInt(res);
1220 return true;
1221 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001222
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001223 case CLEAR_APP_DATA_TRANSACTION: {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001224 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001225 String packageName = data.readString();
1226 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
1227 data.readStrongBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -07001228 int userId = data.readInt();
1229 boolean res = clearApplicationUserData(packageName, observer, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001230 reply.writeNoException();
1231 reply.writeInt(res ? 1 : 0);
1232 return true;
1233 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001234
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001235 case GRANT_URI_PERMISSION_TRANSACTION: {
1236 data.enforceInterface(IActivityManager.descriptor);
1237 IBinder b = data.readStrongBinder();
1238 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1239 String targetPkg = data.readString();
1240 Uri uri = Uri.CREATOR.createFromParcel(data);
1241 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001242 int userId = data.readInt();
1243 grantUriPermission(app, targetPkg, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001244 reply.writeNoException();
1245 return true;
1246 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001247
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001248 case REVOKE_URI_PERMISSION_TRANSACTION: {
1249 data.enforceInterface(IActivityManager.descriptor);
1250 IBinder b = data.readStrongBinder();
1251 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1252 Uri uri = Uri.CREATOR.createFromParcel(data);
1253 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001254 int userId = data.readInt();
1255 revokeUriPermission(app, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001256 reply.writeNoException();
1257 return true;
1258 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001259
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001260 case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1261 data.enforceInterface(IActivityManager.descriptor);
1262 Uri uri = Uri.CREATOR.createFromParcel(data);
1263 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001264 int userId = data.readInt();
1265 takePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001266 reply.writeNoException();
1267 return true;
1268 }
1269
1270 case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1271 data.enforceInterface(IActivityManager.descriptor);
1272 Uri uri = Uri.CREATOR.createFromParcel(data);
1273 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001274 int userId = data.readInt();
1275 releasePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001276 reply.writeNoException();
1277 return true;
1278 }
1279
1280 case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: {
1281 data.enforceInterface(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07001282 final String packageName = data.readString();
1283 final boolean incoming = data.readInt() != 0;
1284 final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions(
1285 packageName, incoming);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001286 reply.writeNoException();
1287 perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1288 return true;
1289 }
1290
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001291 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
1292 data.enforceInterface(IActivityManager.descriptor);
1293 IBinder b = data.readStrongBinder();
1294 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1295 boolean waiting = data.readInt() != 0;
1296 showWaitingForDebugger(app, waiting);
1297 reply.writeNoException();
1298 return true;
1299 }
1300
1301 case GET_MEMORY_INFO_TRANSACTION: {
1302 data.enforceInterface(IActivityManager.descriptor);
1303 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
1304 getMemoryInfo(mi);
1305 reply.writeNoException();
1306 mi.writeToParcel(reply, 0);
1307 return true;
1308 }
1309
1310 case UNHANDLED_BACK_TRANSACTION: {
1311 data.enforceInterface(IActivityManager.descriptor);
1312 unhandledBack();
1313 reply.writeNoException();
1314 return true;
1315 }
1316
1317 case OPEN_CONTENT_URI_TRANSACTION: {
1318 data.enforceInterface(IActivityManager.descriptor);
1319 Uri uri = Uri.parse(data.readString());
1320 ParcelFileDescriptor pfd = openContentUri(uri);
1321 reply.writeNoException();
1322 if (pfd != null) {
1323 reply.writeInt(1);
1324 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1325 } else {
1326 reply.writeInt(0);
1327 }
1328 return true;
1329 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001330
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001331 case SET_LOCK_SCREEN_SHOWN_TRANSACTION: {
1332 data.enforceInterface(IActivityManager.descriptor);
1333 setLockScreenShown(data.readInt() != 0);
1334 reply.writeNoException();
1335 return true;
1336 }
1337
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001338 case SET_DEBUG_APP_TRANSACTION: {
1339 data.enforceInterface(IActivityManager.descriptor);
1340 String pn = data.readString();
1341 boolean wfd = data.readInt() != 0;
1342 boolean per = data.readInt() != 0;
1343 setDebugApp(pn, wfd, per);
1344 reply.writeNoException();
1345 return true;
1346 }
1347
1348 case SET_ALWAYS_FINISH_TRANSACTION: {
1349 data.enforceInterface(IActivityManager.descriptor);
1350 boolean enabled = data.readInt() != 0;
1351 setAlwaysFinish(enabled);
1352 reply.writeNoException();
1353 return true;
1354 }
1355
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001356 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001357 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001358 IActivityController watcher = IActivityController.Stub.asInterface(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001359 data.readStrongBinder());
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001360 setActivityController(watcher);
Sungmin Choicdb86bb2012-12-20 14:08:59 +09001361 reply.writeNoException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001362 return true;
1363 }
1364
1365 case ENTER_SAFE_MODE_TRANSACTION: {
1366 data.enforceInterface(IActivityManager.descriptor);
1367 enterSafeMode();
1368 reply.writeNoException();
1369 return true;
1370 }
1371
1372 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1373 data.enforceInterface(IActivityManager.descriptor);
1374 IIntentSender is = IIntentSender.Stub.asInterface(
1375 data.readStrongBinder());
Dianne Hackborn099bc622014-01-22 13:39:16 -08001376 int sourceUid = data.readInt();
1377 String sourcePkg = data.readString();
1378 noteWakeupAlarm(is, sourceUid, sourcePkg);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001379 reply.writeNoException();
1380 return true;
1381 }
1382
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001383 case KILL_PIDS_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001384 data.enforceInterface(IActivityManager.descriptor);
1385 int[] pids = data.createIntArray();
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001386 String reason = data.readString();
Dianne Hackborn64825172011-03-02 21:32:58 -08001387 boolean secure = data.readInt() != 0;
1388 boolean res = killPids(pids, reason, secure);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001389 reply.writeNoException();
1390 reply.writeInt(res ? 1 : 0);
1391 return true;
1392 }
1393
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07001394 case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: {
1395 data.enforceInterface(IActivityManager.descriptor);
1396 String reason = data.readString();
1397 boolean res = killProcessesBelowForeground(reason);
1398 reply.writeNoException();
1399 reply.writeInt(res ? 1 : 0);
1400 return true;
1401 }
1402
Dan Egnor60d87622009-12-16 16:32:58 -08001403 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1404 data.enforceInterface(IActivityManager.descriptor);
1405 IBinder app = data.readStrongBinder();
1406 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1407 handleApplicationCrash(app, ci);
1408 reply.writeNoException();
1409 return true;
1410 }
1411
1412 case HANDLE_APPLICATION_WTF_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001413 data.enforceInterface(IActivityManager.descriptor);
1414 IBinder app = data.readStrongBinder();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001415 String tag = data.readString();
Dianne Hackborn52322712014-08-26 22:47:26 -07001416 boolean system = data.readInt() != 0;
Dan Egnorb7f03672009-12-09 16:22:32 -08001417 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
Dianne Hackborn52322712014-08-26 22:47:26 -07001418 boolean res = handleApplicationWtf(app, tag, system, ci);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001419 reply.writeNoException();
Dan Egnor60d87622009-12-16 16:32:58 -08001420 reply.writeInt(res ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001421 return true;
1422 }
Dan Egnorb7f03672009-12-09 16:22:32 -08001423
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001424 case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: {
1425 data.enforceInterface(IActivityManager.descriptor);
1426 IBinder app = data.readStrongBinder();
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07001427 int violationMask = data.readInt();
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07001428 StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data);
1429 handleApplicationStrictModeViolation(app, violationMask, info);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001430 reply.writeNoException();
1431 return true;
1432 }
1433
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001434 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1435 data.enforceInterface(IActivityManager.descriptor);
1436 int sig = data.readInt();
1437 signalPersistentProcesses(sig);
1438 reply.writeNoException();
1439 return true;
1440 }
1441
Dianne Hackborn03abb812010-01-04 18:43:19 -08001442 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1443 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001444 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001445 int userId = data.readInt();
1446 killBackgroundProcesses(packageName, userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08001447 reply.writeNoException();
1448 return true;
1449 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08001450
1451 case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
1452 data.enforceInterface(IActivityManager.descriptor);
1453 killAllBackgroundProcesses();
1454 reply.writeNoException();
1455 return true;
1456 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001457
Dianne Hackborn03abb812010-01-04 18:43:19 -08001458 case FORCE_STOP_PACKAGE_TRANSACTION: {
1459 data.enforceInterface(IActivityManager.descriptor);
1460 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001461 int userId = data.readInt();
1462 forceStopPackage(packageName, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001463 reply.writeNoException();
1464 return true;
1465 }
Dianne Hackborn27ff9132012-03-06 14:57:58 -08001466
1467 case GET_MY_MEMORY_STATE_TRANSACTION: {
1468 data.enforceInterface(IActivityManager.descriptor);
1469 ActivityManager.RunningAppProcessInfo info =
1470 new ActivityManager.RunningAppProcessInfo();
1471 getMyMemoryState(info);
1472 reply.writeNoException();
1473 info.writeToParcel(reply, 0);
1474 return true;
1475 }
1476
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001477 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1478 data.enforceInterface(IActivityManager.descriptor);
1479 ConfigurationInfo config = getDeviceConfigurationInfo();
1480 reply.writeNoException();
1481 config.writeToParcel(reply, 0);
1482 return true;
1483 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001484
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001485 case PROFILE_CONTROL_TRANSACTION: {
1486 data.enforceInterface(IActivityManager.descriptor);
1487 String process = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001488 int userId = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001489 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001490 int profileType = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -07001491 ProfilerInfo profilerInfo = data.readInt() != 0
1492 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
1493 boolean res = profileControl(process, userId, start, profilerInfo, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001494 reply.writeNoException();
1495 reply.writeInt(res ? 1 : 0);
1496 return true;
1497 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001498
Dianne Hackborn55280a92009-05-07 15:53:46 -07001499 case SHUTDOWN_TRANSACTION: {
1500 data.enforceInterface(IActivityManager.descriptor);
1501 boolean res = shutdown(data.readInt());
1502 reply.writeNoException();
1503 reply.writeInt(res ? 1 : 0);
1504 return true;
1505 }
1506
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001507 case STOP_APP_SWITCHES_TRANSACTION: {
1508 data.enforceInterface(IActivityManager.descriptor);
1509 stopAppSwitches();
1510 reply.writeNoException();
1511 return true;
1512 }
1513
1514 case RESUME_APP_SWITCHES_TRANSACTION: {
1515 data.enforceInterface(IActivityManager.descriptor);
1516 resumeAppSwitches();
1517 reply.writeNoException();
1518 return true;
1519 }
1520
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001521 case PEEK_SERVICE_TRANSACTION: {
1522 data.enforceInterface(IActivityManager.descriptor);
1523 Intent service = Intent.CREATOR.createFromParcel(data);
1524 String resolvedType = data.readString();
1525 IBinder binder = peekService(service, resolvedType);
1526 reply.writeNoException();
1527 reply.writeStrongBinder(binder);
1528 return true;
1529 }
Christopher Tate181fafa2009-05-14 11:12:14 -07001530
1531 case START_BACKUP_AGENT_TRANSACTION: {
1532 data.enforceInterface(IActivityManager.descriptor);
1533 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1534 int backupRestoreMode = data.readInt();
1535 boolean success = bindBackupAgent(info, backupRestoreMode);
1536 reply.writeNoException();
1537 reply.writeInt(success ? 1 : 0);
1538 return true;
1539 }
1540
1541 case BACKUP_AGENT_CREATED_TRANSACTION: {
1542 data.enforceInterface(IActivityManager.descriptor);
1543 String packageName = data.readString();
1544 IBinder agent = data.readStrongBinder();
1545 backupAgentCreated(packageName, agent);
1546 reply.writeNoException();
1547 return true;
1548 }
1549
1550 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1551 data.enforceInterface(IActivityManager.descriptor);
1552 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1553 unbindBackupAgent(info);
1554 reply.writeNoException();
1555 return true;
1556 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001557
1558 case ADD_PACKAGE_DEPENDENCY_TRANSACTION: {
1559 data.enforceInterface(IActivityManager.descriptor);
1560 String packageName = data.readString();
1561 addPackageDependency(packageName);
1562 reply.writeNoException();
1563 return true;
1564 }
1565
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001566 case KILL_APPLICATION_WITH_APPID_TRANSACTION: {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001567 data.enforceInterface(IActivityManager.descriptor);
1568 String pkg = data.readString();
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001569 int appid = data.readInt();
Dianne Hackborn21d9b562013-05-28 17:46:59 -07001570 String reason = data.readString();
1571 killApplicationWithAppId(pkg, appid, reason);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001572 reply.writeNoException();
1573 return true;
1574 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001575
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001576 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1577 data.enforceInterface(IActivityManager.descriptor);
1578 String reason = data.readString();
1579 closeSystemDialogs(reason);
1580 reply.writeNoException();
1581 return true;
1582 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001583
1584 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1585 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001586 int[] pids = data.createIntArray();
1587 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001588 reply.writeNoException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001589 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001590 return true;
1591 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001592
1593 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1594 data.enforceInterface(IActivityManager.descriptor);
1595 String processName = data.readString();
1596 int uid = data.readInt();
1597 killApplicationProcess(processName, uid);
1598 reply.writeNoException();
1599 return true;
1600 }
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001601
1602 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1603 data.enforceInterface(IActivityManager.descriptor);
1604 IBinder token = data.readStrongBinder();
1605 String packageName = data.readString();
1606 int enterAnim = data.readInt();
1607 int exitAnim = data.readInt();
1608 overridePendingTransition(token, packageName, enterAnim, exitAnim);
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001609 reply.writeNoException();
1610 return true;
1611 }
1612
1613 case IS_USER_A_MONKEY_TRANSACTION: {
1614 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001615 boolean areThey = isUserAMonkey();
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001616 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001617 reply.writeInt(areThey ? 1 : 0);
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001618 return true;
1619 }
Dianne Hackborn860755f2010-06-03 18:47:52 -07001620
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07001621 case SET_USER_IS_MONKEY_TRANSACTION: {
1622 data.enforceInterface(IActivityManager.descriptor);
1623 final boolean monkey = (data.readInt() == 1);
1624 setUserIsMonkey(monkey);
1625 reply.writeNoException();
1626 return true;
1627 }
1628
Dianne Hackborn860755f2010-06-03 18:47:52 -07001629 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1630 data.enforceInterface(IActivityManager.descriptor);
1631 finishHeavyWeightApp();
1632 reply.writeNoException();
1633 return true;
1634 }
Daniel Sandler69a48172010-06-23 16:29:36 -04001635
1636 case IS_IMMERSIVE_TRANSACTION: {
1637 data.enforceInterface(IActivityManager.descriptor);
1638 IBinder token = data.readStrongBinder();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001639 boolean isit = isImmersive(token);
Daniel Sandler69a48172010-06-23 16:29:36 -04001640 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001641 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001642 return true;
1643 }
1644
Craig Mautnerd61dc202014-07-07 11:09:11 -07001645 case IS_TOP_OF_TASK_TRANSACTION: {
1646 data.enforceInterface(IActivityManager.descriptor);
1647 IBinder token = data.readStrongBinder();
1648 final boolean isTopOfTask = isTopOfTask(token);
1649 reply.writeNoException();
1650 reply.writeInt(isTopOfTask ? 1 : 0);
1651 return true;
1652 }
1653
Craig Mautner5eda9b32013-07-02 11:58:16 -07001654 case CONVERT_FROM_TRANSLUCENT_TRANSACTION: {
Craig Mautner4addfc52013-06-25 08:05:45 -07001655 data.enforceInterface(IActivityManager.descriptor);
1656 IBinder token = data.readStrongBinder();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001657 boolean converted = convertFromTranslucent(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001658 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001659 reply.writeInt(converted ? 1 : 0);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001660 return true;
1661 }
1662
1663 case CONVERT_TO_TRANSLUCENT_TRANSACTION: {
1664 data.enforceInterface(IActivityManager.descriptor);
1665 IBinder token = data.readStrongBinder();
Craig Mautner233ceee2014-05-09 17:05:11 -07001666 final Bundle bundle;
1667 if (data.readInt() == 0) {
1668 bundle = null;
1669 } else {
1670 bundle = data.readBundle();
1671 }
1672 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
1673 boolean converted = convertToTranslucent(token, options);
Craig Mautner4addfc52013-06-25 08:05:45 -07001674 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001675 reply.writeInt(converted ? 1 : 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07001676 return true;
1677 }
1678
Craig Mautner233ceee2014-05-09 17:05:11 -07001679 case GET_ACTIVITY_OPTIONS_TRANSACTION: {
1680 data.enforceInterface(IActivityManager.descriptor);
1681 IBinder token = data.readStrongBinder();
1682 final ActivityOptions options = getActivityOptions(token);
1683 reply.writeNoException();
1684 reply.writeBundle(options == null ? null : options.toBundle());
1685 return true;
1686 }
1687
Daniel Sandler69a48172010-06-23 16:29:36 -04001688 case SET_IMMERSIVE_TRANSACTION: {
1689 data.enforceInterface(IActivityManager.descriptor);
1690 IBinder token = data.readStrongBinder();
1691 boolean imm = data.readInt() == 1;
1692 setImmersive(token, imm);
1693 reply.writeNoException();
1694 return true;
1695 }
1696
1697 case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
1698 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001699 boolean isit = isTopActivityImmersive();
Daniel Sandler69a48172010-06-23 16:29:36 -04001700 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001701 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001702 return true;
1703 }
1704
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001705 case CRASH_APPLICATION_TRANSACTION: {
1706 data.enforceInterface(IActivityManager.descriptor);
1707 int uid = data.readInt();
1708 int initialPid = data.readInt();
1709 String packageName = data.readString();
1710 String message = data.readString();
1711 crashApplication(uid, initialPid, packageName, message);
1712 reply.writeNoException();
1713 return true;
1714 }
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001715
1716 case GET_PROVIDER_MIME_TYPE_TRANSACTION: {
1717 data.enforceInterface(IActivityManager.descriptor);
1718 Uri uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001719 int userId = data.readInt();
1720 String type = getProviderMimeType(uri, userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001721 reply.writeNoException();
1722 reply.writeString(type);
1723 return true;
1724 }
1725
Dianne Hackborn7e269642010-08-25 19:50:20 -07001726 case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
1727 data.enforceInterface(IActivityManager.descriptor);
1728 String name = data.readString();
1729 IBinder perm = newUriPermissionOwner(name);
1730 reply.writeNoException();
1731 reply.writeStrongBinder(perm);
1732 return true;
1733 }
1734
1735 case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1736 data.enforceInterface(IActivityManager.descriptor);
1737 IBinder owner = data.readStrongBinder();
1738 int fromUid = data.readInt();
1739 String targetPkg = data.readString();
1740 Uri uri = Uri.CREATOR.createFromParcel(data);
1741 int mode = data.readInt();
Nicolas Prevotf1939902014-06-25 09:29:02 +01001742 int sourceUserId = data.readInt();
1743 int targetUserId = data.readInt();
1744 grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId,
1745 targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001746 reply.writeNoException();
1747 return true;
1748 }
1749
1750 case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1751 data.enforceInterface(IActivityManager.descriptor);
1752 IBinder owner = data.readStrongBinder();
1753 Uri uri = null;
1754 if (data.readInt() != 0) {
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001755 uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001756 }
1757 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001758 int userId = data.readInt();
1759 revokeUriPermissionFromOwner(owner, uri, mode, userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001760 reply.writeNoException();
1761 return true;
1762 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001763
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001764 case CHECK_GRANT_URI_PERMISSION_TRANSACTION: {
1765 data.enforceInterface(IActivityManager.descriptor);
1766 int callingUid = data.readInt();
1767 String targetPkg = data.readString();
1768 Uri uri = Uri.CREATOR.createFromParcel(data);
1769 int modeFlags = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001770 int userId = data.readInt();
1771 int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001772 reply.writeNoException();
1773 reply.writeInt(res);
1774 return true;
1775 }
1776
Andy McFadden824c5102010-07-09 16:26:57 -07001777 case DUMP_HEAP_TRANSACTION: {
1778 data.enforceInterface(IActivityManager.descriptor);
1779 String process = data.readString();
Dianne Hackbornb12e1352012-09-26 11:39:20 -07001780 int userId = data.readInt();
Andy McFadden824c5102010-07-09 16:26:57 -07001781 boolean managed = data.readInt() != 0;
1782 String path = data.readString();
1783 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -07001784 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborn1676c852012-09-10 14:52:30 -07001785 boolean res = dumpHeap(process, userId, managed, path, fd);
Andy McFadden824c5102010-07-09 16:26:57 -07001786 reply.writeNoException();
1787 reply.writeInt(res ? 1 : 0);
1788 return true;
1789 }
1790
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001791 case START_ACTIVITIES_TRANSACTION:
1792 {
1793 data.enforceInterface(IActivityManager.descriptor);
1794 IBinder b = data.readStrongBinder();
1795 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001796 String callingPackage = data.readString();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001797 Intent[] intents = data.createTypedArray(Intent.CREATOR);
1798 String[] resolvedTypes = data.createStringArray();
1799 IBinder resultTo = data.readStrongBinder();
Dianne Hackborna4972e92012-03-14 10:38:05 -07001800 Bundle options = data.readInt() != 0
1801 ? Bundle.CREATOR.createFromParcel(data) : null;
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001802 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001803 int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001804 options, userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001805 reply.writeNoException();
1806 reply.writeInt(result);
1807 return true;
1808 }
1809
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001810 case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1811 {
1812 data.enforceInterface(IActivityManager.descriptor);
1813 int mode = getFrontActivityScreenCompatMode();
1814 reply.writeNoException();
1815 reply.writeInt(mode);
1816 return true;
1817 }
1818
1819 case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1820 {
1821 data.enforceInterface(IActivityManager.descriptor);
1822 int mode = data.readInt();
1823 setFrontActivityScreenCompatMode(mode);
1824 reply.writeNoException();
1825 reply.writeInt(mode);
1826 return true;
1827 }
1828
1829 case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1830 {
1831 data.enforceInterface(IActivityManager.descriptor);
1832 String pkg = data.readString();
1833 int mode = getPackageScreenCompatMode(pkg);
1834 reply.writeNoException();
1835 reply.writeInt(mode);
1836 return true;
1837 }
1838
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001839 case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1840 {
1841 data.enforceInterface(IActivityManager.descriptor);
1842 String pkg = data.readString();
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001843 int mode = data.readInt();
1844 setPackageScreenCompatMode(pkg, mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001845 reply.writeNoException();
1846 return true;
1847 }
Dianne Hackbornaa9d84c2011-05-09 19:00:59 -07001848
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001849 case SWITCH_USER_TRANSACTION: {
1850 data.enforceInterface(IActivityManager.descriptor);
1851 int userid = data.readInt();
1852 boolean result = switchUser(userid);
1853 reply.writeNoException();
1854 reply.writeInt(result ? 1 : 0);
1855 return true;
1856 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07001857
Kenny Guy08488bf2014-02-21 17:40:37 +00001858 case START_USER_IN_BACKGROUND_TRANSACTION: {
1859 data.enforceInterface(IActivityManager.descriptor);
1860 int userid = data.readInt();
1861 boolean result = startUserInBackground(userid);
1862 reply.writeNoException();
1863 reply.writeInt(result ? 1 : 0);
1864 return true;
1865 }
1866
Dianne Hackborn80a4af22012-08-27 19:18:31 -07001867 case STOP_USER_TRANSACTION: {
1868 data.enforceInterface(IActivityManager.descriptor);
1869 int userid = data.readInt();
1870 IStopUserCallback callback = IStopUserCallback.Stub.asInterface(
1871 data.readStrongBinder());
1872 int result = stopUser(userid, callback);
1873 reply.writeNoException();
1874 reply.writeInt(result);
1875 return true;
1876 }
1877
Amith Yamasani52f1d752012-03-28 18:19:29 -07001878 case GET_CURRENT_USER_TRANSACTION: {
1879 data.enforceInterface(IActivityManager.descriptor);
1880 UserInfo userInfo = getCurrentUser();
1881 reply.writeNoException();
1882 userInfo.writeToParcel(reply, 0);
1883 return true;
1884 }
1885
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001886 case IS_USER_RUNNING_TRANSACTION: {
1887 data.enforceInterface(IActivityManager.descriptor);
1888 int userid = data.readInt();
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07001889 boolean orStopping = data.readInt() != 0;
1890 boolean result = isUserRunning(userid, orStopping);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001891 reply.writeNoException();
1892 reply.writeInt(result ? 1 : 0);
1893 return true;
1894 }
1895
Dianne Hackbornc72fc672012-09-20 13:12:03 -07001896 case GET_RUNNING_USER_IDS_TRANSACTION: {
1897 data.enforceInterface(IActivityManager.descriptor);
1898 int[] result = getRunningUserIds();
1899 reply.writeNoException();
1900 reply.writeIntArray(result);
1901 return true;
1902 }
1903
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001904 case REMOVE_TASK_TRANSACTION:
1905 {
1906 data.enforceInterface(IActivityManager.descriptor);
1907 int taskId = data.readInt();
Wale Ogunwaled54b5782014-10-23 15:55:23 -07001908 boolean result = removeTask(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001909 reply.writeNoException();
1910 reply.writeInt(result ? 1 : 0);
1911 return true;
1912 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001913
Jeff Sharkeya4620792011-05-20 15:29:23 -07001914 case REGISTER_PROCESS_OBSERVER_TRANSACTION: {
1915 data.enforceInterface(IActivityManager.descriptor);
1916 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1917 data.readStrongBinder());
1918 registerProcessObserver(observer);
1919 return true;
1920 }
1921
1922 case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: {
1923 data.enforceInterface(IActivityManager.descriptor);
1924 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1925 data.readStrongBinder());
1926 unregisterProcessObserver(observer);
1927 return true;
1928 }
1929
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07001930 case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1931 {
1932 data.enforceInterface(IActivityManager.descriptor);
1933 String pkg = data.readString();
1934 boolean ask = getPackageAskScreenCompat(pkg);
1935 reply.writeNoException();
1936 reply.writeInt(ask ? 1 : 0);
1937 return true;
1938 }
1939
1940 case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1941 {
1942 data.enforceInterface(IActivityManager.descriptor);
1943 String pkg = data.readString();
1944 boolean ask = data.readInt() != 0;
1945 setPackageAskScreenCompat(pkg, ask);
1946 reply.writeNoException();
1947 return true;
1948 }
1949
Dianne Hackborn6c418d52011-06-29 14:05:33 -07001950 case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: {
1951 data.enforceInterface(IActivityManager.descriptor);
1952 IIntentSender r = IIntentSender.Stub.asInterface(
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07001953 data.readStrongBinder());
Dianne Hackborn6c418d52011-06-29 14:05:33 -07001954 boolean res = isIntentSenderTargetedToPackage(r);
1955 reply.writeNoException();
1956 reply.writeInt(res ? 1 : 0);
1957 return true;
1958 }
1959
Dianne Hackborn1927ae82012-06-22 15:21:36 -07001960 case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: {
1961 data.enforceInterface(IActivityManager.descriptor);
1962 IIntentSender r = IIntentSender.Stub.asInterface(
1963 data.readStrongBinder());
1964 boolean res = isIntentSenderAnActivity(r);
1965 reply.writeNoException();
1966 reply.writeInt(res ? 1 : 0);
1967 return true;
1968 }
1969
Dianne Hackborn81038902012-11-26 17:04:09 -08001970 case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: {
1971 data.enforceInterface(IActivityManager.descriptor);
1972 IIntentSender r = IIntentSender.Stub.asInterface(
1973 data.readStrongBinder());
1974 Intent intent = getIntentForIntentSender(r);
1975 reply.writeNoException();
1976 if (intent != null) {
1977 reply.writeInt(1);
1978 intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1979 } else {
1980 reply.writeInt(0);
1981 }
1982 return true;
1983 }
1984
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08001985 case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: {
1986 data.enforceInterface(IActivityManager.descriptor);
1987 IIntentSender r = IIntentSender.Stub.asInterface(
1988 data.readStrongBinder());
1989 String prefix = data.readString();
1990 String tag = getTagForIntentSender(r, prefix);
1991 reply.writeNoException();
1992 reply.writeString(tag);
1993 return true;
1994 }
1995
Dianne Hackborn31ca8542011-07-19 14:58:28 -07001996 case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
1997 data.enforceInterface(IActivityManager.descriptor);
1998 Configuration config = Configuration.CREATOR.createFromParcel(data);
1999 updatePersistentConfiguration(config);
2000 reply.writeNoException();
2001 return true;
2002 }
2003
Dianne Hackbornb437e092011-08-05 17:50:29 -07002004 case GET_PROCESS_PSS_TRANSACTION: {
2005 data.enforceInterface(IActivityManager.descriptor);
2006 int[] pids = data.createIntArray();
2007 long[] pss = getProcessPss(pids);
2008 reply.writeNoException();
2009 reply.writeLongArray(pss);
2010 return true;
2011 }
2012
Dianne Hackborn661cd522011-08-22 00:26:20 -07002013 case SHOW_BOOT_MESSAGE_TRANSACTION: {
2014 data.enforceInterface(IActivityManager.descriptor);
2015 CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
2016 boolean always = data.readInt() != 0;
2017 showBootMessage(msg, always);
2018 reply.writeNoException();
2019 return true;
2020 }
2021
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002022 case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002023 data.enforceInterface(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002024 keyguardWaitingForActivityDrawn();
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002025 reply.writeNoException();
2026 return true;
2027 }
2028
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002029 case SHOULD_UP_RECREATE_TASK_TRANSACTION: {
Adam Powelldd8fab22012-03-22 17:47:27 -07002030 data.enforceInterface(IActivityManager.descriptor);
2031 IBinder token = data.readStrongBinder();
2032 String destAffinity = data.readString();
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002033 boolean res = shouldUpRecreateTask(token, destAffinity);
Adam Powelldd8fab22012-03-22 17:47:27 -07002034 reply.writeNoException();
2035 reply.writeInt(res ? 1 : 0);
2036 return true;
2037 }
2038
2039 case NAVIGATE_UP_TO_TRANSACTION: {
2040 data.enforceInterface(IActivityManager.descriptor);
2041 IBinder token = data.readStrongBinder();
2042 Intent target = Intent.CREATOR.createFromParcel(data);
2043 int resultCode = data.readInt();
2044 Intent resultData = null;
2045 if (data.readInt() != 0) {
2046 resultData = Intent.CREATOR.createFromParcel(data);
2047 }
2048 boolean res = navigateUpTo(token, target, resultCode, resultData);
2049 reply.writeNoException();
2050 reply.writeInt(res ? 1 : 0);
2051 return true;
2052 }
2053
Dianne Hackborn5320eb82012-05-18 12:05:04 -07002054 case GET_LAUNCHED_FROM_UID_TRANSACTION: {
2055 data.enforceInterface(IActivityManager.descriptor);
2056 IBinder token = data.readStrongBinder();
2057 int res = getLaunchedFromUid(token);
2058 reply.writeNoException();
2059 reply.writeInt(res);
2060 return true;
2061 }
2062
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002063 case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: {
2064 data.enforceInterface(IActivityManager.descriptor);
2065 IBinder token = data.readStrongBinder();
2066 String res = getLaunchedFromPackage(token);
2067 reply.writeNoException();
2068 reply.writeString(res);
2069 return true;
2070 }
2071
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002072 case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2073 data.enforceInterface(IActivityManager.descriptor);
2074 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2075 data.readStrongBinder());
2076 registerUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002077 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002078 return true;
2079 }
2080
2081 case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2082 data.enforceInterface(IActivityManager.descriptor);
2083 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2084 data.readStrongBinder());
2085 unregisterUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002086 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002087 return true;
2088 }
2089
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002090 case REQUEST_BUG_REPORT_TRANSACTION: {
2091 data.enforceInterface(IActivityManager.descriptor);
2092 requestBugReport();
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002093 reply.writeNoException();
2094 return true;
2095 }
2096
2097 case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: {
2098 data.enforceInterface(IActivityManager.descriptor);
2099 int pid = data.readInt();
2100 boolean aboveSystem = data.readInt() != 0;
Jeff Brownbd181bb2013-09-10 16:44:24 -07002101 String reason = data.readString();
2102 long res = inputDispatchingTimedOut(pid, aboveSystem, reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002103 reply.writeNoException();
2104 reply.writeLong(res);
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002105 return true;
2106 }
2107
Adam Skorydfc7fd72013-08-05 19:23:41 -07002108 case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002109 data.enforceInterface(IActivityManager.descriptor);
2110 int requestType = data.readInt();
Adam Skorydfc7fd72013-08-05 19:23:41 -07002111 Bundle res = getAssistContextExtras(requestType);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002112 reply.writeNoException();
2113 reply.writeBundle(res);
2114 return true;
2115 }
2116
Adam Skorydfc7fd72013-08-05 19:23:41 -07002117 case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002118 data.enforceInterface(IActivityManager.descriptor);
2119 IBinder token = data.readStrongBinder();
2120 Bundle extras = data.readBundle();
Adam Skory7140a252013-09-11 12:04:58 +01002121 reportAssistContextExtras(token, extras);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002122 reply.writeNoException();
2123 return true;
2124 }
2125
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002126 case LAUNCH_ASSIST_INTENT_TRANSACTION: {
2127 data.enforceInterface(IActivityManager.descriptor);
2128 Intent intent = Intent.CREATOR.createFromParcel(data);
2129 int requestType = data.readInt();
2130 String hint = data.readString();
2131 int userHandle = data.readInt();
2132 boolean res = launchAssistIntent(intent, requestType, hint, userHandle);
2133 reply.writeNoException();
2134 reply.writeInt(res ? 1 : 0);
2135 return true;
2136 }
2137
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002138 case KILL_UID_TRANSACTION: {
2139 data.enforceInterface(IActivityManager.descriptor);
2140 int uid = data.readInt();
2141 String reason = data.readString();
2142 killUid(uid, reason);
2143 reply.writeNoException();
2144 return true;
2145 }
2146
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07002147 case HANG_TRANSACTION: {
2148 data.enforceInterface(IActivityManager.descriptor);
2149 IBinder who = data.readStrongBinder();
2150 boolean allowRestart = data.readInt() != 0;
2151 hang(who, allowRestart);
2152 reply.writeNoException();
2153 return true;
2154 }
2155
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07002156 case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: {
2157 data.enforceInterface(IActivityManager.descriptor);
2158 IBinder token = data.readStrongBinder();
2159 reportActivityFullyDrawn(token);
2160 reply.writeNoException();
2161 return true;
2162 }
2163
Craig Mautner5eda9b32013-07-02 11:58:16 -07002164 case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: {
2165 data.enforceInterface(IActivityManager.descriptor);
2166 IBinder token = data.readStrongBinder();
2167 notifyActivityDrawn(token);
2168 reply.writeNoException();
2169 return true;
2170 }
Dianne Hackborn57a7f592013-07-22 18:21:32 -07002171
2172 case RESTART_TRANSACTION: {
2173 data.enforceInterface(IActivityManager.descriptor);
2174 restart();
2175 reply.writeNoException();
2176 return true;
2177 }
Jeff Sharkey08da7a12013-08-11 20:53:18 -07002178
Dianne Hackborn35f72be2013-09-16 10:57:39 -07002179 case PERFORM_IDLE_MAINTENANCE_TRANSACTION: {
2180 data.enforceInterface(IActivityManager.descriptor);
2181 performIdleMaintenance();
2182 reply.writeNoException();
2183 return true;
2184 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002185
Todd Kennedyca4d8422015-01-15 15:19:22 -08002186 case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: {
Craig Mautner4a1cb222013-12-04 16:14:06 -08002187 data.enforceInterface(IActivityManager.descriptor);
2188 IBinder parentActivityToken = data.readStrongBinder();
2189 IActivityContainerCallback callback =
Craig Mautnere3a00d72014-04-16 08:31:19 -07002190 IActivityContainerCallback.Stub.asInterface(data.readStrongBinder());
Craig Mautner4a1cb222013-12-04 16:14:06 -08002191 IActivityContainer activityContainer =
Todd Kennedyca4d8422015-01-15 15:19:22 -08002192 createVirtualActivityContainer(parentActivityToken, callback);
Craig Mautner4a1cb222013-12-04 16:14:06 -08002193 reply.writeNoException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08002194 if (activityContainer != null) {
2195 reply.writeInt(1);
2196 reply.writeStrongBinder(activityContainer.asBinder());
2197 } else {
2198 reply.writeInt(0);
2199 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002200 return true;
2201 }
2202
Craig Mautner95da1082014-02-24 17:54:35 -08002203 case DELETE_ACTIVITY_CONTAINER_TRANSACTION: {
2204 data.enforceInterface(IActivityManager.descriptor);
2205 IActivityContainer activityContainer =
2206 IActivityContainer.Stub.asInterface(data.readStrongBinder());
2207 deleteActivityContainer(activityContainer);
2208 reply.writeNoException();
2209 return true;
2210 }
2211
Craig Mautnere0a38842013-12-16 16:14:02 -08002212 case GET_ACTIVITY_CONTAINER_TRANSACTION: {
2213 data.enforceInterface(IActivityManager.descriptor);
2214 IBinder activityToken = data.readStrongBinder();
2215 IActivityContainer activityContainer = getEnclosingActivityContainer(activityToken);
2216 reply.writeNoException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08002217 if (activityContainer != null) {
2218 reply.writeInt(1);
2219 reply.writeStrongBinder(activityContainer.asBinder());
2220 } else {
2221 reply.writeInt(0);
2222 }
Craig Mautnere0a38842013-12-16 16:14:02 -08002223 return true;
2224 }
2225
Craig Mautner4a1cb222013-12-04 16:14:06 -08002226 case GET_HOME_ACTIVITY_TOKEN_TRANSACTION: {
2227 data.enforceInterface(IActivityManager.descriptor);
2228 IBinder homeActivityToken = getHomeActivityToken();
2229 reply.writeNoException();
2230 reply.writeStrongBinder(homeActivityToken);
2231 return true;
2232 }
Craig Mautneraea74a52014-03-08 14:23:10 -08002233
2234 case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: {
2235 data.enforceInterface(IActivityManager.descriptor);
2236 final int taskId = data.readInt();
2237 startLockTaskMode(taskId);
2238 reply.writeNoException();
2239 return true;
2240 }
2241
2242 case START_LOCK_TASK_BY_TOKEN_TRANSACTION: {
2243 data.enforceInterface(IActivityManager.descriptor);
2244 IBinder token = data.readStrongBinder();
2245 startLockTaskMode(token);
2246 reply.writeNoException();
2247 return true;
2248 }
2249
Craig Mautnerd61dc202014-07-07 11:09:11 -07002250 case START_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002251 data.enforceInterface(IActivityManager.descriptor);
2252 startLockTaskModeOnCurrent();
2253 reply.writeNoException();
2254 return true;
2255 }
2256
Craig Mautneraea74a52014-03-08 14:23:10 -08002257 case STOP_LOCK_TASK_MODE_TRANSACTION: {
2258 data.enforceInterface(IActivityManager.descriptor);
2259 stopLockTaskMode();
2260 reply.writeNoException();
2261 return true;
2262 }
2263
Craig Mautnerd61dc202014-07-07 11:09:11 -07002264 case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002265 data.enforceInterface(IActivityManager.descriptor);
2266 stopLockTaskModeOnCurrent();
2267 reply.writeNoException();
2268 return true;
2269 }
2270
Craig Mautneraea74a52014-03-08 14:23:10 -08002271 case IS_IN_LOCK_TASK_MODE_TRANSACTION: {
2272 data.enforceInterface(IActivityManager.descriptor);
2273 final boolean isInLockTaskMode = isInLockTaskMode();
2274 reply.writeNoException();
2275 reply.writeInt(isInLockTaskMode ? 1 : 0);
2276 return true;
2277 }
Craig Mautner2fbd7542014-03-21 09:34:07 -07002278
Winson Chunga449dc02014-05-16 11:15:04 -07002279 case SET_TASK_DESCRIPTION_TRANSACTION: {
Craig Mautner2fbd7542014-03-21 09:34:07 -07002280 data.enforceInterface(IActivityManager.descriptor);
2281 IBinder token = data.readStrongBinder();
Winson Chunga449dc02014-05-16 11:15:04 -07002282 ActivityManager.TaskDescription values =
2283 ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
2284 setTaskDescription(token, values);
Craig Mautner2fbd7542014-03-21 09:34:07 -07002285 reply.writeNoException();
2286 return true;
2287 }
Craig Mautneree2e45a2014-06-27 12:10:03 -07002288
Craig Mautner648f69b2014-09-18 14:16:26 -07002289 case GET_TASK_DESCRIPTION_ICON_TRANSACTION: {
2290 data.enforceInterface(IActivityManager.descriptor);
2291 String filename = data.readString();
2292 Bitmap icon = getTaskDescriptionIcon(filename);
2293 reply.writeNoException();
2294 if (icon == null) {
2295 reply.writeInt(0);
2296 } else {
2297 reply.writeInt(1);
2298 icon.writeToParcel(reply, 0);
2299 }
2300 return true;
2301 }
2302
Winson Chung044d5292014-11-06 11:05:19 -08002303 case START_IN_PLACE_ANIMATION_TRANSACTION: {
2304 data.enforceInterface(IActivityManager.descriptor);
2305 final Bundle bundle;
2306 if (data.readInt() == 0) {
2307 bundle = null;
2308 } else {
2309 bundle = data.readBundle();
2310 }
2311 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
2312 startInPlaceAnimationOnFrontMostApplication(options);
2313 reply.writeNoException();
2314 return true;
2315 }
2316
Jose Lima4b6c6692014-08-12 17:41:12 -07002317 case REQUEST_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002318 data.enforceInterface(IActivityManager.descriptor);
2319 IBinder token = data.readStrongBinder();
2320 boolean enable = data.readInt() > 0;
Jose Lima4b6c6692014-08-12 17:41:12 -07002321 boolean success = requestVisibleBehind(token, enable);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002322 reply.writeNoException();
2323 reply.writeInt(success ? 1 : 0);
2324 return true;
2325 }
2326
Jose Lima4b6c6692014-08-12 17:41:12 -07002327 case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002328 data.enforceInterface(IActivityManager.descriptor);
2329 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002330 final boolean enabled = isBackgroundVisibleBehind(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002331 reply.writeNoException();
2332 reply.writeInt(enabled ? 1 : 0);
2333 return true;
2334 }
2335
Jose Lima4b6c6692014-08-12 17:41:12 -07002336 case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002337 data.enforceInterface(IActivityManager.descriptor);
2338 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002339 backgroundResourcesReleased(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002340 reply.writeNoException();
2341 return true;
2342 }
Craig Mautnerbb742462014-07-07 15:28:55 -07002343
2344 case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: {
2345 data.enforceInterface(IActivityManager.descriptor);
2346 IBinder token = data.readStrongBinder();
2347 notifyLaunchTaskBehindComplete(token);
2348 reply.writeNoException();
2349 return true;
2350 }
Craig Mautner8746a472014-07-24 15:12:54 -07002351
2352 case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: {
2353 data.enforceInterface(IActivityManager.descriptor);
2354 IBinder token = data.readStrongBinder();
2355 notifyEnterAnimationComplete(token);
2356 reply.writeNoException();
2357 return true;
2358 }
Craig Mautner6e2f3952014-09-09 14:26:41 -07002359
2360 case BOOT_ANIMATION_COMPLETE_TRANSACTION: {
2361 data.enforceInterface(IActivityManager.descriptor);
2362 bootAnimationComplete();
2363 reply.writeNoException();
2364 return true;
2365 }
Wale Ogunwale18795a22014-12-03 11:38:33 -08002366
2367 case SYSTEM_BACKUP_RESTORED: {
2368 data.enforceInterface(IActivityManager.descriptor);
2369 systemBackupRestored();
2370 reply.writeNoException();
2371 return true;
2372 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002373 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002374
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002375 return super.onTransact(code, data, reply, flags);
2376 }
2377
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002378 public IBinder asBinder() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002379 return this;
2380 }
2381
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002382 private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
2383 protected IActivityManager create() {
2384 IBinder b = ServiceManager.getService("activity");
Joe Onorato43a17652011-04-06 19:22:23 -07002385 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002386 Log.v("ActivityManager", "default service binder = " + b);
2387 }
2388 IActivityManager am = asInterface(b);
Joe Onorato43a17652011-04-06 19:22:23 -07002389 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002390 Log.v("ActivityManager", "default service = " + am);
2391 }
2392 return am;
2393 }
2394 };
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002395}
2396
2397class ActivityManagerProxy implements IActivityManager
2398{
2399 public ActivityManagerProxy(IBinder remote)
2400 {
2401 mRemote = remote;
2402 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002403
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002404 public IBinder asBinder()
2405 {
2406 return mRemote;
2407 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002408
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002409 public int startActivity(IApplicationThread caller, String callingPackage, Intent intent,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002410 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002411 int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002412 Parcel data = Parcel.obtain();
2413 Parcel reply = Parcel.obtain();
2414 data.writeInterfaceToken(IActivityManager.descriptor);
2415 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002416 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002417 intent.writeToParcel(data, 0);
2418 data.writeString(resolvedType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002419 data.writeStrongBinder(resultTo);
2420 data.writeString(resultWho);
2421 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002422 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002423 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002424 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002425 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002426 } else {
2427 data.writeInt(0);
2428 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002429 if (options != null) {
2430 data.writeInt(1);
2431 options.writeToParcel(data, 0);
2432 } else {
2433 data.writeInt(0);
2434 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002435 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2436 reply.readException();
2437 int result = reply.readInt();
2438 reply.recycle();
2439 data.recycle();
2440 return result;
2441 }
Amith Yamasani82644082012-08-03 13:09:11 -07002442
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002443 public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent,
Amith Yamasani82644082012-08-03 13:09:11 -07002444 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002445 int startFlags, ProfilerInfo profilerInfo, Bundle options,
2446 int userId) throws RemoteException {
Amith Yamasani82644082012-08-03 13:09:11 -07002447 Parcel data = Parcel.obtain();
2448 Parcel reply = Parcel.obtain();
2449 data.writeInterfaceToken(IActivityManager.descriptor);
2450 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002451 data.writeString(callingPackage);
Amith Yamasani82644082012-08-03 13:09:11 -07002452 intent.writeToParcel(data, 0);
2453 data.writeString(resolvedType);
2454 data.writeStrongBinder(resultTo);
2455 data.writeString(resultWho);
2456 data.writeInt(requestCode);
2457 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002458 if (profilerInfo != null) {
Amith Yamasani82644082012-08-03 13:09:11 -07002459 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002460 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Amith Yamasani82644082012-08-03 13:09:11 -07002461 } else {
2462 data.writeInt(0);
2463 }
2464 if (options != null) {
2465 data.writeInt(1);
2466 options.writeToParcel(data, 0);
2467 } else {
2468 data.writeInt(0);
2469 }
2470 data.writeInt(userId);
2471 mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0);
2472 reply.readException();
2473 int result = reply.readInt();
2474 reply.recycle();
2475 data.recycle();
2476 return result;
2477 }
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002478 public int startActivityAsCaller(IApplicationThread caller, String callingPackage,
2479 Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Sharkey97978802014-10-14 10:48:18 -07002480 int startFlags, ProfilerInfo profilerInfo, Bundle options, int userId) throws RemoteException {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002481 Parcel data = Parcel.obtain();
2482 Parcel reply = Parcel.obtain();
2483 data.writeInterfaceToken(IActivityManager.descriptor);
2484 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2485 data.writeString(callingPackage);
2486 intent.writeToParcel(data, 0);
2487 data.writeString(resolvedType);
2488 data.writeStrongBinder(resultTo);
2489 data.writeString(resultWho);
2490 data.writeInt(requestCode);
2491 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002492 if (profilerInfo != null) {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002493 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002494 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002495 } else {
2496 data.writeInt(0);
2497 }
2498 if (options != null) {
2499 data.writeInt(1);
2500 options.writeToParcel(data, 0);
2501 } else {
2502 data.writeInt(0);
2503 }
Jeff Sharkey97978802014-10-14 10:48:18 -07002504 data.writeInt(userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002505 mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0);
2506 reply.readException();
2507 int result = reply.readInt();
2508 reply.recycle();
2509 data.recycle();
2510 return result;
2511 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002512 public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage,
2513 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Jeff Hao1b012d32014-08-20 10:35:34 -07002514 int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options,
2515 int userId) throws RemoteException {
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002516 Parcel data = Parcel.obtain();
2517 Parcel reply = Parcel.obtain();
2518 data.writeInterfaceToken(IActivityManager.descriptor);
2519 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002520 data.writeString(callingPackage);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002521 intent.writeToParcel(data, 0);
2522 data.writeString(resolvedType);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002523 data.writeStrongBinder(resultTo);
2524 data.writeString(resultWho);
2525 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002526 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002527 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002528 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002529 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002530 } else {
2531 data.writeInt(0);
2532 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002533 if (options != null) {
2534 data.writeInt(1);
2535 options.writeToParcel(data, 0);
2536 } else {
2537 data.writeInt(0);
2538 }
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002539 data.writeInt(userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002540 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
2541 reply.readException();
2542 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
2543 reply.recycle();
2544 data.recycle();
2545 return result;
2546 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002547 public int startActivityWithConfig(IApplicationThread caller, String callingPackage,
2548 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002549 int requestCode, int startFlags, Configuration config,
Dianne Hackborn41203752012-08-31 14:05:51 -07002550 Bundle options, int userId) throws RemoteException {
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002551 Parcel data = Parcel.obtain();
2552 Parcel reply = Parcel.obtain();
2553 data.writeInterfaceToken(IActivityManager.descriptor);
2554 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002555 data.writeString(callingPackage);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002556 intent.writeToParcel(data, 0);
2557 data.writeString(resolvedType);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002558 data.writeStrongBinder(resultTo);
2559 data.writeString(resultWho);
2560 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002561 data.writeInt(startFlags);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002562 config.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002563 if (options != null) {
2564 data.writeInt(1);
2565 options.writeToParcel(data, 0);
2566 } else {
2567 data.writeInt(0);
2568 }
Dianne Hackborn41203752012-08-31 14:05:51 -07002569 data.writeInt(userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002570 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2571 reply.readException();
2572 int result = reply.readInt();
2573 reply.recycle();
2574 data.recycle();
2575 return result;
2576 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002577 public int startActivityIntentSender(IApplicationThread caller,
2578 IntentSender intent, Intent fillInIntent, String resolvedType,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002579 IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002580 int flagsMask, int flagsValues, Bundle options) throws RemoteException {
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002581 Parcel data = Parcel.obtain();
2582 Parcel reply = Parcel.obtain();
2583 data.writeInterfaceToken(IActivityManager.descriptor);
2584 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2585 intent.writeToParcel(data, 0);
2586 if (fillInIntent != null) {
2587 data.writeInt(1);
2588 fillInIntent.writeToParcel(data, 0);
2589 } else {
2590 data.writeInt(0);
2591 }
2592 data.writeString(resolvedType);
2593 data.writeStrongBinder(resultTo);
2594 data.writeString(resultWho);
2595 data.writeInt(requestCode);
2596 data.writeInt(flagsMask);
2597 data.writeInt(flagsValues);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002598 if (options != null) {
2599 data.writeInt(1);
2600 options.writeToParcel(data, 0);
2601 } else {
2602 data.writeInt(0);
2603 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002604 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002605 reply.readException();
2606 int result = reply.readInt();
2607 reply.recycle();
2608 data.recycle();
2609 return result;
2610 }
Dianne Hackborn91097de2014-04-04 18:02:06 -07002611 public int startVoiceActivity(String callingPackage, int callingPid, int callingUid,
2612 Intent intent, String resolvedType, IVoiceInteractionSession session,
Jeff Hao1b012d32014-08-20 10:35:34 -07002613 IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo,
2614 Bundle options, int userId) throws RemoteException {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002615 Parcel data = Parcel.obtain();
2616 Parcel reply = Parcel.obtain();
2617 data.writeInterfaceToken(IActivityManager.descriptor);
2618 data.writeString(callingPackage);
2619 data.writeInt(callingPid);
2620 data.writeInt(callingUid);
2621 intent.writeToParcel(data, 0);
2622 data.writeString(resolvedType);
2623 data.writeStrongBinder(session.asBinder());
2624 data.writeStrongBinder(interactor.asBinder());
2625 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002626 if (profilerInfo != null) {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002627 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002628 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn91097de2014-04-04 18:02:06 -07002629 } else {
2630 data.writeInt(0);
2631 }
2632 if (options != null) {
2633 data.writeInt(1);
2634 options.writeToParcel(data, 0);
2635 } else {
2636 data.writeInt(0);
2637 }
2638 data.writeInt(userId);
2639 mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0);
2640 reply.readException();
2641 int result = reply.readInt();
2642 reply.recycle();
2643 data.recycle();
2644 return result;
2645 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002646 public boolean startNextMatchingActivity(IBinder callingActivity,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002647 Intent intent, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002648 Parcel data = Parcel.obtain();
2649 Parcel reply = Parcel.obtain();
2650 data.writeInterfaceToken(IActivityManager.descriptor);
2651 data.writeStrongBinder(callingActivity);
2652 intent.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002653 if (options != null) {
2654 data.writeInt(1);
2655 options.writeToParcel(data, 0);
2656 } else {
2657 data.writeInt(0);
2658 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002659 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
2660 reply.readException();
2661 int result = reply.readInt();
2662 reply.recycle();
2663 data.recycle();
2664 return result != 0;
2665 }
Craig Mautnerdc00cbe2014-07-20 17:48:47 -07002666 public int startActivityFromRecents(int taskId, Bundle options) throws RemoteException {
2667 Parcel data = Parcel.obtain();
2668 Parcel reply = Parcel.obtain();
2669 data.writeInterfaceToken(IActivityManager.descriptor);
2670 data.writeInt(taskId);
2671 if (options == null) {
2672 data.writeInt(0);
2673 } else {
2674 data.writeInt(1);
2675 options.writeToParcel(data, 0);
2676 }
2677 mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0);
2678 reply.readException();
2679 int result = reply.readInt();
2680 reply.recycle();
2681 data.recycle();
2682 return result;
2683 }
Winson Chung3b3f4642014-04-22 10:08:18 -07002684 public boolean finishActivity(IBinder token, int resultCode, Intent resultData, boolean finishTask)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002685 throws RemoteException {
2686 Parcel data = Parcel.obtain();
2687 Parcel reply = Parcel.obtain();
2688 data.writeInterfaceToken(IActivityManager.descriptor);
2689 data.writeStrongBinder(token);
2690 data.writeInt(resultCode);
2691 if (resultData != null) {
2692 data.writeInt(1);
2693 resultData.writeToParcel(data, 0);
2694 } else {
2695 data.writeInt(0);
2696 }
Winson Chung3b3f4642014-04-22 10:08:18 -07002697 data.writeInt(finishTask ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002698 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
2699 reply.readException();
2700 boolean res = reply.readInt() != 0;
2701 data.recycle();
2702 reply.recycle();
2703 return res;
2704 }
2705 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
2706 {
2707 Parcel data = Parcel.obtain();
2708 Parcel reply = Parcel.obtain();
2709 data.writeInterfaceToken(IActivityManager.descriptor);
2710 data.writeStrongBinder(token);
2711 data.writeString(resultWho);
2712 data.writeInt(requestCode);
2713 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
2714 reply.readException();
2715 data.recycle();
2716 reply.recycle();
2717 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -07002718 public boolean finishActivityAffinity(IBinder token) throws RemoteException {
2719 Parcel data = Parcel.obtain();
2720 Parcel reply = Parcel.obtain();
2721 data.writeInterfaceToken(IActivityManager.descriptor);
2722 data.writeStrongBinder(token);
2723 mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0);
2724 reply.readException();
2725 boolean res = reply.readInt() != 0;
2726 data.recycle();
2727 reply.recycle();
2728 return res;
2729 }
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -07002730 public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException {
2731 Parcel data = Parcel.obtain();
2732 Parcel reply = Parcel.obtain();
2733 data.writeInterfaceToken(IActivityManager.descriptor);
2734 data.writeStrongBinder(session.asBinder());
2735 mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0);
2736 reply.readException();
2737 data.recycle();
2738 reply.recycle();
2739 }
Dianne Hackborn89ad4562014-08-24 16:45:38 -07002740 public boolean releaseActivityInstance(IBinder token) throws RemoteException {
2741 Parcel data = Parcel.obtain();
2742 Parcel reply = Parcel.obtain();
2743 data.writeInterfaceToken(IActivityManager.descriptor);
2744 data.writeStrongBinder(token);
2745 mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0);
2746 reply.readException();
2747 boolean res = reply.readInt() != 0;
2748 data.recycle();
2749 reply.recycle();
2750 return res;
2751 }
2752 public void releaseSomeActivities(IApplicationThread app) throws RemoteException {
2753 Parcel data = Parcel.obtain();
2754 Parcel reply = Parcel.obtain();
2755 data.writeInterfaceToken(IActivityManager.descriptor);
2756 data.writeStrongBinder(app.asBinder());
2757 mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0);
2758 reply.readException();
2759 data.recycle();
2760 reply.recycle();
2761 }
Dianne Hackborn061d58a2010-03-12 15:07:06 -08002762 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
2763 Parcel data = Parcel.obtain();
2764 Parcel reply = Parcel.obtain();
2765 data.writeInterfaceToken(IActivityManager.descriptor);
2766 data.writeStrongBinder(token);
2767 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
2768 reply.readException();
2769 boolean res = reply.readInt() != 0;
2770 data.recycle();
2771 reply.recycle();
2772 return res;
2773 }
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002774 public Intent registerReceiver(IApplicationThread caller, String packageName,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002775 IIntentReceiver receiver,
Dianne Hackborn20e80982012-08-31 19:00:44 -07002776 IntentFilter filter, String perm, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002777 {
2778 Parcel data = Parcel.obtain();
2779 Parcel reply = Parcel.obtain();
2780 data.writeInterfaceToken(IActivityManager.descriptor);
2781 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002782 data.writeString(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002783 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
2784 filter.writeToParcel(data, 0);
2785 data.writeString(perm);
Dianne Hackborn20e80982012-08-31 19:00:44 -07002786 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002787 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2788 reply.readException();
2789 Intent intent = null;
2790 int haveIntent = reply.readInt();
2791 if (haveIntent != 0) {
2792 intent = Intent.CREATOR.createFromParcel(reply);
2793 }
2794 reply.recycle();
2795 data.recycle();
2796 return intent;
2797 }
2798 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
2799 {
2800 Parcel data = Parcel.obtain();
2801 Parcel reply = Parcel.obtain();
2802 data.writeInterfaceToken(IActivityManager.descriptor);
2803 data.writeStrongBinder(receiver.asBinder());
2804 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2805 reply.readException();
2806 data.recycle();
2807 reply.recycle();
2808 }
2809 public int broadcastIntent(IApplicationThread caller,
2810 Intent intent, String resolvedType, IIntentReceiver resultTo,
2811 int resultCode, String resultData, Bundle map,
Dianne Hackbornf51f6122013-02-04 18:23:34 -08002812 String requiredPermission, int appOp, boolean serialized,
Amith Yamasani742a6712011-05-04 14:49:28 -07002813 boolean sticky, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002814 {
2815 Parcel data = Parcel.obtain();
2816 Parcel reply = Parcel.obtain();
2817 data.writeInterfaceToken(IActivityManager.descriptor);
2818 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2819 intent.writeToParcel(data, 0);
2820 data.writeString(resolvedType);
2821 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
2822 data.writeInt(resultCode);
2823 data.writeString(resultData);
2824 data.writeBundle(map);
2825 data.writeString(requiredPermission);
Dianne Hackbornf51f6122013-02-04 18:23:34 -08002826 data.writeInt(appOp);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002827 data.writeInt(serialized ? 1 : 0);
2828 data.writeInt(sticky ? 1 : 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07002829 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002830 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
2831 reply.readException();
2832 int res = reply.readInt();
2833 reply.recycle();
2834 data.recycle();
2835 return res;
2836 }
Amith Yamasani742a6712011-05-04 14:49:28 -07002837 public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
2838 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002839 {
2840 Parcel data = Parcel.obtain();
2841 Parcel reply = Parcel.obtain();
2842 data.writeInterfaceToken(IActivityManager.descriptor);
2843 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2844 intent.writeToParcel(data, 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07002845 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002846 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
2847 reply.readException();
2848 data.recycle();
2849 reply.recycle();
2850 }
2851 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map, boolean abortBroadcast) throws RemoteException
2852 {
2853 Parcel data = Parcel.obtain();
2854 Parcel reply = Parcel.obtain();
2855 data.writeInterfaceToken(IActivityManager.descriptor);
2856 data.writeStrongBinder(who);
2857 data.writeInt(resultCode);
2858 data.writeString(resultData);
2859 data.writeBundle(map);
2860 data.writeInt(abortBroadcast ? 1 : 0);
2861 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2862 reply.readException();
2863 data.recycle();
2864 reply.recycle();
2865 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002866 public void attachApplication(IApplicationThread app) throws RemoteException
2867 {
2868 Parcel data = Parcel.obtain();
2869 Parcel reply = Parcel.obtain();
2870 data.writeInterfaceToken(IActivityManager.descriptor);
2871 data.writeStrongBinder(app.asBinder());
2872 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
2873 reply.readException();
2874 data.recycle();
2875 reply.recycle();
2876 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002877 public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
2878 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002879 {
2880 Parcel data = Parcel.obtain();
2881 Parcel reply = Parcel.obtain();
2882 data.writeInterfaceToken(IActivityManager.descriptor);
2883 data.writeStrongBinder(token);
Dianne Hackborne88846e2009-09-30 21:34:25 -07002884 if (config != null) {
2885 data.writeInt(1);
2886 config.writeToParcel(data, 0);
2887 } else {
2888 data.writeInt(0);
2889 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002890 data.writeInt(stopProfiling ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002891 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2892 reply.readException();
2893 data.recycle();
2894 reply.recycle();
2895 }
Dianne Hackbornad9b32112012-09-17 15:35:01 -07002896 public void activityResumed(IBinder token) throws RemoteException
2897 {
2898 Parcel data = Parcel.obtain();
2899 Parcel reply = Parcel.obtain();
2900 data.writeInterfaceToken(IActivityManager.descriptor);
2901 data.writeStrongBinder(token);
2902 mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0);
2903 reply.readException();
2904 data.recycle();
2905 reply.recycle();
2906 }
Dianne Hackborna4e102e2014-09-04 22:52:27 -07002907 public void activityPaused(IBinder token) throws RemoteException
Dianne Hackborn0aae2d42010-12-07 23:51:29 -08002908 {
2909 Parcel data = Parcel.obtain();
2910 Parcel reply = Parcel.obtain();
2911 data.writeInterfaceToken(IActivityManager.descriptor);
2912 data.writeStrongBinder(token);
2913 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
2914 reply.readException();
2915 data.recycle();
2916 reply.recycle();
2917 }
2918 public void activityStopped(IBinder token, Bundle state,
Craig Mautnera0026042014-04-23 11:45:37 -07002919 PersistableBundle persistentState, CharSequence description) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002920 {
2921 Parcel data = Parcel.obtain();
2922 Parcel reply = Parcel.obtain();
2923 data.writeInterfaceToken(IActivityManager.descriptor);
2924 data.writeStrongBinder(token);
2925 data.writeBundle(state);
Craig Mautnera0026042014-04-23 11:45:37 -07002926 data.writePersistableBundle(persistentState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002927 TextUtils.writeToParcel(description, data, 0);
2928 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2929 reply.readException();
2930 data.recycle();
2931 reply.recycle();
2932 }
Dianne Hackborn4eba96b2011-01-21 13:34:36 -08002933 public void activitySlept(IBinder token) throws RemoteException
2934 {
2935 Parcel data = Parcel.obtain();
2936 Parcel reply = Parcel.obtain();
2937 data.writeInterfaceToken(IActivityManager.descriptor);
2938 data.writeStrongBinder(token);
2939 mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2940 reply.readException();
2941 data.recycle();
2942 reply.recycle();
2943 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002944 public void activityDestroyed(IBinder token) throws RemoteException
2945 {
2946 Parcel data = Parcel.obtain();
2947 Parcel reply = Parcel.obtain();
2948 data.writeInterfaceToken(IActivityManager.descriptor);
2949 data.writeStrongBinder(token);
2950 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
2951 reply.readException();
2952 data.recycle();
2953 reply.recycle();
2954 }
2955 public String getCallingPackage(IBinder token) throws RemoteException
2956 {
2957 Parcel data = Parcel.obtain();
2958 Parcel reply = Parcel.obtain();
2959 data.writeInterfaceToken(IActivityManager.descriptor);
2960 data.writeStrongBinder(token);
2961 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
2962 reply.readException();
2963 String res = reply.readString();
2964 data.recycle();
2965 reply.recycle();
2966 return res;
2967 }
2968 public ComponentName getCallingActivity(IBinder token)
2969 throws RemoteException {
2970 Parcel data = Parcel.obtain();
2971 Parcel reply = Parcel.obtain();
2972 data.writeInterfaceToken(IActivityManager.descriptor);
2973 data.writeStrongBinder(token);
2974 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
2975 reply.readException();
2976 ComponentName res = ComponentName.readFromParcel(reply);
2977 data.recycle();
2978 reply.recycle();
2979 return res;
2980 }
Dianne Hackborn885fbe52014-08-23 15:23:58 -07002981 public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException {
Winson Chung1147c402014-05-14 11:05:00 -07002982 Parcel data = Parcel.obtain();
2983 Parcel reply = Parcel.obtain();
2984 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -07002985 data.writeString(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -07002986 mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0);
2987 reply.readException();
2988 ArrayList<IAppTask> list = null;
2989 int N = reply.readInt();
2990 if (N >= 0) {
2991 list = new ArrayList<IAppTask>();
2992 while (N > 0) {
2993 IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder());
2994 list.add(task);
2995 N--;
2996 }
2997 }
2998 data.recycle();
2999 reply.recycle();
3000 return list;
3001 }
Dianne Hackbornaec68bb2014-08-20 15:25:13 -07003002 public int addAppTask(IBinder activityToken, Intent intent,
3003 ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException {
3004 Parcel data = Parcel.obtain();
3005 Parcel reply = Parcel.obtain();
3006 data.writeInterfaceToken(IActivityManager.descriptor);
3007 data.writeStrongBinder(activityToken);
3008 intent.writeToParcel(data, 0);
3009 description.writeToParcel(data, 0);
3010 thumbnail.writeToParcel(data, 0);
3011 mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0);
3012 reply.readException();
3013 int res = reply.readInt();
3014 data.recycle();
3015 reply.recycle();
3016 return res;
3017 }
3018 public Point getAppTaskThumbnailSize() throws RemoteException {
3019 Parcel data = Parcel.obtain();
3020 Parcel reply = Parcel.obtain();
3021 data.writeInterfaceToken(IActivityManager.descriptor);
3022 mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0);
3023 reply.readException();
3024 Point size = Point.CREATOR.createFromParcel(reply);
3025 data.recycle();
3026 reply.recycle();
3027 return size;
3028 }
Dianne Hackborn09233282014-04-30 11:33:59 -07003029 public List getTasks(int maxNum, int flags) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003030 Parcel data = Parcel.obtain();
3031 Parcel reply = Parcel.obtain();
3032 data.writeInterfaceToken(IActivityManager.descriptor);
3033 data.writeInt(maxNum);
3034 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003035 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
3036 reply.readException();
3037 ArrayList list = null;
3038 int N = reply.readInt();
3039 if (N >= 0) {
3040 list = new ArrayList();
3041 while (N > 0) {
3042 ActivityManager.RunningTaskInfo info =
3043 ActivityManager.RunningTaskInfo.CREATOR
Winson Chung1147c402014-05-14 11:05:00 -07003044 .createFromParcel(reply);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003045 list.add(info);
3046 N--;
3047 }
3048 }
3049 data.recycle();
3050 reply.recycle();
3051 return list;
3052 }
3053 public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -07003054 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003055 Parcel data = Parcel.obtain();
3056 Parcel reply = Parcel.obtain();
3057 data.writeInterfaceToken(IActivityManager.descriptor);
3058 data.writeInt(maxNum);
3059 data.writeInt(flags);
Amith Yamasani82644082012-08-03 13:09:11 -07003060 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003061 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
3062 reply.readException();
3063 ArrayList<ActivityManager.RecentTaskInfo> list
3064 = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR);
3065 data.recycle();
3066 reply.recycle();
3067 return list;
3068 }
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003069 public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException {
Dianne Hackbornd94df452011-02-16 18:53:31 -08003070 Parcel data = Parcel.obtain();
3071 Parcel reply = Parcel.obtain();
3072 data.writeInterfaceToken(IActivityManager.descriptor);
3073 data.writeInt(id);
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003074 mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003075 reply.readException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003076 ActivityManager.TaskThumbnail taskThumbnail = null;
Dianne Hackbornd94df452011-02-16 18:53:31 -08003077 if (reply.readInt() != 0) {
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003078 taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003079 }
3080 data.recycle();
3081 reply.recycle();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003082 return taskThumbnail;
Dianne Hackborn15491c62012-09-19 10:59:14 -07003083 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003084 public List getServices(int maxNum, int flags) throws RemoteException {
3085 Parcel data = Parcel.obtain();
3086 Parcel reply = Parcel.obtain();
3087 data.writeInterfaceToken(IActivityManager.descriptor);
3088 data.writeInt(maxNum);
3089 data.writeInt(flags);
3090 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
3091 reply.readException();
3092 ArrayList list = null;
3093 int N = reply.readInt();
3094 if (N >= 0) {
3095 list = new ArrayList();
3096 while (N > 0) {
3097 ActivityManager.RunningServiceInfo info =
3098 ActivityManager.RunningServiceInfo.CREATOR
3099 .createFromParcel(reply);
3100 list.add(info);
3101 N--;
3102 }
3103 }
3104 data.recycle();
3105 reply.recycle();
3106 return list;
3107 }
3108 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
3109 throws RemoteException {
3110 Parcel data = Parcel.obtain();
3111 Parcel reply = Parcel.obtain();
3112 data.writeInterfaceToken(IActivityManager.descriptor);
3113 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
3114 reply.readException();
3115 ArrayList<ActivityManager.ProcessErrorStateInfo> list
3116 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
3117 data.recycle();
3118 reply.recycle();
3119 return list;
3120 }
3121 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
3122 throws RemoteException {
3123 Parcel data = Parcel.obtain();
3124 Parcel reply = Parcel.obtain();
3125 data.writeInterfaceToken(IActivityManager.descriptor);
3126 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
3127 reply.readException();
3128 ArrayList<ActivityManager.RunningAppProcessInfo> list
3129 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
3130 data.recycle();
3131 reply.recycle();
3132 return list;
3133 }
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -07003134 public List<ApplicationInfo> getRunningExternalApplications()
3135 throws RemoteException {
3136 Parcel data = Parcel.obtain();
3137 Parcel reply = Parcel.obtain();
3138 data.writeInterfaceToken(IActivityManager.descriptor);
3139 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
3140 reply.readException();
3141 ArrayList<ApplicationInfo> list
3142 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
3143 data.recycle();
3144 reply.recycle();
3145 return list;
3146 }
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003147 public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003148 {
3149 Parcel data = Parcel.obtain();
3150 Parcel reply = Parcel.obtain();
3151 data.writeInterfaceToken(IActivityManager.descriptor);
3152 data.writeInt(task);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003153 data.writeInt(flags);
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003154 if (options != null) {
3155 data.writeInt(1);
3156 options.writeToParcel(data, 0);
3157 } else {
3158 data.writeInt(0);
3159 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003160 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
3161 reply.readException();
3162 data.recycle();
3163 reply.recycle();
3164 }
3165 public void moveTaskToBack(int task) throws RemoteException
3166 {
3167 Parcel data = Parcel.obtain();
3168 Parcel reply = Parcel.obtain();
3169 data.writeInterfaceToken(IActivityManager.descriptor);
3170 data.writeInt(task);
3171 mRemote.transact(MOVE_TASK_TO_BACK_TRANSACTION, data, reply, 0);
3172 reply.readException();
3173 data.recycle();
3174 reply.recycle();
3175 }
3176 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
3177 throws RemoteException {
3178 Parcel data = Parcel.obtain();
3179 Parcel reply = Parcel.obtain();
3180 data.writeInterfaceToken(IActivityManager.descriptor);
3181 data.writeStrongBinder(token);
3182 data.writeInt(nonRoot ? 1 : 0);
3183 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
3184 reply.readException();
3185 boolean res = reply.readInt() != 0;
3186 data.recycle();
3187 reply.recycle();
3188 return res;
3189 }
3190 public void moveTaskBackwards(int task) throws RemoteException
3191 {
3192 Parcel data = Parcel.obtain();
3193 Parcel reply = Parcel.obtain();
3194 data.writeInterfaceToken(IActivityManager.descriptor);
3195 data.writeInt(task);
3196 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
3197 reply.readException();
3198 data.recycle();
3199 reply.recycle();
3200 }
Craig Mautnerc00204b2013-03-05 15:02:14 -08003201 @Override
Craig Mautnerc00204b2013-03-05 15:02:14 -08003202 public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException
3203 {
3204 Parcel data = Parcel.obtain();
3205 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003206 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003207 data.writeInt(taskId);
3208 data.writeInt(stackId);
3209 data.writeInt(toTop ? 1 : 0);
3210 mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0);
3211 reply.readException();
3212 data.recycle();
3213 reply.recycle();
3214 }
3215 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003216 public void resizeStack(int stackBoxId, Rect r) throws RemoteException
Craig Mautnerc00204b2013-03-05 15:02:14 -08003217 {
3218 Parcel data = Parcel.obtain();
3219 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003220 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautner5a449152013-05-24 15:49:29 -07003221 data.writeInt(stackBoxId);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003222 r.writeToParcel(data, 0);
Craig Mautnercf910b02013-04-23 11:23:27 -07003223 mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003224 reply.readException();
3225 data.recycle();
3226 reply.recycle();
3227 }
Craig Mautner967212c2013-04-13 21:10:58 -07003228 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003229 public List<StackInfo> getAllStackInfos() throws RemoteException
Craig Mautner5ff12102013-05-24 12:50:15 -07003230 {
3231 Parcel data = Parcel.obtain();
3232 Parcel reply = Parcel.obtain();
3233 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003234 mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0);
Craig Mautner5ff12102013-05-24 12:50:15 -07003235 reply.readException();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003236 ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR);
Craig Mautner967212c2013-04-13 21:10:58 -07003237 data.recycle();
3238 reply.recycle();
3239 return list;
3240 }
Craig Mautnercf910b02013-04-23 11:23:27 -07003241 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003242 public StackInfo getStackInfo(int stackId) throws RemoteException
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003243 {
3244 Parcel data = Parcel.obtain();
3245 Parcel reply = Parcel.obtain();
3246 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003247 data.writeInt(stackId);
3248 mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003249 reply.readException();
3250 int res = reply.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003251 StackInfo info = null;
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003252 if (res != 0) {
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003253 info = StackInfo.CREATOR.createFromParcel(reply);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003254 }
3255 data.recycle();
3256 reply.recycle();
3257 return info;
3258 }
3259 @Override
Winson Chung303e1ff2014-03-07 15:06:19 -08003260 public boolean isInHomeStack(int taskId) throws RemoteException {
3261 Parcel data = Parcel.obtain();
3262 Parcel reply = Parcel.obtain();
3263 data.writeInterfaceToken(IActivityManager.descriptor);
3264 data.writeInt(taskId);
3265 mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0);
3266 reply.readException();
3267 boolean isInHomeStack = reply.readInt() > 0;
3268 data.recycle();
3269 reply.recycle();
3270 return isInHomeStack;
3271 }
3272 @Override
Craig Mautnercf910b02013-04-23 11:23:27 -07003273 public void setFocusedStack(int stackId) throws RemoteException
3274 {
3275 Parcel data = Parcel.obtain();
3276 Parcel reply = Parcel.obtain();
3277 data.writeInterfaceToken(IActivityManager.descriptor);
3278 data.writeInt(stackId);
3279 mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3280 reply.readException();
3281 data.recycle();
3282 reply.recycle();
3283 }
Winson Chung740c3ac2014-11-12 16:14:38 -08003284 @Override
3285 public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException
3286 {
3287 Parcel data = Parcel.obtain();
3288 Parcel reply = Parcel.obtain();
3289 data.writeInterfaceToken(IActivityManager.descriptor);
3290 data.writeStrongBinder(listener.asBinder());
3291 mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3292 reply.readException();
3293 data.recycle();
3294 reply.recycle();
3295 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003296 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
3297 {
3298 Parcel data = Parcel.obtain();
3299 Parcel reply = Parcel.obtain();
3300 data.writeInterfaceToken(IActivityManager.descriptor);
3301 data.writeStrongBinder(token);
3302 data.writeInt(onlyRoot ? 1 : 0);
3303 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
3304 reply.readException();
3305 int res = reply.readInt();
3306 data.recycle();
3307 reply.recycle();
3308 return res;
3309 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003310 public ContentProviderHolder getContentProvider(IApplicationThread caller,
Jeff Sharkey6d515712012-09-20 16:06:08 -07003311 String name, int userId, boolean stable) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003312 Parcel data = Parcel.obtain();
3313 Parcel reply = Parcel.obtain();
3314 data.writeInterfaceToken(IActivityManager.descriptor);
3315 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3316 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003317 data.writeInt(userId);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003318 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003319 mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3320 reply.readException();
3321 int res = reply.readInt();
3322 ContentProviderHolder cph = null;
3323 if (res != 0) {
3324 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3325 }
3326 data.recycle();
3327 reply.recycle();
3328 return cph;
3329 }
Jeff Sharkey6d515712012-09-20 16:06:08 -07003330 public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token)
3331 throws RemoteException {
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003332 Parcel data = Parcel.obtain();
3333 Parcel reply = Parcel.obtain();
3334 data.writeInterfaceToken(IActivityManager.descriptor);
3335 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003336 data.writeInt(userId);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003337 data.writeStrongBinder(token);
3338 mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3339 reply.readException();
3340 int res = reply.readInt();
3341 ContentProviderHolder cph = null;
3342 if (res != 0) {
3343 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3344 }
3345 data.recycle();
3346 reply.recycle();
3347 return cph;
3348 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003349 public void publishContentProviders(IApplicationThread caller,
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003350 List<ContentProviderHolder> providers) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003351 {
3352 Parcel data = Parcel.obtain();
3353 Parcel reply = Parcel.obtain();
3354 data.writeInterfaceToken(IActivityManager.descriptor);
3355 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3356 data.writeTypedList(providers);
3357 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
3358 reply.readException();
3359 data.recycle();
3360 reply.recycle();
3361 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003362 public boolean refContentProvider(IBinder connection, int stable, int unstable)
3363 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003364 Parcel data = Parcel.obtain();
3365 Parcel reply = Parcel.obtain();
3366 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003367 data.writeStrongBinder(connection);
3368 data.writeInt(stable);
3369 data.writeInt(unstable);
3370 mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3371 reply.readException();
3372 boolean res = reply.readInt() != 0;
3373 data.recycle();
3374 reply.recycle();
3375 return res;
3376 }
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003377
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003378 public void unstableProviderDied(IBinder connection) throws RemoteException {
3379 Parcel data = Parcel.obtain();
3380 Parcel reply = Parcel.obtain();
3381 data.writeInterfaceToken(IActivityManager.descriptor);
3382 data.writeStrongBinder(connection);
3383 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0);
3384 reply.readException();
3385 data.recycle();
3386 reply.recycle();
3387 }
3388
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003389 @Override
3390 public void appNotRespondingViaProvider(IBinder connection) throws RemoteException {
3391 Parcel data = Parcel.obtain();
3392 Parcel reply = Parcel.obtain();
3393 data.writeInterfaceToken(IActivityManager.descriptor);
3394 data.writeStrongBinder(connection);
3395 mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0);
3396 reply.readException();
3397 data.recycle();
3398 reply.recycle();
3399 }
3400
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003401 public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException {
3402 Parcel data = Parcel.obtain();
3403 Parcel reply = Parcel.obtain();
3404 data.writeInterfaceToken(IActivityManager.descriptor);
3405 data.writeStrongBinder(connection);
3406 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003407 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3408 reply.readException();
3409 data.recycle();
3410 reply.recycle();
3411 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003412
3413 public void removeContentProviderExternal(String name, IBinder token) throws RemoteException {
3414 Parcel data = Parcel.obtain();
3415 Parcel reply = Parcel.obtain();
3416 data.writeInterfaceToken(IActivityManager.descriptor);
3417 data.writeString(name);
3418 data.writeStrongBinder(token);
3419 mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3420 reply.readException();
3421 data.recycle();
3422 reply.recycle();
3423 }
3424
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07003425 public PendingIntent getRunningServiceControlPanel(ComponentName service)
3426 throws RemoteException
3427 {
3428 Parcel data = Parcel.obtain();
3429 Parcel reply = Parcel.obtain();
3430 data.writeInterfaceToken(IActivityManager.descriptor);
3431 service.writeToParcel(data, 0);
3432 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
3433 reply.readException();
3434 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
3435 data.recycle();
3436 reply.recycle();
3437 return res;
3438 }
3439
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003440 public ComponentName startService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003441 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003442 {
3443 Parcel data = Parcel.obtain();
3444 Parcel reply = Parcel.obtain();
3445 data.writeInterfaceToken(IActivityManager.descriptor);
3446 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3447 service.writeToParcel(data, 0);
3448 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003449 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003450 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
3451 reply.readException();
3452 ComponentName res = ComponentName.readFromParcel(reply);
3453 data.recycle();
3454 reply.recycle();
3455 return res;
3456 }
3457 public int stopService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003458 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003459 {
3460 Parcel data = Parcel.obtain();
3461 Parcel reply = Parcel.obtain();
3462 data.writeInterfaceToken(IActivityManager.descriptor);
3463 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3464 service.writeToParcel(data, 0);
3465 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003466 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003467 mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0);
3468 reply.readException();
3469 int res = reply.readInt();
3470 reply.recycle();
3471 data.recycle();
3472 return res;
3473 }
3474 public boolean stopServiceToken(ComponentName className, IBinder token,
3475 int startId) throws RemoteException {
3476 Parcel data = Parcel.obtain();
3477 Parcel reply = Parcel.obtain();
3478 data.writeInterfaceToken(IActivityManager.descriptor);
3479 ComponentName.writeToParcel(className, data);
3480 data.writeStrongBinder(token);
3481 data.writeInt(startId);
3482 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
3483 reply.readException();
3484 boolean res = reply.readInt() != 0;
3485 data.recycle();
3486 reply.recycle();
3487 return res;
3488 }
3489 public void setServiceForeground(ComponentName className, IBinder token,
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003490 int id, Notification notification, boolean removeNotification) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003491 Parcel data = Parcel.obtain();
3492 Parcel reply = Parcel.obtain();
3493 data.writeInterfaceToken(IActivityManager.descriptor);
3494 ComponentName.writeToParcel(className, data);
3495 data.writeStrongBinder(token);
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003496 data.writeInt(id);
3497 if (notification != null) {
3498 data.writeInt(1);
3499 notification.writeToParcel(data, 0);
3500 } else {
3501 data.writeInt(0);
3502 }
3503 data.writeInt(removeNotification ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003504 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
3505 reply.readException();
3506 data.recycle();
3507 reply.recycle();
3508 }
3509 public int bindService(IApplicationThread caller, IBinder token,
3510 Intent service, String resolvedType, IServiceConnection connection,
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003511 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003512 Parcel data = Parcel.obtain();
3513 Parcel reply = Parcel.obtain();
3514 data.writeInterfaceToken(IActivityManager.descriptor);
3515 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3516 data.writeStrongBinder(token);
3517 service.writeToParcel(data, 0);
3518 data.writeString(resolvedType);
3519 data.writeStrongBinder(connection.asBinder());
3520 data.writeInt(flags);
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003521 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003522 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
3523 reply.readException();
3524 int res = reply.readInt();
3525 data.recycle();
3526 reply.recycle();
3527 return res;
3528 }
3529 public boolean unbindService(IServiceConnection connection) throws RemoteException
3530 {
3531 Parcel data = Parcel.obtain();
3532 Parcel reply = Parcel.obtain();
3533 data.writeInterfaceToken(IActivityManager.descriptor);
3534 data.writeStrongBinder(connection.asBinder());
3535 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
3536 reply.readException();
3537 boolean res = reply.readInt() != 0;
3538 data.recycle();
3539 reply.recycle();
3540 return res;
3541 }
3542
3543 public void publishService(IBinder token,
3544 Intent intent, IBinder service) throws RemoteException {
3545 Parcel data = Parcel.obtain();
3546 Parcel reply = Parcel.obtain();
3547 data.writeInterfaceToken(IActivityManager.descriptor);
3548 data.writeStrongBinder(token);
3549 intent.writeToParcel(data, 0);
3550 data.writeStrongBinder(service);
3551 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
3552 reply.readException();
3553 data.recycle();
3554 reply.recycle();
3555 }
3556
3557 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
3558 throws RemoteException {
3559 Parcel data = Parcel.obtain();
3560 Parcel reply = Parcel.obtain();
3561 data.writeInterfaceToken(IActivityManager.descriptor);
3562 data.writeStrongBinder(token);
3563 intent.writeToParcel(data, 0);
3564 data.writeInt(doRebind ? 1 : 0);
3565 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
3566 reply.readException();
3567 data.recycle();
3568 reply.recycle();
3569 }
3570
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003571 public void serviceDoneExecuting(IBinder token, int type, int startId,
3572 int res) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003573 Parcel data = Parcel.obtain();
3574 Parcel reply = Parcel.obtain();
3575 data.writeInterfaceToken(IActivityManager.descriptor);
3576 data.writeStrongBinder(token);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003577 data.writeInt(type);
3578 data.writeInt(startId);
3579 data.writeInt(res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003580 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3581 reply.readException();
3582 data.recycle();
3583 reply.recycle();
3584 }
3585
3586 public IBinder peekService(Intent service, String resolvedType) throws RemoteException {
3587 Parcel data = Parcel.obtain();
3588 Parcel reply = Parcel.obtain();
3589 data.writeInterfaceToken(IActivityManager.descriptor);
3590 service.writeToParcel(data, 0);
3591 data.writeString(resolvedType);
3592 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
3593 reply.readException();
3594 IBinder binder = reply.readStrongBinder();
3595 reply.recycle();
3596 data.recycle();
3597 return binder;
3598 }
3599
Christopher Tate181fafa2009-05-14 11:12:14 -07003600 public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
3601 throws RemoteException {
3602 Parcel data = Parcel.obtain();
3603 Parcel reply = Parcel.obtain();
3604 data.writeInterfaceToken(IActivityManager.descriptor);
3605 app.writeToParcel(data, 0);
3606 data.writeInt(backupRestoreMode);
3607 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3608 reply.readException();
3609 boolean success = reply.readInt() != 0;
3610 reply.recycle();
3611 data.recycle();
3612 return success;
3613 }
3614
Christopher Tate346acb12012-10-15 19:20:25 -07003615 public void clearPendingBackup() throws RemoteException {
3616 Parcel data = Parcel.obtain();
3617 Parcel reply = Parcel.obtain();
3618 data.writeInterfaceToken(IActivityManager.descriptor);
3619 mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0);
3620 reply.recycle();
3621 data.recycle();
3622 }
3623
Christopher Tate181fafa2009-05-14 11:12:14 -07003624 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
3625 Parcel data = Parcel.obtain();
3626 Parcel reply = Parcel.obtain();
3627 data.writeInterfaceToken(IActivityManager.descriptor);
3628 data.writeString(packageName);
3629 data.writeStrongBinder(agent);
3630 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
3631 reply.recycle();
3632 data.recycle();
3633 }
3634
3635 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
3636 Parcel data = Parcel.obtain();
3637 Parcel reply = Parcel.obtain();
3638 data.writeInterfaceToken(IActivityManager.descriptor);
3639 app.writeToParcel(data, 0);
3640 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3641 reply.readException();
3642 reply.recycle();
3643 data.recycle();
3644 }
3645
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003646 public boolean startInstrumentation(ComponentName className, String profileFile,
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003647 int flags, Bundle arguments, IInstrumentationWatcher watcher,
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01003648 IUiAutomationConnection connection, int userId, String instructionSet)
3649 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003650 Parcel data = Parcel.obtain();
3651 Parcel reply = Parcel.obtain();
3652 data.writeInterfaceToken(IActivityManager.descriptor);
3653 ComponentName.writeToParcel(className, data);
3654 data.writeString(profileFile);
3655 data.writeInt(flags);
3656 data.writeBundle(arguments);
3657 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003658 data.writeStrongBinder(connection != null ? connection.asBinder() : null);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07003659 data.writeInt(userId);
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01003660 data.writeString(instructionSet);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003661 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3662 reply.readException();
3663 boolean res = reply.readInt() != 0;
3664 reply.recycle();
3665 data.recycle();
3666 return res;
3667 }
3668
3669 public void finishInstrumentation(IApplicationThread target,
3670 int resultCode, Bundle results) throws RemoteException {
3671 Parcel data = Parcel.obtain();
3672 Parcel reply = Parcel.obtain();
3673 data.writeInterfaceToken(IActivityManager.descriptor);
3674 data.writeStrongBinder(target != null ? target.asBinder() : null);
3675 data.writeInt(resultCode);
3676 data.writeBundle(results);
3677 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3678 reply.readException();
3679 data.recycle();
3680 reply.recycle();
3681 }
3682 public Configuration getConfiguration() throws RemoteException
3683 {
3684 Parcel data = Parcel.obtain();
3685 Parcel reply = Parcel.obtain();
3686 data.writeInterfaceToken(IActivityManager.descriptor);
3687 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
3688 reply.readException();
3689 Configuration res = Configuration.CREATOR.createFromParcel(reply);
3690 reply.recycle();
3691 data.recycle();
3692 return res;
3693 }
3694 public void updateConfiguration(Configuration values) throws RemoteException
3695 {
3696 Parcel data = Parcel.obtain();
3697 Parcel reply = Parcel.obtain();
3698 data.writeInterfaceToken(IActivityManager.descriptor);
3699 values.writeToParcel(data, 0);
3700 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
3701 reply.readException();
3702 data.recycle();
3703 reply.recycle();
3704 }
3705 public void setRequestedOrientation(IBinder token, int requestedOrientation)
3706 throws RemoteException {
3707 Parcel data = Parcel.obtain();
3708 Parcel reply = Parcel.obtain();
3709 data.writeInterfaceToken(IActivityManager.descriptor);
3710 data.writeStrongBinder(token);
3711 data.writeInt(requestedOrientation);
3712 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3713 reply.readException();
3714 data.recycle();
3715 reply.recycle();
3716 }
3717 public int getRequestedOrientation(IBinder token) throws RemoteException {
3718 Parcel data = Parcel.obtain();
3719 Parcel reply = Parcel.obtain();
3720 data.writeInterfaceToken(IActivityManager.descriptor);
3721 data.writeStrongBinder(token);
3722 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3723 reply.readException();
3724 int res = reply.readInt();
3725 data.recycle();
3726 reply.recycle();
3727 return res;
3728 }
3729 public ComponentName getActivityClassForToken(IBinder token)
3730 throws RemoteException {
3731 Parcel data = Parcel.obtain();
3732 Parcel reply = Parcel.obtain();
3733 data.writeInterfaceToken(IActivityManager.descriptor);
3734 data.writeStrongBinder(token);
3735 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
3736 reply.readException();
3737 ComponentName res = ComponentName.readFromParcel(reply);
3738 data.recycle();
3739 reply.recycle();
3740 return res;
3741 }
3742 public String getPackageForToken(IBinder token) throws RemoteException
3743 {
3744 Parcel data = Parcel.obtain();
3745 Parcel reply = Parcel.obtain();
3746 data.writeInterfaceToken(IActivityManager.descriptor);
3747 data.writeStrongBinder(token);
3748 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
3749 reply.readException();
3750 String res = reply.readString();
3751 data.recycle();
3752 reply.recycle();
3753 return res;
3754 }
3755 public IIntentSender getIntentSender(int type,
3756 String packageName, IBinder token, String resultWho,
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003757 int requestCode, Intent[] intents, String[] resolvedTypes, int flags,
Dianne Hackborn41203752012-08-31 14:05:51 -07003758 Bundle options, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003759 Parcel data = Parcel.obtain();
3760 Parcel reply = Parcel.obtain();
3761 data.writeInterfaceToken(IActivityManager.descriptor);
3762 data.writeInt(type);
3763 data.writeString(packageName);
3764 data.writeStrongBinder(token);
3765 data.writeString(resultWho);
3766 data.writeInt(requestCode);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003767 if (intents != null) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003768 data.writeInt(1);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003769 data.writeTypedArray(intents, 0);
3770 data.writeStringArray(resolvedTypes);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003771 } else {
3772 data.writeInt(0);
3773 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003774 data.writeInt(flags);
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003775 if (options != null) {
3776 data.writeInt(1);
3777 options.writeToParcel(data, 0);
3778 } else {
3779 data.writeInt(0);
3780 }
Dianne Hackborn41203752012-08-31 14:05:51 -07003781 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003782 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
3783 reply.readException();
3784 IIntentSender res = IIntentSender.Stub.asInterface(
Dianne Hackbornff170242014-11-19 10:59:01 -08003785 reply.readStrongBinder());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003786 data.recycle();
3787 reply.recycle();
3788 return res;
3789 }
3790 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
3791 Parcel data = Parcel.obtain();
3792 Parcel reply = Parcel.obtain();
3793 data.writeInterfaceToken(IActivityManager.descriptor);
3794 data.writeStrongBinder(sender.asBinder());
3795 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
3796 reply.readException();
3797 data.recycle();
3798 reply.recycle();
3799 }
3800 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
3801 Parcel data = Parcel.obtain();
3802 Parcel reply = Parcel.obtain();
3803 data.writeInterfaceToken(IActivityManager.descriptor);
3804 data.writeStrongBinder(sender.asBinder());
3805 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
3806 reply.readException();
3807 String res = reply.readString();
3808 data.recycle();
3809 reply.recycle();
3810 return res;
3811 }
Christopher Tatec4a07d12012-04-06 14:19:13 -07003812 public int getUidForIntentSender(IIntentSender sender) throws RemoteException {
3813 Parcel data = Parcel.obtain();
3814 Parcel reply = Parcel.obtain();
3815 data.writeInterfaceToken(IActivityManager.descriptor);
3816 data.writeStrongBinder(sender.asBinder());
3817 mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
3818 reply.readException();
3819 int res = reply.readInt();
3820 data.recycle();
3821 reply.recycle();
3822 return res;
3823 }
Dianne Hackborn41203752012-08-31 14:05:51 -07003824 public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
3825 boolean requireFull, String name, String callerPackage) throws RemoteException {
3826 Parcel data = Parcel.obtain();
3827 Parcel reply = Parcel.obtain();
3828 data.writeInterfaceToken(IActivityManager.descriptor);
3829 data.writeInt(callingPid);
3830 data.writeInt(callingUid);
3831 data.writeInt(userId);
3832 data.writeInt(allowAll ? 1 : 0);
3833 data.writeInt(requireFull ? 1 : 0);
3834 data.writeString(name);
3835 data.writeString(callerPackage);
3836 mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0);
3837 reply.readException();
3838 int res = reply.readInt();
3839 data.recycle();
3840 reply.recycle();
3841 return res;
3842 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003843 public void setProcessLimit(int max) throws RemoteException
3844 {
3845 Parcel data = Parcel.obtain();
3846 Parcel reply = Parcel.obtain();
3847 data.writeInterfaceToken(IActivityManager.descriptor);
3848 data.writeInt(max);
3849 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
3850 reply.readException();
3851 data.recycle();
3852 reply.recycle();
3853 }
3854 public int getProcessLimit() throws RemoteException
3855 {
3856 Parcel data = Parcel.obtain();
3857 Parcel reply = Parcel.obtain();
3858 data.writeInterfaceToken(IActivityManager.descriptor);
3859 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
3860 reply.readException();
3861 int res = reply.readInt();
3862 data.recycle();
3863 reply.recycle();
3864 return res;
3865 }
3866 public void setProcessForeground(IBinder token, int pid,
3867 boolean isForeground) throws RemoteException {
3868 Parcel data = Parcel.obtain();
3869 Parcel reply = Parcel.obtain();
3870 data.writeInterfaceToken(IActivityManager.descriptor);
3871 data.writeStrongBinder(token);
3872 data.writeInt(pid);
3873 data.writeInt(isForeground ? 1 : 0);
3874 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
3875 reply.readException();
3876 data.recycle();
3877 reply.recycle();
3878 }
3879 public int checkPermission(String permission, int pid, int uid)
3880 throws RemoteException {
3881 Parcel data = Parcel.obtain();
3882 Parcel reply = Parcel.obtain();
3883 data.writeInterfaceToken(IActivityManager.descriptor);
3884 data.writeString(permission);
3885 data.writeInt(pid);
3886 data.writeInt(uid);
3887 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
3888 reply.readException();
3889 int res = reply.readInt();
3890 data.recycle();
3891 reply.recycle();
3892 return res;
3893 }
Dianne Hackbornff170242014-11-19 10:59:01 -08003894 public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken)
3895 throws RemoteException {
3896 Parcel data = Parcel.obtain();
3897 Parcel reply = Parcel.obtain();
3898 data.writeInterfaceToken(IActivityManager.descriptor);
3899 data.writeString(permission);
3900 data.writeInt(pid);
3901 data.writeInt(uid);
3902 data.writeStrongBinder(callerToken);
3903 mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0);
3904 reply.readException();
3905 int res = reply.readInt();
3906 data.recycle();
3907 reply.recycle();
3908 return res;
3909 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003910 public boolean clearApplicationUserData(final String packageName,
Amith Yamasani742a6712011-05-04 14:49:28 -07003911 final IPackageDataObserver observer, final int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003912 Parcel data = Parcel.obtain();
3913 Parcel reply = Parcel.obtain();
3914 data.writeInterfaceToken(IActivityManager.descriptor);
3915 data.writeString(packageName);
Christopher Tate31b65f92013-09-09 14:17:27 -07003916 data.writeStrongBinder((observer != null) ? observer.asBinder() : null);
Amith Yamasani742a6712011-05-04 14:49:28 -07003917 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003918 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
3919 reply.readException();
3920 boolean res = reply.readInt() != 0;
3921 data.recycle();
3922 reply.recycle();
3923 return res;
3924 }
Dianne Hackbornff170242014-11-19 10:59:01 -08003925 public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId,
3926 IBinder callerToken) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003927 Parcel data = Parcel.obtain();
3928 Parcel reply = Parcel.obtain();
3929 data.writeInterfaceToken(IActivityManager.descriptor);
3930 uri.writeToParcel(data, 0);
3931 data.writeInt(pid);
3932 data.writeInt(uid);
3933 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003934 data.writeInt(userId);
Dianne Hackbornff170242014-11-19 10:59:01 -08003935 data.writeStrongBinder(callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003936 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
3937 reply.readException();
3938 int res = reply.readInt();
3939 data.recycle();
3940 reply.recycle();
3941 return res;
3942 }
3943 public void grantUriPermission(IApplicationThread caller, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003944 Uri uri, int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003945 Parcel data = Parcel.obtain();
3946 Parcel reply = Parcel.obtain();
3947 data.writeInterfaceToken(IActivityManager.descriptor);
3948 data.writeStrongBinder(caller.asBinder());
3949 data.writeString(targetPkg);
3950 uri.writeToParcel(data, 0);
3951 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003952 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003953 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
3954 reply.readException();
3955 data.recycle();
3956 reply.recycle();
3957 }
3958 public void revokeUriPermission(IApplicationThread caller, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003959 int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003960 Parcel data = Parcel.obtain();
3961 Parcel reply = Parcel.obtain();
3962 data.writeInterfaceToken(IActivityManager.descriptor);
3963 data.writeStrongBinder(caller.asBinder());
3964 uri.writeToParcel(data, 0);
3965 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003966 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003967 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
3968 reply.readException();
3969 data.recycle();
3970 reply.recycle();
3971 }
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003972
3973 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003974 public void takePersistableUriPermission(Uri uri, int mode, int userId)
3975 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003976 Parcel data = Parcel.obtain();
3977 Parcel reply = Parcel.obtain();
3978 data.writeInterfaceToken(IActivityManager.descriptor);
3979 uri.writeToParcel(data, 0);
3980 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003981 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003982 mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
3983 reply.readException();
3984 data.recycle();
3985 reply.recycle();
3986 }
3987
3988 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003989 public void releasePersistableUriPermission(Uri uri, int mode, int userId)
3990 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003991 Parcel data = Parcel.obtain();
3992 Parcel reply = Parcel.obtain();
3993 data.writeInterfaceToken(IActivityManager.descriptor);
3994 uri.writeToParcel(data, 0);
3995 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01003996 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07003997 mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
3998 reply.readException();
3999 data.recycle();
4000 reply.recycle();
4001 }
4002
4003 @Override
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004004 public ParceledListSlice<UriPermission> getPersistedUriPermissions(
4005 String packageName, boolean incoming) throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004006 Parcel data = Parcel.obtain();
4007 Parcel reply = Parcel.obtain();
4008 data.writeInterfaceToken(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004009 data.writeString(packageName);
4010 data.writeInt(incoming ? 1 : 0);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004011 mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
4012 reply.readException();
4013 final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel(
4014 reply);
4015 data.recycle();
4016 reply.recycle();
4017 return perms;
4018 }
4019
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004020 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
4021 throws RemoteException {
4022 Parcel data = Parcel.obtain();
4023 Parcel reply = Parcel.obtain();
4024 data.writeInterfaceToken(IActivityManager.descriptor);
4025 data.writeStrongBinder(who.asBinder());
4026 data.writeInt(waiting ? 1 : 0);
4027 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
4028 reply.readException();
4029 data.recycle();
4030 reply.recycle();
4031 }
4032 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
4033 Parcel data = Parcel.obtain();
4034 Parcel reply = Parcel.obtain();
4035 data.writeInterfaceToken(IActivityManager.descriptor);
4036 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
4037 reply.readException();
4038 outInfo.readFromParcel(reply);
4039 data.recycle();
4040 reply.recycle();
4041 }
4042 public void unhandledBack() throws RemoteException
4043 {
4044 Parcel data = Parcel.obtain();
4045 Parcel reply = Parcel.obtain();
4046 data.writeInterfaceToken(IActivityManager.descriptor);
4047 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
4048 reply.readException();
4049 data.recycle();
4050 reply.recycle();
4051 }
4052 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
4053 {
4054 Parcel data = Parcel.obtain();
4055 Parcel reply = Parcel.obtain();
4056 data.writeInterfaceToken(IActivityManager.descriptor);
4057 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
4058 reply.readException();
4059 ParcelFileDescriptor pfd = null;
4060 if (reply.readInt() != 0) {
4061 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
4062 }
4063 data.recycle();
4064 reply.recycle();
4065 return pfd;
4066 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07004067 public void setLockScreenShown(boolean shown) throws RemoteException
4068 {
4069 Parcel data = Parcel.obtain();
4070 Parcel reply = Parcel.obtain();
4071 data.writeInterfaceToken(IActivityManager.descriptor);
4072 data.writeInt(shown ? 1 : 0);
4073 mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0);
4074 reply.readException();
4075 data.recycle();
4076 reply.recycle();
4077 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004078 public void setDebugApp(
4079 String packageName, boolean waitForDebugger, boolean persistent)
4080 throws RemoteException
4081 {
4082 Parcel data = Parcel.obtain();
4083 Parcel reply = Parcel.obtain();
4084 data.writeInterfaceToken(IActivityManager.descriptor);
4085 data.writeString(packageName);
4086 data.writeInt(waitForDebugger ? 1 : 0);
4087 data.writeInt(persistent ? 1 : 0);
4088 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
4089 reply.readException();
4090 data.recycle();
4091 reply.recycle();
4092 }
4093 public void setAlwaysFinish(boolean enabled) throws RemoteException
4094 {
4095 Parcel data = Parcel.obtain();
4096 Parcel reply = Parcel.obtain();
4097 data.writeInterfaceToken(IActivityManager.descriptor);
4098 data.writeInt(enabled ? 1 : 0);
4099 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
4100 reply.readException();
4101 data.recycle();
4102 reply.recycle();
4103 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004104 public void setActivityController(IActivityController watcher) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004105 {
4106 Parcel data = Parcel.obtain();
4107 Parcel reply = Parcel.obtain();
4108 data.writeInterfaceToken(IActivityManager.descriptor);
4109 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004110 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004111 reply.readException();
4112 data.recycle();
4113 reply.recycle();
4114 }
4115 public void enterSafeMode() throws RemoteException {
4116 Parcel data = Parcel.obtain();
4117 data.writeInterfaceToken(IActivityManager.descriptor);
4118 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
4119 data.recycle();
4120 }
Dianne Hackborn099bc622014-01-22 13:39:16 -08004121 public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg)
4122 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004123 Parcel data = Parcel.obtain();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004124 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn099bc622014-01-22 13:39:16 -08004125 data.writeStrongBinder(sender.asBinder());
4126 data.writeInt(sourceUid);
4127 data.writeString(sourcePkg);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004128 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
4129 data.recycle();
4130 }
Dianne Hackborn64825172011-03-02 21:32:58 -08004131 public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004132 Parcel data = Parcel.obtain();
4133 Parcel reply = Parcel.obtain();
4134 data.writeInterfaceToken(IActivityManager.descriptor);
4135 data.writeIntArray(pids);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004136 data.writeString(reason);
Dianne Hackborn64825172011-03-02 21:32:58 -08004137 data.writeInt(secure ? 1 : 0);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004138 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07004139 reply.readException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004140 boolean res = reply.readInt() != 0;
4141 data.recycle();
4142 reply.recycle();
4143 return res;
4144 }
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07004145 @Override
4146 public boolean killProcessesBelowForeground(String reason) throws RemoteException {
4147 Parcel data = Parcel.obtain();
4148 Parcel reply = Parcel.obtain();
4149 data.writeInterfaceToken(IActivityManager.descriptor);
4150 data.writeString(reason);
4151 mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0);
4152 boolean res = reply.readInt() != 0;
4153 data.recycle();
4154 reply.recycle();
4155 return res;
4156 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004157 public boolean testIsSystemReady()
4158 {
4159 /* this base class version is never called */
4160 return true;
4161 }
Dan Egnor60d87622009-12-16 16:32:58 -08004162 public void handleApplicationCrash(IBinder app,
4163 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
4164 {
4165 Parcel data = Parcel.obtain();
4166 Parcel reply = Parcel.obtain();
4167 data.writeInterfaceToken(IActivityManager.descriptor);
4168 data.writeStrongBinder(app);
4169 crashInfo.writeToParcel(data, 0);
4170 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
4171 reply.readException();
4172 reply.recycle();
4173 data.recycle();
4174 }
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004175
Dianne Hackborn52322712014-08-26 22:47:26 -07004176 public boolean handleApplicationWtf(IBinder app, String tag, boolean system,
Dan Egnorb7f03672009-12-09 16:22:32 -08004177 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004178 {
4179 Parcel data = Parcel.obtain();
4180 Parcel reply = Parcel.obtain();
4181 data.writeInterfaceToken(IActivityManager.descriptor);
4182 data.writeStrongBinder(app);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004183 data.writeString(tag);
Dianne Hackborn52322712014-08-26 22:47:26 -07004184 data.writeInt(system ? 1 : 0);
Dan Egnorb7f03672009-12-09 16:22:32 -08004185 crashInfo.writeToParcel(data, 0);
Dan Egnor60d87622009-12-16 16:32:58 -08004186 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004187 reply.readException();
Dan Egnor60d87622009-12-16 16:32:58 -08004188 boolean res = reply.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004189 reply.recycle();
4190 data.recycle();
Dan Egnor60d87622009-12-16 16:32:58 -08004191 return res;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004192 }
Dan Egnorb7f03672009-12-09 16:22:32 -08004193
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004194 public void handleApplicationStrictModeViolation(IBinder app,
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004195 int violationMask,
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004196 StrictMode.ViolationInfo info) throws RemoteException
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004197 {
4198 Parcel data = Parcel.obtain();
4199 Parcel reply = Parcel.obtain();
4200 data.writeInterfaceToken(IActivityManager.descriptor);
4201 data.writeStrongBinder(app);
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004202 data.writeInt(violationMask);
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004203 info.writeToParcel(data, 0);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004204 mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0);
4205 reply.readException();
4206 reply.recycle();
4207 data.recycle();
4208 }
4209
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004210 public void signalPersistentProcesses(int sig) throws RemoteException {
4211 Parcel data = Parcel.obtain();
4212 Parcel reply = Parcel.obtain();
4213 data.writeInterfaceToken(IActivityManager.descriptor);
4214 data.writeInt(sig);
4215 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
4216 reply.readException();
4217 data.recycle();
4218 reply.recycle();
4219 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004220
Dianne Hackborn1676c852012-09-10 14:52:30 -07004221 public void killBackgroundProcesses(String packageName, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004222 Parcel data = Parcel.obtain();
4223 Parcel reply = Parcel.obtain();
4224 data.writeInterfaceToken(IActivityManager.descriptor);
4225 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004226 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004227 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4228 reply.readException();
4229 data.recycle();
4230 reply.recycle();
4231 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004232
4233 public void killAllBackgroundProcesses() throws RemoteException {
4234 Parcel data = Parcel.obtain();
4235 Parcel reply = Parcel.obtain();
4236 data.writeInterfaceToken(IActivityManager.descriptor);
4237 mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4238 reply.readException();
4239 data.recycle();
4240 reply.recycle();
4241 }
4242
Dianne Hackborn1676c852012-09-10 14:52:30 -07004243 public void forceStopPackage(String packageName, int userId) throws RemoteException {
Dianne Hackborn03abb812010-01-04 18:43:19 -08004244 Parcel data = Parcel.obtain();
4245 Parcel reply = Parcel.obtain();
4246 data.writeInterfaceToken(IActivityManager.descriptor);
4247 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004248 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004249 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004250 reply.readException();
4251 data.recycle();
4252 reply.recycle();
4253 }
4254
Dianne Hackborn27ff9132012-03-06 14:57:58 -08004255 public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
4256 throws RemoteException
4257 {
4258 Parcel data = Parcel.obtain();
4259 Parcel reply = Parcel.obtain();
4260 data.writeInterfaceToken(IActivityManager.descriptor);
4261 mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0);
4262 reply.readException();
4263 outInfo.readFromParcel(reply);
4264 reply.recycle();
4265 data.recycle();
4266 }
4267
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004268 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
4269 {
4270 Parcel data = Parcel.obtain();
4271 Parcel reply = Parcel.obtain();
4272 data.writeInterfaceToken(IActivityManager.descriptor);
4273 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
4274 reply.readException();
4275 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
4276 reply.recycle();
4277 data.recycle();
4278 return res;
4279 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004280
Dianne Hackborn1676c852012-09-10 14:52:30 -07004281 public boolean profileControl(String process, int userId, boolean start,
Jeff Hao1b012d32014-08-20 10:35:34 -07004282 ProfilerInfo profilerInfo, int profileType) throws RemoteException
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004283 {
4284 Parcel data = Parcel.obtain();
4285 Parcel reply = Parcel.obtain();
4286 data.writeInterfaceToken(IActivityManager.descriptor);
4287 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004288 data.writeInt(userId);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004289 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07004290 data.writeInt(profileType);
Jeff Hao1b012d32014-08-20 10:35:34 -07004291 if (profilerInfo != null) {
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004292 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07004293 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004294 } else {
4295 data.writeInt(0);
4296 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004297 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
4298 reply.readException();
4299 boolean res = reply.readInt() != 0;
4300 reply.recycle();
4301 data.recycle();
4302 return res;
4303 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004304
Dianne Hackborn55280a92009-05-07 15:53:46 -07004305 public boolean shutdown(int timeout) throws RemoteException
4306 {
4307 Parcel data = Parcel.obtain();
4308 Parcel reply = Parcel.obtain();
4309 data.writeInterfaceToken(IActivityManager.descriptor);
4310 data.writeInt(timeout);
4311 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
4312 reply.readException();
4313 boolean res = reply.readInt() != 0;
4314 reply.recycle();
4315 data.recycle();
4316 return res;
4317 }
4318
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07004319 public void stopAppSwitches() throws RemoteException {
4320 Parcel data = Parcel.obtain();
4321 Parcel reply = Parcel.obtain();
4322 data.writeInterfaceToken(IActivityManager.descriptor);
4323 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
4324 reply.readException();
4325 reply.recycle();
4326 data.recycle();
4327 }
4328
4329 public void resumeAppSwitches() throws RemoteException {
4330 Parcel data = Parcel.obtain();
4331 Parcel reply = Parcel.obtain();
4332 data.writeInterfaceToken(IActivityManager.descriptor);
4333 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
4334 reply.readException();
4335 reply.recycle();
4336 data.recycle();
4337 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07004338
4339 public void addPackageDependency(String packageName) throws RemoteException {
4340 Parcel data = Parcel.obtain();
4341 Parcel reply = Parcel.obtain();
4342 data.writeInterfaceToken(IActivityManager.descriptor);
4343 data.writeString(packageName);
4344 mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0);
4345 reply.readException();
4346 data.recycle();
4347 reply.recycle();
4348 }
4349
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004350 public void killApplicationWithAppId(String pkg, int appid, String reason)
4351 throws RemoteException {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004352 Parcel data = Parcel.obtain();
4353 Parcel reply = Parcel.obtain();
4354 data.writeInterfaceToken(IActivityManager.descriptor);
4355 data.writeString(pkg);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004356 data.writeInt(appid);
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004357 data.writeString(reason);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004358 mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004359 reply.readException();
4360 data.recycle();
4361 reply.recycle();
4362 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07004363
4364 public void closeSystemDialogs(String reason) throws RemoteException {
4365 Parcel data = Parcel.obtain();
4366 Parcel reply = Parcel.obtain();
4367 data.writeInterfaceToken(IActivityManager.descriptor);
4368 data.writeString(reason);
4369 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
4370 reply.readException();
4371 data.recycle();
4372 reply.recycle();
4373 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004374
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004375 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004376 throws RemoteException {
4377 Parcel data = Parcel.obtain();
4378 Parcel reply = Parcel.obtain();
4379 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004380 data.writeIntArray(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004381 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
4382 reply.readException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004383 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004384 data.recycle();
4385 reply.recycle();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004386 return res;
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004387 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07004388
4389 public void killApplicationProcess(String processName, int uid) throws RemoteException {
4390 Parcel data = Parcel.obtain();
4391 Parcel reply = Parcel.obtain();
4392 data.writeInterfaceToken(IActivityManager.descriptor);
4393 data.writeString(processName);
4394 data.writeInt(uid);
4395 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
4396 reply.readException();
4397 data.recycle();
4398 reply.recycle();
4399 }
4400
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07004401 public void overridePendingTransition(IBinder token, String packageName,
4402 int enterAnim, int exitAnim) throws RemoteException {
4403 Parcel data = Parcel.obtain();
4404 Parcel reply = Parcel.obtain();
4405 data.writeInterfaceToken(IActivityManager.descriptor);
4406 data.writeStrongBinder(token);
4407 data.writeString(packageName);
4408 data.writeInt(enterAnim);
4409 data.writeInt(exitAnim);
4410 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
4411 reply.readException();
4412 data.recycle();
4413 reply.recycle();
4414 }
4415
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08004416 public boolean isUserAMonkey() throws RemoteException {
4417 Parcel data = Parcel.obtain();
4418 Parcel reply = Parcel.obtain();
4419 data.writeInterfaceToken(IActivityManager.descriptor);
4420 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
4421 reply.readException();
4422 boolean res = reply.readInt() != 0;
4423 data.recycle();
4424 reply.recycle();
4425 return res;
4426 }
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07004427
4428 public void setUserIsMonkey(boolean monkey) throws RemoteException {
4429 Parcel data = Parcel.obtain();
4430 Parcel reply = Parcel.obtain();
4431 data.writeInterfaceToken(IActivityManager.descriptor);
4432 data.writeInt(monkey ? 1 : 0);
4433 mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0);
4434 reply.readException();
4435 data.recycle();
4436 reply.recycle();
4437 }
4438
Dianne Hackborn860755f2010-06-03 18:47:52 -07004439 public void finishHeavyWeightApp() throws RemoteException {
4440 Parcel data = Parcel.obtain();
4441 Parcel reply = Parcel.obtain();
4442 data.writeInterfaceToken(IActivityManager.descriptor);
4443 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
4444 reply.readException();
4445 data.recycle();
4446 reply.recycle();
4447 }
Craig Mautner4addfc52013-06-25 08:05:45 -07004448
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004449 public boolean convertFromTranslucent(IBinder token)
Craig Mautner4addfc52013-06-25 08:05:45 -07004450 throws RemoteException {
4451 Parcel data = Parcel.obtain();
4452 Parcel reply = Parcel.obtain();
4453 data.writeInterfaceToken(IActivityManager.descriptor);
4454 data.writeStrongBinder(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07004455 mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0);
4456 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004457 boolean res = reply.readInt() != 0;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004458 data.recycle();
4459 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004460 return res;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004461 }
4462
Craig Mautner233ceee2014-05-09 17:05:11 -07004463 public boolean convertToTranslucent(IBinder token, ActivityOptions options)
Craig Mautner5eda9b32013-07-02 11:58:16 -07004464 throws RemoteException {
4465 Parcel data = Parcel.obtain();
4466 Parcel reply = Parcel.obtain();
4467 data.writeInterfaceToken(IActivityManager.descriptor);
4468 data.writeStrongBinder(token);
Craig Mautner233ceee2014-05-09 17:05:11 -07004469 if (options == null) {
4470 data.writeInt(0);
4471 } else {
4472 data.writeInt(1);
4473 data.writeBundle(options.toBundle());
4474 }
Craig Mautner5eda9b32013-07-02 11:58:16 -07004475 mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07004476 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004477 boolean res = reply.readInt() != 0;
Craig Mautner4addfc52013-06-25 08:05:45 -07004478 data.recycle();
4479 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004480 return res;
Craig Mautner4addfc52013-06-25 08:05:45 -07004481 }
4482
Craig Mautner233ceee2014-05-09 17:05:11 -07004483 public ActivityOptions getActivityOptions(IBinder token) throws RemoteException {
4484 Parcel data = Parcel.obtain();
4485 Parcel reply = Parcel.obtain();
4486 data.writeInterfaceToken(IActivityManager.descriptor);
4487 data.writeStrongBinder(token);
4488 mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0);
4489 reply.readException();
4490 Bundle bundle = reply.readBundle();
4491 ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
4492 data.recycle();
4493 reply.recycle();
4494 return options;
4495 }
4496
Daniel Sandler69a48172010-06-23 16:29:36 -04004497 public void setImmersive(IBinder token, boolean immersive)
4498 throws RemoteException {
4499 Parcel data = Parcel.obtain();
4500 Parcel reply = Parcel.obtain();
4501 data.writeInterfaceToken(IActivityManager.descriptor);
4502 data.writeStrongBinder(token);
4503 data.writeInt(immersive ? 1 : 0);
4504 mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
4505 reply.readException();
4506 data.recycle();
4507 reply.recycle();
4508 }
4509
4510 public boolean isImmersive(IBinder token)
4511 throws RemoteException {
4512 Parcel data = Parcel.obtain();
4513 Parcel reply = Parcel.obtain();
4514 data.writeInterfaceToken(IActivityManager.descriptor);
4515 data.writeStrongBinder(token);
4516 mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004517 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004518 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004519 data.recycle();
4520 reply.recycle();
4521 return res;
4522 }
4523
Craig Mautnerd61dc202014-07-07 11:09:11 -07004524 public boolean isTopOfTask(IBinder token) throws RemoteException {
4525 Parcel data = Parcel.obtain();
4526 Parcel reply = Parcel.obtain();
4527 data.writeInterfaceToken(IActivityManager.descriptor);
4528 data.writeStrongBinder(token);
4529 mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0);
4530 reply.readException();
4531 boolean res = reply.readInt() == 1;
4532 data.recycle();
4533 reply.recycle();
4534 return res;
4535 }
4536
Daniel Sandler69a48172010-06-23 16:29:36 -04004537 public boolean isTopActivityImmersive()
4538 throws RemoteException {
4539 Parcel data = Parcel.obtain();
4540 Parcel reply = Parcel.obtain();
4541 data.writeInterfaceToken(IActivityManager.descriptor);
4542 mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004543 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004544 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004545 data.recycle();
4546 reply.recycle();
4547 return res;
4548 }
4549
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004550 public void crashApplication(int uid, int initialPid, String packageName,
4551 String message) throws RemoteException {
4552 Parcel data = Parcel.obtain();
4553 Parcel reply = Parcel.obtain();
4554 data.writeInterfaceToken(IActivityManager.descriptor);
4555 data.writeInt(uid);
4556 data.writeInt(initialPid);
4557 data.writeString(packageName);
4558 data.writeString(message);
4559 mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0);
4560 reply.readException();
4561 data.recycle();
4562 reply.recycle();
4563 }
Andy McFadden824c5102010-07-09 16:26:57 -07004564
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004565 public String getProviderMimeType(Uri uri, int userId) throws RemoteException {
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004566 Parcel data = Parcel.obtain();
4567 Parcel reply = Parcel.obtain();
4568 data.writeInterfaceToken(IActivityManager.descriptor);
4569 uri.writeToParcel(data, 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004570 data.writeInt(userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004571 mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0);
4572 reply.readException();
4573 String res = reply.readString();
4574 data.recycle();
4575 reply.recycle();
4576 return res;
4577 }
4578
Dianne Hackborn7e269642010-08-25 19:50:20 -07004579 public IBinder newUriPermissionOwner(String name)
4580 throws RemoteException {
4581 Parcel data = Parcel.obtain();
4582 Parcel reply = Parcel.obtain();
4583 data.writeInterfaceToken(IActivityManager.descriptor);
4584 data.writeString(name);
4585 mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
4586 reply.readException();
4587 IBinder res = reply.readStrongBinder();
4588 data.recycle();
4589 reply.recycle();
4590 return res;
4591 }
4592
4593 public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
Nicolas Prevotf1939902014-06-25 09:29:02 +01004594 Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07004595 Parcel data = Parcel.obtain();
4596 Parcel reply = Parcel.obtain();
4597 data.writeInterfaceToken(IActivityManager.descriptor);
4598 data.writeStrongBinder(owner);
4599 data.writeInt(fromUid);
4600 data.writeString(targetPkg);
4601 uri.writeToParcel(data, 0);
4602 data.writeInt(mode);
Nicolas Prevotf1939902014-06-25 09:29:02 +01004603 data.writeInt(sourceUserId);
4604 data.writeInt(targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07004605 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4606 reply.readException();
4607 data.recycle();
4608 reply.recycle();
4609 }
4610
4611 public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004612 int mode, int userId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07004613 Parcel data = Parcel.obtain();
4614 Parcel reply = Parcel.obtain();
4615 data.writeInterfaceToken(IActivityManager.descriptor);
4616 data.writeStrongBinder(owner);
4617 if (uri != null) {
4618 data.writeInt(1);
4619 uri.writeToParcel(data, 0);
4620 } else {
4621 data.writeInt(0);
4622 }
4623 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004624 data.writeInt(userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07004625 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4626 reply.readException();
4627 data.recycle();
4628 reply.recycle();
4629 }
Dianne Hackbornc8f84972010-08-25 23:14:44 -07004630
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004631 public int checkGrantUriPermission(int callingUid, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004632 Uri uri, int modeFlags, int userId) throws RemoteException {
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004633 Parcel data = Parcel.obtain();
4634 Parcel reply = Parcel.obtain();
4635 data.writeInterfaceToken(IActivityManager.descriptor);
4636 data.writeInt(callingUid);
4637 data.writeString(targetPkg);
4638 uri.writeToParcel(data, 0);
4639 data.writeInt(modeFlags);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004640 data.writeInt(userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004641 mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4642 reply.readException();
4643 int res = reply.readInt();
4644 data.recycle();
4645 reply.recycle();
4646 return res;
4647 }
4648
Dianne Hackborn1676c852012-09-10 14:52:30 -07004649 public boolean dumpHeap(String process, int userId, boolean managed,
Andy McFadden824c5102010-07-09 16:26:57 -07004650 String path, ParcelFileDescriptor fd) throws RemoteException {
4651 Parcel data = Parcel.obtain();
4652 Parcel reply = Parcel.obtain();
4653 data.writeInterfaceToken(IActivityManager.descriptor);
4654 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004655 data.writeInt(userId);
Andy McFadden824c5102010-07-09 16:26:57 -07004656 data.writeInt(managed ? 1 : 0);
4657 data.writeString(path);
4658 if (fd != null) {
4659 data.writeInt(1);
4660 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
4661 } else {
4662 data.writeInt(0);
4663 }
4664 mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
4665 reply.readException();
4666 boolean res = reply.readInt() != 0;
4667 reply.recycle();
4668 data.recycle();
4669 return res;
4670 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004671
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004672 public int startActivities(IApplicationThread caller, String callingPackage,
Dianne Hackborna4972e92012-03-14 10:38:05 -07004673 Intent[] intents, String[] resolvedTypes, IBinder resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004674 Bundle options, int userId) throws RemoteException {
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004675 Parcel data = Parcel.obtain();
4676 Parcel reply = Parcel.obtain();
4677 data.writeInterfaceToken(IActivityManager.descriptor);
4678 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004679 data.writeString(callingPackage);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004680 data.writeTypedArray(intents, 0);
4681 data.writeStringArray(resolvedTypes);
4682 data.writeStrongBinder(resultTo);
Dianne Hackborna4972e92012-03-14 10:38:05 -07004683 if (options != null) {
4684 data.writeInt(1);
4685 options.writeToParcel(data, 0);
4686 } else {
4687 data.writeInt(0);
4688 }
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004689 data.writeInt(userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004690 mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0);
4691 reply.readException();
4692 int result = reply.readInt();
4693 reply.recycle();
4694 data.recycle();
4695 return result;
4696 }
4697
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004698 public int getFrontActivityScreenCompatMode() throws RemoteException {
4699 Parcel data = Parcel.obtain();
4700 Parcel reply = Parcel.obtain();
4701 data.writeInterfaceToken(IActivityManager.descriptor);
4702 mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4703 reply.readException();
4704 int mode = reply.readInt();
4705 reply.recycle();
4706 data.recycle();
4707 return mode;
4708 }
4709
4710 public void setFrontActivityScreenCompatMode(int mode) throws RemoteException {
4711 Parcel data = Parcel.obtain();
4712 Parcel reply = Parcel.obtain();
4713 data.writeInterfaceToken(IActivityManager.descriptor);
4714 data.writeInt(mode);
4715 mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4716 reply.readException();
4717 reply.recycle();
4718 data.recycle();
4719 }
4720
4721 public int getPackageScreenCompatMode(String packageName) throws RemoteException {
4722 Parcel data = Parcel.obtain();
4723 Parcel reply = Parcel.obtain();
4724 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004725 data.writeString(packageName);
4726 mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004727 reply.readException();
4728 int mode = reply.readInt();
4729 reply.recycle();
4730 data.recycle();
4731 return mode;
4732 }
4733
4734 public void setPackageScreenCompatMode(String packageName, int mode)
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004735 throws RemoteException {
4736 Parcel data = Parcel.obtain();
4737 Parcel reply = Parcel.obtain();
4738 data.writeInterfaceToken(IActivityManager.descriptor);
4739 data.writeString(packageName);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004740 data.writeInt(mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004741 mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4742 reply.readException();
4743 reply.recycle();
4744 data.recycle();
4745 }
4746
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004747 public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
4748 Parcel data = Parcel.obtain();
4749 Parcel reply = Parcel.obtain();
4750 data.writeInterfaceToken(IActivityManager.descriptor);
4751 data.writeString(packageName);
4752 mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4753 reply.readException();
4754 boolean ask = reply.readInt() != 0;
4755 reply.recycle();
4756 data.recycle();
4757 return ask;
4758 }
4759
4760 public void setPackageAskScreenCompat(String packageName, boolean ask)
4761 throws RemoteException {
4762 Parcel data = Parcel.obtain();
4763 Parcel reply = Parcel.obtain();
4764 data.writeInterfaceToken(IActivityManager.descriptor);
4765 data.writeString(packageName);
4766 data.writeInt(ask ? 1 : 0);
4767 mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4768 reply.readException();
4769 reply.recycle();
4770 data.recycle();
4771 }
4772
Amith Yamasani4b2e9342011-03-31 12:38:53 -07004773 public boolean switchUser(int userid) throws RemoteException {
4774 Parcel data = Parcel.obtain();
4775 Parcel reply = Parcel.obtain();
4776 data.writeInterfaceToken(IActivityManager.descriptor);
4777 data.writeInt(userid);
4778 mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0);
4779 reply.readException();
4780 boolean result = reply.readInt() != 0;
4781 reply.recycle();
4782 data.recycle();
4783 return result;
4784 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07004785
Kenny Guy08488bf2014-02-21 17:40:37 +00004786 public boolean startUserInBackground(int userid) throws RemoteException {
4787 Parcel data = Parcel.obtain();
4788 Parcel reply = Parcel.obtain();
4789 data.writeInterfaceToken(IActivityManager.descriptor);
4790 data.writeInt(userid);
4791 mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0);
4792 reply.readException();
4793 boolean result = reply.readInt() != 0;
4794 reply.recycle();
4795 data.recycle();
4796 return result;
4797 }
4798
Dianne Hackborn80a4af22012-08-27 19:18:31 -07004799 public int stopUser(int userid, IStopUserCallback callback) throws RemoteException {
4800 Parcel data = Parcel.obtain();
4801 Parcel reply = Parcel.obtain();
4802 data.writeInterfaceToken(IActivityManager.descriptor);
4803 data.writeInt(userid);
4804 data.writeStrongInterface(callback);
4805 mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0);
4806 reply.readException();
4807 int result = reply.readInt();
4808 reply.recycle();
4809 data.recycle();
4810 return result;
4811 }
4812
Amith Yamasani52f1d752012-03-28 18:19:29 -07004813 public UserInfo getCurrentUser() throws RemoteException {
4814 Parcel data = Parcel.obtain();
4815 Parcel reply = Parcel.obtain();
4816 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn80a4af22012-08-27 19:18:31 -07004817 mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0);
Amith Yamasani52f1d752012-03-28 18:19:29 -07004818 reply.readException();
4819 UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply);
4820 reply.recycle();
4821 data.recycle();
4822 return userInfo;
4823 }
4824
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07004825 public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException {
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004826 Parcel data = Parcel.obtain();
4827 Parcel reply = Parcel.obtain();
4828 data.writeInterfaceToken(IActivityManager.descriptor);
4829 data.writeInt(userid);
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07004830 data.writeInt(orStopping ? 1 : 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004831 mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0);
4832 reply.readException();
4833 boolean result = reply.readInt() != 0;
4834 reply.recycle();
4835 data.recycle();
4836 return result;
4837 }
4838
Dianne Hackbornc72fc672012-09-20 13:12:03 -07004839 public int[] getRunningUserIds() throws RemoteException {
4840 Parcel data = Parcel.obtain();
4841 Parcel reply = Parcel.obtain();
4842 data.writeInterfaceToken(IActivityManager.descriptor);
4843 mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0);
4844 reply.readException();
4845 int[] result = reply.createIntArray();
4846 reply.recycle();
4847 data.recycle();
4848 return result;
4849 }
4850
Wale Ogunwaled54b5782014-10-23 15:55:23 -07004851 public boolean removeTask(int taskId) throws RemoteException {
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07004852 Parcel data = Parcel.obtain();
4853 Parcel reply = Parcel.obtain();
4854 data.writeInterfaceToken(IActivityManager.descriptor);
4855 data.writeInt(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07004856 mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
4857 reply.readException();
4858 boolean result = reply.readInt() != 0;
4859 reply.recycle();
4860 data.recycle();
4861 return result;
4862 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07004863
Jeff Sharkeya4620792011-05-20 15:29:23 -07004864 public void registerProcessObserver(IProcessObserver observer) throws RemoteException {
4865 Parcel data = Parcel.obtain();
4866 Parcel reply = Parcel.obtain();
4867 data.writeInterfaceToken(IActivityManager.descriptor);
4868 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
4869 mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
4870 reply.readException();
4871 data.recycle();
4872 reply.recycle();
4873 }
4874
4875 public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException {
4876 Parcel data = Parcel.obtain();
4877 Parcel reply = Parcel.obtain();
4878 data.writeInterfaceToken(IActivityManager.descriptor);
4879 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
4880 mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
4881 reply.readException();
4882 data.recycle();
4883 reply.recycle();
4884 }
4885
Dianne Hackborn6c418d52011-06-29 14:05:33 -07004886 public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException {
4887 Parcel data = Parcel.obtain();
4888 Parcel reply = Parcel.obtain();
4889 data.writeInterfaceToken(IActivityManager.descriptor);
4890 data.writeStrongBinder(sender.asBinder());
4891 mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0);
4892 reply.readException();
4893 boolean res = reply.readInt() != 0;
4894 data.recycle();
4895 reply.recycle();
4896 return res;
4897 }
4898
Dianne Hackborn1927ae82012-06-22 15:21:36 -07004899 public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException {
4900 Parcel data = Parcel.obtain();
4901 Parcel reply = Parcel.obtain();
4902 data.writeInterfaceToken(IActivityManager.descriptor);
4903 data.writeStrongBinder(sender.asBinder());
4904 mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0);
4905 reply.readException();
4906 boolean res = reply.readInt() != 0;
4907 data.recycle();
4908 reply.recycle();
4909 return res;
4910 }
4911
Dianne Hackborn81038902012-11-26 17:04:09 -08004912 public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException {
4913 Parcel data = Parcel.obtain();
4914 Parcel reply = Parcel.obtain();
4915 data.writeInterfaceToken(IActivityManager.descriptor);
4916 data.writeStrongBinder(sender.asBinder());
4917 mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4918 reply.readException();
4919 Intent res = reply.readInt() != 0
4920 ? Intent.CREATOR.createFromParcel(reply) : null;
4921 data.recycle();
4922 reply.recycle();
4923 return res;
4924 }
4925
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08004926 public String getTagForIntentSender(IIntentSender sender, String prefix)
4927 throws RemoteException {
4928 Parcel data = Parcel.obtain();
4929 Parcel reply = Parcel.obtain();
4930 data.writeInterfaceToken(IActivityManager.descriptor);
4931 data.writeStrongBinder(sender.asBinder());
4932 data.writeString(prefix);
4933 mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4934 reply.readException();
4935 String res = reply.readString();
4936 data.recycle();
4937 reply.recycle();
4938 return res;
4939 }
4940
Dianne Hackborn31ca8542011-07-19 14:58:28 -07004941 public void updatePersistentConfiguration(Configuration values) throws RemoteException
4942 {
4943 Parcel data = Parcel.obtain();
4944 Parcel reply = Parcel.obtain();
4945 data.writeInterfaceToken(IActivityManager.descriptor);
4946 values.writeToParcel(data, 0);
4947 mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0);
4948 reply.readException();
4949 data.recycle();
4950 reply.recycle();
4951 }
4952
Dianne Hackbornb437e092011-08-05 17:50:29 -07004953 public long[] getProcessPss(int[] pids) throws RemoteException {
4954 Parcel data = Parcel.obtain();
4955 Parcel reply = Parcel.obtain();
4956 data.writeInterfaceToken(IActivityManager.descriptor);
4957 data.writeIntArray(pids);
4958 mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0);
4959 reply.readException();
4960 long[] res = reply.createLongArray();
4961 data.recycle();
4962 reply.recycle();
4963 return res;
4964 }
4965
Dianne Hackborn661cd522011-08-22 00:26:20 -07004966 public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
4967 Parcel data = Parcel.obtain();
4968 Parcel reply = Parcel.obtain();
4969 data.writeInterfaceToken(IActivityManager.descriptor);
4970 TextUtils.writeToParcel(msg, data, 0);
4971 data.writeInt(always ? 1 : 0);
4972 mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
4973 reply.readException();
4974 data.recycle();
4975 reply.recycle();
4976 }
4977
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02004978 public void keyguardWaitingForActivityDrawn() throws RemoteException {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07004979 Parcel data = Parcel.obtain();
4980 Parcel reply = Parcel.obtain();
4981 data.writeInterfaceToken(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02004982 mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
Dianne Hackborn90c52de2011-09-23 12:57:44 -07004983 reply.readException();
4984 data.recycle();
4985 reply.recycle();
4986 }
4987
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07004988 public boolean shouldUpRecreateTask(IBinder token, String destAffinity)
Adam Powelldd8fab22012-03-22 17:47:27 -07004989 throws RemoteException {
4990 Parcel data = Parcel.obtain();
4991 Parcel reply = Parcel.obtain();
4992 data.writeInterfaceToken(IActivityManager.descriptor);
4993 data.writeStrongBinder(token);
4994 data.writeString(destAffinity);
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07004995 mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0);
Adam Powelldd8fab22012-03-22 17:47:27 -07004996 reply.readException();
4997 boolean result = reply.readInt() != 0;
4998 data.recycle();
4999 reply.recycle();
5000 return result;
5001 }
5002
5003 public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData)
5004 throws RemoteException {
5005 Parcel data = Parcel.obtain();
5006 Parcel reply = Parcel.obtain();
5007 data.writeInterfaceToken(IActivityManager.descriptor);
5008 data.writeStrongBinder(token);
5009 target.writeToParcel(data, 0);
5010 data.writeInt(resultCode);
5011 if (resultData != null) {
5012 data.writeInt(1);
5013 resultData.writeToParcel(data, 0);
5014 } else {
5015 data.writeInt(0);
5016 }
5017 mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0);
5018 reply.readException();
5019 boolean result = reply.readInt() != 0;
5020 data.recycle();
5021 reply.recycle();
5022 return result;
5023 }
5024
Dianne Hackborn5320eb82012-05-18 12:05:04 -07005025 public int getLaunchedFromUid(IBinder activityToken) throws RemoteException {
5026 Parcel data = Parcel.obtain();
5027 Parcel reply = Parcel.obtain();
5028 data.writeInterfaceToken(IActivityManager.descriptor);
5029 data.writeStrongBinder(activityToken);
5030 mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0);
5031 reply.readException();
5032 int result = reply.readInt();
5033 data.recycle();
5034 reply.recycle();
5035 return result;
5036 }
5037
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005038 public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException {
5039 Parcel data = Parcel.obtain();
5040 Parcel reply = Parcel.obtain();
5041 data.writeInterfaceToken(IActivityManager.descriptor);
5042 data.writeStrongBinder(activityToken);
5043 mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0);
5044 reply.readException();
5045 String result = reply.readString();
5046 data.recycle();
5047 reply.recycle();
5048 return result;
5049 }
5050
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07005051 public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5052 Parcel data = Parcel.obtain();
5053 Parcel reply = Parcel.obtain();
5054 data.writeInterfaceToken(IActivityManager.descriptor);
5055 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5056 mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5057 reply.readException();
5058 data.recycle();
5059 reply.recycle();
5060 }
5061
5062 public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5063 Parcel data = Parcel.obtain();
5064 Parcel reply = Parcel.obtain();
5065 data.writeInterfaceToken(IActivityManager.descriptor);
5066 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5067 mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5068 reply.readException();
5069 data.recycle();
5070 reply.recycle();
5071 }
5072
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07005073 public void requestBugReport() throws RemoteException {
5074 Parcel data = Parcel.obtain();
5075 Parcel reply = Parcel.obtain();
5076 data.writeInterfaceToken(IActivityManager.descriptor);
5077 mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0);
5078 reply.readException();
5079 data.recycle();
5080 reply.recycle();
5081 }
5082
Jeff Brownbd181bb2013-09-10 16:44:24 -07005083 public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason)
5084 throws RemoteException {
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005085 Parcel data = Parcel.obtain();
5086 Parcel reply = Parcel.obtain();
5087 data.writeInterfaceToken(IActivityManager.descriptor);
5088 data.writeInt(pid);
5089 data.writeInt(aboveSystem ? 1 : 0);
Jeff Brownbd181bb2013-09-10 16:44:24 -07005090 data.writeString(reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005091 mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0);
5092 reply.readException();
5093 long res = reply.readInt();
5094 data.recycle();
5095 reply.recycle();
5096 return res;
5097 }
5098
Adam Skorydfc7fd72013-08-05 19:23:41 -07005099 public Bundle getAssistContextExtras(int requestType) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005100 Parcel data = Parcel.obtain();
5101 Parcel reply = Parcel.obtain();
5102 data.writeInterfaceToken(IActivityManager.descriptor);
5103 data.writeInt(requestType);
Adam Skorydfc7fd72013-08-05 19:23:41 -07005104 mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005105 reply.readException();
5106 Bundle res = reply.readBundle();
5107 data.recycle();
5108 reply.recycle();
5109 return res;
5110 }
5111
Adam Skory7140a252013-09-11 12:04:58 +01005112 public void reportAssistContextExtras(IBinder token, Bundle extras)
Adam Skorydfc7fd72013-08-05 19:23:41 -07005113 throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005114 Parcel data = Parcel.obtain();
5115 Parcel reply = Parcel.obtain();
5116 data.writeInterfaceToken(IActivityManager.descriptor);
5117 data.writeStrongBinder(token);
5118 data.writeBundle(extras);
Adam Skorydfc7fd72013-08-05 19:23:41 -07005119 mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005120 reply.readException();
5121 data.recycle();
5122 reply.recycle();
5123 }
5124
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07005125 public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle)
5126 throws RemoteException {
5127 Parcel data = Parcel.obtain();
5128 Parcel reply = Parcel.obtain();
5129 data.writeInterfaceToken(IActivityManager.descriptor);
5130 intent.writeToParcel(data, 0);
5131 data.writeInt(requestType);
5132 data.writeString(hint);
5133 data.writeInt(userHandle);
5134 mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0);
5135 reply.readException();
5136 boolean res = reply.readInt() != 0;
5137 data.recycle();
5138 reply.recycle();
5139 return res;
5140 }
5141
Dianne Hackbornf1b78242013-04-08 22:28:59 -07005142 public void killUid(int uid, String reason) throws RemoteException {
5143 Parcel data = Parcel.obtain();
5144 Parcel reply = Parcel.obtain();
5145 data.writeInterfaceToken(IActivityManager.descriptor);
5146 data.writeInt(uid);
5147 data.writeString(reason);
5148 mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0);
5149 reply.readException();
5150 data.recycle();
5151 reply.recycle();
5152 }
5153
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07005154 public void hang(IBinder who, boolean allowRestart) throws RemoteException {
5155 Parcel data = Parcel.obtain();
5156 Parcel reply = Parcel.obtain();
5157 data.writeInterfaceToken(IActivityManager.descriptor);
5158 data.writeStrongBinder(who);
5159 data.writeInt(allowRestart ? 1 : 0);
5160 mRemote.transact(HANG_TRANSACTION, data, reply, 0);
5161 reply.readException();
5162 data.recycle();
5163 reply.recycle();
5164 }
5165
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07005166 public void reportActivityFullyDrawn(IBinder token) throws RemoteException {
5167 Parcel data = Parcel.obtain();
5168 Parcel reply = Parcel.obtain();
5169 data.writeInterfaceToken(IActivityManager.descriptor);
5170 data.writeStrongBinder(token);
5171 mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0);
5172 reply.readException();
5173 data.recycle();
5174 reply.recycle();
5175 }
5176
Craig Mautner5eda9b32013-07-02 11:58:16 -07005177 public void notifyActivityDrawn(IBinder token) throws RemoteException {
5178 Parcel data = Parcel.obtain();
5179 Parcel reply = Parcel.obtain();
5180 data.writeInterfaceToken(IActivityManager.descriptor);
5181 data.writeStrongBinder(token);
5182 mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
5183 reply.readException();
5184 data.recycle();
5185 reply.recycle();
5186 }
5187
Dianne Hackborn57a7f592013-07-22 18:21:32 -07005188 public void restart() throws RemoteException {
5189 Parcel data = Parcel.obtain();
5190 Parcel reply = Parcel.obtain();
5191 data.writeInterfaceToken(IActivityManager.descriptor);
5192 mRemote.transact(RESTART_TRANSACTION, data, reply, 0);
5193 reply.readException();
5194 data.recycle();
5195 reply.recycle();
5196 }
5197
Dianne Hackborn35f72be2013-09-16 10:57:39 -07005198 public void performIdleMaintenance() throws RemoteException {
5199 Parcel data = Parcel.obtain();
5200 Parcel reply = Parcel.obtain();
5201 data.writeInterfaceToken(IActivityManager.descriptor);
5202 mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0);
5203 reply.readException();
5204 data.recycle();
5205 reply.recycle();
5206 }
5207
Todd Kennedyca4d8422015-01-15 15:19:22 -08005208 public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken,
Craig Mautner4a1cb222013-12-04 16:14:06 -08005209 IActivityContainerCallback callback) throws RemoteException {
5210 Parcel data = Parcel.obtain();
5211 Parcel reply = Parcel.obtain();
5212 data.writeInterfaceToken(IActivityManager.descriptor);
5213 data.writeStrongBinder(parentActivityToken);
Craig Mautnere3a00d72014-04-16 08:31:19 -07005214 data.writeStrongBinder(callback == null ? null : callback.asBinder());
Todd Kennedyca4d8422015-01-15 15:19:22 -08005215 mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
Craig Mautner4a1cb222013-12-04 16:14:06 -08005216 reply.readException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08005217 final int result = reply.readInt();
5218 final IActivityContainer res;
5219 if (result == 1) {
5220 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5221 } else {
5222 res = null;
5223 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08005224 data.recycle();
5225 reply.recycle();
5226 return res;
5227 }
5228
Craig Mautner95da1082014-02-24 17:54:35 -08005229 public void deleteActivityContainer(IActivityContainer activityContainer)
5230 throws RemoteException {
5231 Parcel data = Parcel.obtain();
5232 Parcel reply = Parcel.obtain();
5233 data.writeInterfaceToken(IActivityManager.descriptor);
5234 data.writeStrongBinder(activityContainer.asBinder());
5235 mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
5236 reply.readException();
5237 data.recycle();
5238 reply.recycle();
5239 }
5240
Craig Mautnere0a38842013-12-16 16:14:02 -08005241 public IActivityContainer getEnclosingActivityContainer(IBinder activityToken)
5242 throws RemoteException {
5243 Parcel data = Parcel.obtain();
5244 Parcel reply = Parcel.obtain();
5245 data.writeInterfaceToken(IActivityManager.descriptor);
5246 data.writeStrongBinder(activityToken);
5247 mRemote.transact(GET_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
5248 reply.readException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08005249 final int result = reply.readInt();
5250 final IActivityContainer res;
5251 if (result == 1) {
5252 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5253 } else {
5254 res = null;
5255 }
Craig Mautnere0a38842013-12-16 16:14:02 -08005256 data.recycle();
5257 reply.recycle();
5258 return res;
5259 }
5260
Craig Mautner4a1cb222013-12-04 16:14:06 -08005261 public IBinder getHomeActivityToken() throws RemoteException {
5262 Parcel data = Parcel.obtain();
5263 Parcel reply = Parcel.obtain();
5264 data.writeInterfaceToken(IActivityManager.descriptor);
5265 mRemote.transact(GET_HOME_ACTIVITY_TOKEN_TRANSACTION, data, reply, 0);
5266 reply.readException();
5267 IBinder res = reply.readStrongBinder();
5268 data.recycle();
5269 reply.recycle();
5270 return res;
5271 }
5272
Craig Mautneraea74a52014-03-08 14:23:10 -08005273 @Override
5274 public void startLockTaskMode(int taskId) throws RemoteException {
5275 Parcel data = Parcel.obtain();
5276 Parcel reply = Parcel.obtain();
5277 data.writeInterfaceToken(IActivityManager.descriptor);
5278 data.writeInt(taskId);
5279 mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0);
5280 reply.readException();
5281 data.recycle();
5282 reply.recycle();
5283 }
5284
5285 @Override
5286 public void startLockTaskMode(IBinder token) throws RemoteException {
5287 Parcel data = Parcel.obtain();
5288 Parcel reply = Parcel.obtain();
5289 data.writeInterfaceToken(IActivityManager.descriptor);
5290 data.writeStrongBinder(token);
5291 mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0);
5292 reply.readException();
5293 data.recycle();
5294 reply.recycle();
5295 }
5296
5297 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005298 public void startLockTaskModeOnCurrent() throws RemoteException {
5299 Parcel data = Parcel.obtain();
5300 Parcel reply = Parcel.obtain();
5301 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005302 mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005303 reply.readException();
5304 data.recycle();
5305 reply.recycle();
5306 }
5307
5308 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005309 public void stopLockTaskMode() throws RemoteException {
5310 Parcel data = Parcel.obtain();
5311 Parcel reply = Parcel.obtain();
5312 data.writeInterfaceToken(IActivityManager.descriptor);
5313 mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5314 reply.readException();
5315 data.recycle();
5316 reply.recycle();
5317 }
5318
5319 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005320 public void stopLockTaskModeOnCurrent() throws RemoteException {
5321 Parcel data = Parcel.obtain();
5322 Parcel reply = Parcel.obtain();
5323 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005324 mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005325 reply.readException();
5326 data.recycle();
5327 reply.recycle();
5328 }
5329
5330 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005331 public boolean isInLockTaskMode() throws RemoteException {
5332 Parcel data = Parcel.obtain();
5333 Parcel reply = Parcel.obtain();
5334 data.writeInterfaceToken(IActivityManager.descriptor);
5335 mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5336 reply.readException();
5337 boolean isInLockTaskMode = reply.readInt() == 1;
5338 data.recycle();
5339 reply.recycle();
5340 return isInLockTaskMode;
5341 }
5342
Craig Mautner688b5102014-03-27 16:55:03 -07005343 @Override
Winson Chunga449dc02014-05-16 11:15:04 -07005344 public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values)
Winson Chung03a9bae2014-05-02 09:56:12 -07005345 throws RemoteException {
Craig Mautner2fbd7542014-03-21 09:34:07 -07005346 Parcel data = Parcel.obtain();
5347 Parcel reply = Parcel.obtain();
5348 data.writeInterfaceToken(IActivityManager.descriptor);
5349 data.writeStrongBinder(token);
Winson Chung03a9bae2014-05-02 09:56:12 -07005350 values.writeToParcel(data, 0);
Winson Chunga449dc02014-05-16 11:15:04 -07005351 mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
Craig Mautner2fbd7542014-03-21 09:34:07 -07005352 reply.readException();
5353 data.recycle();
5354 reply.recycle();
5355 }
5356
Craig Mautneree2e45a2014-06-27 12:10:03 -07005357 @Override
Craig Mautner648f69b2014-09-18 14:16:26 -07005358 public Bitmap getTaskDescriptionIcon(String filename) throws RemoteException {
5359 Parcel data = Parcel.obtain();
5360 Parcel reply = Parcel.obtain();
5361 data.writeInterfaceToken(IActivityManager.descriptor);
5362 data.writeString(filename);
5363 mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0);
5364 reply.readException();
5365 final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply);
5366 data.recycle();
5367 reply.recycle();
5368 return icon;
5369 }
5370
5371 @Override
Winson Chung044d5292014-11-06 11:05:19 -08005372 public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options)
5373 throws RemoteException {
5374 Parcel data = Parcel.obtain();
5375 Parcel reply = Parcel.obtain();
5376 data.writeInterfaceToken(IActivityManager.descriptor);
5377 if (options == null) {
5378 data.writeInt(0);
5379 } else {
5380 data.writeInt(1);
5381 data.writeBundle(options.toBundle());
5382 }
5383 mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
5384 reply.readException();
5385 data.recycle();
5386 reply.recycle();
5387 }
5388
5389 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005390 public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005391 Parcel data = Parcel.obtain();
5392 Parcel reply = Parcel.obtain();
5393 data.writeInterfaceToken(IActivityManager.descriptor);
5394 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07005395 data.writeInt(visible ? 1 : 0);
5396 mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005397 reply.readException();
5398 boolean success = reply.readInt() > 0;
5399 data.recycle();
5400 reply.recycle();
5401 return success;
5402 }
5403
5404 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005405 public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005406 Parcel data = Parcel.obtain();
5407 Parcel reply = Parcel.obtain();
5408 data.writeInterfaceToken(IActivityManager.descriptor);
5409 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07005410 mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005411 reply.readException();
Jose Lima4b6c6692014-08-12 17:41:12 -07005412 final boolean visible = reply.readInt() > 0;
Craig Mautneree2e45a2014-06-27 12:10:03 -07005413 data.recycle();
5414 reply.recycle();
Jose Lima4b6c6692014-08-12 17:41:12 -07005415 return visible;
Craig Mautneree2e45a2014-06-27 12:10:03 -07005416 }
5417
5418 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005419 public void backgroundResourcesReleased(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005420 Parcel data = Parcel.obtain();
5421 Parcel reply = Parcel.obtain();
5422 data.writeInterfaceToken(IActivityManager.descriptor);
5423 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07005424 mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply,
5425 IBinder.FLAG_ONEWAY);
Craig Mautnerbb742462014-07-07 15:28:55 -07005426 reply.readException();
5427 data.recycle();
5428 reply.recycle();
5429 }
5430
5431 @Override
5432 public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException {
5433 Parcel data = Parcel.obtain();
5434 Parcel reply = Parcel.obtain();
5435 data.writeInterfaceToken(IActivityManager.descriptor);
5436 data.writeStrongBinder(token);
5437 mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply,
5438 IBinder.FLAG_ONEWAY);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005439 reply.readException();
5440 data.recycle();
5441 reply.recycle();
5442 }
5443
Craig Mautner8746a472014-07-24 15:12:54 -07005444 @Override
5445 public void notifyEnterAnimationComplete(IBinder token) throws RemoteException {
5446 Parcel data = Parcel.obtain();
5447 Parcel reply = Parcel.obtain();
5448 data.writeInterfaceToken(IActivityManager.descriptor);
5449 data.writeStrongBinder(token);
5450 mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply,
5451 IBinder.FLAG_ONEWAY);
5452 reply.readException();
5453 data.recycle();
5454 reply.recycle();
5455 }
5456
Craig Mautner6e2f3952014-09-09 14:26:41 -07005457 @Override
5458 public void bootAnimationComplete() throws RemoteException {
5459 Parcel data = Parcel.obtain();
5460 Parcel reply = Parcel.obtain();
5461 data.writeInterfaceToken(IActivityManager.descriptor);
5462 mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
5463 reply.readException();
5464 data.recycle();
5465 reply.recycle();
5466 }
5467
Wale Ogunwale18795a22014-12-03 11:38:33 -08005468 @Override
5469 public void systemBackupRestored() throws RemoteException {
5470 Parcel data = Parcel.obtain();
5471 Parcel reply = Parcel.obtain();
5472 data.writeInterfaceToken(IActivityManager.descriptor);
5473 mRemote.transact(SYSTEM_BACKUP_RESTORED, data, reply, 0);
5474 reply.readException();
5475 data.recycle();
5476 reply.recycle();
5477 }
5478
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005479 private IBinder mRemote;
5480}