blob: 1e9bc542908c977fcf10d9ba33cf97f76dddbfb9 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.app;
18
Craig Mautnerbdc748af2013-12-02 14:08:25 -080019import android.app.ActivityManager.StackInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080020import android.content.ComponentName;
Adam Powelldd8fab22012-03-22 17:47:27 -070021import android.content.IIntentReceiver;
22import android.content.IIntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023import android.content.Intent;
24import android.content.IntentFilter;
Dianne Hackbornfa82f222009-09-17 15:14:12 -070025import android.content.IntentSender;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070026import android.content.UriPermission;
Christopher Tate181fafa2009-05-14 11:12:14 -070027import android.content.pm.ApplicationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080028import android.content.pm.ConfigurationInfo;
29import android.content.pm.IPackageDataObserver;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070030import android.content.pm.ParceledListSlice;
Amith Yamasani52f1d752012-03-28 18:19:29 -070031import android.content.pm.UserInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080032import android.content.res.Configuration;
Dianne Hackbornaec68bb2014-08-20 15:25:13 -070033import android.graphics.Bitmap;
34import android.graphics.Point;
Craig Mautnerbdc748af2013-12-02 14:08:25 -080035import android.graphics.Rect;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080036import android.net.Uri;
37import android.os.Binder;
38import android.os.Bundle;
Dianne Hackborn3025ef32009-08-31 21:31:47 -070039import android.os.Debug;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080040import android.os.IBinder;
41import android.os.Parcel;
Adam Powelldd8fab22012-03-22 17:47:27 -070042import android.os.ParcelFileDescriptor;
43import android.os.Parcelable;
Craig Mautnera0026042014-04-23 11:45:37 -070044import android.os.PersistableBundle;
Adam Powelldd8fab22012-03-22 17:47:27 -070045import android.os.RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080046import android.os.ServiceManager;
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -070047import android.os.StrictMode;
Dianne Hackborn91097de2014-04-04 18:02:06 -070048import android.service.voice.IVoiceInteractionSession;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080049import android.text.TextUtils;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080050import android.util.Log;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080051import android.util.Singleton;
Dianne Hackborn91097de2014-04-04 18:02:06 -070052import com.android.internal.app.IVoiceInteractor;
Dianne Hackbornae6688b2015-02-11 17:02:41 -080053import com.android.internal.os.IResultReceiver;
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
Svet Ganov16a16892015-04-16 10:32:04 -070096 static public void broadcastStickyIntent(Intent intent, String permission, int userId) {
97 broadcastStickyIntent(intent, permission, AppOpsManager.OP_NONE, userId);
98 }
99
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800100 /**
101 * Convenience for sending a sticky broadcast. For internal use only.
102 * If you don't care about permission, use null.
103 */
Svet Ganov16a16892015-04-16 10:32:04 -0700104 static public void broadcastStickyIntent(Intent intent, String permission, int appOp,
105 int userId) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800106 try {
107 getDefault().broadcastIntent(
108 null, intent, null, null, Activity.RESULT_OK, null, null,
Svet Ganov16a16892015-04-16 10:32:04 -0700109 null /*permission*/, appOp, false, true, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800110 } catch (RemoteException ex) {
111 }
112 }
113
Dianne Hackborn1e383822015-04-10 14:02:33 -0700114 static public void noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg,
115 String tag) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800116 try {
Dianne Hackborn1e383822015-04-10 14:02:33 -0700117 getDefault().noteWakeupAlarm(ps.getTarget(), sourceUid, sourcePkg, tag);
118 } catch (RemoteException ex) {
119 }
120 }
121
122 static public void noteAlarmStart(PendingIntent ps, int sourceUid, String tag) {
123 try {
124 getDefault().noteAlarmStart(ps.getTarget(), sourceUid, tag);
125 } catch (RemoteException ex) {
126 }
127 }
128
129 static public void noteAlarmFinish(PendingIntent ps, int sourceUid, String tag) {
130 try {
131 getDefault().noteAlarmFinish(ps.getTarget(), sourceUid, tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800132 } catch (RemoteException ex) {
133 }
134 }
135
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -0800136 public ActivityManagerNative() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800137 attachInterface(this, descriptor);
138 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700139
140 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800141 public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
142 throws RemoteException {
143 switch (code) {
144 case START_ACTIVITY_TRANSACTION:
145 {
146 data.enforceInterface(IActivityManager.descriptor);
147 IBinder b = data.readStrongBinder();
148 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800149 String callingPackage = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800150 Intent intent = Intent.CREATOR.createFromParcel(data);
151 String resolvedType = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800152 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800153 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800154 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700155 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700156 ProfilerInfo profilerInfo = data.readInt() != 0
157 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700158 Bundle options = data.readInt() != 0
159 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800160 int result = startActivity(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700161 resultTo, resultWho, requestCode, startFlags, profilerInfo, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800162 reply.writeNoException();
163 reply.writeInt(result);
164 return true;
165 }
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700166
Amith Yamasani82644082012-08-03 13:09:11 -0700167 case START_ACTIVITY_AS_USER_TRANSACTION:
168 {
169 data.enforceInterface(IActivityManager.descriptor);
170 IBinder b = data.readStrongBinder();
171 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800172 String callingPackage = data.readString();
Amith Yamasani82644082012-08-03 13:09:11 -0700173 Intent intent = Intent.CREATOR.createFromParcel(data);
174 String resolvedType = data.readString();
175 IBinder resultTo = data.readStrongBinder();
176 String resultWho = data.readString();
177 int requestCode = data.readInt();
178 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700179 ProfilerInfo profilerInfo = data.readInt() != 0
180 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Amith Yamasani82644082012-08-03 13:09:11 -0700181 Bundle options = data.readInt() != 0
182 ? Bundle.CREATOR.createFromParcel(data) : null;
183 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800184 int result = startActivityAsUser(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700185 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Amith Yamasani82644082012-08-03 13:09:11 -0700186 reply.writeNoException();
187 reply.writeInt(result);
188 return true;
189 }
190
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700191 case START_ACTIVITY_AS_CALLER_TRANSACTION:
192 {
193 data.enforceInterface(IActivityManager.descriptor);
194 IBinder b = data.readStrongBinder();
195 IApplicationThread app = ApplicationThreadNative.asInterface(b);
196 String callingPackage = data.readString();
197 Intent intent = Intent.CREATOR.createFromParcel(data);
198 String resolvedType = data.readString();
199 IBinder resultTo = data.readStrongBinder();
200 String resultWho = data.readString();
201 int requestCode = data.readInt();
202 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700203 ProfilerInfo profilerInfo = data.readInt() != 0
204 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700205 Bundle options = data.readInt() != 0
206 ? Bundle.CREATOR.createFromParcel(data) : null;
Jeff Sharkey97978802014-10-14 10:48:18 -0700207 int userId = data.readInt();
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700208 int result = startActivityAsCaller(app, callingPackage, intent, resolvedType,
Jeff Sharkey97978802014-10-14 10:48:18 -0700209 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700210 reply.writeNoException();
211 reply.writeInt(result);
212 return true;
213 }
214
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800215 case START_ACTIVITY_AND_WAIT_TRANSACTION:
216 {
217 data.enforceInterface(IActivityManager.descriptor);
218 IBinder b = data.readStrongBinder();
219 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800220 String callingPackage = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800221 Intent intent = Intent.CREATOR.createFromParcel(data);
222 String resolvedType = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800223 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800224 String resultWho = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800225 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700226 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700227 ProfilerInfo profilerInfo = data.readInt() != 0
228 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700229 Bundle options = data.readInt() != 0
230 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -0700231 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800232 WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700233 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800234 reply.writeNoException();
235 result.writeToParcel(reply, 0);
236 return true;
237 }
238
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700239 case START_ACTIVITY_WITH_CONFIG_TRANSACTION:
240 {
241 data.enforceInterface(IActivityManager.descriptor);
242 IBinder b = data.readStrongBinder();
243 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800244 String callingPackage = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700245 Intent intent = Intent.CREATOR.createFromParcel(data);
246 String resolvedType = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700247 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700248 String resultWho = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700249 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700250 int startFlags = data.readInt();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700251 Configuration config = Configuration.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700252 Bundle options = data.readInt() != 0
253 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -0700254 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800255 int result = startActivityWithConfig(app, callingPackage, intent, resolvedType,
Dianne Hackborn41203752012-08-31 14:05:51 -0700256 resultTo, resultWho, requestCode, startFlags, config, options, userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700257 reply.writeNoException();
258 reply.writeInt(result);
259 return true;
260 }
261
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700262 case START_ACTIVITY_INTENT_SENDER_TRANSACTION:
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700263 {
264 data.enforceInterface(IActivityManager.descriptor);
265 IBinder b = data.readStrongBinder();
266 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700267 IntentSender intent = IntentSender.CREATOR.createFromParcel(data);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700268 Intent fillInIntent = null;
269 if (data.readInt() != 0) {
270 fillInIntent = Intent.CREATOR.createFromParcel(data);
271 }
272 String resolvedType = data.readString();
273 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700274 String resultWho = data.readString();
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700275 int requestCode = data.readInt();
276 int flagsMask = data.readInt();
277 int flagsValues = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700278 Bundle options = data.readInt() != 0
279 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700280 int result = startActivityIntentSender(app, intent,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700281 fillInIntent, resolvedType, resultTo, resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700282 requestCode, flagsMask, flagsValues, options);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700283 reply.writeNoException();
284 reply.writeInt(result);
285 return true;
286 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700287
Dianne Hackborn91097de2014-04-04 18:02:06 -0700288 case START_VOICE_ACTIVITY_TRANSACTION:
289 {
290 data.enforceInterface(IActivityManager.descriptor);
291 String callingPackage = data.readString();
292 int callingPid = data.readInt();
293 int callingUid = data.readInt();
294 Intent intent = Intent.CREATOR.createFromParcel(data);
295 String resolvedType = data.readString();
296 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
297 data.readStrongBinder());
298 IVoiceInteractor interactor = IVoiceInteractor.Stub.asInterface(
299 data.readStrongBinder());
300 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700301 ProfilerInfo profilerInfo = data.readInt() != 0
302 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborn91097de2014-04-04 18:02:06 -0700303 Bundle options = data.readInt() != 0
304 ? Bundle.CREATOR.createFromParcel(data) : null;
305 int userId = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700306 int result = startVoiceActivity(callingPackage, callingPid, callingUid, intent,
307 resolvedType, session, interactor, startFlags, profilerInfo, options, userId);
Dianne Hackborn91097de2014-04-04 18:02:06 -0700308 reply.writeNoException();
309 reply.writeInt(result);
310 return true;
311 }
312
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800313 case START_NEXT_MATCHING_ACTIVITY_TRANSACTION:
314 {
315 data.enforceInterface(IActivityManager.descriptor);
316 IBinder callingActivity = data.readStrongBinder();
317 Intent intent = Intent.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700318 Bundle options = data.readInt() != 0
319 ? Bundle.CREATOR.createFromParcel(data) : null;
320 boolean result = startNextMatchingActivity(callingActivity, intent, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800321 reply.writeNoException();
322 reply.writeInt(result ? 1 : 0);
323 return true;
324 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700325
Craig Mautnerdc00cbe2014-07-20 17:48:47 -0700326 case START_ACTIVITY_FROM_RECENTS_TRANSACTION:
327 {
328 data.enforceInterface(IActivityManager.descriptor);
329 int taskId = data.readInt();
330 Bundle options = data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data);
331 int result = startActivityFromRecents(taskId, options);
332 reply.writeNoException();
333 reply.writeInt(result);
334 return true;
335 }
336
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800337 case FINISH_ACTIVITY_TRANSACTION: {
338 data.enforceInterface(IActivityManager.descriptor);
339 IBinder token = data.readStrongBinder();
340 Intent resultData = null;
341 int resultCode = data.readInt();
342 if (data.readInt() != 0) {
343 resultData = Intent.CREATOR.createFromParcel(data);
344 }
Winson Chung3b3f4642014-04-22 10:08:18 -0700345 boolean finishTask = (data.readInt() != 0);
346 boolean res = finishActivity(token, resultCode, resultData, finishTask);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800347 reply.writeNoException();
348 reply.writeInt(res ? 1 : 0);
349 return true;
350 }
351
352 case FINISH_SUB_ACTIVITY_TRANSACTION: {
353 data.enforceInterface(IActivityManager.descriptor);
354 IBinder token = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700355 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800356 int requestCode = data.readInt();
357 finishSubActivity(token, resultWho, requestCode);
358 reply.writeNoException();
359 return true;
360 }
361
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700362 case FINISH_ACTIVITY_AFFINITY_TRANSACTION: {
363 data.enforceInterface(IActivityManager.descriptor);
364 IBinder token = data.readStrongBinder();
365 boolean res = finishActivityAffinity(token);
366 reply.writeNoException();
367 reply.writeInt(res ? 1 : 0);
368 return true;
369 }
370
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -0700371 case FINISH_VOICE_TASK_TRANSACTION: {
372 data.enforceInterface(IActivityManager.descriptor);
373 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
374 data.readStrongBinder());
375 finishVoiceTask(session);
376 reply.writeNoException();
377 return true;
378 }
379
Dianne Hackborn89ad4562014-08-24 16:45:38 -0700380 case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: {
381 data.enforceInterface(IActivityManager.descriptor);
382 IBinder token = data.readStrongBinder();
383 boolean res = releaseActivityInstance(token);
384 reply.writeNoException();
385 reply.writeInt(res ? 1 : 0);
386 return true;
387 }
388
389 case RELEASE_SOME_ACTIVITIES_TRANSACTION: {
390 data.enforceInterface(IActivityManager.descriptor);
391 IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder());
392 releaseSomeActivities(app);
393 reply.writeNoException();
394 return true;
395 }
396
Dianne Hackborn061d58a2010-03-12 15:07:06 -0800397 case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: {
398 data.enforceInterface(IActivityManager.descriptor);
399 IBinder token = data.readStrongBinder();
400 boolean res = willActivityBeVisible(token);
401 reply.writeNoException();
402 reply.writeInt(res ? 1 : 0);
403 return true;
404 }
405
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800406 case REGISTER_RECEIVER_TRANSACTION:
407 {
408 data.enforceInterface(IActivityManager.descriptor);
409 IBinder b = data.readStrongBinder();
410 IApplicationThread app =
411 b != null ? ApplicationThreadNative.asInterface(b) : null;
Dianne Hackborn6c418d52011-06-29 14:05:33 -0700412 String packageName = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800413 b = data.readStrongBinder();
414 IIntentReceiver rec
415 = b != null ? IIntentReceiver.Stub.asInterface(b) : null;
416 IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data);
417 String perm = data.readString();
Dianne Hackborn20e80982012-08-31 19:00:44 -0700418 int userId = data.readInt();
419 Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800420 reply.writeNoException();
421 if (intent != null) {
422 reply.writeInt(1);
423 intent.writeToParcel(reply, 0);
424 } else {
425 reply.writeInt(0);
426 }
427 return true;
428 }
429
430 case UNREGISTER_RECEIVER_TRANSACTION:
431 {
432 data.enforceInterface(IActivityManager.descriptor);
433 IBinder b = data.readStrongBinder();
434 if (b == null) {
435 return true;
436 }
437 IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b);
438 unregisterReceiver(rec);
439 reply.writeNoException();
440 return true;
441 }
442
443 case BROADCAST_INTENT_TRANSACTION:
444 {
445 data.enforceInterface(IActivityManager.descriptor);
446 IBinder b = data.readStrongBinder();
447 IApplicationThread app =
448 b != null ? ApplicationThreadNative.asInterface(b) : null;
449 Intent intent = Intent.CREATOR.createFromParcel(data);
450 String resolvedType = data.readString();
451 b = data.readStrongBinder();
452 IIntentReceiver resultTo =
453 b != null ? IIntentReceiver.Stub.asInterface(b) : null;
454 int resultCode = data.readInt();
455 String resultData = data.readString();
456 Bundle resultExtras = data.readBundle();
457 String perm = data.readString();
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800458 int appOp = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800459 boolean serialized = data.readInt() != 0;
460 boolean sticky = data.readInt() != 0;
Amith Yamasani742a6712011-05-04 14:49:28 -0700461 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800462 int res = broadcastIntent(app, intent, resolvedType, resultTo,
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800463 resultCode, resultData, resultExtras, perm, appOp,
Amith Yamasani742a6712011-05-04 14:49:28 -0700464 serialized, sticky, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800465 reply.writeNoException();
466 reply.writeInt(res);
467 return true;
468 }
469
470 case UNBROADCAST_INTENT_TRANSACTION:
471 {
472 data.enforceInterface(IActivityManager.descriptor);
473 IBinder b = data.readStrongBinder();
474 IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null;
475 Intent intent = Intent.CREATOR.createFromParcel(data);
Amith Yamasani742a6712011-05-04 14:49:28 -0700476 int userId = data.readInt();
477 unbroadcastIntent(app, intent, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800478 reply.writeNoException();
479 return true;
480 }
481
482 case FINISH_RECEIVER_TRANSACTION: {
483 data.enforceInterface(IActivityManager.descriptor);
484 IBinder who = data.readStrongBinder();
485 int resultCode = data.readInt();
486 String resultData = data.readString();
487 Bundle resultExtras = data.readBundle();
488 boolean resultAbort = data.readInt() != 0;
riddle_hsu1f5ac4d2015-01-03 15:38:21 +0800489 int intentFlags = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800490 if (who != null) {
riddle_hsu1f5ac4d2015-01-03 15:38:21 +0800491 finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800492 }
493 reply.writeNoException();
494 return true;
495 }
496
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800497 case ATTACH_APPLICATION_TRANSACTION: {
498 data.enforceInterface(IActivityManager.descriptor);
499 IApplicationThread app = ApplicationThreadNative.asInterface(
500 data.readStrongBinder());
501 if (app != null) {
502 attachApplication(app);
503 }
504 reply.writeNoException();
505 return true;
506 }
507
508 case ACTIVITY_IDLE_TRANSACTION: {
509 data.enforceInterface(IActivityManager.descriptor);
510 IBinder token = data.readStrongBinder();
Dianne Hackborne88846e2009-09-30 21:34:25 -0700511 Configuration config = null;
512 if (data.readInt() != 0) {
513 config = Configuration.CREATOR.createFromParcel(data);
514 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700515 boolean stopProfiling = data.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800516 if (token != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700517 activityIdle(token, config, stopProfiling);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800518 }
519 reply.writeNoException();
520 return true;
521 }
522
Dianne Hackbornad9b32112012-09-17 15:35:01 -0700523 case ACTIVITY_RESUMED_TRANSACTION: {
524 data.enforceInterface(IActivityManager.descriptor);
525 IBinder token = data.readStrongBinder();
526 activityResumed(token);
527 reply.writeNoException();
528 return true;
529 }
530
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800531 case ACTIVITY_PAUSED_TRANSACTION: {
532 data.enforceInterface(IActivityManager.descriptor);
533 IBinder token = data.readStrongBinder();
Dianne Hackborna4e102e2014-09-04 22:52:27 -0700534 activityPaused(token);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800535 reply.writeNoException();
536 return true;
537 }
538
539 case ACTIVITY_STOPPED_TRANSACTION: {
540 data.enforceInterface(IActivityManager.descriptor);
541 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800542 Bundle map = data.readBundle();
Craig Mautnera0026042014-04-23 11:45:37 -0700543 PersistableBundle persistentState = data.readPersistableBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800544 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
Craig Mautnera0026042014-04-23 11:45:37 -0700545 activityStopped(token, map, persistentState, description);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800546 reply.writeNoException();
547 return true;
548 }
549
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800550 case ACTIVITY_SLEPT_TRANSACTION: {
551 data.enforceInterface(IActivityManager.descriptor);
552 IBinder token = data.readStrongBinder();
553 activitySlept(token);
554 reply.writeNoException();
555 return true;
556 }
557
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800558 case ACTIVITY_DESTROYED_TRANSACTION: {
559 data.enforceInterface(IActivityManager.descriptor);
560 IBinder token = data.readStrongBinder();
561 activityDestroyed(token);
562 reply.writeNoException();
563 return true;
564 }
565
566 case GET_CALLING_PACKAGE_TRANSACTION: {
567 data.enforceInterface(IActivityManager.descriptor);
568 IBinder token = data.readStrongBinder();
569 String res = token != null ? getCallingPackage(token) : null;
570 reply.writeNoException();
571 reply.writeString(res);
572 return true;
573 }
574
575 case GET_CALLING_ACTIVITY_TRANSACTION: {
576 data.enforceInterface(IActivityManager.descriptor);
577 IBinder token = data.readStrongBinder();
578 ComponentName cn = getCallingActivity(token);
579 reply.writeNoException();
580 ComponentName.writeToParcel(cn, reply);
581 return true;
582 }
583
Winson Chung1147c402014-05-14 11:05:00 -0700584 case GET_APP_TASKS_TRANSACTION: {
585 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -0700586 String callingPackage = data.readString();
587 List<IAppTask> list = getAppTasks(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -0700588 reply.writeNoException();
589 int N = list != null ? list.size() : -1;
590 reply.writeInt(N);
591 int i;
592 for (i=0; i<N; i++) {
593 IAppTask task = list.get(i);
594 reply.writeStrongBinder(task.asBinder());
595 }
596 return true;
597 }
598
Dianne Hackbornaec68bb2014-08-20 15:25:13 -0700599 case ADD_APP_TASK_TRANSACTION: {
600 data.enforceInterface(IActivityManager.descriptor);
601 IBinder activityToken = data.readStrongBinder();
602 Intent intent = Intent.CREATOR.createFromParcel(data);
603 ActivityManager.TaskDescription descr
604 = ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
605 Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data);
606 int res = addAppTask(activityToken, intent, descr, thumbnail);
607 reply.writeNoException();
608 reply.writeInt(res);
609 return true;
610 }
611
612 case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: {
613 data.enforceInterface(IActivityManager.descriptor);
614 Point size = getAppTaskThumbnailSize();
615 reply.writeNoException();
616 size.writeToParcel(reply, 0);
617 return true;
618 }
619
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800620 case GET_TASKS_TRANSACTION: {
621 data.enforceInterface(IActivityManager.descriptor);
622 int maxNum = data.readInt();
623 int fl = data.readInt();
Dianne Hackborn09233282014-04-30 11:33:59 -0700624 List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800625 reply.writeNoException();
626 int N = list != null ? list.size() : -1;
627 reply.writeInt(N);
628 int i;
629 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700630 ActivityManager.RunningTaskInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800631 info.writeToParcel(reply, 0);
632 }
633 return true;
634 }
635
636 case GET_RECENT_TASKS_TRANSACTION: {
637 data.enforceInterface(IActivityManager.descriptor);
638 int maxNum = data.readInt();
639 int fl = data.readInt();
Amith Yamasani82644082012-08-03 13:09:11 -0700640 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800641 List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -0700642 fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800643 reply.writeNoException();
644 reply.writeTypedList(list);
645 return true;
646 }
Dianne Hackborn15491c62012-09-19 10:59:14 -0700647
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700648 case GET_TASK_THUMBNAIL_TRANSACTION: {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800649 data.enforceInterface(IActivityManager.descriptor);
650 int id = data.readInt();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700651 ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id);
Dianne Hackbornd94df452011-02-16 18:53:31 -0800652 reply.writeNoException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700653 if (taskThumbnail != null) {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800654 reply.writeInt(1);
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700655 taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn15491c62012-09-19 10:59:14 -0700656 } else {
657 reply.writeInt(0);
658 }
659 return true;
660 }
661
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800662 case GET_SERVICES_TRANSACTION: {
663 data.enforceInterface(IActivityManager.descriptor);
664 int maxNum = data.readInt();
665 int fl = data.readInt();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700666 List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800667 reply.writeNoException();
668 int N = list != null ? list.size() : -1;
669 reply.writeInt(N);
670 int i;
671 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700672 ActivityManager.RunningServiceInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800673 info.writeToParcel(reply, 0);
674 }
675 return true;
676 }
677
678 case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: {
679 data.enforceInterface(IActivityManager.descriptor);
680 List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState();
681 reply.writeNoException();
682 reply.writeTypedList(list);
683 return true;
684 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700685
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800686 case GET_RUNNING_APP_PROCESSES_TRANSACTION: {
687 data.enforceInterface(IActivityManager.descriptor);
688 List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses();
689 reply.writeNoException();
690 reply.writeTypedList(list);
691 return true;
692 }
693
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -0700694 case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: {
695 data.enforceInterface(IActivityManager.descriptor);
696 List<ApplicationInfo> list = getRunningExternalApplications();
697 reply.writeNoException();
698 reply.writeTypedList(list);
699 return true;
700 }
701
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800702 case MOVE_TASK_TO_FRONT_TRANSACTION: {
703 data.enforceInterface(IActivityManager.descriptor);
704 int task = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800705 int fl = data.readInt();
Dianne Hackborn8078d8c2012-03-20 11:11:26 -0700706 Bundle options = data.readInt() != 0
707 ? Bundle.CREATOR.createFromParcel(data) : null;
708 moveTaskToFront(task, fl, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800709 reply.writeNoException();
710 return true;
711 }
712
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800713 case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: {
714 data.enforceInterface(IActivityManager.descriptor);
715 IBinder token = data.readStrongBinder();
716 boolean nonRoot = data.readInt() != 0;
717 boolean res = moveActivityTaskToBack(token, nonRoot);
718 reply.writeNoException();
719 reply.writeInt(res ? 1 : 0);
720 return true;
721 }
722
723 case MOVE_TASK_BACKWARDS_TRANSACTION: {
724 data.enforceInterface(IActivityManager.descriptor);
725 int task = data.readInt();
726 moveTaskBackwards(task);
727 reply.writeNoException();
728 return true;
729 }
730
Craig Mautnerc00204b2013-03-05 15:02:14 -0800731 case MOVE_TASK_TO_STACK_TRANSACTION: {
732 data.enforceInterface(IActivityManager.descriptor);
733 int taskId = data.readInt();
734 int stackId = data.readInt();
735 boolean toTop = data.readInt() != 0;
736 moveTaskToStack(taskId, stackId, toTop);
737 reply.writeNoException();
738 return true;
739 }
740
741 case RESIZE_STACK_TRANSACTION: {
742 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800743 int stackId = data.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800744 Rect r = Rect.CREATOR.createFromParcel(data);
745 resizeStack(stackId, r);
Craig Mautnerc00204b2013-03-05 15:02:14 -0800746 reply.writeNoException();
747 return true;
748 }
749
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800750 case GET_ALL_STACK_INFOS_TRANSACTION: {
Craig Mautner5ff12102013-05-24 12:50:15 -0700751 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800752 List<StackInfo> list = getAllStackInfos();
Craig Mautner5ff12102013-05-24 12:50:15 -0700753 reply.writeNoException();
754 reply.writeTypedList(list);
755 return true;
756 }
757
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800758 case GET_STACK_INFO_TRANSACTION: {
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700759 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800760 int stackId = data.readInt();
761 StackInfo info = getStackInfo(stackId);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700762 reply.writeNoException();
763 if (info != null) {
764 reply.writeInt(1);
765 info.writeToParcel(reply, 0);
766 } else {
767 reply.writeInt(0);
768 }
769 return true;
770 }
771
Winson Chung303e1ff2014-03-07 15:06:19 -0800772 case IS_IN_HOME_STACK_TRANSACTION: {
773 data.enforceInterface(IActivityManager.descriptor);
774 int taskId = data.readInt();
775 boolean isInHomeStack = isInHomeStack(taskId);
776 reply.writeNoException();
777 reply.writeInt(isInHomeStack ? 1 : 0);
778 return true;
779 }
780
Craig Mautnercf910b02013-04-23 11:23:27 -0700781 case SET_FOCUSED_STACK_TRANSACTION: {
782 data.enforceInterface(IActivityManager.descriptor);
783 int stackId = data.readInt();
784 setFocusedStack(stackId);
785 reply.writeNoException();
786 return true;
787 }
788
Winson Chungd16c5652015-01-26 16:11:07 -0800789 case GET_FOCUSED_STACK_ID_TRANSACTION: {
790 data.enforceInterface(IActivityManager.descriptor);
791 int focusedStackId = getFocusedStackId();
792 reply.writeNoException();
793 reply.writeInt(focusedStackId);
794 return true;
795 }
796
Winson Chung740c3ac2014-11-12 16:14:38 -0800797 case REGISTER_TASK_STACK_LISTENER_TRANSACTION: {
798 data.enforceInterface(IActivityManager.descriptor);
799 IBinder token = data.readStrongBinder();
800 registerTaskStackListener(ITaskStackListener.Stub.asInterface(token));
801 reply.writeNoException();
802 return true;
803 }
804
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800805 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
806 data.enforceInterface(IActivityManager.descriptor);
807 IBinder token = data.readStrongBinder();
808 boolean onlyRoot = data.readInt() != 0;
809 int res = token != null
810 ? getTaskForActivity(token, onlyRoot) : -1;
811 reply.writeNoException();
812 reply.writeInt(res);
813 return true;
814 }
815
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800816 case GET_CONTENT_PROVIDER_TRANSACTION: {
817 data.enforceInterface(IActivityManager.descriptor);
818 IBinder b = data.readStrongBinder();
819 IApplicationThread app = ApplicationThreadNative.asInterface(b);
820 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700821 int userId = data.readInt();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700822 boolean stable = data.readInt() != 0;
Jeff Sharkey6d515712012-09-20 16:06:08 -0700823 ContentProviderHolder cph = getContentProvider(app, name, userId, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800824 reply.writeNoException();
825 if (cph != null) {
826 reply.writeInt(1);
827 cph.writeToParcel(reply, 0);
828 } else {
829 reply.writeInt(0);
830 }
831 return true;
832 }
833
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800834 case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
835 data.enforceInterface(IActivityManager.descriptor);
836 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700837 int userId = data.readInt();
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800838 IBinder token = data.readStrongBinder();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700839 ContentProviderHolder cph = getContentProviderExternal(name, userId, token);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800840 reply.writeNoException();
841 if (cph != null) {
842 reply.writeInt(1);
843 cph.writeToParcel(reply, 0);
844 } else {
845 reply.writeInt(0);
846 }
847 return true;
848 }
849
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800850 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
851 data.enforceInterface(IActivityManager.descriptor);
852 IBinder b = data.readStrongBinder();
853 IApplicationThread app = ApplicationThreadNative.asInterface(b);
854 ArrayList<ContentProviderHolder> providers =
855 data.createTypedArrayList(ContentProviderHolder.CREATOR);
856 publishContentProviders(app, providers);
857 reply.writeNoException();
858 return true;
859 }
860
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700861 case REF_CONTENT_PROVIDER_TRANSACTION: {
862 data.enforceInterface(IActivityManager.descriptor);
863 IBinder b = data.readStrongBinder();
864 int stable = data.readInt();
865 int unstable = data.readInt();
866 boolean res = refContentProvider(b, stable, unstable);
867 reply.writeNoException();
868 reply.writeInt(res ? 1 : 0);
869 return true;
870 }
871
872 case UNSTABLE_PROVIDER_DIED_TRANSACTION: {
873 data.enforceInterface(IActivityManager.descriptor);
874 IBinder b = data.readStrongBinder();
875 unstableProviderDied(b);
876 reply.writeNoException();
877 return true;
878 }
879
Jeff Sharkey7aa76012013-09-30 14:26:27 -0700880 case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: {
881 data.enforceInterface(IActivityManager.descriptor);
882 IBinder b = data.readStrongBinder();
883 appNotRespondingViaProvider(b);
884 reply.writeNoException();
885 return true;
886 }
887
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800888 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
889 data.enforceInterface(IActivityManager.descriptor);
890 IBinder b = data.readStrongBinder();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700891 boolean stable = data.readInt() != 0;
892 removeContentProvider(b, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800893 reply.writeNoException();
894 return true;
895 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800896
897 case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
898 data.enforceInterface(IActivityManager.descriptor);
899 String name = data.readString();
900 IBinder token = data.readStrongBinder();
901 removeContentProviderExternal(name, token);
902 reply.writeNoException();
903 return true;
904 }
905
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700906 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
907 data.enforceInterface(IActivityManager.descriptor);
908 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
909 PendingIntent pi = getRunningServiceControlPanel(comp);
910 reply.writeNoException();
911 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
912 return true;
913 }
914
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800915 case START_SERVICE_TRANSACTION: {
916 data.enforceInterface(IActivityManager.descriptor);
917 IBinder b = data.readStrongBinder();
918 IApplicationThread app = ApplicationThreadNative.asInterface(b);
919 Intent service = Intent.CREATOR.createFromParcel(data);
920 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700921 int userId = data.readInt();
922 ComponentName cn = startService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800923 reply.writeNoException();
924 ComponentName.writeToParcel(cn, reply);
925 return true;
926 }
927
928 case STOP_SERVICE_TRANSACTION: {
929 data.enforceInterface(IActivityManager.descriptor);
930 IBinder b = data.readStrongBinder();
931 IApplicationThread app = ApplicationThreadNative.asInterface(b);
932 Intent service = Intent.CREATOR.createFromParcel(data);
933 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700934 int userId = data.readInt();
935 int res = stopService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800936 reply.writeNoException();
937 reply.writeInt(res);
938 return true;
939 }
940
941 case STOP_SERVICE_TOKEN_TRANSACTION: {
942 data.enforceInterface(IActivityManager.descriptor);
943 ComponentName className = ComponentName.readFromParcel(data);
944 IBinder token = data.readStrongBinder();
945 int startId = data.readInt();
946 boolean res = stopServiceToken(className, token, startId);
947 reply.writeNoException();
948 reply.writeInt(res ? 1 : 0);
949 return true;
950 }
951
952 case SET_SERVICE_FOREGROUND_TRANSACTION: {
953 data.enforceInterface(IActivityManager.descriptor);
954 ComponentName className = ComponentName.readFromParcel(data);
955 IBinder token = data.readStrongBinder();
Dianne Hackbornd8a43f62009-08-17 23:33:56 -0700956 int id = data.readInt();
957 Notification notification = null;
958 if (data.readInt() != 0) {
959 notification = Notification.CREATOR.createFromParcel(data);
960 }
961 boolean removeNotification = data.readInt() != 0;
962 setServiceForeground(className, token, id, notification, removeNotification);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800963 reply.writeNoException();
964 return true;
965 }
966
967 case BIND_SERVICE_TRANSACTION: {
968 data.enforceInterface(IActivityManager.descriptor);
969 IBinder b = data.readStrongBinder();
970 IApplicationThread app = ApplicationThreadNative.asInterface(b);
971 IBinder token = data.readStrongBinder();
972 Intent service = Intent.CREATOR.createFromParcel(data);
973 String resolvedType = data.readString();
974 b = data.readStrongBinder();
975 int fl = data.readInt();
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800976 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800977 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800978 int res = bindService(app, token, service, resolvedType, conn, fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800979 reply.writeNoException();
980 reply.writeInt(res);
981 return true;
982 }
983
984 case UNBIND_SERVICE_TRANSACTION: {
985 data.enforceInterface(IActivityManager.descriptor);
986 IBinder b = data.readStrongBinder();
987 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
988 boolean res = unbindService(conn);
989 reply.writeNoException();
990 reply.writeInt(res ? 1 : 0);
991 return true;
992 }
993
994 case PUBLISH_SERVICE_TRANSACTION: {
995 data.enforceInterface(IActivityManager.descriptor);
996 IBinder token = data.readStrongBinder();
997 Intent intent = Intent.CREATOR.createFromParcel(data);
998 IBinder service = data.readStrongBinder();
999 publishService(token, intent, service);
1000 reply.writeNoException();
1001 return true;
1002 }
1003
1004 case UNBIND_FINISHED_TRANSACTION: {
1005 data.enforceInterface(IActivityManager.descriptor);
1006 IBinder token = data.readStrongBinder();
1007 Intent intent = Intent.CREATOR.createFromParcel(data);
1008 boolean doRebind = data.readInt() != 0;
1009 unbindFinished(token, intent, doRebind);
1010 reply.writeNoException();
1011 return true;
1012 }
1013
1014 case SERVICE_DONE_EXECUTING_TRANSACTION: {
1015 data.enforceInterface(IActivityManager.descriptor);
1016 IBinder token = data.readStrongBinder();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07001017 int type = data.readInt();
1018 int startId = data.readInt();
1019 int res = data.readInt();
1020 serviceDoneExecuting(token, type, startId, res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001021 reply.writeNoException();
1022 return true;
1023 }
1024
1025 case START_INSTRUMENTATION_TRANSACTION: {
1026 data.enforceInterface(IActivityManager.descriptor);
1027 ComponentName className = ComponentName.readFromParcel(data);
1028 String profileFile = data.readString();
1029 int fl = data.readInt();
1030 Bundle arguments = data.readBundle();
1031 IBinder b = data.readStrongBinder();
1032 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08001033 b = data.readStrongBinder();
1034 IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001035 int userId = data.readInt();
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01001036 String abiOverride = data.readString();
1037 boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId,
1038 abiOverride);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001039 reply.writeNoException();
1040 reply.writeInt(res ? 1 : 0);
1041 return true;
1042 }
1043
1044
1045 case FINISH_INSTRUMENTATION_TRANSACTION: {
1046 data.enforceInterface(IActivityManager.descriptor);
1047 IBinder b = data.readStrongBinder();
1048 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1049 int resultCode = data.readInt();
1050 Bundle results = data.readBundle();
1051 finishInstrumentation(app, resultCode, results);
1052 reply.writeNoException();
1053 return true;
1054 }
1055
1056 case GET_CONFIGURATION_TRANSACTION: {
1057 data.enforceInterface(IActivityManager.descriptor);
1058 Configuration config = getConfiguration();
1059 reply.writeNoException();
1060 config.writeToParcel(reply, 0);
1061 return true;
1062 }
1063
1064 case UPDATE_CONFIGURATION_TRANSACTION: {
1065 data.enforceInterface(IActivityManager.descriptor);
1066 Configuration config = Configuration.CREATOR.createFromParcel(data);
1067 updateConfiguration(config);
1068 reply.writeNoException();
1069 return true;
1070 }
1071
1072 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
1073 data.enforceInterface(IActivityManager.descriptor);
1074 IBinder token = data.readStrongBinder();
1075 int requestedOrientation = data.readInt();
1076 setRequestedOrientation(token, requestedOrientation);
1077 reply.writeNoException();
1078 return true;
1079 }
1080
1081 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
1082 data.enforceInterface(IActivityManager.descriptor);
1083 IBinder token = data.readStrongBinder();
1084 int req = getRequestedOrientation(token);
1085 reply.writeNoException();
1086 reply.writeInt(req);
1087 return true;
1088 }
1089
1090 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
1091 data.enforceInterface(IActivityManager.descriptor);
1092 IBinder token = data.readStrongBinder();
1093 ComponentName cn = getActivityClassForToken(token);
1094 reply.writeNoException();
1095 ComponentName.writeToParcel(cn, reply);
1096 return true;
1097 }
1098
1099 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
1100 data.enforceInterface(IActivityManager.descriptor);
1101 IBinder token = data.readStrongBinder();
1102 reply.writeNoException();
1103 reply.writeString(getPackageForToken(token));
1104 return true;
1105 }
1106
1107 case GET_INTENT_SENDER_TRANSACTION: {
1108 data.enforceInterface(IActivityManager.descriptor);
1109 int type = data.readInt();
1110 String packageName = data.readString();
1111 IBinder token = data.readStrongBinder();
1112 String resultWho = data.readString();
1113 int requestCode = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001114 Intent[] requestIntents;
1115 String[] requestResolvedTypes;
1116 if (data.readInt() != 0) {
1117 requestIntents = data.createTypedArray(Intent.CREATOR);
1118 requestResolvedTypes = data.createStringArray();
1119 } else {
1120 requestIntents = null;
1121 requestResolvedTypes = null;
1122 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001123 int fl = data.readInt();
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07001124 Bundle options = data.readInt() != 0
1125 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -07001126 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001127 IIntentSender res = getIntentSender(type, packageName, token,
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001128 resultWho, requestCode, requestIntents,
Dianne Hackborn41203752012-08-31 14:05:51 -07001129 requestResolvedTypes, fl, options, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001130 reply.writeNoException();
1131 reply.writeStrongBinder(res != null ? res.asBinder() : null);
1132 return true;
1133 }
1134
1135 case CANCEL_INTENT_SENDER_TRANSACTION: {
1136 data.enforceInterface(IActivityManager.descriptor);
1137 IIntentSender r = IIntentSender.Stub.asInterface(
1138 data.readStrongBinder());
1139 cancelIntentSender(r);
1140 reply.writeNoException();
1141 return true;
1142 }
1143
1144 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
1145 data.enforceInterface(IActivityManager.descriptor);
1146 IIntentSender r = IIntentSender.Stub.asInterface(
1147 data.readStrongBinder());
1148 String res = getPackageForIntentSender(r);
1149 reply.writeNoException();
1150 reply.writeString(res);
1151 return true;
1152 }
1153
Christopher Tatec4a07d12012-04-06 14:19:13 -07001154 case GET_UID_FOR_INTENT_SENDER_TRANSACTION: {
1155 data.enforceInterface(IActivityManager.descriptor);
1156 IIntentSender r = IIntentSender.Stub.asInterface(
1157 data.readStrongBinder());
1158 int res = getUidForIntentSender(r);
1159 reply.writeNoException();
1160 reply.writeInt(res);
1161 return true;
1162 }
1163
Dianne Hackborn41203752012-08-31 14:05:51 -07001164 case HANDLE_INCOMING_USER_TRANSACTION: {
1165 data.enforceInterface(IActivityManager.descriptor);
1166 int callingPid = data.readInt();
1167 int callingUid = data.readInt();
1168 int userId = data.readInt();
1169 boolean allowAll = data.readInt() != 0 ;
1170 boolean requireFull = data.readInt() != 0;
1171 String name = data.readString();
1172 String callerPackage = data.readString();
1173 int res = handleIncomingUser(callingPid, callingUid, userId, allowAll,
1174 requireFull, name, callerPackage);
1175 reply.writeNoException();
1176 reply.writeInt(res);
1177 return true;
1178 }
1179
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001180 case SET_PROCESS_LIMIT_TRANSACTION: {
1181 data.enforceInterface(IActivityManager.descriptor);
1182 int max = data.readInt();
1183 setProcessLimit(max);
1184 reply.writeNoException();
1185 return true;
1186 }
1187
1188 case GET_PROCESS_LIMIT_TRANSACTION: {
1189 data.enforceInterface(IActivityManager.descriptor);
1190 int limit = getProcessLimit();
1191 reply.writeNoException();
1192 reply.writeInt(limit);
1193 return true;
1194 }
1195
1196 case SET_PROCESS_FOREGROUND_TRANSACTION: {
1197 data.enforceInterface(IActivityManager.descriptor);
1198 IBinder token = data.readStrongBinder();
1199 int pid = data.readInt();
1200 boolean isForeground = data.readInt() != 0;
1201 setProcessForeground(token, pid, isForeground);
1202 reply.writeNoException();
1203 return true;
1204 }
1205
1206 case CHECK_PERMISSION_TRANSACTION: {
1207 data.enforceInterface(IActivityManager.descriptor);
1208 String perm = data.readString();
1209 int pid = data.readInt();
1210 int uid = data.readInt();
1211 int res = checkPermission(perm, pid, uid);
1212 reply.writeNoException();
1213 reply.writeInt(res);
1214 return true;
1215 }
1216
Dianne Hackbornff170242014-11-19 10:59:01 -08001217 case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: {
1218 data.enforceInterface(IActivityManager.descriptor);
1219 String perm = data.readString();
1220 int pid = data.readInt();
1221 int uid = data.readInt();
1222 IBinder token = data.readStrongBinder();
1223 int res = checkPermissionWithToken(perm, pid, uid, token);
1224 reply.writeNoException();
1225 reply.writeInt(res);
1226 return true;
1227 }
1228
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001229 case CHECK_URI_PERMISSION_TRANSACTION: {
1230 data.enforceInterface(IActivityManager.descriptor);
1231 Uri uri = Uri.CREATOR.createFromParcel(data);
1232 int pid = data.readInt();
1233 int uid = data.readInt();
1234 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001235 int userId = data.readInt();
Dianne Hackbornff170242014-11-19 10:59:01 -08001236 IBinder callerToken = data.readStrongBinder();
1237 int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001238 reply.writeNoException();
1239 reply.writeInt(res);
1240 return true;
1241 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001242
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001243 case CLEAR_APP_DATA_TRANSACTION: {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001244 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001245 String packageName = data.readString();
1246 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
1247 data.readStrongBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -07001248 int userId = data.readInt();
1249 boolean res = clearApplicationUserData(packageName, observer, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001250 reply.writeNoException();
1251 reply.writeInt(res ? 1 : 0);
1252 return true;
1253 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001254
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001255 case GRANT_URI_PERMISSION_TRANSACTION: {
1256 data.enforceInterface(IActivityManager.descriptor);
1257 IBinder b = data.readStrongBinder();
1258 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1259 String targetPkg = data.readString();
1260 Uri uri = Uri.CREATOR.createFromParcel(data);
1261 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001262 int userId = data.readInt();
1263 grantUriPermission(app, targetPkg, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001264 reply.writeNoException();
1265 return true;
1266 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001267
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001268 case REVOKE_URI_PERMISSION_TRANSACTION: {
1269 data.enforceInterface(IActivityManager.descriptor);
1270 IBinder b = data.readStrongBinder();
1271 IApplicationThread app = ApplicationThreadNative.asInterface(b);
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 revokeUriPermission(app, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001276 reply.writeNoException();
1277 return true;
1278 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001279
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001280 case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1281 data.enforceInterface(IActivityManager.descriptor);
1282 Uri uri = Uri.CREATOR.createFromParcel(data);
1283 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001284 int userId = data.readInt();
1285 takePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001286 reply.writeNoException();
1287 return true;
1288 }
1289
1290 case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1291 data.enforceInterface(IActivityManager.descriptor);
1292 Uri uri = Uri.CREATOR.createFromParcel(data);
1293 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001294 int userId = data.readInt();
1295 releasePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001296 reply.writeNoException();
1297 return true;
1298 }
1299
1300 case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: {
1301 data.enforceInterface(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07001302 final String packageName = data.readString();
1303 final boolean incoming = data.readInt() != 0;
1304 final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions(
1305 packageName, incoming);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001306 reply.writeNoException();
1307 perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1308 return true;
1309 }
1310
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001311 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
1312 data.enforceInterface(IActivityManager.descriptor);
1313 IBinder b = data.readStrongBinder();
1314 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1315 boolean waiting = data.readInt() != 0;
1316 showWaitingForDebugger(app, waiting);
1317 reply.writeNoException();
1318 return true;
1319 }
1320
1321 case GET_MEMORY_INFO_TRANSACTION: {
1322 data.enforceInterface(IActivityManager.descriptor);
1323 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
1324 getMemoryInfo(mi);
1325 reply.writeNoException();
1326 mi.writeToParcel(reply, 0);
1327 return true;
1328 }
1329
1330 case UNHANDLED_BACK_TRANSACTION: {
1331 data.enforceInterface(IActivityManager.descriptor);
1332 unhandledBack();
1333 reply.writeNoException();
1334 return true;
1335 }
1336
1337 case OPEN_CONTENT_URI_TRANSACTION: {
1338 data.enforceInterface(IActivityManager.descriptor);
1339 Uri uri = Uri.parse(data.readString());
1340 ParcelFileDescriptor pfd = openContentUri(uri);
1341 reply.writeNoException();
1342 if (pfd != null) {
1343 reply.writeInt(1);
1344 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1345 } else {
1346 reply.writeInt(0);
1347 }
1348 return true;
1349 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001350
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001351 case SET_LOCK_SCREEN_SHOWN_TRANSACTION: {
1352 data.enforceInterface(IActivityManager.descriptor);
1353 setLockScreenShown(data.readInt() != 0);
1354 reply.writeNoException();
1355 return true;
1356 }
1357
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001358 case SET_DEBUG_APP_TRANSACTION: {
1359 data.enforceInterface(IActivityManager.descriptor);
1360 String pn = data.readString();
1361 boolean wfd = data.readInt() != 0;
1362 boolean per = data.readInt() != 0;
1363 setDebugApp(pn, wfd, per);
1364 reply.writeNoException();
1365 return true;
1366 }
1367
1368 case SET_ALWAYS_FINISH_TRANSACTION: {
1369 data.enforceInterface(IActivityManager.descriptor);
1370 boolean enabled = data.readInt() != 0;
1371 setAlwaysFinish(enabled);
1372 reply.writeNoException();
1373 return true;
1374 }
1375
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001376 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001377 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001378 IActivityController watcher = IActivityController.Stub.asInterface(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001379 data.readStrongBinder());
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001380 setActivityController(watcher);
Sungmin Choicdb86bb2012-12-20 14:08:59 +09001381 reply.writeNoException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001382 return true;
1383 }
1384
1385 case ENTER_SAFE_MODE_TRANSACTION: {
1386 data.enforceInterface(IActivityManager.descriptor);
1387 enterSafeMode();
1388 reply.writeNoException();
1389 return true;
1390 }
1391
1392 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1393 data.enforceInterface(IActivityManager.descriptor);
1394 IIntentSender is = IIntentSender.Stub.asInterface(
1395 data.readStrongBinder());
Dianne Hackborn099bc622014-01-22 13:39:16 -08001396 int sourceUid = data.readInt();
1397 String sourcePkg = data.readString();
Dianne Hackborn1e383822015-04-10 14:02:33 -07001398 String tag = data.readString();
1399 noteWakeupAlarm(is, sourceUid, sourcePkg, tag);
1400 reply.writeNoException();
1401 return true;
1402 }
1403
1404 case NOTE_ALARM_START_TRANSACTION: {
1405 data.enforceInterface(IActivityManager.descriptor);
1406 IIntentSender is = IIntentSender.Stub.asInterface(
1407 data.readStrongBinder());
1408 int sourceUid = data.readInt();
1409 String tag = data.readString();
1410 noteAlarmStart(is, sourceUid, tag);
1411 reply.writeNoException();
1412 return true;
1413 }
1414
1415 case NOTE_ALARM_FINISH_TRANSACTION: {
1416 data.enforceInterface(IActivityManager.descriptor);
1417 IIntentSender is = IIntentSender.Stub.asInterface(
1418 data.readStrongBinder());
1419 int sourceUid = data.readInt();
1420 String tag = data.readString();
1421 noteAlarmFinish(is, sourceUid, tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001422 reply.writeNoException();
1423 return true;
1424 }
1425
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001426 case KILL_PIDS_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001427 data.enforceInterface(IActivityManager.descriptor);
1428 int[] pids = data.createIntArray();
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001429 String reason = data.readString();
Dianne Hackborn64825172011-03-02 21:32:58 -08001430 boolean secure = data.readInt() != 0;
1431 boolean res = killPids(pids, reason, secure);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001432 reply.writeNoException();
1433 reply.writeInt(res ? 1 : 0);
1434 return true;
1435 }
1436
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07001437 case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: {
1438 data.enforceInterface(IActivityManager.descriptor);
1439 String reason = data.readString();
1440 boolean res = killProcessesBelowForeground(reason);
1441 reply.writeNoException();
1442 reply.writeInt(res ? 1 : 0);
1443 return true;
1444 }
1445
Dan Egnor60d87622009-12-16 16:32:58 -08001446 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1447 data.enforceInterface(IActivityManager.descriptor);
1448 IBinder app = data.readStrongBinder();
1449 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1450 handleApplicationCrash(app, ci);
1451 reply.writeNoException();
1452 return true;
1453 }
1454
1455 case HANDLE_APPLICATION_WTF_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001456 data.enforceInterface(IActivityManager.descriptor);
1457 IBinder app = data.readStrongBinder();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001458 String tag = data.readString();
Dianne Hackborn52322712014-08-26 22:47:26 -07001459 boolean system = data.readInt() != 0;
Dan Egnorb7f03672009-12-09 16:22:32 -08001460 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
Dianne Hackborn52322712014-08-26 22:47:26 -07001461 boolean res = handleApplicationWtf(app, tag, system, ci);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001462 reply.writeNoException();
Dan Egnor60d87622009-12-16 16:32:58 -08001463 reply.writeInt(res ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001464 return true;
1465 }
Dan Egnorb7f03672009-12-09 16:22:32 -08001466
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001467 case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: {
1468 data.enforceInterface(IActivityManager.descriptor);
1469 IBinder app = data.readStrongBinder();
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07001470 int violationMask = data.readInt();
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07001471 StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data);
1472 handleApplicationStrictModeViolation(app, violationMask, info);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001473 reply.writeNoException();
1474 return true;
1475 }
1476
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001477 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1478 data.enforceInterface(IActivityManager.descriptor);
1479 int sig = data.readInt();
1480 signalPersistentProcesses(sig);
1481 reply.writeNoException();
1482 return true;
1483 }
1484
Dianne Hackborn03abb812010-01-04 18:43:19 -08001485 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1486 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001487 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001488 int userId = data.readInt();
1489 killBackgroundProcesses(packageName, userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08001490 reply.writeNoException();
1491 return true;
1492 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08001493
1494 case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
1495 data.enforceInterface(IActivityManager.descriptor);
1496 killAllBackgroundProcesses();
1497 reply.writeNoException();
1498 return true;
1499 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001500
Dianne Hackborn03abb812010-01-04 18:43:19 -08001501 case FORCE_STOP_PACKAGE_TRANSACTION: {
1502 data.enforceInterface(IActivityManager.descriptor);
1503 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001504 int userId = data.readInt();
1505 forceStopPackage(packageName, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001506 reply.writeNoException();
1507 return true;
1508 }
Dianne Hackborn27ff9132012-03-06 14:57:58 -08001509
1510 case GET_MY_MEMORY_STATE_TRANSACTION: {
1511 data.enforceInterface(IActivityManager.descriptor);
1512 ActivityManager.RunningAppProcessInfo info =
1513 new ActivityManager.RunningAppProcessInfo();
1514 getMyMemoryState(info);
1515 reply.writeNoException();
1516 info.writeToParcel(reply, 0);
1517 return true;
1518 }
1519
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001520 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1521 data.enforceInterface(IActivityManager.descriptor);
1522 ConfigurationInfo config = getDeviceConfigurationInfo();
1523 reply.writeNoException();
1524 config.writeToParcel(reply, 0);
1525 return true;
1526 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001527
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001528 case PROFILE_CONTROL_TRANSACTION: {
1529 data.enforceInterface(IActivityManager.descriptor);
1530 String process = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001531 int userId = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001532 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001533 int profileType = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -07001534 ProfilerInfo profilerInfo = data.readInt() != 0
1535 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
1536 boolean res = profileControl(process, userId, start, profilerInfo, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001537 reply.writeNoException();
1538 reply.writeInt(res ? 1 : 0);
1539 return true;
1540 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001541
Dianne Hackborn55280a92009-05-07 15:53:46 -07001542 case SHUTDOWN_TRANSACTION: {
1543 data.enforceInterface(IActivityManager.descriptor);
1544 boolean res = shutdown(data.readInt());
1545 reply.writeNoException();
1546 reply.writeInt(res ? 1 : 0);
1547 return true;
1548 }
1549
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001550 case STOP_APP_SWITCHES_TRANSACTION: {
1551 data.enforceInterface(IActivityManager.descriptor);
1552 stopAppSwitches();
1553 reply.writeNoException();
1554 return true;
1555 }
1556
1557 case RESUME_APP_SWITCHES_TRANSACTION: {
1558 data.enforceInterface(IActivityManager.descriptor);
1559 resumeAppSwitches();
1560 reply.writeNoException();
1561 return true;
1562 }
1563
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001564 case PEEK_SERVICE_TRANSACTION: {
1565 data.enforceInterface(IActivityManager.descriptor);
1566 Intent service = Intent.CREATOR.createFromParcel(data);
1567 String resolvedType = data.readString();
1568 IBinder binder = peekService(service, resolvedType);
1569 reply.writeNoException();
1570 reply.writeStrongBinder(binder);
1571 return true;
1572 }
Christopher Tate181fafa2009-05-14 11:12:14 -07001573
1574 case START_BACKUP_AGENT_TRANSACTION: {
1575 data.enforceInterface(IActivityManager.descriptor);
1576 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1577 int backupRestoreMode = data.readInt();
1578 boolean success = bindBackupAgent(info, backupRestoreMode);
1579 reply.writeNoException();
1580 reply.writeInt(success ? 1 : 0);
1581 return true;
1582 }
1583
1584 case BACKUP_AGENT_CREATED_TRANSACTION: {
1585 data.enforceInterface(IActivityManager.descriptor);
1586 String packageName = data.readString();
1587 IBinder agent = data.readStrongBinder();
1588 backupAgentCreated(packageName, agent);
1589 reply.writeNoException();
1590 return true;
1591 }
1592
1593 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1594 data.enforceInterface(IActivityManager.descriptor);
1595 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1596 unbindBackupAgent(info);
1597 reply.writeNoException();
1598 return true;
1599 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001600
1601 case ADD_PACKAGE_DEPENDENCY_TRANSACTION: {
1602 data.enforceInterface(IActivityManager.descriptor);
1603 String packageName = data.readString();
1604 addPackageDependency(packageName);
1605 reply.writeNoException();
1606 return true;
1607 }
1608
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001609 case KILL_APPLICATION_WITH_APPID_TRANSACTION: {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001610 data.enforceInterface(IActivityManager.descriptor);
1611 String pkg = data.readString();
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001612 int appid = data.readInt();
Dianne Hackborn21d9b562013-05-28 17:46:59 -07001613 String reason = data.readString();
1614 killApplicationWithAppId(pkg, appid, reason);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001615 reply.writeNoException();
1616 return true;
1617 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001618
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001619 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1620 data.enforceInterface(IActivityManager.descriptor);
1621 String reason = data.readString();
1622 closeSystemDialogs(reason);
1623 reply.writeNoException();
1624 return true;
1625 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001626
1627 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1628 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001629 int[] pids = data.createIntArray();
1630 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001631 reply.writeNoException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001632 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001633 return true;
1634 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001635
1636 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1637 data.enforceInterface(IActivityManager.descriptor);
1638 String processName = data.readString();
1639 int uid = data.readInt();
1640 killApplicationProcess(processName, uid);
1641 reply.writeNoException();
1642 return true;
1643 }
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001644
1645 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1646 data.enforceInterface(IActivityManager.descriptor);
1647 IBinder token = data.readStrongBinder();
1648 String packageName = data.readString();
1649 int enterAnim = data.readInt();
1650 int exitAnim = data.readInt();
1651 overridePendingTransition(token, packageName, enterAnim, exitAnim);
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001652 reply.writeNoException();
1653 return true;
1654 }
1655
1656 case IS_USER_A_MONKEY_TRANSACTION: {
1657 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001658 boolean areThey = isUserAMonkey();
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001659 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001660 reply.writeInt(areThey ? 1 : 0);
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001661 return true;
1662 }
Dianne Hackborn860755f2010-06-03 18:47:52 -07001663
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07001664 case SET_USER_IS_MONKEY_TRANSACTION: {
1665 data.enforceInterface(IActivityManager.descriptor);
1666 final boolean monkey = (data.readInt() == 1);
1667 setUserIsMonkey(monkey);
1668 reply.writeNoException();
1669 return true;
1670 }
1671
Dianne Hackborn860755f2010-06-03 18:47:52 -07001672 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1673 data.enforceInterface(IActivityManager.descriptor);
1674 finishHeavyWeightApp();
1675 reply.writeNoException();
1676 return true;
1677 }
Daniel Sandler69a48172010-06-23 16:29:36 -04001678
1679 case IS_IMMERSIVE_TRANSACTION: {
1680 data.enforceInterface(IActivityManager.descriptor);
1681 IBinder token = data.readStrongBinder();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001682 boolean isit = isImmersive(token);
Daniel Sandler69a48172010-06-23 16:29:36 -04001683 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001684 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001685 return true;
1686 }
1687
Craig Mautnerd61dc202014-07-07 11:09:11 -07001688 case IS_TOP_OF_TASK_TRANSACTION: {
1689 data.enforceInterface(IActivityManager.descriptor);
1690 IBinder token = data.readStrongBinder();
1691 final boolean isTopOfTask = isTopOfTask(token);
1692 reply.writeNoException();
1693 reply.writeInt(isTopOfTask ? 1 : 0);
1694 return true;
1695 }
1696
Craig Mautner5eda9b32013-07-02 11:58:16 -07001697 case CONVERT_FROM_TRANSLUCENT_TRANSACTION: {
Craig Mautner4addfc52013-06-25 08:05:45 -07001698 data.enforceInterface(IActivityManager.descriptor);
1699 IBinder token = data.readStrongBinder();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001700 boolean converted = convertFromTranslucent(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001701 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001702 reply.writeInt(converted ? 1 : 0);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001703 return true;
1704 }
1705
1706 case CONVERT_TO_TRANSLUCENT_TRANSACTION: {
1707 data.enforceInterface(IActivityManager.descriptor);
1708 IBinder token = data.readStrongBinder();
Craig Mautner233ceee2014-05-09 17:05:11 -07001709 final Bundle bundle;
1710 if (data.readInt() == 0) {
1711 bundle = null;
1712 } else {
1713 bundle = data.readBundle();
1714 }
1715 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
1716 boolean converted = convertToTranslucent(token, options);
Craig Mautner4addfc52013-06-25 08:05:45 -07001717 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001718 reply.writeInt(converted ? 1 : 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07001719 return true;
1720 }
1721
Craig Mautner233ceee2014-05-09 17:05:11 -07001722 case GET_ACTIVITY_OPTIONS_TRANSACTION: {
1723 data.enforceInterface(IActivityManager.descriptor);
1724 IBinder token = data.readStrongBinder();
1725 final ActivityOptions options = getActivityOptions(token);
1726 reply.writeNoException();
1727 reply.writeBundle(options == null ? null : options.toBundle());
1728 return true;
1729 }
1730
Daniel Sandler69a48172010-06-23 16:29:36 -04001731 case SET_IMMERSIVE_TRANSACTION: {
1732 data.enforceInterface(IActivityManager.descriptor);
1733 IBinder token = data.readStrongBinder();
1734 boolean imm = data.readInt() == 1;
1735 setImmersive(token, imm);
1736 reply.writeNoException();
1737 return true;
1738 }
1739
1740 case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
1741 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001742 boolean isit = isTopActivityImmersive();
Daniel Sandler69a48172010-06-23 16:29:36 -04001743 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001744 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001745 return true;
1746 }
1747
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001748 case CRASH_APPLICATION_TRANSACTION: {
1749 data.enforceInterface(IActivityManager.descriptor);
1750 int uid = data.readInt();
1751 int initialPid = data.readInt();
1752 String packageName = data.readString();
1753 String message = data.readString();
1754 crashApplication(uid, initialPid, packageName, message);
1755 reply.writeNoException();
1756 return true;
1757 }
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001758
1759 case GET_PROVIDER_MIME_TYPE_TRANSACTION: {
1760 data.enforceInterface(IActivityManager.descriptor);
1761 Uri uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001762 int userId = data.readInt();
1763 String type = getProviderMimeType(uri, userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001764 reply.writeNoException();
1765 reply.writeString(type);
1766 return true;
1767 }
1768
Dianne Hackborn7e269642010-08-25 19:50:20 -07001769 case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
1770 data.enforceInterface(IActivityManager.descriptor);
1771 String name = data.readString();
1772 IBinder perm = newUriPermissionOwner(name);
1773 reply.writeNoException();
1774 reply.writeStrongBinder(perm);
1775 return true;
1776 }
1777
1778 case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1779 data.enforceInterface(IActivityManager.descriptor);
1780 IBinder owner = data.readStrongBinder();
1781 int fromUid = data.readInt();
1782 String targetPkg = data.readString();
1783 Uri uri = Uri.CREATOR.createFromParcel(data);
1784 int mode = data.readInt();
Nicolas Prevotf1939902014-06-25 09:29:02 +01001785 int sourceUserId = data.readInt();
1786 int targetUserId = data.readInt();
1787 grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId,
1788 targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001789 reply.writeNoException();
1790 return true;
1791 }
1792
1793 case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1794 data.enforceInterface(IActivityManager.descriptor);
1795 IBinder owner = data.readStrongBinder();
1796 Uri uri = null;
1797 if (data.readInt() != 0) {
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001798 uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001799 }
1800 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001801 int userId = data.readInt();
1802 revokeUriPermissionFromOwner(owner, uri, mode, userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001803 reply.writeNoException();
1804 return true;
1805 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001806
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001807 case CHECK_GRANT_URI_PERMISSION_TRANSACTION: {
1808 data.enforceInterface(IActivityManager.descriptor);
1809 int callingUid = data.readInt();
1810 String targetPkg = data.readString();
1811 Uri uri = Uri.CREATOR.createFromParcel(data);
1812 int modeFlags = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001813 int userId = data.readInt();
1814 int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001815 reply.writeNoException();
1816 reply.writeInt(res);
1817 return true;
1818 }
1819
Andy McFadden824c5102010-07-09 16:26:57 -07001820 case DUMP_HEAP_TRANSACTION: {
1821 data.enforceInterface(IActivityManager.descriptor);
1822 String process = data.readString();
Dianne Hackbornb12e1352012-09-26 11:39:20 -07001823 int userId = data.readInt();
Andy McFadden824c5102010-07-09 16:26:57 -07001824 boolean managed = data.readInt() != 0;
1825 String path = data.readString();
1826 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -07001827 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborn1676c852012-09-10 14:52:30 -07001828 boolean res = dumpHeap(process, userId, managed, path, fd);
Andy McFadden824c5102010-07-09 16:26:57 -07001829 reply.writeNoException();
1830 reply.writeInt(res ? 1 : 0);
1831 return true;
1832 }
1833
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001834 case START_ACTIVITIES_TRANSACTION:
1835 {
1836 data.enforceInterface(IActivityManager.descriptor);
1837 IBinder b = data.readStrongBinder();
1838 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001839 String callingPackage = data.readString();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001840 Intent[] intents = data.createTypedArray(Intent.CREATOR);
1841 String[] resolvedTypes = data.createStringArray();
1842 IBinder resultTo = data.readStrongBinder();
Dianne Hackborna4972e92012-03-14 10:38:05 -07001843 Bundle options = data.readInt() != 0
1844 ? Bundle.CREATOR.createFromParcel(data) : null;
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001845 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001846 int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001847 options, userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001848 reply.writeNoException();
1849 reply.writeInt(result);
1850 return true;
1851 }
1852
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001853 case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1854 {
1855 data.enforceInterface(IActivityManager.descriptor);
1856 int mode = getFrontActivityScreenCompatMode();
1857 reply.writeNoException();
1858 reply.writeInt(mode);
1859 return true;
1860 }
1861
1862 case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1863 {
1864 data.enforceInterface(IActivityManager.descriptor);
1865 int mode = data.readInt();
1866 setFrontActivityScreenCompatMode(mode);
1867 reply.writeNoException();
1868 reply.writeInt(mode);
1869 return true;
1870 }
1871
1872 case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1873 {
1874 data.enforceInterface(IActivityManager.descriptor);
1875 String pkg = data.readString();
1876 int mode = getPackageScreenCompatMode(pkg);
1877 reply.writeNoException();
1878 reply.writeInt(mode);
1879 return true;
1880 }
1881
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001882 case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1883 {
1884 data.enforceInterface(IActivityManager.descriptor);
1885 String pkg = data.readString();
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001886 int mode = data.readInt();
1887 setPackageScreenCompatMode(pkg, mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001888 reply.writeNoException();
1889 return true;
1890 }
Dianne Hackbornaa9d84c2011-05-09 19:00:59 -07001891
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001892 case SWITCH_USER_TRANSACTION: {
1893 data.enforceInterface(IActivityManager.descriptor);
1894 int userid = data.readInt();
1895 boolean result = switchUser(userid);
1896 reply.writeNoException();
1897 reply.writeInt(result ? 1 : 0);
1898 return true;
1899 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07001900
Kenny Guy08488bf2014-02-21 17:40:37 +00001901 case START_USER_IN_BACKGROUND_TRANSACTION: {
1902 data.enforceInterface(IActivityManager.descriptor);
1903 int userid = data.readInt();
1904 boolean result = startUserInBackground(userid);
1905 reply.writeNoException();
1906 reply.writeInt(result ? 1 : 0);
1907 return true;
1908 }
1909
Dianne Hackborn80a4af22012-08-27 19:18:31 -07001910 case STOP_USER_TRANSACTION: {
1911 data.enforceInterface(IActivityManager.descriptor);
1912 int userid = data.readInt();
1913 IStopUserCallback callback = IStopUserCallback.Stub.asInterface(
1914 data.readStrongBinder());
1915 int result = stopUser(userid, callback);
1916 reply.writeNoException();
1917 reply.writeInt(result);
1918 return true;
1919 }
1920
Amith Yamasani52f1d752012-03-28 18:19:29 -07001921 case GET_CURRENT_USER_TRANSACTION: {
1922 data.enforceInterface(IActivityManager.descriptor);
1923 UserInfo userInfo = getCurrentUser();
1924 reply.writeNoException();
1925 userInfo.writeToParcel(reply, 0);
1926 return true;
1927 }
1928
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001929 case IS_USER_RUNNING_TRANSACTION: {
1930 data.enforceInterface(IActivityManager.descriptor);
1931 int userid = data.readInt();
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07001932 boolean orStopping = data.readInt() != 0;
1933 boolean result = isUserRunning(userid, orStopping);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001934 reply.writeNoException();
1935 reply.writeInt(result ? 1 : 0);
1936 return true;
1937 }
1938
Dianne Hackbornc72fc672012-09-20 13:12:03 -07001939 case GET_RUNNING_USER_IDS_TRANSACTION: {
1940 data.enforceInterface(IActivityManager.descriptor);
1941 int[] result = getRunningUserIds();
1942 reply.writeNoException();
1943 reply.writeIntArray(result);
1944 return true;
1945 }
1946
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001947 case REMOVE_TASK_TRANSACTION:
1948 {
1949 data.enforceInterface(IActivityManager.descriptor);
1950 int taskId = data.readInt();
Wale Ogunwaled54b5782014-10-23 15:55:23 -07001951 boolean result = removeTask(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001952 reply.writeNoException();
1953 reply.writeInt(result ? 1 : 0);
1954 return true;
1955 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001956
Jeff Sharkeya4620792011-05-20 15:29:23 -07001957 case REGISTER_PROCESS_OBSERVER_TRANSACTION: {
1958 data.enforceInterface(IActivityManager.descriptor);
1959 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1960 data.readStrongBinder());
1961 registerProcessObserver(observer);
1962 return true;
1963 }
1964
1965 case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: {
1966 data.enforceInterface(IActivityManager.descriptor);
1967 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1968 data.readStrongBinder());
1969 unregisterProcessObserver(observer);
1970 return true;
1971 }
1972
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07001973 case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1974 {
1975 data.enforceInterface(IActivityManager.descriptor);
1976 String pkg = data.readString();
1977 boolean ask = getPackageAskScreenCompat(pkg);
1978 reply.writeNoException();
1979 reply.writeInt(ask ? 1 : 0);
1980 return true;
1981 }
1982
1983 case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1984 {
1985 data.enforceInterface(IActivityManager.descriptor);
1986 String pkg = data.readString();
1987 boolean ask = data.readInt() != 0;
1988 setPackageAskScreenCompat(pkg, ask);
1989 reply.writeNoException();
1990 return true;
1991 }
1992
Dianne Hackborn6c418d52011-06-29 14:05:33 -07001993 case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: {
1994 data.enforceInterface(IActivityManager.descriptor);
1995 IIntentSender r = IIntentSender.Stub.asInterface(
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07001996 data.readStrongBinder());
Dianne Hackborn6c418d52011-06-29 14:05:33 -07001997 boolean res = isIntentSenderTargetedToPackage(r);
1998 reply.writeNoException();
1999 reply.writeInt(res ? 1 : 0);
2000 return true;
2001 }
2002
Dianne Hackborn1927ae82012-06-22 15:21:36 -07002003 case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: {
2004 data.enforceInterface(IActivityManager.descriptor);
2005 IIntentSender r = IIntentSender.Stub.asInterface(
2006 data.readStrongBinder());
2007 boolean res = isIntentSenderAnActivity(r);
2008 reply.writeNoException();
2009 reply.writeInt(res ? 1 : 0);
2010 return true;
2011 }
2012
Dianne Hackborn81038902012-11-26 17:04:09 -08002013 case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: {
2014 data.enforceInterface(IActivityManager.descriptor);
2015 IIntentSender r = IIntentSender.Stub.asInterface(
2016 data.readStrongBinder());
2017 Intent intent = getIntentForIntentSender(r);
2018 reply.writeNoException();
2019 if (intent != null) {
2020 reply.writeInt(1);
2021 intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2022 } else {
2023 reply.writeInt(0);
2024 }
2025 return true;
2026 }
2027
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08002028 case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: {
2029 data.enforceInterface(IActivityManager.descriptor);
2030 IIntentSender r = IIntentSender.Stub.asInterface(
2031 data.readStrongBinder());
2032 String prefix = data.readString();
2033 String tag = getTagForIntentSender(r, prefix);
2034 reply.writeNoException();
2035 reply.writeString(tag);
2036 return true;
2037 }
2038
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002039 case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
2040 data.enforceInterface(IActivityManager.descriptor);
2041 Configuration config = Configuration.CREATOR.createFromParcel(data);
2042 updatePersistentConfiguration(config);
2043 reply.writeNoException();
2044 return true;
2045 }
2046
Dianne Hackbornb437e092011-08-05 17:50:29 -07002047 case GET_PROCESS_PSS_TRANSACTION: {
2048 data.enforceInterface(IActivityManager.descriptor);
2049 int[] pids = data.createIntArray();
2050 long[] pss = getProcessPss(pids);
2051 reply.writeNoException();
2052 reply.writeLongArray(pss);
2053 return true;
2054 }
2055
Dianne Hackborn661cd522011-08-22 00:26:20 -07002056 case SHOW_BOOT_MESSAGE_TRANSACTION: {
2057 data.enforceInterface(IActivityManager.descriptor);
2058 CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
2059 boolean always = data.readInt() != 0;
2060 showBootMessage(msg, always);
2061 reply.writeNoException();
2062 return true;
2063 }
2064
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002065 case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002066 data.enforceInterface(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002067 keyguardWaitingForActivityDrawn();
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002068 reply.writeNoException();
2069 return true;
2070 }
2071
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07002072 case KEYGUARD_GOING_AWAY_TRANSACTION: {
2073 data.enforceInterface(IActivityManager.descriptor);
2074 keyguardGoingAway(data.readInt() != 0, data.readInt() != 0);
2075 reply.writeNoException();
2076 return true;
2077 }
2078
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002079 case SHOULD_UP_RECREATE_TASK_TRANSACTION: {
Adam Powelldd8fab22012-03-22 17:47:27 -07002080 data.enforceInterface(IActivityManager.descriptor);
2081 IBinder token = data.readStrongBinder();
2082 String destAffinity = data.readString();
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002083 boolean res = shouldUpRecreateTask(token, destAffinity);
Adam Powelldd8fab22012-03-22 17:47:27 -07002084 reply.writeNoException();
2085 reply.writeInt(res ? 1 : 0);
2086 return true;
2087 }
2088
2089 case NAVIGATE_UP_TO_TRANSACTION: {
2090 data.enforceInterface(IActivityManager.descriptor);
2091 IBinder token = data.readStrongBinder();
2092 Intent target = Intent.CREATOR.createFromParcel(data);
2093 int resultCode = data.readInt();
2094 Intent resultData = null;
2095 if (data.readInt() != 0) {
2096 resultData = Intent.CREATOR.createFromParcel(data);
2097 }
2098 boolean res = navigateUpTo(token, target, resultCode, resultData);
2099 reply.writeNoException();
2100 reply.writeInt(res ? 1 : 0);
2101 return true;
2102 }
2103
Dianne Hackborn5320eb82012-05-18 12:05:04 -07002104 case GET_LAUNCHED_FROM_UID_TRANSACTION: {
2105 data.enforceInterface(IActivityManager.descriptor);
2106 IBinder token = data.readStrongBinder();
2107 int res = getLaunchedFromUid(token);
2108 reply.writeNoException();
2109 reply.writeInt(res);
2110 return true;
2111 }
2112
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002113 case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: {
2114 data.enforceInterface(IActivityManager.descriptor);
2115 IBinder token = data.readStrongBinder();
2116 String res = getLaunchedFromPackage(token);
2117 reply.writeNoException();
2118 reply.writeString(res);
2119 return true;
2120 }
2121
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002122 case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2123 data.enforceInterface(IActivityManager.descriptor);
2124 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2125 data.readStrongBinder());
2126 registerUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002127 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002128 return true;
2129 }
2130
2131 case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2132 data.enforceInterface(IActivityManager.descriptor);
2133 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2134 data.readStrongBinder());
2135 unregisterUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002136 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002137 return true;
2138 }
2139
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002140 case REQUEST_BUG_REPORT_TRANSACTION: {
2141 data.enforceInterface(IActivityManager.descriptor);
2142 requestBugReport();
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002143 reply.writeNoException();
2144 return true;
2145 }
2146
2147 case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: {
2148 data.enforceInterface(IActivityManager.descriptor);
2149 int pid = data.readInt();
2150 boolean aboveSystem = data.readInt() != 0;
Jeff Brownbd181bb2013-09-10 16:44:24 -07002151 String reason = data.readString();
2152 long res = inputDispatchingTimedOut(pid, aboveSystem, reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002153 reply.writeNoException();
2154 reply.writeLong(res);
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002155 return true;
2156 }
2157
Adam Skorydfc7fd72013-08-05 19:23:41 -07002158 case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002159 data.enforceInterface(IActivityManager.descriptor);
2160 int requestType = data.readInt();
Adam Skorydfc7fd72013-08-05 19:23:41 -07002161 Bundle res = getAssistContextExtras(requestType);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002162 reply.writeNoException();
2163 reply.writeBundle(res);
2164 return true;
2165 }
2166
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002167 case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
2168 data.enforceInterface(IActivityManager.descriptor);
2169 int requestType = data.readInt();
2170 IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder());
2171 requestAssistContextExtras(requestType, receiver);
2172 reply.writeNoException();
2173 return true;
2174 }
2175
Adam Skorydfc7fd72013-08-05 19:23:41 -07002176 case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002177 data.enforceInterface(IActivityManager.descriptor);
2178 IBinder token = data.readStrongBinder();
2179 Bundle extras = data.readBundle();
Adam Skory7140a252013-09-11 12:04:58 +01002180 reportAssistContextExtras(token, extras);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002181 reply.writeNoException();
2182 return true;
2183 }
2184
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002185 case LAUNCH_ASSIST_INTENT_TRANSACTION: {
2186 data.enforceInterface(IActivityManager.descriptor);
2187 Intent intent = Intent.CREATOR.createFromParcel(data);
2188 int requestType = data.readInt();
2189 String hint = data.readString();
2190 int userHandle = data.readInt();
2191 boolean res = launchAssistIntent(intent, requestType, hint, userHandle);
2192 reply.writeNoException();
2193 reply.writeInt(res ? 1 : 0);
2194 return true;
2195 }
2196
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002197 case KILL_UID_TRANSACTION: {
2198 data.enforceInterface(IActivityManager.descriptor);
2199 int uid = data.readInt();
2200 String reason = data.readString();
2201 killUid(uid, reason);
2202 reply.writeNoException();
2203 return true;
2204 }
2205
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07002206 case HANG_TRANSACTION: {
2207 data.enforceInterface(IActivityManager.descriptor);
2208 IBinder who = data.readStrongBinder();
2209 boolean allowRestart = data.readInt() != 0;
2210 hang(who, allowRestart);
2211 reply.writeNoException();
2212 return true;
2213 }
2214
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07002215 case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: {
2216 data.enforceInterface(IActivityManager.descriptor);
2217 IBinder token = data.readStrongBinder();
2218 reportActivityFullyDrawn(token);
2219 reply.writeNoException();
2220 return true;
2221 }
2222
Craig Mautner5eda9b32013-07-02 11:58:16 -07002223 case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: {
2224 data.enforceInterface(IActivityManager.descriptor);
2225 IBinder token = data.readStrongBinder();
2226 notifyActivityDrawn(token);
2227 reply.writeNoException();
2228 return true;
2229 }
Dianne Hackborn57a7f592013-07-22 18:21:32 -07002230
2231 case RESTART_TRANSACTION: {
2232 data.enforceInterface(IActivityManager.descriptor);
2233 restart();
2234 reply.writeNoException();
2235 return true;
2236 }
Jeff Sharkey08da7a12013-08-11 20:53:18 -07002237
Dianne Hackborn35f72be2013-09-16 10:57:39 -07002238 case PERFORM_IDLE_MAINTENANCE_TRANSACTION: {
2239 data.enforceInterface(IActivityManager.descriptor);
2240 performIdleMaintenance();
2241 reply.writeNoException();
2242 return true;
2243 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002244
Todd Kennedyca4d8422015-01-15 15:19:22 -08002245 case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: {
Craig Mautner4a1cb222013-12-04 16:14:06 -08002246 data.enforceInterface(IActivityManager.descriptor);
2247 IBinder parentActivityToken = data.readStrongBinder();
2248 IActivityContainerCallback callback =
Craig Mautnere3a00d72014-04-16 08:31:19 -07002249 IActivityContainerCallback.Stub.asInterface(data.readStrongBinder());
Craig Mautner4a1cb222013-12-04 16:14:06 -08002250 IActivityContainer activityContainer =
Todd Kennedyca4d8422015-01-15 15:19:22 -08002251 createVirtualActivityContainer(parentActivityToken, callback);
Craig Mautner4a1cb222013-12-04 16:14:06 -08002252 reply.writeNoException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08002253 if (activityContainer != null) {
2254 reply.writeInt(1);
2255 reply.writeStrongBinder(activityContainer.asBinder());
2256 } else {
2257 reply.writeInt(0);
2258 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002259 return true;
2260 }
2261
Craig Mautner95da1082014-02-24 17:54:35 -08002262 case DELETE_ACTIVITY_CONTAINER_TRANSACTION: {
2263 data.enforceInterface(IActivityManager.descriptor);
2264 IActivityContainer activityContainer =
2265 IActivityContainer.Stub.asInterface(data.readStrongBinder());
2266 deleteActivityContainer(activityContainer);
2267 reply.writeNoException();
2268 return true;
2269 }
2270
Todd Kennedy4900bf92015-01-16 16:05:14 -08002271 case CREATE_STACK_ON_DISPLAY: {
2272 data.enforceInterface(IActivityManager.descriptor);
2273 int displayId = data.readInt();
2274 IActivityContainer activityContainer = createStackOnDisplay(displayId);
2275 reply.writeNoException();
2276 if (activityContainer != null) {
2277 reply.writeInt(1);
2278 reply.writeStrongBinder(activityContainer.asBinder());
2279 } else {
2280 reply.writeInt(0);
2281 }
2282 return true;
2283 }
2284
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002285 case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: {
Craig Mautnere0a38842013-12-16 16:14:02 -08002286 data.enforceInterface(IActivityManager.descriptor);
2287 IBinder activityToken = data.readStrongBinder();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002288 int displayId = getActivityDisplayId(activityToken);
Craig Mautnere0a38842013-12-16 16:14:02 -08002289 reply.writeNoException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002290 reply.writeInt(displayId);
Craig Mautnere0a38842013-12-16 16:14:02 -08002291 return true;
2292 }
2293
Craig Mautner4a1cb222013-12-04 16:14:06 -08002294 case GET_HOME_ACTIVITY_TOKEN_TRANSACTION: {
2295 data.enforceInterface(IActivityManager.descriptor);
2296 IBinder homeActivityToken = getHomeActivityToken();
2297 reply.writeNoException();
2298 reply.writeStrongBinder(homeActivityToken);
2299 return true;
2300 }
Craig Mautneraea74a52014-03-08 14:23:10 -08002301
2302 case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: {
2303 data.enforceInterface(IActivityManager.descriptor);
2304 final int taskId = data.readInt();
2305 startLockTaskMode(taskId);
2306 reply.writeNoException();
2307 return true;
2308 }
2309
2310 case START_LOCK_TASK_BY_TOKEN_TRANSACTION: {
2311 data.enforceInterface(IActivityManager.descriptor);
2312 IBinder token = data.readStrongBinder();
2313 startLockTaskMode(token);
2314 reply.writeNoException();
2315 return true;
2316 }
2317
Craig Mautnerd61dc202014-07-07 11:09:11 -07002318 case START_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002319 data.enforceInterface(IActivityManager.descriptor);
2320 startLockTaskModeOnCurrent();
2321 reply.writeNoException();
2322 return true;
2323 }
2324
Craig Mautneraea74a52014-03-08 14:23:10 -08002325 case STOP_LOCK_TASK_MODE_TRANSACTION: {
2326 data.enforceInterface(IActivityManager.descriptor);
2327 stopLockTaskMode();
2328 reply.writeNoException();
2329 return true;
2330 }
2331
Craig Mautnerd61dc202014-07-07 11:09:11 -07002332 case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002333 data.enforceInterface(IActivityManager.descriptor);
2334 stopLockTaskModeOnCurrent();
2335 reply.writeNoException();
2336 return true;
2337 }
2338
Craig Mautneraea74a52014-03-08 14:23:10 -08002339 case IS_IN_LOCK_TASK_MODE_TRANSACTION: {
2340 data.enforceInterface(IActivityManager.descriptor);
2341 final boolean isInLockTaskMode = isInLockTaskMode();
2342 reply.writeNoException();
2343 reply.writeInt(isInLockTaskMode ? 1 : 0);
2344 return true;
2345 }
Craig Mautner2fbd7542014-03-21 09:34:07 -07002346
Benjamin Franz43261142015-02-11 15:59:44 +00002347 case GET_LOCK_TASK_MODE_STATE_TRANSACTION: {
2348 data.enforceInterface(IActivityManager.descriptor);
2349 final int lockTaskModeState = getLockTaskModeState();
2350 reply.writeNoException();
2351 reply.writeInt(lockTaskModeState);
2352 return true;
2353 }
2354
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07002355 case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: {
2356 data.enforceInterface(IActivityManager.descriptor);
2357 final IBinder token = data.readStrongBinder();
2358 showLockTaskEscapeMessage(token);
2359 reply.writeNoException();
2360 return true;
2361 }
2362
Winson Chunga449dc02014-05-16 11:15:04 -07002363 case SET_TASK_DESCRIPTION_TRANSACTION: {
Craig Mautner2fbd7542014-03-21 09:34:07 -07002364 data.enforceInterface(IActivityManager.descriptor);
2365 IBinder token = data.readStrongBinder();
Winson Chunga449dc02014-05-16 11:15:04 -07002366 ActivityManager.TaskDescription values =
2367 ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
2368 setTaskDescription(token, values);
Craig Mautner2fbd7542014-03-21 09:34:07 -07002369 reply.writeNoException();
2370 return true;
2371 }
Craig Mautneree2e45a2014-06-27 12:10:03 -07002372
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08002373 case SET_TASK_RESIZEABLE_TRANSACTION: {
2374 data.enforceInterface(IActivityManager.descriptor);
2375 int taskId = data.readInt();
2376 boolean resizeable = (data.readInt() == 1) ? true : false;
2377 setTaskResizeable(taskId, resizeable);
2378 reply.writeNoException();
2379 return true;
2380 }
2381
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002382 case RESIZE_TASK_TRANSACTION: {
2383 data.enforceInterface(IActivityManager.descriptor);
2384 int taskId = data.readInt();
2385 Rect r = Rect.CREATOR.createFromParcel(data);
2386 resizeTask(taskId, r);
2387 reply.writeNoException();
2388 return true;
2389 }
2390
Craig Mautner648f69b2014-09-18 14:16:26 -07002391 case GET_TASK_DESCRIPTION_ICON_TRANSACTION: {
2392 data.enforceInterface(IActivityManager.descriptor);
2393 String filename = data.readString();
2394 Bitmap icon = getTaskDescriptionIcon(filename);
2395 reply.writeNoException();
2396 if (icon == null) {
2397 reply.writeInt(0);
2398 } else {
2399 reply.writeInt(1);
2400 icon.writeToParcel(reply, 0);
2401 }
2402 return true;
2403 }
2404
Winson Chung044d5292014-11-06 11:05:19 -08002405 case START_IN_PLACE_ANIMATION_TRANSACTION: {
2406 data.enforceInterface(IActivityManager.descriptor);
2407 final Bundle bundle;
2408 if (data.readInt() == 0) {
2409 bundle = null;
2410 } else {
2411 bundle = data.readBundle();
2412 }
2413 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
2414 startInPlaceAnimationOnFrontMostApplication(options);
2415 reply.writeNoException();
2416 return true;
2417 }
2418
Jose Lima4b6c6692014-08-12 17:41:12 -07002419 case REQUEST_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002420 data.enforceInterface(IActivityManager.descriptor);
2421 IBinder token = data.readStrongBinder();
2422 boolean enable = data.readInt() > 0;
Jose Lima4b6c6692014-08-12 17:41:12 -07002423 boolean success = requestVisibleBehind(token, enable);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002424 reply.writeNoException();
2425 reply.writeInt(success ? 1 : 0);
2426 return true;
2427 }
2428
Jose Lima4b6c6692014-08-12 17:41:12 -07002429 case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002430 data.enforceInterface(IActivityManager.descriptor);
2431 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002432 final boolean enabled = isBackgroundVisibleBehind(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002433 reply.writeNoException();
2434 reply.writeInt(enabled ? 1 : 0);
2435 return true;
2436 }
2437
Jose Lima4b6c6692014-08-12 17:41:12 -07002438 case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002439 data.enforceInterface(IActivityManager.descriptor);
2440 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002441 backgroundResourcesReleased(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002442 reply.writeNoException();
2443 return true;
2444 }
Craig Mautnerbb742462014-07-07 15:28:55 -07002445
2446 case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: {
2447 data.enforceInterface(IActivityManager.descriptor);
2448 IBinder token = data.readStrongBinder();
2449 notifyLaunchTaskBehindComplete(token);
2450 reply.writeNoException();
2451 return true;
2452 }
Craig Mautner8746a472014-07-24 15:12:54 -07002453
2454 case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: {
2455 data.enforceInterface(IActivityManager.descriptor);
2456 IBinder token = data.readStrongBinder();
2457 notifyEnterAnimationComplete(token);
2458 reply.writeNoException();
2459 return true;
2460 }
Craig Mautner6e2f3952014-09-09 14:26:41 -07002461
2462 case BOOT_ANIMATION_COMPLETE_TRANSACTION: {
2463 data.enforceInterface(IActivityManager.descriptor);
2464 bootAnimationComplete();
2465 reply.writeNoException();
2466 return true;
2467 }
Wale Ogunwale18795a22014-12-03 11:38:33 -08002468
2469 case SYSTEM_BACKUP_RESTORED: {
2470 data.enforceInterface(IActivityManager.descriptor);
2471 systemBackupRestored();
2472 reply.writeNoException();
2473 return true;
2474 }
Jeff Sharkeyc2ae6fb2015-01-15 21:27:13 -08002475
Jeff Sharkey605eb792014-11-04 13:34:06 -08002476 case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: {
2477 data.enforceInterface(IActivityManager.descriptor);
2478 final int uid = data.readInt();
2479 final byte[] firstPacket = data.createByteArray();
2480 notifyCleartextNetwork(uid, firstPacket);
2481 reply.writeNoException();
2482 return true;
2483 }
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002484
2485 case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: {
2486 data.enforceInterface(IActivityManager.descriptor);
2487 String procName = data.readString();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002488 int uid = data.readInt();
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002489 long maxMemSize = data.readLong();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002490 String reportPackage = data.readString();
2491 setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002492 reply.writeNoException();
2493 return true;
2494 }
2495
2496 case DUMP_HEAP_FINISHED_TRANSACTION: {
2497 data.enforceInterface(IActivityManager.descriptor);
2498 String path = data.readString();
2499 dumpHeapFinished(path);
2500 reply.writeNoException();
2501 return true;
2502 }
Dianne Hackborn3d07c942015-03-13 18:02:54 -07002503
2504 case SET_VOICE_KEEP_AWAKE_TRANSACTION: {
2505 data.enforceInterface(IActivityManager.descriptor);
2506 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
2507 data.readStrongBinder());
2508 boolean keepAwake = data.readInt() != 0;
2509 setVoiceKeepAwake(session, keepAwake);
2510 reply.writeNoException();
2511 return true;
2512 }
Craig Mautnere5600772015-04-03 21:36:37 -07002513
2514 case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: {
2515 data.enforceInterface(IActivityManager.descriptor);
2516 int userId = data.readInt();
2517 String[] packages = data.readStringArray();
2518 updateLockTaskPackages(userId, packages);
2519 reply.writeNoException();
2520 return true;
2521 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07002522
Craig Mautner015c5e52015-04-23 10:39:39 -07002523 case UPDATE_DEVICE_OWNER_TRANSACTION: {
2524 data.enforceInterface(IActivityManager.descriptor);
2525 String packageName = data.readString();
2526 updateDeviceOwner(packageName);
2527 reply.writeNoException();
2528 return true;
2529 }
2530
Julia Reynolds13c58ba2015-04-20 16:42:54 -04002531 case UPDATE_PREFERRED_SETUP_ACTIVITY_TRANSACTION: {
2532 data.enforceInterface(IActivityManager.descriptor);
2533 ComponentName preferredActivity = ComponentName.readFromParcel(data);
2534 int userId = data.readInt();
2535 updatePreferredSetupActivity(preferredActivity, userId);
2536 reply.writeNoException();
2537 return true;
2538 }
2539
Dianne Hackborn1e383822015-04-10 14:02:33 -07002540 case GET_PACKAGE_PROCESS_STATE_TRANSACTION: {
2541 data.enforceInterface(IActivityManager.descriptor);
2542 String pkg = data.readString();
2543 int res = getPackageProcessState(pkg);
2544 reply.writeNoException();
2545 reply.writeInt(res);
2546 return true;
2547 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002548 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002549
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002550 return super.onTransact(code, data, reply, flags);
2551 }
2552
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002553 public IBinder asBinder() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002554 return this;
2555 }
2556
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002557 private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
2558 protected IActivityManager create() {
2559 IBinder b = ServiceManager.getService("activity");
Joe Onorato43a17652011-04-06 19:22:23 -07002560 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002561 Log.v("ActivityManager", "default service binder = " + b);
2562 }
2563 IActivityManager am = asInterface(b);
Joe Onorato43a17652011-04-06 19:22:23 -07002564 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002565 Log.v("ActivityManager", "default service = " + am);
2566 }
2567 return am;
2568 }
2569 };
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002570}
2571
2572class ActivityManagerProxy implements IActivityManager
2573{
2574 public ActivityManagerProxy(IBinder remote)
2575 {
2576 mRemote = remote;
2577 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002578
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002579 public IBinder asBinder()
2580 {
2581 return mRemote;
2582 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002583
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002584 public int startActivity(IApplicationThread caller, String callingPackage, Intent intent,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002585 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002586 int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002587 Parcel data = Parcel.obtain();
2588 Parcel reply = Parcel.obtain();
2589 data.writeInterfaceToken(IActivityManager.descriptor);
2590 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002591 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002592 intent.writeToParcel(data, 0);
2593 data.writeString(resolvedType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002594 data.writeStrongBinder(resultTo);
2595 data.writeString(resultWho);
2596 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002597 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002598 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002599 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002600 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002601 } else {
2602 data.writeInt(0);
2603 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002604 if (options != null) {
2605 data.writeInt(1);
2606 options.writeToParcel(data, 0);
2607 } else {
2608 data.writeInt(0);
2609 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002610 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2611 reply.readException();
2612 int result = reply.readInt();
2613 reply.recycle();
2614 data.recycle();
2615 return result;
2616 }
Amith Yamasani82644082012-08-03 13:09:11 -07002617
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002618 public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent,
Amith Yamasani82644082012-08-03 13:09:11 -07002619 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002620 int startFlags, ProfilerInfo profilerInfo, Bundle options,
2621 int userId) throws RemoteException {
Amith Yamasani82644082012-08-03 13:09:11 -07002622 Parcel data = Parcel.obtain();
2623 Parcel reply = Parcel.obtain();
2624 data.writeInterfaceToken(IActivityManager.descriptor);
2625 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002626 data.writeString(callingPackage);
Amith Yamasani82644082012-08-03 13:09:11 -07002627 intent.writeToParcel(data, 0);
2628 data.writeString(resolvedType);
2629 data.writeStrongBinder(resultTo);
2630 data.writeString(resultWho);
2631 data.writeInt(requestCode);
2632 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002633 if (profilerInfo != null) {
Amith Yamasani82644082012-08-03 13:09:11 -07002634 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002635 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Amith Yamasani82644082012-08-03 13:09:11 -07002636 } else {
2637 data.writeInt(0);
2638 }
2639 if (options != null) {
2640 data.writeInt(1);
2641 options.writeToParcel(data, 0);
2642 } else {
2643 data.writeInt(0);
2644 }
2645 data.writeInt(userId);
2646 mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0);
2647 reply.readException();
2648 int result = reply.readInt();
2649 reply.recycle();
2650 data.recycle();
2651 return result;
2652 }
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002653 public int startActivityAsCaller(IApplicationThread caller, String callingPackage,
2654 Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Sharkey97978802014-10-14 10:48:18 -07002655 int startFlags, ProfilerInfo profilerInfo, Bundle options, int userId) throws RemoteException {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002656 Parcel data = Parcel.obtain();
2657 Parcel reply = Parcel.obtain();
2658 data.writeInterfaceToken(IActivityManager.descriptor);
2659 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2660 data.writeString(callingPackage);
2661 intent.writeToParcel(data, 0);
2662 data.writeString(resolvedType);
2663 data.writeStrongBinder(resultTo);
2664 data.writeString(resultWho);
2665 data.writeInt(requestCode);
2666 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002667 if (profilerInfo != null) {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002668 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002669 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002670 } else {
2671 data.writeInt(0);
2672 }
2673 if (options != null) {
2674 data.writeInt(1);
2675 options.writeToParcel(data, 0);
2676 } else {
2677 data.writeInt(0);
2678 }
Jeff Sharkey97978802014-10-14 10:48:18 -07002679 data.writeInt(userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002680 mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0);
2681 reply.readException();
2682 int result = reply.readInt();
2683 reply.recycle();
2684 data.recycle();
2685 return result;
2686 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002687 public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage,
2688 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Jeff Hao1b012d32014-08-20 10:35:34 -07002689 int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options,
2690 int userId) throws RemoteException {
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002691 Parcel data = Parcel.obtain();
2692 Parcel reply = Parcel.obtain();
2693 data.writeInterfaceToken(IActivityManager.descriptor);
2694 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002695 data.writeString(callingPackage);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002696 intent.writeToParcel(data, 0);
2697 data.writeString(resolvedType);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002698 data.writeStrongBinder(resultTo);
2699 data.writeString(resultWho);
2700 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002701 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002702 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002703 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002704 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002705 } else {
2706 data.writeInt(0);
2707 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002708 if (options != null) {
2709 data.writeInt(1);
2710 options.writeToParcel(data, 0);
2711 } else {
2712 data.writeInt(0);
2713 }
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002714 data.writeInt(userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002715 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
2716 reply.readException();
2717 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
2718 reply.recycle();
2719 data.recycle();
2720 return result;
2721 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002722 public int startActivityWithConfig(IApplicationThread caller, String callingPackage,
2723 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002724 int requestCode, int startFlags, Configuration config,
Dianne Hackborn41203752012-08-31 14:05:51 -07002725 Bundle options, int userId) throws RemoteException {
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002726 Parcel data = Parcel.obtain();
2727 Parcel reply = Parcel.obtain();
2728 data.writeInterfaceToken(IActivityManager.descriptor);
2729 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002730 data.writeString(callingPackage);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002731 intent.writeToParcel(data, 0);
2732 data.writeString(resolvedType);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002733 data.writeStrongBinder(resultTo);
2734 data.writeString(resultWho);
2735 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002736 data.writeInt(startFlags);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002737 config.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002738 if (options != null) {
2739 data.writeInt(1);
2740 options.writeToParcel(data, 0);
2741 } else {
2742 data.writeInt(0);
2743 }
Dianne Hackborn41203752012-08-31 14:05:51 -07002744 data.writeInt(userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002745 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2746 reply.readException();
2747 int result = reply.readInt();
2748 reply.recycle();
2749 data.recycle();
2750 return result;
2751 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002752 public int startActivityIntentSender(IApplicationThread caller,
2753 IntentSender intent, Intent fillInIntent, String resolvedType,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002754 IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002755 int flagsMask, int flagsValues, Bundle options) throws RemoteException {
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002756 Parcel data = Parcel.obtain();
2757 Parcel reply = Parcel.obtain();
2758 data.writeInterfaceToken(IActivityManager.descriptor);
2759 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2760 intent.writeToParcel(data, 0);
2761 if (fillInIntent != null) {
2762 data.writeInt(1);
2763 fillInIntent.writeToParcel(data, 0);
2764 } else {
2765 data.writeInt(0);
2766 }
2767 data.writeString(resolvedType);
2768 data.writeStrongBinder(resultTo);
2769 data.writeString(resultWho);
2770 data.writeInt(requestCode);
2771 data.writeInt(flagsMask);
2772 data.writeInt(flagsValues);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002773 if (options != null) {
2774 data.writeInt(1);
2775 options.writeToParcel(data, 0);
2776 } else {
2777 data.writeInt(0);
2778 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002779 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002780 reply.readException();
2781 int result = reply.readInt();
2782 reply.recycle();
2783 data.recycle();
2784 return result;
2785 }
Dianne Hackborn91097de2014-04-04 18:02:06 -07002786 public int startVoiceActivity(String callingPackage, int callingPid, int callingUid,
2787 Intent intent, String resolvedType, IVoiceInteractionSession session,
Jeff Hao1b012d32014-08-20 10:35:34 -07002788 IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo,
2789 Bundle options, int userId) throws RemoteException {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002790 Parcel data = Parcel.obtain();
2791 Parcel reply = Parcel.obtain();
2792 data.writeInterfaceToken(IActivityManager.descriptor);
2793 data.writeString(callingPackage);
2794 data.writeInt(callingPid);
2795 data.writeInt(callingUid);
2796 intent.writeToParcel(data, 0);
2797 data.writeString(resolvedType);
2798 data.writeStrongBinder(session.asBinder());
2799 data.writeStrongBinder(interactor.asBinder());
2800 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002801 if (profilerInfo != null) {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002802 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002803 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn91097de2014-04-04 18:02:06 -07002804 } else {
2805 data.writeInt(0);
2806 }
2807 if (options != null) {
2808 data.writeInt(1);
2809 options.writeToParcel(data, 0);
2810 } else {
2811 data.writeInt(0);
2812 }
2813 data.writeInt(userId);
2814 mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0);
2815 reply.readException();
2816 int result = reply.readInt();
2817 reply.recycle();
2818 data.recycle();
2819 return result;
2820 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002821 public boolean startNextMatchingActivity(IBinder callingActivity,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002822 Intent intent, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002823 Parcel data = Parcel.obtain();
2824 Parcel reply = Parcel.obtain();
2825 data.writeInterfaceToken(IActivityManager.descriptor);
2826 data.writeStrongBinder(callingActivity);
2827 intent.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002828 if (options != null) {
2829 data.writeInt(1);
2830 options.writeToParcel(data, 0);
2831 } else {
2832 data.writeInt(0);
2833 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002834 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
2835 reply.readException();
2836 int result = reply.readInt();
2837 reply.recycle();
2838 data.recycle();
2839 return result != 0;
2840 }
Craig Mautnerdc00cbe2014-07-20 17:48:47 -07002841 public int startActivityFromRecents(int taskId, Bundle options) throws RemoteException {
2842 Parcel data = Parcel.obtain();
2843 Parcel reply = Parcel.obtain();
2844 data.writeInterfaceToken(IActivityManager.descriptor);
2845 data.writeInt(taskId);
2846 if (options == null) {
2847 data.writeInt(0);
2848 } else {
2849 data.writeInt(1);
2850 options.writeToParcel(data, 0);
2851 }
2852 mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0);
2853 reply.readException();
2854 int result = reply.readInt();
2855 reply.recycle();
2856 data.recycle();
2857 return result;
2858 }
Winson Chung3b3f4642014-04-22 10:08:18 -07002859 public boolean finishActivity(IBinder token, int resultCode, Intent resultData, boolean finishTask)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002860 throws RemoteException {
2861 Parcel data = Parcel.obtain();
2862 Parcel reply = Parcel.obtain();
2863 data.writeInterfaceToken(IActivityManager.descriptor);
2864 data.writeStrongBinder(token);
2865 data.writeInt(resultCode);
2866 if (resultData != null) {
2867 data.writeInt(1);
2868 resultData.writeToParcel(data, 0);
2869 } else {
2870 data.writeInt(0);
2871 }
Winson Chung3b3f4642014-04-22 10:08:18 -07002872 data.writeInt(finishTask ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002873 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
2874 reply.readException();
2875 boolean res = reply.readInt() != 0;
2876 data.recycle();
2877 reply.recycle();
2878 return res;
2879 }
2880 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
2881 {
2882 Parcel data = Parcel.obtain();
2883 Parcel reply = Parcel.obtain();
2884 data.writeInterfaceToken(IActivityManager.descriptor);
2885 data.writeStrongBinder(token);
2886 data.writeString(resultWho);
2887 data.writeInt(requestCode);
2888 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
2889 reply.readException();
2890 data.recycle();
2891 reply.recycle();
2892 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -07002893 public boolean finishActivityAffinity(IBinder token) throws RemoteException {
2894 Parcel data = Parcel.obtain();
2895 Parcel reply = Parcel.obtain();
2896 data.writeInterfaceToken(IActivityManager.descriptor);
2897 data.writeStrongBinder(token);
2898 mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0);
2899 reply.readException();
2900 boolean res = reply.readInt() != 0;
2901 data.recycle();
2902 reply.recycle();
2903 return res;
2904 }
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -07002905 public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException {
2906 Parcel data = Parcel.obtain();
2907 Parcel reply = Parcel.obtain();
2908 data.writeInterfaceToken(IActivityManager.descriptor);
2909 data.writeStrongBinder(session.asBinder());
2910 mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0);
2911 reply.readException();
2912 data.recycle();
2913 reply.recycle();
2914 }
Dianne Hackborn89ad4562014-08-24 16:45:38 -07002915 public boolean releaseActivityInstance(IBinder token) throws RemoteException {
2916 Parcel data = Parcel.obtain();
2917 Parcel reply = Parcel.obtain();
2918 data.writeInterfaceToken(IActivityManager.descriptor);
2919 data.writeStrongBinder(token);
2920 mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0);
2921 reply.readException();
2922 boolean res = reply.readInt() != 0;
2923 data.recycle();
2924 reply.recycle();
2925 return res;
2926 }
2927 public void releaseSomeActivities(IApplicationThread app) throws RemoteException {
2928 Parcel data = Parcel.obtain();
2929 Parcel reply = Parcel.obtain();
2930 data.writeInterfaceToken(IActivityManager.descriptor);
2931 data.writeStrongBinder(app.asBinder());
2932 mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0);
2933 reply.readException();
2934 data.recycle();
2935 reply.recycle();
2936 }
Dianne Hackborn061d58a2010-03-12 15:07:06 -08002937 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
2938 Parcel data = Parcel.obtain();
2939 Parcel reply = Parcel.obtain();
2940 data.writeInterfaceToken(IActivityManager.descriptor);
2941 data.writeStrongBinder(token);
2942 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
2943 reply.readException();
2944 boolean res = reply.readInt() != 0;
2945 data.recycle();
2946 reply.recycle();
2947 return res;
2948 }
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002949 public Intent registerReceiver(IApplicationThread caller, String packageName,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002950 IIntentReceiver receiver,
Dianne Hackborn20e80982012-08-31 19:00:44 -07002951 IntentFilter filter, String perm, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002952 {
2953 Parcel data = Parcel.obtain();
2954 Parcel reply = Parcel.obtain();
2955 data.writeInterfaceToken(IActivityManager.descriptor);
2956 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002957 data.writeString(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002958 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
2959 filter.writeToParcel(data, 0);
2960 data.writeString(perm);
Dianne Hackborn20e80982012-08-31 19:00:44 -07002961 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002962 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2963 reply.readException();
2964 Intent intent = null;
2965 int haveIntent = reply.readInt();
2966 if (haveIntent != 0) {
2967 intent = Intent.CREATOR.createFromParcel(reply);
2968 }
2969 reply.recycle();
2970 data.recycle();
2971 return intent;
2972 }
2973 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
2974 {
2975 Parcel data = Parcel.obtain();
2976 Parcel reply = Parcel.obtain();
2977 data.writeInterfaceToken(IActivityManager.descriptor);
2978 data.writeStrongBinder(receiver.asBinder());
2979 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2980 reply.readException();
2981 data.recycle();
2982 reply.recycle();
2983 }
2984 public int broadcastIntent(IApplicationThread caller,
2985 Intent intent, String resolvedType, IIntentReceiver resultTo,
2986 int resultCode, String resultData, Bundle map,
Dianne Hackbornf51f6122013-02-04 18:23:34 -08002987 String requiredPermission, int appOp, boolean serialized,
Amith Yamasani742a6712011-05-04 14:49:28 -07002988 boolean sticky, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002989 {
2990 Parcel data = Parcel.obtain();
2991 Parcel reply = Parcel.obtain();
2992 data.writeInterfaceToken(IActivityManager.descriptor);
2993 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2994 intent.writeToParcel(data, 0);
2995 data.writeString(resolvedType);
2996 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
2997 data.writeInt(resultCode);
2998 data.writeString(resultData);
2999 data.writeBundle(map);
3000 data.writeString(requiredPermission);
Dianne Hackbornf51f6122013-02-04 18:23:34 -08003001 data.writeInt(appOp);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003002 data.writeInt(serialized ? 1 : 0);
3003 data.writeInt(sticky ? 1 : 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003004 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003005 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
3006 reply.readException();
3007 int res = reply.readInt();
3008 reply.recycle();
3009 data.recycle();
3010 return res;
3011 }
Amith Yamasani742a6712011-05-04 14:49:28 -07003012 public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
3013 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003014 {
3015 Parcel data = Parcel.obtain();
3016 Parcel reply = Parcel.obtain();
3017 data.writeInterfaceToken(IActivityManager.descriptor);
3018 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3019 intent.writeToParcel(data, 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003020 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003021 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
3022 reply.readException();
3023 data.recycle();
3024 reply.recycle();
3025 }
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003026 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map,
3027 boolean abortBroadcast, int flags) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003028 {
3029 Parcel data = Parcel.obtain();
3030 Parcel reply = Parcel.obtain();
3031 data.writeInterfaceToken(IActivityManager.descriptor);
3032 data.writeStrongBinder(who);
3033 data.writeInt(resultCode);
3034 data.writeString(resultData);
3035 data.writeBundle(map);
3036 data.writeInt(abortBroadcast ? 1 : 0);
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003037 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003038 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3039 reply.readException();
3040 data.recycle();
3041 reply.recycle();
3042 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003043 public void attachApplication(IApplicationThread app) throws RemoteException
3044 {
3045 Parcel data = Parcel.obtain();
3046 Parcel reply = Parcel.obtain();
3047 data.writeInterfaceToken(IActivityManager.descriptor);
3048 data.writeStrongBinder(app.asBinder());
3049 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
3050 reply.readException();
3051 data.recycle();
3052 reply.recycle();
3053 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003054 public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
3055 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003056 {
3057 Parcel data = Parcel.obtain();
3058 Parcel reply = Parcel.obtain();
3059 data.writeInterfaceToken(IActivityManager.descriptor);
3060 data.writeStrongBinder(token);
Dianne Hackborne88846e2009-09-30 21:34:25 -07003061 if (config != null) {
3062 data.writeInt(1);
3063 config.writeToParcel(data, 0);
3064 } else {
3065 data.writeInt(0);
3066 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003067 data.writeInt(stopProfiling ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003068 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3069 reply.readException();
3070 data.recycle();
3071 reply.recycle();
3072 }
Dianne Hackbornad9b32112012-09-17 15:35:01 -07003073 public void activityResumed(IBinder token) throws RemoteException
3074 {
3075 Parcel data = Parcel.obtain();
3076 Parcel reply = Parcel.obtain();
3077 data.writeInterfaceToken(IActivityManager.descriptor);
3078 data.writeStrongBinder(token);
3079 mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0);
3080 reply.readException();
3081 data.recycle();
3082 reply.recycle();
3083 }
Dianne Hackborna4e102e2014-09-04 22:52:27 -07003084 public void activityPaused(IBinder token) throws RemoteException
Dianne Hackborn0aae2d42010-12-07 23:51:29 -08003085 {
3086 Parcel data = Parcel.obtain();
3087 Parcel reply = Parcel.obtain();
3088 data.writeInterfaceToken(IActivityManager.descriptor);
3089 data.writeStrongBinder(token);
3090 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
3091 reply.readException();
3092 data.recycle();
3093 reply.recycle();
3094 }
3095 public void activityStopped(IBinder token, Bundle state,
Craig Mautnera0026042014-04-23 11:45:37 -07003096 PersistableBundle persistentState, CharSequence description) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003097 {
3098 Parcel data = Parcel.obtain();
3099 Parcel reply = Parcel.obtain();
3100 data.writeInterfaceToken(IActivityManager.descriptor);
3101 data.writeStrongBinder(token);
3102 data.writeBundle(state);
Craig Mautnera0026042014-04-23 11:45:37 -07003103 data.writePersistableBundle(persistentState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003104 TextUtils.writeToParcel(description, data, 0);
3105 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3106 reply.readException();
3107 data.recycle();
3108 reply.recycle();
3109 }
Dianne Hackborn4eba96b2011-01-21 13:34:36 -08003110 public void activitySlept(IBinder token) throws RemoteException
3111 {
3112 Parcel data = Parcel.obtain();
3113 Parcel reply = Parcel.obtain();
3114 data.writeInterfaceToken(IActivityManager.descriptor);
3115 data.writeStrongBinder(token);
3116 mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3117 reply.readException();
3118 data.recycle();
3119 reply.recycle();
3120 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003121 public void activityDestroyed(IBinder token) throws RemoteException
3122 {
3123 Parcel data = Parcel.obtain();
3124 Parcel reply = Parcel.obtain();
3125 data.writeInterfaceToken(IActivityManager.descriptor);
3126 data.writeStrongBinder(token);
3127 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3128 reply.readException();
3129 data.recycle();
3130 reply.recycle();
3131 }
3132 public String getCallingPackage(IBinder token) throws RemoteException
3133 {
3134 Parcel data = Parcel.obtain();
3135 Parcel reply = Parcel.obtain();
3136 data.writeInterfaceToken(IActivityManager.descriptor);
3137 data.writeStrongBinder(token);
3138 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
3139 reply.readException();
3140 String res = reply.readString();
3141 data.recycle();
3142 reply.recycle();
3143 return res;
3144 }
3145 public ComponentName getCallingActivity(IBinder token)
3146 throws RemoteException {
3147 Parcel data = Parcel.obtain();
3148 Parcel reply = Parcel.obtain();
3149 data.writeInterfaceToken(IActivityManager.descriptor);
3150 data.writeStrongBinder(token);
3151 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
3152 reply.readException();
3153 ComponentName res = ComponentName.readFromParcel(reply);
3154 data.recycle();
3155 reply.recycle();
3156 return res;
3157 }
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003158 public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException {
Winson Chung1147c402014-05-14 11:05:00 -07003159 Parcel data = Parcel.obtain();
3160 Parcel reply = Parcel.obtain();
3161 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003162 data.writeString(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -07003163 mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0);
3164 reply.readException();
3165 ArrayList<IAppTask> list = null;
3166 int N = reply.readInt();
3167 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003168 list = new ArrayList<>();
Winson Chung1147c402014-05-14 11:05:00 -07003169 while (N > 0) {
3170 IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder());
3171 list.add(task);
3172 N--;
3173 }
3174 }
3175 data.recycle();
3176 reply.recycle();
3177 return list;
3178 }
Dianne Hackbornaec68bb2014-08-20 15:25:13 -07003179 public int addAppTask(IBinder activityToken, Intent intent,
3180 ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException {
3181 Parcel data = Parcel.obtain();
3182 Parcel reply = Parcel.obtain();
3183 data.writeInterfaceToken(IActivityManager.descriptor);
3184 data.writeStrongBinder(activityToken);
3185 intent.writeToParcel(data, 0);
3186 description.writeToParcel(data, 0);
3187 thumbnail.writeToParcel(data, 0);
3188 mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0);
3189 reply.readException();
3190 int res = reply.readInt();
3191 data.recycle();
3192 reply.recycle();
3193 return res;
3194 }
3195 public Point getAppTaskThumbnailSize() throws RemoteException {
3196 Parcel data = Parcel.obtain();
3197 Parcel reply = Parcel.obtain();
3198 data.writeInterfaceToken(IActivityManager.descriptor);
3199 mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0);
3200 reply.readException();
3201 Point size = Point.CREATOR.createFromParcel(reply);
3202 data.recycle();
3203 reply.recycle();
3204 return size;
3205 }
Todd Kennedye635f662015-01-20 10:36:49 -08003206 public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags)
3207 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003208 Parcel data = Parcel.obtain();
3209 Parcel reply = Parcel.obtain();
3210 data.writeInterfaceToken(IActivityManager.descriptor);
3211 data.writeInt(maxNum);
3212 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003213 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
3214 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003215 ArrayList<ActivityManager.RunningTaskInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003216 int N = reply.readInt();
3217 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003218 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003219 while (N > 0) {
3220 ActivityManager.RunningTaskInfo info =
3221 ActivityManager.RunningTaskInfo.CREATOR
Winson Chung1147c402014-05-14 11:05:00 -07003222 .createFromParcel(reply);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003223 list.add(info);
3224 N--;
3225 }
3226 }
3227 data.recycle();
3228 reply.recycle();
3229 return list;
3230 }
3231 public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -07003232 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003233 Parcel data = Parcel.obtain();
3234 Parcel reply = Parcel.obtain();
3235 data.writeInterfaceToken(IActivityManager.descriptor);
3236 data.writeInt(maxNum);
3237 data.writeInt(flags);
Amith Yamasani82644082012-08-03 13:09:11 -07003238 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003239 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
3240 reply.readException();
3241 ArrayList<ActivityManager.RecentTaskInfo> list
3242 = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR);
3243 data.recycle();
3244 reply.recycle();
3245 return list;
3246 }
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003247 public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException {
Dianne Hackbornd94df452011-02-16 18:53:31 -08003248 Parcel data = Parcel.obtain();
3249 Parcel reply = Parcel.obtain();
3250 data.writeInterfaceToken(IActivityManager.descriptor);
3251 data.writeInt(id);
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003252 mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003253 reply.readException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003254 ActivityManager.TaskThumbnail taskThumbnail = null;
Dianne Hackbornd94df452011-02-16 18:53:31 -08003255 if (reply.readInt() != 0) {
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003256 taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003257 }
3258 data.recycle();
3259 reply.recycle();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003260 return taskThumbnail;
Dianne Hackborn15491c62012-09-19 10:59:14 -07003261 }
Todd Kennedye635f662015-01-20 10:36:49 -08003262 public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags)
3263 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003264 Parcel data = Parcel.obtain();
3265 Parcel reply = Parcel.obtain();
3266 data.writeInterfaceToken(IActivityManager.descriptor);
3267 data.writeInt(maxNum);
3268 data.writeInt(flags);
3269 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
3270 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003271 ArrayList<ActivityManager.RunningServiceInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003272 int N = reply.readInt();
3273 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003274 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003275 while (N > 0) {
3276 ActivityManager.RunningServiceInfo info =
3277 ActivityManager.RunningServiceInfo.CREATOR
3278 .createFromParcel(reply);
3279 list.add(info);
3280 N--;
3281 }
3282 }
3283 data.recycle();
3284 reply.recycle();
3285 return list;
3286 }
3287 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
3288 throws RemoteException {
3289 Parcel data = Parcel.obtain();
3290 Parcel reply = Parcel.obtain();
3291 data.writeInterfaceToken(IActivityManager.descriptor);
3292 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
3293 reply.readException();
3294 ArrayList<ActivityManager.ProcessErrorStateInfo> list
3295 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
3296 data.recycle();
3297 reply.recycle();
3298 return list;
3299 }
3300 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
3301 throws RemoteException {
3302 Parcel data = Parcel.obtain();
3303 Parcel reply = Parcel.obtain();
3304 data.writeInterfaceToken(IActivityManager.descriptor);
3305 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
3306 reply.readException();
3307 ArrayList<ActivityManager.RunningAppProcessInfo> list
3308 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
3309 data.recycle();
3310 reply.recycle();
3311 return list;
3312 }
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -07003313 public List<ApplicationInfo> getRunningExternalApplications()
3314 throws RemoteException {
3315 Parcel data = Parcel.obtain();
3316 Parcel reply = Parcel.obtain();
3317 data.writeInterfaceToken(IActivityManager.descriptor);
3318 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
3319 reply.readException();
3320 ArrayList<ApplicationInfo> list
3321 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
3322 data.recycle();
3323 reply.recycle();
3324 return list;
3325 }
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003326 public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003327 {
3328 Parcel data = Parcel.obtain();
3329 Parcel reply = Parcel.obtain();
3330 data.writeInterfaceToken(IActivityManager.descriptor);
3331 data.writeInt(task);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003332 data.writeInt(flags);
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003333 if (options != null) {
3334 data.writeInt(1);
3335 options.writeToParcel(data, 0);
3336 } else {
3337 data.writeInt(0);
3338 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003339 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
3340 reply.readException();
3341 data.recycle();
3342 reply.recycle();
3343 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003344 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
3345 throws RemoteException {
3346 Parcel data = Parcel.obtain();
3347 Parcel reply = Parcel.obtain();
3348 data.writeInterfaceToken(IActivityManager.descriptor);
3349 data.writeStrongBinder(token);
3350 data.writeInt(nonRoot ? 1 : 0);
3351 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
3352 reply.readException();
3353 boolean res = reply.readInt() != 0;
3354 data.recycle();
3355 reply.recycle();
3356 return res;
3357 }
3358 public void moveTaskBackwards(int task) throws RemoteException
3359 {
3360 Parcel data = Parcel.obtain();
3361 Parcel reply = Parcel.obtain();
3362 data.writeInterfaceToken(IActivityManager.descriptor);
3363 data.writeInt(task);
3364 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
3365 reply.readException();
3366 data.recycle();
3367 reply.recycle();
3368 }
Craig Mautnerc00204b2013-03-05 15:02:14 -08003369 @Override
Craig Mautnerc00204b2013-03-05 15:02:14 -08003370 public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException
3371 {
3372 Parcel data = Parcel.obtain();
3373 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003374 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003375 data.writeInt(taskId);
3376 data.writeInt(stackId);
3377 data.writeInt(toTop ? 1 : 0);
3378 mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0);
3379 reply.readException();
3380 data.recycle();
3381 reply.recycle();
3382 }
3383 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003384 public void resizeStack(int stackBoxId, Rect r) throws RemoteException
Craig Mautnerc00204b2013-03-05 15:02:14 -08003385 {
3386 Parcel data = Parcel.obtain();
3387 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003388 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautner5a449152013-05-24 15:49:29 -07003389 data.writeInt(stackBoxId);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003390 r.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07003391 mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003392 reply.readException();
3393 data.recycle();
3394 reply.recycle();
3395 }
Craig Mautner967212c2013-04-13 21:10:58 -07003396 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003397 public List<StackInfo> getAllStackInfos() throws RemoteException
Craig Mautner5ff12102013-05-24 12:50:15 -07003398 {
3399 Parcel data = Parcel.obtain();
3400 Parcel reply = Parcel.obtain();
3401 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003402 mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0);
Craig Mautner5ff12102013-05-24 12:50:15 -07003403 reply.readException();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003404 ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR);
Craig Mautner967212c2013-04-13 21:10:58 -07003405 data.recycle();
3406 reply.recycle();
3407 return list;
3408 }
Craig Mautnercf910b02013-04-23 11:23:27 -07003409 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003410 public StackInfo getStackInfo(int stackId) throws RemoteException
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003411 {
3412 Parcel data = Parcel.obtain();
3413 Parcel reply = Parcel.obtain();
3414 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003415 data.writeInt(stackId);
3416 mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003417 reply.readException();
3418 int res = reply.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003419 StackInfo info = null;
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003420 if (res != 0) {
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003421 info = StackInfo.CREATOR.createFromParcel(reply);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003422 }
3423 data.recycle();
3424 reply.recycle();
3425 return info;
3426 }
3427 @Override
Winson Chung303e1ff2014-03-07 15:06:19 -08003428 public boolean isInHomeStack(int taskId) throws RemoteException {
3429 Parcel data = Parcel.obtain();
3430 Parcel reply = Parcel.obtain();
3431 data.writeInterfaceToken(IActivityManager.descriptor);
3432 data.writeInt(taskId);
3433 mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0);
3434 reply.readException();
3435 boolean isInHomeStack = reply.readInt() > 0;
3436 data.recycle();
3437 reply.recycle();
3438 return isInHomeStack;
3439 }
3440 @Override
Craig Mautnercf910b02013-04-23 11:23:27 -07003441 public void setFocusedStack(int stackId) throws RemoteException
3442 {
3443 Parcel data = Parcel.obtain();
3444 Parcel reply = Parcel.obtain();
3445 data.writeInterfaceToken(IActivityManager.descriptor);
3446 data.writeInt(stackId);
Dianne Hackborn1e383822015-04-10 14:02:33 -07003447 mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0);
Craig Mautnercf910b02013-04-23 11:23:27 -07003448 reply.readException();
3449 data.recycle();
3450 reply.recycle();
3451 }
Winson Chung740c3ac2014-11-12 16:14:38 -08003452 @Override
Winson Chungd16c5652015-01-26 16:11:07 -08003453 public int getFocusedStackId() throws RemoteException {
3454 Parcel data = Parcel.obtain();
3455 Parcel reply = Parcel.obtain();
3456 data.writeInterfaceToken(IActivityManager.descriptor);
3457 mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0);
3458 reply.readException();
3459 int focusedStackId = reply.readInt();
3460 data.recycle();
3461 reply.recycle();
3462 return focusedStackId;
3463 }
3464 @Override
Winson Chung740c3ac2014-11-12 16:14:38 -08003465 public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException
3466 {
3467 Parcel data = Parcel.obtain();
3468 Parcel reply = Parcel.obtain();
3469 data.writeInterfaceToken(IActivityManager.descriptor);
3470 data.writeStrongBinder(listener.asBinder());
Dianne Hackborn1e383822015-04-10 14:02:33 -07003471 mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0);
Winson Chung740c3ac2014-11-12 16:14:38 -08003472 reply.readException();
3473 data.recycle();
3474 reply.recycle();
3475 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003476 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
3477 {
3478 Parcel data = Parcel.obtain();
3479 Parcel reply = Parcel.obtain();
3480 data.writeInterfaceToken(IActivityManager.descriptor);
3481 data.writeStrongBinder(token);
3482 data.writeInt(onlyRoot ? 1 : 0);
3483 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
3484 reply.readException();
3485 int res = reply.readInt();
3486 data.recycle();
3487 reply.recycle();
3488 return res;
3489 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003490 public ContentProviderHolder getContentProvider(IApplicationThread caller,
Jeff Sharkey6d515712012-09-20 16:06:08 -07003491 String name, int userId, boolean stable) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003492 Parcel data = Parcel.obtain();
3493 Parcel reply = Parcel.obtain();
3494 data.writeInterfaceToken(IActivityManager.descriptor);
3495 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3496 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003497 data.writeInt(userId);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003498 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003499 mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3500 reply.readException();
3501 int res = reply.readInt();
3502 ContentProviderHolder cph = null;
3503 if (res != 0) {
3504 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3505 }
3506 data.recycle();
3507 reply.recycle();
3508 return cph;
3509 }
Jeff Sharkey6d515712012-09-20 16:06:08 -07003510 public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token)
3511 throws RemoteException {
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003512 Parcel data = Parcel.obtain();
3513 Parcel reply = Parcel.obtain();
3514 data.writeInterfaceToken(IActivityManager.descriptor);
3515 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003516 data.writeInt(userId);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003517 data.writeStrongBinder(token);
3518 mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3519 reply.readException();
3520 int res = reply.readInt();
3521 ContentProviderHolder cph = null;
3522 if (res != 0) {
3523 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3524 }
3525 data.recycle();
3526 reply.recycle();
3527 return cph;
3528 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003529 public void publishContentProviders(IApplicationThread caller,
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003530 List<ContentProviderHolder> providers) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003531 {
3532 Parcel data = Parcel.obtain();
3533 Parcel reply = Parcel.obtain();
3534 data.writeInterfaceToken(IActivityManager.descriptor);
3535 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3536 data.writeTypedList(providers);
3537 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
3538 reply.readException();
3539 data.recycle();
3540 reply.recycle();
3541 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003542 public boolean refContentProvider(IBinder connection, int stable, int unstable)
3543 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003544 Parcel data = Parcel.obtain();
3545 Parcel reply = Parcel.obtain();
3546 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003547 data.writeStrongBinder(connection);
3548 data.writeInt(stable);
3549 data.writeInt(unstable);
3550 mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3551 reply.readException();
3552 boolean res = reply.readInt() != 0;
3553 data.recycle();
3554 reply.recycle();
3555 return res;
3556 }
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003557
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003558 public void unstableProviderDied(IBinder connection) throws RemoteException {
3559 Parcel data = Parcel.obtain();
3560 Parcel reply = Parcel.obtain();
3561 data.writeInterfaceToken(IActivityManager.descriptor);
3562 data.writeStrongBinder(connection);
3563 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0);
3564 reply.readException();
3565 data.recycle();
3566 reply.recycle();
3567 }
3568
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003569 @Override
3570 public void appNotRespondingViaProvider(IBinder connection) throws RemoteException {
3571 Parcel data = Parcel.obtain();
3572 Parcel reply = Parcel.obtain();
3573 data.writeInterfaceToken(IActivityManager.descriptor);
3574 data.writeStrongBinder(connection);
3575 mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0);
3576 reply.readException();
3577 data.recycle();
3578 reply.recycle();
3579 }
3580
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003581 public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException {
3582 Parcel data = Parcel.obtain();
3583 Parcel reply = Parcel.obtain();
3584 data.writeInterfaceToken(IActivityManager.descriptor);
3585 data.writeStrongBinder(connection);
3586 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003587 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3588 reply.readException();
3589 data.recycle();
3590 reply.recycle();
3591 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003592
3593 public void removeContentProviderExternal(String name, IBinder token) throws RemoteException {
3594 Parcel data = Parcel.obtain();
3595 Parcel reply = Parcel.obtain();
3596 data.writeInterfaceToken(IActivityManager.descriptor);
3597 data.writeString(name);
3598 data.writeStrongBinder(token);
3599 mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3600 reply.readException();
3601 data.recycle();
3602 reply.recycle();
3603 }
3604
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07003605 public PendingIntent getRunningServiceControlPanel(ComponentName service)
3606 throws RemoteException
3607 {
3608 Parcel data = Parcel.obtain();
3609 Parcel reply = Parcel.obtain();
3610 data.writeInterfaceToken(IActivityManager.descriptor);
3611 service.writeToParcel(data, 0);
3612 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
3613 reply.readException();
3614 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
3615 data.recycle();
3616 reply.recycle();
3617 return res;
3618 }
3619
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003620 public ComponentName startService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003621 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003622 {
3623 Parcel data = Parcel.obtain();
3624 Parcel reply = Parcel.obtain();
3625 data.writeInterfaceToken(IActivityManager.descriptor);
3626 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3627 service.writeToParcel(data, 0);
3628 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003629 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003630 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
3631 reply.readException();
3632 ComponentName res = ComponentName.readFromParcel(reply);
3633 data.recycle();
3634 reply.recycle();
3635 return res;
3636 }
3637 public int stopService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003638 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003639 {
3640 Parcel data = Parcel.obtain();
3641 Parcel reply = Parcel.obtain();
3642 data.writeInterfaceToken(IActivityManager.descriptor);
3643 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3644 service.writeToParcel(data, 0);
3645 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003646 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003647 mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0);
3648 reply.readException();
3649 int res = reply.readInt();
3650 reply.recycle();
3651 data.recycle();
3652 return res;
3653 }
3654 public boolean stopServiceToken(ComponentName className, IBinder token,
3655 int startId) throws RemoteException {
3656 Parcel data = Parcel.obtain();
3657 Parcel reply = Parcel.obtain();
3658 data.writeInterfaceToken(IActivityManager.descriptor);
3659 ComponentName.writeToParcel(className, data);
3660 data.writeStrongBinder(token);
3661 data.writeInt(startId);
3662 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
3663 reply.readException();
3664 boolean res = reply.readInt() != 0;
3665 data.recycle();
3666 reply.recycle();
3667 return res;
3668 }
3669 public void setServiceForeground(ComponentName className, IBinder token,
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003670 int id, Notification notification, boolean removeNotification) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003671 Parcel data = Parcel.obtain();
3672 Parcel reply = Parcel.obtain();
3673 data.writeInterfaceToken(IActivityManager.descriptor);
3674 ComponentName.writeToParcel(className, data);
3675 data.writeStrongBinder(token);
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003676 data.writeInt(id);
3677 if (notification != null) {
3678 data.writeInt(1);
3679 notification.writeToParcel(data, 0);
3680 } else {
3681 data.writeInt(0);
3682 }
3683 data.writeInt(removeNotification ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003684 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
3685 reply.readException();
3686 data.recycle();
3687 reply.recycle();
3688 }
3689 public int bindService(IApplicationThread caller, IBinder token,
3690 Intent service, String resolvedType, IServiceConnection connection,
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003691 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003692 Parcel data = Parcel.obtain();
3693 Parcel reply = Parcel.obtain();
3694 data.writeInterfaceToken(IActivityManager.descriptor);
3695 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3696 data.writeStrongBinder(token);
3697 service.writeToParcel(data, 0);
3698 data.writeString(resolvedType);
3699 data.writeStrongBinder(connection.asBinder());
3700 data.writeInt(flags);
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003701 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003702 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
3703 reply.readException();
3704 int res = reply.readInt();
3705 data.recycle();
3706 reply.recycle();
3707 return res;
3708 }
3709 public boolean unbindService(IServiceConnection connection) throws RemoteException
3710 {
3711 Parcel data = Parcel.obtain();
3712 Parcel reply = Parcel.obtain();
3713 data.writeInterfaceToken(IActivityManager.descriptor);
3714 data.writeStrongBinder(connection.asBinder());
3715 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
3716 reply.readException();
3717 boolean res = reply.readInt() != 0;
3718 data.recycle();
3719 reply.recycle();
3720 return res;
3721 }
3722
3723 public void publishService(IBinder token,
3724 Intent intent, IBinder service) throws RemoteException {
3725 Parcel data = Parcel.obtain();
3726 Parcel reply = Parcel.obtain();
3727 data.writeInterfaceToken(IActivityManager.descriptor);
3728 data.writeStrongBinder(token);
3729 intent.writeToParcel(data, 0);
3730 data.writeStrongBinder(service);
3731 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
3732 reply.readException();
3733 data.recycle();
3734 reply.recycle();
3735 }
3736
3737 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
3738 throws RemoteException {
3739 Parcel data = Parcel.obtain();
3740 Parcel reply = Parcel.obtain();
3741 data.writeInterfaceToken(IActivityManager.descriptor);
3742 data.writeStrongBinder(token);
3743 intent.writeToParcel(data, 0);
3744 data.writeInt(doRebind ? 1 : 0);
3745 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
3746 reply.readException();
3747 data.recycle();
3748 reply.recycle();
3749 }
3750
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003751 public void serviceDoneExecuting(IBinder token, int type, int startId,
3752 int res) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003753 Parcel data = Parcel.obtain();
3754 Parcel reply = Parcel.obtain();
3755 data.writeInterfaceToken(IActivityManager.descriptor);
3756 data.writeStrongBinder(token);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003757 data.writeInt(type);
3758 data.writeInt(startId);
3759 data.writeInt(res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003760 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3761 reply.readException();
3762 data.recycle();
3763 reply.recycle();
3764 }
3765
3766 public IBinder peekService(Intent service, String resolvedType) throws RemoteException {
3767 Parcel data = Parcel.obtain();
3768 Parcel reply = Parcel.obtain();
3769 data.writeInterfaceToken(IActivityManager.descriptor);
3770 service.writeToParcel(data, 0);
3771 data.writeString(resolvedType);
3772 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
3773 reply.readException();
3774 IBinder binder = reply.readStrongBinder();
3775 reply.recycle();
3776 data.recycle();
3777 return binder;
3778 }
3779
Christopher Tate181fafa2009-05-14 11:12:14 -07003780 public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
3781 throws RemoteException {
3782 Parcel data = Parcel.obtain();
3783 Parcel reply = Parcel.obtain();
3784 data.writeInterfaceToken(IActivityManager.descriptor);
3785 app.writeToParcel(data, 0);
3786 data.writeInt(backupRestoreMode);
3787 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3788 reply.readException();
3789 boolean success = reply.readInt() != 0;
3790 reply.recycle();
3791 data.recycle();
3792 return success;
3793 }
3794
Christopher Tate346acb12012-10-15 19:20:25 -07003795 public void clearPendingBackup() throws RemoteException {
3796 Parcel data = Parcel.obtain();
3797 Parcel reply = Parcel.obtain();
3798 data.writeInterfaceToken(IActivityManager.descriptor);
3799 mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0);
3800 reply.recycle();
3801 data.recycle();
3802 }
3803
Christopher Tate181fafa2009-05-14 11:12:14 -07003804 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
3805 Parcel data = Parcel.obtain();
3806 Parcel reply = Parcel.obtain();
3807 data.writeInterfaceToken(IActivityManager.descriptor);
3808 data.writeString(packageName);
3809 data.writeStrongBinder(agent);
3810 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
3811 reply.recycle();
3812 data.recycle();
3813 }
3814
3815 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
3816 Parcel data = Parcel.obtain();
3817 Parcel reply = Parcel.obtain();
3818 data.writeInterfaceToken(IActivityManager.descriptor);
3819 app.writeToParcel(data, 0);
3820 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3821 reply.readException();
3822 reply.recycle();
3823 data.recycle();
3824 }
3825
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003826 public boolean startInstrumentation(ComponentName className, String profileFile,
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003827 int flags, Bundle arguments, IInstrumentationWatcher watcher,
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01003828 IUiAutomationConnection connection, int userId, String instructionSet)
3829 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003830 Parcel data = Parcel.obtain();
3831 Parcel reply = Parcel.obtain();
3832 data.writeInterfaceToken(IActivityManager.descriptor);
3833 ComponentName.writeToParcel(className, data);
3834 data.writeString(profileFile);
3835 data.writeInt(flags);
3836 data.writeBundle(arguments);
3837 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003838 data.writeStrongBinder(connection != null ? connection.asBinder() : null);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07003839 data.writeInt(userId);
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01003840 data.writeString(instructionSet);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003841 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3842 reply.readException();
3843 boolean res = reply.readInt() != 0;
3844 reply.recycle();
3845 data.recycle();
3846 return res;
3847 }
3848
3849 public void finishInstrumentation(IApplicationThread target,
3850 int resultCode, Bundle results) throws RemoteException {
3851 Parcel data = Parcel.obtain();
3852 Parcel reply = Parcel.obtain();
3853 data.writeInterfaceToken(IActivityManager.descriptor);
3854 data.writeStrongBinder(target != null ? target.asBinder() : null);
3855 data.writeInt(resultCode);
3856 data.writeBundle(results);
3857 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3858 reply.readException();
3859 data.recycle();
3860 reply.recycle();
3861 }
3862 public Configuration getConfiguration() throws RemoteException
3863 {
3864 Parcel data = Parcel.obtain();
3865 Parcel reply = Parcel.obtain();
3866 data.writeInterfaceToken(IActivityManager.descriptor);
3867 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
3868 reply.readException();
3869 Configuration res = Configuration.CREATOR.createFromParcel(reply);
3870 reply.recycle();
3871 data.recycle();
3872 return res;
3873 }
3874 public void updateConfiguration(Configuration values) throws RemoteException
3875 {
3876 Parcel data = Parcel.obtain();
3877 Parcel reply = Parcel.obtain();
3878 data.writeInterfaceToken(IActivityManager.descriptor);
3879 values.writeToParcel(data, 0);
3880 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
3881 reply.readException();
3882 data.recycle();
3883 reply.recycle();
3884 }
3885 public void setRequestedOrientation(IBinder token, int requestedOrientation)
3886 throws RemoteException {
3887 Parcel data = Parcel.obtain();
3888 Parcel reply = Parcel.obtain();
3889 data.writeInterfaceToken(IActivityManager.descriptor);
3890 data.writeStrongBinder(token);
3891 data.writeInt(requestedOrientation);
3892 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3893 reply.readException();
3894 data.recycle();
3895 reply.recycle();
3896 }
3897 public int getRequestedOrientation(IBinder token) throws RemoteException {
3898 Parcel data = Parcel.obtain();
3899 Parcel reply = Parcel.obtain();
3900 data.writeInterfaceToken(IActivityManager.descriptor);
3901 data.writeStrongBinder(token);
3902 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3903 reply.readException();
3904 int res = reply.readInt();
3905 data.recycle();
3906 reply.recycle();
3907 return res;
3908 }
3909 public ComponentName getActivityClassForToken(IBinder token)
3910 throws RemoteException {
3911 Parcel data = Parcel.obtain();
3912 Parcel reply = Parcel.obtain();
3913 data.writeInterfaceToken(IActivityManager.descriptor);
3914 data.writeStrongBinder(token);
3915 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
3916 reply.readException();
3917 ComponentName res = ComponentName.readFromParcel(reply);
3918 data.recycle();
3919 reply.recycle();
3920 return res;
3921 }
3922 public String getPackageForToken(IBinder token) throws RemoteException
3923 {
3924 Parcel data = Parcel.obtain();
3925 Parcel reply = Parcel.obtain();
3926 data.writeInterfaceToken(IActivityManager.descriptor);
3927 data.writeStrongBinder(token);
3928 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
3929 reply.readException();
3930 String res = reply.readString();
3931 data.recycle();
3932 reply.recycle();
3933 return res;
3934 }
3935 public IIntentSender getIntentSender(int type,
3936 String packageName, IBinder token, String resultWho,
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003937 int requestCode, Intent[] intents, String[] resolvedTypes, int flags,
Dianne Hackborn41203752012-08-31 14:05:51 -07003938 Bundle options, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003939 Parcel data = Parcel.obtain();
3940 Parcel reply = Parcel.obtain();
3941 data.writeInterfaceToken(IActivityManager.descriptor);
3942 data.writeInt(type);
3943 data.writeString(packageName);
3944 data.writeStrongBinder(token);
3945 data.writeString(resultWho);
3946 data.writeInt(requestCode);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003947 if (intents != null) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003948 data.writeInt(1);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003949 data.writeTypedArray(intents, 0);
3950 data.writeStringArray(resolvedTypes);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003951 } else {
3952 data.writeInt(0);
3953 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003954 data.writeInt(flags);
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003955 if (options != null) {
3956 data.writeInt(1);
3957 options.writeToParcel(data, 0);
3958 } else {
3959 data.writeInt(0);
3960 }
Dianne Hackborn41203752012-08-31 14:05:51 -07003961 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003962 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
3963 reply.readException();
3964 IIntentSender res = IIntentSender.Stub.asInterface(
Dianne Hackbornff170242014-11-19 10:59:01 -08003965 reply.readStrongBinder());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003966 data.recycle();
3967 reply.recycle();
3968 return res;
3969 }
3970 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
3971 Parcel data = Parcel.obtain();
3972 Parcel reply = Parcel.obtain();
3973 data.writeInterfaceToken(IActivityManager.descriptor);
3974 data.writeStrongBinder(sender.asBinder());
3975 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
3976 reply.readException();
3977 data.recycle();
3978 reply.recycle();
3979 }
3980 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
3981 Parcel data = Parcel.obtain();
3982 Parcel reply = Parcel.obtain();
3983 data.writeInterfaceToken(IActivityManager.descriptor);
3984 data.writeStrongBinder(sender.asBinder());
3985 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
3986 reply.readException();
3987 String res = reply.readString();
3988 data.recycle();
3989 reply.recycle();
3990 return res;
3991 }
Christopher Tatec4a07d12012-04-06 14:19:13 -07003992 public int getUidForIntentSender(IIntentSender sender) throws RemoteException {
3993 Parcel data = Parcel.obtain();
3994 Parcel reply = Parcel.obtain();
3995 data.writeInterfaceToken(IActivityManager.descriptor);
3996 data.writeStrongBinder(sender.asBinder());
3997 mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
3998 reply.readException();
3999 int res = reply.readInt();
4000 data.recycle();
4001 reply.recycle();
4002 return res;
4003 }
Dianne Hackborn41203752012-08-31 14:05:51 -07004004 public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
4005 boolean requireFull, String name, String callerPackage) throws RemoteException {
4006 Parcel data = Parcel.obtain();
4007 Parcel reply = Parcel.obtain();
4008 data.writeInterfaceToken(IActivityManager.descriptor);
4009 data.writeInt(callingPid);
4010 data.writeInt(callingUid);
4011 data.writeInt(userId);
4012 data.writeInt(allowAll ? 1 : 0);
4013 data.writeInt(requireFull ? 1 : 0);
4014 data.writeString(name);
4015 data.writeString(callerPackage);
4016 mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0);
4017 reply.readException();
4018 int res = reply.readInt();
4019 data.recycle();
4020 reply.recycle();
4021 return res;
4022 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004023 public void setProcessLimit(int max) throws RemoteException
4024 {
4025 Parcel data = Parcel.obtain();
4026 Parcel reply = Parcel.obtain();
4027 data.writeInterfaceToken(IActivityManager.descriptor);
4028 data.writeInt(max);
4029 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4030 reply.readException();
4031 data.recycle();
4032 reply.recycle();
4033 }
4034 public int getProcessLimit() throws RemoteException
4035 {
4036 Parcel data = Parcel.obtain();
4037 Parcel reply = Parcel.obtain();
4038 data.writeInterfaceToken(IActivityManager.descriptor);
4039 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4040 reply.readException();
4041 int res = reply.readInt();
4042 data.recycle();
4043 reply.recycle();
4044 return res;
4045 }
4046 public void setProcessForeground(IBinder token, int pid,
4047 boolean isForeground) throws RemoteException {
4048 Parcel data = Parcel.obtain();
4049 Parcel reply = Parcel.obtain();
4050 data.writeInterfaceToken(IActivityManager.descriptor);
4051 data.writeStrongBinder(token);
4052 data.writeInt(pid);
4053 data.writeInt(isForeground ? 1 : 0);
4054 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
4055 reply.readException();
4056 data.recycle();
4057 reply.recycle();
4058 }
4059 public int checkPermission(String permission, int pid, int uid)
4060 throws RemoteException {
4061 Parcel data = Parcel.obtain();
4062 Parcel reply = Parcel.obtain();
4063 data.writeInterfaceToken(IActivityManager.descriptor);
4064 data.writeString(permission);
4065 data.writeInt(pid);
4066 data.writeInt(uid);
4067 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
4068 reply.readException();
4069 int res = reply.readInt();
4070 data.recycle();
4071 reply.recycle();
4072 return res;
4073 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004074 public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken)
4075 throws RemoteException {
4076 Parcel data = Parcel.obtain();
4077 Parcel reply = Parcel.obtain();
4078 data.writeInterfaceToken(IActivityManager.descriptor);
4079 data.writeString(permission);
4080 data.writeInt(pid);
4081 data.writeInt(uid);
4082 data.writeStrongBinder(callerToken);
4083 mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0);
4084 reply.readException();
4085 int res = reply.readInt();
4086 data.recycle();
4087 reply.recycle();
4088 return res;
4089 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004090 public boolean clearApplicationUserData(final String packageName,
Amith Yamasani742a6712011-05-04 14:49:28 -07004091 final IPackageDataObserver observer, final int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004092 Parcel data = Parcel.obtain();
4093 Parcel reply = Parcel.obtain();
4094 data.writeInterfaceToken(IActivityManager.descriptor);
4095 data.writeString(packageName);
Christopher Tate31b65f92013-09-09 14:17:27 -07004096 data.writeStrongBinder((observer != null) ? observer.asBinder() : null);
Amith Yamasani742a6712011-05-04 14:49:28 -07004097 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004098 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
4099 reply.readException();
4100 boolean res = reply.readInt() != 0;
4101 data.recycle();
4102 reply.recycle();
4103 return res;
4104 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004105 public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId,
4106 IBinder callerToken) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004107 Parcel data = Parcel.obtain();
4108 Parcel reply = Parcel.obtain();
4109 data.writeInterfaceToken(IActivityManager.descriptor);
4110 uri.writeToParcel(data, 0);
4111 data.writeInt(pid);
4112 data.writeInt(uid);
4113 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004114 data.writeInt(userId);
Dianne Hackbornff170242014-11-19 10:59:01 -08004115 data.writeStrongBinder(callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004116 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
4117 reply.readException();
4118 int res = reply.readInt();
4119 data.recycle();
4120 reply.recycle();
4121 return res;
4122 }
4123 public void grantUriPermission(IApplicationThread caller, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004124 Uri uri, int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004125 Parcel data = Parcel.obtain();
4126 Parcel reply = Parcel.obtain();
4127 data.writeInterfaceToken(IActivityManager.descriptor);
4128 data.writeStrongBinder(caller.asBinder());
4129 data.writeString(targetPkg);
4130 uri.writeToParcel(data, 0);
4131 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004132 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004133 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4134 reply.readException();
4135 data.recycle();
4136 reply.recycle();
4137 }
4138 public void revokeUriPermission(IApplicationThread caller, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004139 int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004140 Parcel data = Parcel.obtain();
4141 Parcel reply = Parcel.obtain();
4142 data.writeInterfaceToken(IActivityManager.descriptor);
4143 data.writeStrongBinder(caller.asBinder());
4144 uri.writeToParcel(data, 0);
4145 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004146 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004147 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4148 reply.readException();
4149 data.recycle();
4150 reply.recycle();
4151 }
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004152
4153 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004154 public void takePersistableUriPermission(Uri uri, int mode, int userId)
4155 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004156 Parcel data = Parcel.obtain();
4157 Parcel reply = Parcel.obtain();
4158 data.writeInterfaceToken(IActivityManager.descriptor);
4159 uri.writeToParcel(data, 0);
4160 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004161 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004162 mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4163 reply.readException();
4164 data.recycle();
4165 reply.recycle();
4166 }
4167
4168 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004169 public void releasePersistableUriPermission(Uri uri, int mode, int userId)
4170 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004171 Parcel data = Parcel.obtain();
4172 Parcel reply = Parcel.obtain();
4173 data.writeInterfaceToken(IActivityManager.descriptor);
4174 uri.writeToParcel(data, 0);
4175 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004176 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004177 mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4178 reply.readException();
4179 data.recycle();
4180 reply.recycle();
4181 }
4182
4183 @Override
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004184 public ParceledListSlice<UriPermission> getPersistedUriPermissions(
4185 String packageName, boolean incoming) throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004186 Parcel data = Parcel.obtain();
4187 Parcel reply = Parcel.obtain();
4188 data.writeInterfaceToken(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004189 data.writeString(packageName);
4190 data.writeInt(incoming ? 1 : 0);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004191 mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
4192 reply.readException();
4193 final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel(
4194 reply);
4195 data.recycle();
4196 reply.recycle();
4197 return perms;
4198 }
4199
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004200 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
4201 throws RemoteException {
4202 Parcel data = Parcel.obtain();
4203 Parcel reply = Parcel.obtain();
4204 data.writeInterfaceToken(IActivityManager.descriptor);
4205 data.writeStrongBinder(who.asBinder());
4206 data.writeInt(waiting ? 1 : 0);
4207 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
4208 reply.readException();
4209 data.recycle();
4210 reply.recycle();
4211 }
4212 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
4213 Parcel data = Parcel.obtain();
4214 Parcel reply = Parcel.obtain();
4215 data.writeInterfaceToken(IActivityManager.descriptor);
4216 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
4217 reply.readException();
4218 outInfo.readFromParcel(reply);
4219 data.recycle();
4220 reply.recycle();
4221 }
4222 public void unhandledBack() throws RemoteException
4223 {
4224 Parcel data = Parcel.obtain();
4225 Parcel reply = Parcel.obtain();
4226 data.writeInterfaceToken(IActivityManager.descriptor);
4227 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
4228 reply.readException();
4229 data.recycle();
4230 reply.recycle();
4231 }
4232 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
4233 {
4234 Parcel data = Parcel.obtain();
4235 Parcel reply = Parcel.obtain();
4236 data.writeInterfaceToken(IActivityManager.descriptor);
4237 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
4238 reply.readException();
4239 ParcelFileDescriptor pfd = null;
4240 if (reply.readInt() != 0) {
4241 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
4242 }
4243 data.recycle();
4244 reply.recycle();
4245 return pfd;
4246 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07004247 public void setLockScreenShown(boolean shown) throws RemoteException
4248 {
4249 Parcel data = Parcel.obtain();
4250 Parcel reply = Parcel.obtain();
4251 data.writeInterfaceToken(IActivityManager.descriptor);
4252 data.writeInt(shown ? 1 : 0);
4253 mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0);
4254 reply.readException();
4255 data.recycle();
4256 reply.recycle();
4257 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004258 public void setDebugApp(
4259 String packageName, boolean waitForDebugger, boolean persistent)
4260 throws RemoteException
4261 {
4262 Parcel data = Parcel.obtain();
4263 Parcel reply = Parcel.obtain();
4264 data.writeInterfaceToken(IActivityManager.descriptor);
4265 data.writeString(packageName);
4266 data.writeInt(waitForDebugger ? 1 : 0);
4267 data.writeInt(persistent ? 1 : 0);
4268 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
4269 reply.readException();
4270 data.recycle();
4271 reply.recycle();
4272 }
4273 public void setAlwaysFinish(boolean enabled) throws RemoteException
4274 {
4275 Parcel data = Parcel.obtain();
4276 Parcel reply = Parcel.obtain();
4277 data.writeInterfaceToken(IActivityManager.descriptor);
4278 data.writeInt(enabled ? 1 : 0);
4279 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
4280 reply.readException();
4281 data.recycle();
4282 reply.recycle();
4283 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004284 public void setActivityController(IActivityController watcher) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004285 {
4286 Parcel data = Parcel.obtain();
4287 Parcel reply = Parcel.obtain();
4288 data.writeInterfaceToken(IActivityManager.descriptor);
4289 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004290 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004291 reply.readException();
4292 data.recycle();
4293 reply.recycle();
4294 }
4295 public void enterSafeMode() throws RemoteException {
4296 Parcel data = Parcel.obtain();
4297 data.writeInterfaceToken(IActivityManager.descriptor);
4298 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
4299 data.recycle();
4300 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07004301 public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag)
Dianne Hackborn099bc622014-01-22 13:39:16 -08004302 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004303 Parcel data = Parcel.obtain();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004304 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn099bc622014-01-22 13:39:16 -08004305 data.writeStrongBinder(sender.asBinder());
4306 data.writeInt(sourceUid);
4307 data.writeString(sourcePkg);
Dianne Hackborn1e383822015-04-10 14:02:33 -07004308 data.writeString(tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004309 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
4310 data.recycle();
4311 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07004312 public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag)
4313 throws RemoteException {
4314 Parcel data = Parcel.obtain();
4315 data.writeInterfaceToken(IActivityManager.descriptor);
4316 data.writeStrongBinder(sender.asBinder());
4317 data.writeInt(sourceUid);
4318 data.writeString(tag);
4319 mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0);
4320 data.recycle();
4321 }
4322 public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag)
4323 throws RemoteException {
4324 Parcel data = Parcel.obtain();
4325 data.writeInterfaceToken(IActivityManager.descriptor);
4326 data.writeStrongBinder(sender.asBinder());
4327 data.writeInt(sourceUid);
4328 data.writeString(tag);
4329 mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0);
4330 data.recycle();
4331 }
Dianne Hackborn64825172011-03-02 21:32:58 -08004332 public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004333 Parcel data = Parcel.obtain();
4334 Parcel reply = Parcel.obtain();
4335 data.writeInterfaceToken(IActivityManager.descriptor);
4336 data.writeIntArray(pids);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004337 data.writeString(reason);
Dianne Hackborn64825172011-03-02 21:32:58 -08004338 data.writeInt(secure ? 1 : 0);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004339 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07004340 reply.readException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004341 boolean res = reply.readInt() != 0;
4342 data.recycle();
4343 reply.recycle();
4344 return res;
4345 }
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07004346 @Override
4347 public boolean killProcessesBelowForeground(String reason) throws RemoteException {
4348 Parcel data = Parcel.obtain();
4349 Parcel reply = Parcel.obtain();
4350 data.writeInterfaceToken(IActivityManager.descriptor);
4351 data.writeString(reason);
4352 mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0);
4353 boolean res = reply.readInt() != 0;
4354 data.recycle();
4355 reply.recycle();
4356 return res;
4357 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004358 public boolean testIsSystemReady()
4359 {
4360 /* this base class version is never called */
4361 return true;
4362 }
Dan Egnor60d87622009-12-16 16:32:58 -08004363 public void handleApplicationCrash(IBinder app,
4364 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
4365 {
4366 Parcel data = Parcel.obtain();
4367 Parcel reply = Parcel.obtain();
4368 data.writeInterfaceToken(IActivityManager.descriptor);
4369 data.writeStrongBinder(app);
4370 crashInfo.writeToParcel(data, 0);
4371 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
4372 reply.readException();
4373 reply.recycle();
4374 data.recycle();
4375 }
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004376
Dianne Hackborn52322712014-08-26 22:47:26 -07004377 public boolean handleApplicationWtf(IBinder app, String tag, boolean system,
Dan Egnorb7f03672009-12-09 16:22:32 -08004378 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004379 {
4380 Parcel data = Parcel.obtain();
4381 Parcel reply = Parcel.obtain();
4382 data.writeInterfaceToken(IActivityManager.descriptor);
4383 data.writeStrongBinder(app);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004384 data.writeString(tag);
Dianne Hackborn52322712014-08-26 22:47:26 -07004385 data.writeInt(system ? 1 : 0);
Dan Egnorb7f03672009-12-09 16:22:32 -08004386 crashInfo.writeToParcel(data, 0);
Dan Egnor60d87622009-12-16 16:32:58 -08004387 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004388 reply.readException();
Dan Egnor60d87622009-12-16 16:32:58 -08004389 boolean res = reply.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004390 reply.recycle();
4391 data.recycle();
Dan Egnor60d87622009-12-16 16:32:58 -08004392 return res;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004393 }
Dan Egnorb7f03672009-12-09 16:22:32 -08004394
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004395 public void handleApplicationStrictModeViolation(IBinder app,
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004396 int violationMask,
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004397 StrictMode.ViolationInfo info) throws RemoteException
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004398 {
4399 Parcel data = Parcel.obtain();
4400 Parcel reply = Parcel.obtain();
4401 data.writeInterfaceToken(IActivityManager.descriptor);
4402 data.writeStrongBinder(app);
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004403 data.writeInt(violationMask);
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004404 info.writeToParcel(data, 0);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004405 mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0);
4406 reply.readException();
4407 reply.recycle();
4408 data.recycle();
4409 }
4410
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004411 public void signalPersistentProcesses(int sig) throws RemoteException {
4412 Parcel data = Parcel.obtain();
4413 Parcel reply = Parcel.obtain();
4414 data.writeInterfaceToken(IActivityManager.descriptor);
4415 data.writeInt(sig);
4416 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
4417 reply.readException();
4418 data.recycle();
4419 reply.recycle();
4420 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004421
Dianne Hackborn1676c852012-09-10 14:52:30 -07004422 public void killBackgroundProcesses(String packageName, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004423 Parcel data = Parcel.obtain();
4424 Parcel reply = Parcel.obtain();
4425 data.writeInterfaceToken(IActivityManager.descriptor);
4426 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004427 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004428 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4429 reply.readException();
4430 data.recycle();
4431 reply.recycle();
4432 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004433
4434 public void killAllBackgroundProcesses() throws RemoteException {
4435 Parcel data = Parcel.obtain();
4436 Parcel reply = Parcel.obtain();
4437 data.writeInterfaceToken(IActivityManager.descriptor);
4438 mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4439 reply.readException();
4440 data.recycle();
4441 reply.recycle();
4442 }
4443
Dianne Hackborn1676c852012-09-10 14:52:30 -07004444 public void forceStopPackage(String packageName, int userId) throws RemoteException {
Dianne Hackborn03abb812010-01-04 18:43:19 -08004445 Parcel data = Parcel.obtain();
4446 Parcel reply = Parcel.obtain();
4447 data.writeInterfaceToken(IActivityManager.descriptor);
4448 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004449 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004450 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004451 reply.readException();
4452 data.recycle();
4453 reply.recycle();
4454 }
4455
Dianne Hackborn27ff9132012-03-06 14:57:58 -08004456 public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
4457 throws RemoteException
4458 {
4459 Parcel data = Parcel.obtain();
4460 Parcel reply = Parcel.obtain();
4461 data.writeInterfaceToken(IActivityManager.descriptor);
4462 mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0);
4463 reply.readException();
4464 outInfo.readFromParcel(reply);
4465 reply.recycle();
4466 data.recycle();
4467 }
4468
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004469 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
4470 {
4471 Parcel data = Parcel.obtain();
4472 Parcel reply = Parcel.obtain();
4473 data.writeInterfaceToken(IActivityManager.descriptor);
4474 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
4475 reply.readException();
4476 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
4477 reply.recycle();
4478 data.recycle();
4479 return res;
4480 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004481
Dianne Hackborn1676c852012-09-10 14:52:30 -07004482 public boolean profileControl(String process, int userId, boolean start,
Jeff Hao1b012d32014-08-20 10:35:34 -07004483 ProfilerInfo profilerInfo, int profileType) throws RemoteException
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004484 {
4485 Parcel data = Parcel.obtain();
4486 Parcel reply = Parcel.obtain();
4487 data.writeInterfaceToken(IActivityManager.descriptor);
4488 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004489 data.writeInt(userId);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004490 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07004491 data.writeInt(profileType);
Jeff Hao1b012d32014-08-20 10:35:34 -07004492 if (profilerInfo != null) {
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004493 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07004494 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004495 } else {
4496 data.writeInt(0);
4497 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004498 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
4499 reply.readException();
4500 boolean res = reply.readInt() != 0;
4501 reply.recycle();
4502 data.recycle();
4503 return res;
4504 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004505
Dianne Hackborn55280a92009-05-07 15:53:46 -07004506 public boolean shutdown(int timeout) throws RemoteException
4507 {
4508 Parcel data = Parcel.obtain();
4509 Parcel reply = Parcel.obtain();
4510 data.writeInterfaceToken(IActivityManager.descriptor);
4511 data.writeInt(timeout);
4512 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
4513 reply.readException();
4514 boolean res = reply.readInt() != 0;
4515 reply.recycle();
4516 data.recycle();
4517 return res;
4518 }
4519
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07004520 public void stopAppSwitches() throws RemoteException {
4521 Parcel data = Parcel.obtain();
4522 Parcel reply = Parcel.obtain();
4523 data.writeInterfaceToken(IActivityManager.descriptor);
4524 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
4525 reply.readException();
4526 reply.recycle();
4527 data.recycle();
4528 }
4529
4530 public void resumeAppSwitches() throws RemoteException {
4531 Parcel data = Parcel.obtain();
4532 Parcel reply = Parcel.obtain();
4533 data.writeInterfaceToken(IActivityManager.descriptor);
4534 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
4535 reply.readException();
4536 reply.recycle();
4537 data.recycle();
4538 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07004539
4540 public void addPackageDependency(String packageName) throws RemoteException {
4541 Parcel data = Parcel.obtain();
4542 Parcel reply = Parcel.obtain();
4543 data.writeInterfaceToken(IActivityManager.descriptor);
4544 data.writeString(packageName);
4545 mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0);
4546 reply.readException();
4547 data.recycle();
4548 reply.recycle();
4549 }
4550
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004551 public void killApplicationWithAppId(String pkg, int appid, String reason)
4552 throws RemoteException {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004553 Parcel data = Parcel.obtain();
4554 Parcel reply = Parcel.obtain();
4555 data.writeInterfaceToken(IActivityManager.descriptor);
4556 data.writeString(pkg);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004557 data.writeInt(appid);
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004558 data.writeString(reason);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004559 mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004560 reply.readException();
4561 data.recycle();
4562 reply.recycle();
4563 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07004564
4565 public void closeSystemDialogs(String reason) throws RemoteException {
4566 Parcel data = Parcel.obtain();
4567 Parcel reply = Parcel.obtain();
4568 data.writeInterfaceToken(IActivityManager.descriptor);
4569 data.writeString(reason);
4570 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
4571 reply.readException();
4572 data.recycle();
4573 reply.recycle();
4574 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004575
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004576 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004577 throws RemoteException {
4578 Parcel data = Parcel.obtain();
4579 Parcel reply = Parcel.obtain();
4580 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004581 data.writeIntArray(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004582 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
4583 reply.readException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004584 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004585 data.recycle();
4586 reply.recycle();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004587 return res;
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004588 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07004589
4590 public void killApplicationProcess(String processName, int uid) throws RemoteException {
4591 Parcel data = Parcel.obtain();
4592 Parcel reply = Parcel.obtain();
4593 data.writeInterfaceToken(IActivityManager.descriptor);
4594 data.writeString(processName);
4595 data.writeInt(uid);
4596 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
4597 reply.readException();
4598 data.recycle();
4599 reply.recycle();
4600 }
4601
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07004602 public void overridePendingTransition(IBinder token, String packageName,
4603 int enterAnim, int exitAnim) throws RemoteException {
4604 Parcel data = Parcel.obtain();
4605 Parcel reply = Parcel.obtain();
4606 data.writeInterfaceToken(IActivityManager.descriptor);
4607 data.writeStrongBinder(token);
4608 data.writeString(packageName);
4609 data.writeInt(enterAnim);
4610 data.writeInt(exitAnim);
4611 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
4612 reply.readException();
4613 data.recycle();
4614 reply.recycle();
4615 }
4616
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08004617 public boolean isUserAMonkey() throws RemoteException {
4618 Parcel data = Parcel.obtain();
4619 Parcel reply = Parcel.obtain();
4620 data.writeInterfaceToken(IActivityManager.descriptor);
4621 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
4622 reply.readException();
4623 boolean res = reply.readInt() != 0;
4624 data.recycle();
4625 reply.recycle();
4626 return res;
4627 }
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07004628
4629 public void setUserIsMonkey(boolean monkey) throws RemoteException {
4630 Parcel data = Parcel.obtain();
4631 Parcel reply = Parcel.obtain();
4632 data.writeInterfaceToken(IActivityManager.descriptor);
4633 data.writeInt(monkey ? 1 : 0);
4634 mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0);
4635 reply.readException();
4636 data.recycle();
4637 reply.recycle();
4638 }
4639
Dianne Hackborn860755f2010-06-03 18:47:52 -07004640 public void finishHeavyWeightApp() throws RemoteException {
4641 Parcel data = Parcel.obtain();
4642 Parcel reply = Parcel.obtain();
4643 data.writeInterfaceToken(IActivityManager.descriptor);
4644 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
4645 reply.readException();
4646 data.recycle();
4647 reply.recycle();
4648 }
Craig Mautner4addfc52013-06-25 08:05:45 -07004649
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004650 public boolean convertFromTranslucent(IBinder token)
Craig Mautner4addfc52013-06-25 08:05:45 -07004651 throws RemoteException {
4652 Parcel data = Parcel.obtain();
4653 Parcel reply = Parcel.obtain();
4654 data.writeInterfaceToken(IActivityManager.descriptor);
4655 data.writeStrongBinder(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07004656 mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0);
4657 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004658 boolean res = reply.readInt() != 0;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004659 data.recycle();
4660 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004661 return res;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004662 }
4663
Craig Mautner233ceee2014-05-09 17:05:11 -07004664 public boolean convertToTranslucent(IBinder token, ActivityOptions options)
Craig Mautner5eda9b32013-07-02 11:58:16 -07004665 throws RemoteException {
4666 Parcel data = Parcel.obtain();
4667 Parcel reply = Parcel.obtain();
4668 data.writeInterfaceToken(IActivityManager.descriptor);
4669 data.writeStrongBinder(token);
Craig Mautner233ceee2014-05-09 17:05:11 -07004670 if (options == null) {
4671 data.writeInt(0);
4672 } else {
4673 data.writeInt(1);
4674 data.writeBundle(options.toBundle());
4675 }
Craig Mautner5eda9b32013-07-02 11:58:16 -07004676 mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07004677 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004678 boolean res = reply.readInt() != 0;
Craig Mautner4addfc52013-06-25 08:05:45 -07004679 data.recycle();
4680 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004681 return res;
Craig Mautner4addfc52013-06-25 08:05:45 -07004682 }
4683
Craig Mautner233ceee2014-05-09 17:05:11 -07004684 public ActivityOptions getActivityOptions(IBinder token) throws RemoteException {
4685 Parcel data = Parcel.obtain();
4686 Parcel reply = Parcel.obtain();
4687 data.writeInterfaceToken(IActivityManager.descriptor);
4688 data.writeStrongBinder(token);
4689 mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0);
4690 reply.readException();
4691 Bundle bundle = reply.readBundle();
4692 ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
4693 data.recycle();
4694 reply.recycle();
4695 return options;
4696 }
4697
Daniel Sandler69a48172010-06-23 16:29:36 -04004698 public void setImmersive(IBinder token, boolean immersive)
4699 throws RemoteException {
4700 Parcel data = Parcel.obtain();
4701 Parcel reply = Parcel.obtain();
4702 data.writeInterfaceToken(IActivityManager.descriptor);
4703 data.writeStrongBinder(token);
4704 data.writeInt(immersive ? 1 : 0);
4705 mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
4706 reply.readException();
4707 data.recycle();
4708 reply.recycle();
4709 }
4710
4711 public boolean isImmersive(IBinder token)
4712 throws RemoteException {
4713 Parcel data = Parcel.obtain();
4714 Parcel reply = Parcel.obtain();
4715 data.writeInterfaceToken(IActivityManager.descriptor);
4716 data.writeStrongBinder(token);
4717 mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004718 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004719 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004720 data.recycle();
4721 reply.recycle();
4722 return res;
4723 }
4724
Craig Mautnerd61dc202014-07-07 11:09:11 -07004725 public boolean isTopOfTask(IBinder token) throws RemoteException {
4726 Parcel data = Parcel.obtain();
4727 Parcel reply = Parcel.obtain();
4728 data.writeInterfaceToken(IActivityManager.descriptor);
4729 data.writeStrongBinder(token);
4730 mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0);
4731 reply.readException();
4732 boolean res = reply.readInt() == 1;
4733 data.recycle();
4734 reply.recycle();
4735 return res;
4736 }
4737
Daniel Sandler69a48172010-06-23 16:29:36 -04004738 public boolean isTopActivityImmersive()
4739 throws RemoteException {
4740 Parcel data = Parcel.obtain();
4741 Parcel reply = Parcel.obtain();
4742 data.writeInterfaceToken(IActivityManager.descriptor);
4743 mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004744 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004745 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004746 data.recycle();
4747 reply.recycle();
4748 return res;
4749 }
4750
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004751 public void crashApplication(int uid, int initialPid, String packageName,
4752 String message) throws RemoteException {
4753 Parcel data = Parcel.obtain();
4754 Parcel reply = Parcel.obtain();
4755 data.writeInterfaceToken(IActivityManager.descriptor);
4756 data.writeInt(uid);
4757 data.writeInt(initialPid);
4758 data.writeString(packageName);
4759 data.writeString(message);
4760 mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0);
4761 reply.readException();
4762 data.recycle();
4763 reply.recycle();
4764 }
Andy McFadden824c5102010-07-09 16:26:57 -07004765
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004766 public String getProviderMimeType(Uri uri, int userId) throws RemoteException {
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004767 Parcel data = Parcel.obtain();
4768 Parcel reply = Parcel.obtain();
4769 data.writeInterfaceToken(IActivityManager.descriptor);
4770 uri.writeToParcel(data, 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004771 data.writeInt(userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004772 mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0);
4773 reply.readException();
4774 String res = reply.readString();
4775 data.recycle();
4776 reply.recycle();
4777 return res;
4778 }
4779
Dianne Hackborn7e269642010-08-25 19:50:20 -07004780 public IBinder newUriPermissionOwner(String name)
4781 throws RemoteException {
4782 Parcel data = Parcel.obtain();
4783 Parcel reply = Parcel.obtain();
4784 data.writeInterfaceToken(IActivityManager.descriptor);
4785 data.writeString(name);
4786 mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
4787 reply.readException();
4788 IBinder res = reply.readStrongBinder();
4789 data.recycle();
4790 reply.recycle();
4791 return res;
4792 }
4793
4794 public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
Nicolas Prevotf1939902014-06-25 09:29:02 +01004795 Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07004796 Parcel data = Parcel.obtain();
4797 Parcel reply = Parcel.obtain();
4798 data.writeInterfaceToken(IActivityManager.descriptor);
4799 data.writeStrongBinder(owner);
4800 data.writeInt(fromUid);
4801 data.writeString(targetPkg);
4802 uri.writeToParcel(data, 0);
4803 data.writeInt(mode);
Nicolas Prevotf1939902014-06-25 09:29:02 +01004804 data.writeInt(sourceUserId);
4805 data.writeInt(targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07004806 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4807 reply.readException();
4808 data.recycle();
4809 reply.recycle();
4810 }
4811
4812 public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004813 int mode, int userId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07004814 Parcel data = Parcel.obtain();
4815 Parcel reply = Parcel.obtain();
4816 data.writeInterfaceToken(IActivityManager.descriptor);
4817 data.writeStrongBinder(owner);
4818 if (uri != null) {
4819 data.writeInt(1);
4820 uri.writeToParcel(data, 0);
4821 } else {
4822 data.writeInt(0);
4823 }
4824 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004825 data.writeInt(userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07004826 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4827 reply.readException();
4828 data.recycle();
4829 reply.recycle();
4830 }
Dianne Hackbornc8f84972010-08-25 23:14:44 -07004831
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004832 public int checkGrantUriPermission(int callingUid, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004833 Uri uri, int modeFlags, int userId) throws RemoteException {
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004834 Parcel data = Parcel.obtain();
4835 Parcel reply = Parcel.obtain();
4836 data.writeInterfaceToken(IActivityManager.descriptor);
4837 data.writeInt(callingUid);
4838 data.writeString(targetPkg);
4839 uri.writeToParcel(data, 0);
4840 data.writeInt(modeFlags);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004841 data.writeInt(userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004842 mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4843 reply.readException();
4844 int res = reply.readInt();
4845 data.recycle();
4846 reply.recycle();
4847 return res;
4848 }
4849
Dianne Hackborn1676c852012-09-10 14:52:30 -07004850 public boolean dumpHeap(String process, int userId, boolean managed,
Andy McFadden824c5102010-07-09 16:26:57 -07004851 String path, ParcelFileDescriptor fd) throws RemoteException {
4852 Parcel data = Parcel.obtain();
4853 Parcel reply = Parcel.obtain();
4854 data.writeInterfaceToken(IActivityManager.descriptor);
4855 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004856 data.writeInt(userId);
Andy McFadden824c5102010-07-09 16:26:57 -07004857 data.writeInt(managed ? 1 : 0);
4858 data.writeString(path);
4859 if (fd != null) {
4860 data.writeInt(1);
4861 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
4862 } else {
4863 data.writeInt(0);
4864 }
4865 mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
4866 reply.readException();
4867 boolean res = reply.readInt() != 0;
4868 reply.recycle();
4869 data.recycle();
4870 return res;
4871 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004872
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004873 public int startActivities(IApplicationThread caller, String callingPackage,
Dianne Hackborna4972e92012-03-14 10:38:05 -07004874 Intent[] intents, String[] resolvedTypes, IBinder resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004875 Bundle options, int userId) throws RemoteException {
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004876 Parcel data = Parcel.obtain();
4877 Parcel reply = Parcel.obtain();
4878 data.writeInterfaceToken(IActivityManager.descriptor);
4879 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004880 data.writeString(callingPackage);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004881 data.writeTypedArray(intents, 0);
4882 data.writeStringArray(resolvedTypes);
4883 data.writeStrongBinder(resultTo);
Dianne Hackborna4972e92012-03-14 10:38:05 -07004884 if (options != null) {
4885 data.writeInt(1);
4886 options.writeToParcel(data, 0);
4887 } else {
4888 data.writeInt(0);
4889 }
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004890 data.writeInt(userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004891 mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0);
4892 reply.readException();
4893 int result = reply.readInt();
4894 reply.recycle();
4895 data.recycle();
4896 return result;
4897 }
4898
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004899 public int getFrontActivityScreenCompatMode() throws RemoteException {
4900 Parcel data = Parcel.obtain();
4901 Parcel reply = Parcel.obtain();
4902 data.writeInterfaceToken(IActivityManager.descriptor);
4903 mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4904 reply.readException();
4905 int mode = reply.readInt();
4906 reply.recycle();
4907 data.recycle();
4908 return mode;
4909 }
4910
4911 public void setFrontActivityScreenCompatMode(int mode) throws RemoteException {
4912 Parcel data = Parcel.obtain();
4913 Parcel reply = Parcel.obtain();
4914 data.writeInterfaceToken(IActivityManager.descriptor);
4915 data.writeInt(mode);
4916 mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4917 reply.readException();
4918 reply.recycle();
4919 data.recycle();
4920 }
4921
4922 public int getPackageScreenCompatMode(String packageName) throws RemoteException {
4923 Parcel data = Parcel.obtain();
4924 Parcel reply = Parcel.obtain();
4925 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004926 data.writeString(packageName);
4927 mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004928 reply.readException();
4929 int mode = reply.readInt();
4930 reply.recycle();
4931 data.recycle();
4932 return mode;
4933 }
4934
4935 public void setPackageScreenCompatMode(String packageName, int mode)
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004936 throws RemoteException {
4937 Parcel data = Parcel.obtain();
4938 Parcel reply = Parcel.obtain();
4939 data.writeInterfaceToken(IActivityManager.descriptor);
4940 data.writeString(packageName);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004941 data.writeInt(mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004942 mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4943 reply.readException();
4944 reply.recycle();
4945 data.recycle();
4946 }
4947
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004948 public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
4949 Parcel data = Parcel.obtain();
4950 Parcel reply = Parcel.obtain();
4951 data.writeInterfaceToken(IActivityManager.descriptor);
4952 data.writeString(packageName);
4953 mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4954 reply.readException();
4955 boolean ask = reply.readInt() != 0;
4956 reply.recycle();
4957 data.recycle();
4958 return ask;
4959 }
4960
4961 public void setPackageAskScreenCompat(String packageName, boolean ask)
4962 throws RemoteException {
4963 Parcel data = Parcel.obtain();
4964 Parcel reply = Parcel.obtain();
4965 data.writeInterfaceToken(IActivityManager.descriptor);
4966 data.writeString(packageName);
4967 data.writeInt(ask ? 1 : 0);
4968 mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4969 reply.readException();
4970 reply.recycle();
4971 data.recycle();
4972 }
4973
Amith Yamasani4b2e9342011-03-31 12:38:53 -07004974 public boolean switchUser(int userid) throws RemoteException {
4975 Parcel data = Parcel.obtain();
4976 Parcel reply = Parcel.obtain();
4977 data.writeInterfaceToken(IActivityManager.descriptor);
4978 data.writeInt(userid);
4979 mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0);
4980 reply.readException();
4981 boolean result = reply.readInt() != 0;
4982 reply.recycle();
4983 data.recycle();
4984 return result;
4985 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07004986
Kenny Guy08488bf2014-02-21 17:40:37 +00004987 public boolean startUserInBackground(int userid) throws RemoteException {
4988 Parcel data = Parcel.obtain();
4989 Parcel reply = Parcel.obtain();
4990 data.writeInterfaceToken(IActivityManager.descriptor);
4991 data.writeInt(userid);
4992 mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0);
4993 reply.readException();
4994 boolean result = reply.readInt() != 0;
4995 reply.recycle();
4996 data.recycle();
4997 return result;
4998 }
4999
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005000 public int stopUser(int userid, IStopUserCallback callback) throws RemoteException {
5001 Parcel data = Parcel.obtain();
5002 Parcel reply = Parcel.obtain();
5003 data.writeInterfaceToken(IActivityManager.descriptor);
5004 data.writeInt(userid);
5005 data.writeStrongInterface(callback);
5006 mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0);
5007 reply.readException();
5008 int result = reply.readInt();
5009 reply.recycle();
5010 data.recycle();
5011 return result;
5012 }
5013
Amith Yamasani52f1d752012-03-28 18:19:29 -07005014 public UserInfo getCurrentUser() throws RemoteException {
5015 Parcel data = Parcel.obtain();
5016 Parcel reply = Parcel.obtain();
5017 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005018 mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0);
Amith Yamasani52f1d752012-03-28 18:19:29 -07005019 reply.readException();
5020 UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply);
5021 reply.recycle();
5022 data.recycle();
5023 return userInfo;
5024 }
5025
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07005026 public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException {
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005027 Parcel data = Parcel.obtain();
5028 Parcel reply = Parcel.obtain();
5029 data.writeInterfaceToken(IActivityManager.descriptor);
5030 data.writeInt(userid);
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07005031 data.writeInt(orStopping ? 1 : 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005032 mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0);
5033 reply.readException();
5034 boolean result = reply.readInt() != 0;
5035 reply.recycle();
5036 data.recycle();
5037 return result;
5038 }
5039
Dianne Hackbornc72fc672012-09-20 13:12:03 -07005040 public int[] getRunningUserIds() throws RemoteException {
5041 Parcel data = Parcel.obtain();
5042 Parcel reply = Parcel.obtain();
5043 data.writeInterfaceToken(IActivityManager.descriptor);
5044 mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0);
5045 reply.readException();
5046 int[] result = reply.createIntArray();
5047 reply.recycle();
5048 data.recycle();
5049 return result;
5050 }
5051
Wale Ogunwaled54b5782014-10-23 15:55:23 -07005052 public boolean removeTask(int taskId) throws RemoteException {
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005053 Parcel data = Parcel.obtain();
5054 Parcel reply = Parcel.obtain();
5055 data.writeInterfaceToken(IActivityManager.descriptor);
5056 data.writeInt(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005057 mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
5058 reply.readException();
5059 boolean result = reply.readInt() != 0;
5060 reply.recycle();
5061 data.recycle();
5062 return result;
5063 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07005064
Jeff Sharkeya4620792011-05-20 15:29:23 -07005065 public void registerProcessObserver(IProcessObserver observer) throws RemoteException {
5066 Parcel data = Parcel.obtain();
5067 Parcel reply = Parcel.obtain();
5068 data.writeInterfaceToken(IActivityManager.descriptor);
5069 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5070 mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5071 reply.readException();
5072 data.recycle();
5073 reply.recycle();
5074 }
5075
5076 public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException {
5077 Parcel data = Parcel.obtain();
5078 Parcel reply = Parcel.obtain();
5079 data.writeInterfaceToken(IActivityManager.descriptor);
5080 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5081 mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5082 reply.readException();
5083 data.recycle();
5084 reply.recycle();
5085 }
5086
Dianne Hackborn6c418d52011-06-29 14:05:33 -07005087 public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException {
5088 Parcel data = Parcel.obtain();
5089 Parcel reply = Parcel.obtain();
5090 data.writeInterfaceToken(IActivityManager.descriptor);
5091 data.writeStrongBinder(sender.asBinder());
5092 mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0);
5093 reply.readException();
5094 boolean res = reply.readInt() != 0;
5095 data.recycle();
5096 reply.recycle();
5097 return res;
5098 }
5099
Dianne Hackborn1927ae82012-06-22 15:21:36 -07005100 public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException {
5101 Parcel data = Parcel.obtain();
5102 Parcel reply = Parcel.obtain();
5103 data.writeInterfaceToken(IActivityManager.descriptor);
5104 data.writeStrongBinder(sender.asBinder());
5105 mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0);
5106 reply.readException();
5107 boolean res = reply.readInt() != 0;
5108 data.recycle();
5109 reply.recycle();
5110 return res;
5111 }
5112
Dianne Hackborn81038902012-11-26 17:04:09 -08005113 public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException {
5114 Parcel data = Parcel.obtain();
5115 Parcel reply = Parcel.obtain();
5116 data.writeInterfaceToken(IActivityManager.descriptor);
5117 data.writeStrongBinder(sender.asBinder());
5118 mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5119 reply.readException();
5120 Intent res = reply.readInt() != 0
5121 ? Intent.CREATOR.createFromParcel(reply) : null;
5122 data.recycle();
5123 reply.recycle();
5124 return res;
5125 }
5126
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08005127 public String getTagForIntentSender(IIntentSender sender, String prefix)
5128 throws RemoteException {
5129 Parcel data = Parcel.obtain();
5130 Parcel reply = Parcel.obtain();
5131 data.writeInterfaceToken(IActivityManager.descriptor);
5132 data.writeStrongBinder(sender.asBinder());
5133 data.writeString(prefix);
5134 mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5135 reply.readException();
5136 String res = reply.readString();
5137 data.recycle();
5138 reply.recycle();
5139 return res;
5140 }
5141
Dianne Hackborn31ca8542011-07-19 14:58:28 -07005142 public void updatePersistentConfiguration(Configuration values) throws RemoteException
5143 {
5144 Parcel data = Parcel.obtain();
5145 Parcel reply = Parcel.obtain();
5146 data.writeInterfaceToken(IActivityManager.descriptor);
5147 values.writeToParcel(data, 0);
5148 mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0);
5149 reply.readException();
5150 data.recycle();
5151 reply.recycle();
5152 }
5153
Dianne Hackbornb437e092011-08-05 17:50:29 -07005154 public long[] getProcessPss(int[] pids) throws RemoteException {
5155 Parcel data = Parcel.obtain();
5156 Parcel reply = Parcel.obtain();
5157 data.writeInterfaceToken(IActivityManager.descriptor);
5158 data.writeIntArray(pids);
5159 mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0);
5160 reply.readException();
5161 long[] res = reply.createLongArray();
5162 data.recycle();
5163 reply.recycle();
5164 return res;
5165 }
5166
Dianne Hackborn661cd522011-08-22 00:26:20 -07005167 public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
5168 Parcel data = Parcel.obtain();
5169 Parcel reply = Parcel.obtain();
5170 data.writeInterfaceToken(IActivityManager.descriptor);
5171 TextUtils.writeToParcel(msg, data, 0);
5172 data.writeInt(always ? 1 : 0);
5173 mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
5174 reply.readException();
5175 data.recycle();
5176 reply.recycle();
5177 }
5178
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02005179 public void keyguardWaitingForActivityDrawn() throws RemoteException {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07005180 Parcel data = Parcel.obtain();
5181 Parcel reply = Parcel.obtain();
5182 data.writeInterfaceToken(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02005183 mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
Dianne Hackborn90c52de2011-09-23 12:57:44 -07005184 reply.readException();
5185 data.recycle();
5186 reply.recycle();
5187 }
5188
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07005189 public void keyguardGoingAway(boolean disableWindowAnimations,
5190 boolean keyguardGoingToNotificationShade) throws RemoteException {
5191 Parcel data = Parcel.obtain();
5192 Parcel reply = Parcel.obtain();
5193 data.writeInterfaceToken(IActivityManager.descriptor);
5194 data.writeInt(disableWindowAnimations ? 1 : 0);
5195 data.writeInt(keyguardGoingToNotificationShade ? 1 : 0);
5196 mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0);
5197 reply.readException();
5198 data.recycle();
5199 reply.recycle();
5200 }
5201
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07005202 public boolean shouldUpRecreateTask(IBinder token, String destAffinity)
Adam Powelldd8fab22012-03-22 17:47:27 -07005203 throws RemoteException {
5204 Parcel data = Parcel.obtain();
5205 Parcel reply = Parcel.obtain();
5206 data.writeInterfaceToken(IActivityManager.descriptor);
5207 data.writeStrongBinder(token);
5208 data.writeString(destAffinity);
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07005209 mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0);
Adam Powelldd8fab22012-03-22 17:47:27 -07005210 reply.readException();
5211 boolean result = reply.readInt() != 0;
5212 data.recycle();
5213 reply.recycle();
5214 return result;
5215 }
5216
5217 public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData)
5218 throws RemoteException {
5219 Parcel data = Parcel.obtain();
5220 Parcel reply = Parcel.obtain();
5221 data.writeInterfaceToken(IActivityManager.descriptor);
5222 data.writeStrongBinder(token);
5223 target.writeToParcel(data, 0);
5224 data.writeInt(resultCode);
5225 if (resultData != null) {
5226 data.writeInt(1);
5227 resultData.writeToParcel(data, 0);
5228 } else {
5229 data.writeInt(0);
5230 }
5231 mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0);
5232 reply.readException();
5233 boolean result = reply.readInt() != 0;
5234 data.recycle();
5235 reply.recycle();
5236 return result;
5237 }
5238
Dianne Hackborn5320eb82012-05-18 12:05:04 -07005239 public int getLaunchedFromUid(IBinder activityToken) throws RemoteException {
5240 Parcel data = Parcel.obtain();
5241 Parcel reply = Parcel.obtain();
5242 data.writeInterfaceToken(IActivityManager.descriptor);
5243 data.writeStrongBinder(activityToken);
5244 mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0);
5245 reply.readException();
5246 int result = reply.readInt();
5247 data.recycle();
5248 reply.recycle();
5249 return result;
5250 }
5251
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005252 public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException {
5253 Parcel data = Parcel.obtain();
5254 Parcel reply = Parcel.obtain();
5255 data.writeInterfaceToken(IActivityManager.descriptor);
5256 data.writeStrongBinder(activityToken);
5257 mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0);
5258 reply.readException();
5259 String result = reply.readString();
5260 data.recycle();
5261 reply.recycle();
5262 return result;
5263 }
5264
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07005265 public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5266 Parcel data = Parcel.obtain();
5267 Parcel reply = Parcel.obtain();
5268 data.writeInterfaceToken(IActivityManager.descriptor);
5269 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5270 mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5271 reply.readException();
5272 data.recycle();
5273 reply.recycle();
5274 }
5275
5276 public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5277 Parcel data = Parcel.obtain();
5278 Parcel reply = Parcel.obtain();
5279 data.writeInterfaceToken(IActivityManager.descriptor);
5280 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5281 mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5282 reply.readException();
5283 data.recycle();
5284 reply.recycle();
5285 }
5286
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07005287 public void requestBugReport() throws RemoteException {
5288 Parcel data = Parcel.obtain();
5289 Parcel reply = Parcel.obtain();
5290 data.writeInterfaceToken(IActivityManager.descriptor);
5291 mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0);
5292 reply.readException();
5293 data.recycle();
5294 reply.recycle();
5295 }
5296
Jeff Brownbd181bb2013-09-10 16:44:24 -07005297 public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason)
5298 throws RemoteException {
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005299 Parcel data = Parcel.obtain();
5300 Parcel reply = Parcel.obtain();
5301 data.writeInterfaceToken(IActivityManager.descriptor);
5302 data.writeInt(pid);
5303 data.writeInt(aboveSystem ? 1 : 0);
Jeff Brownbd181bb2013-09-10 16:44:24 -07005304 data.writeString(reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005305 mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0);
5306 reply.readException();
5307 long res = reply.readInt();
5308 data.recycle();
5309 reply.recycle();
5310 return res;
5311 }
5312
Adam Skorydfc7fd72013-08-05 19:23:41 -07005313 public Bundle getAssistContextExtras(int requestType) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005314 Parcel data = Parcel.obtain();
5315 Parcel reply = Parcel.obtain();
5316 data.writeInterfaceToken(IActivityManager.descriptor);
5317 data.writeInt(requestType);
Adam Skorydfc7fd72013-08-05 19:23:41 -07005318 mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005319 reply.readException();
5320 Bundle res = reply.readBundle();
5321 data.recycle();
5322 reply.recycle();
5323 return res;
5324 }
5325
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005326 public void requestAssistContextExtras(int requestType, IResultReceiver receiver)
5327 throws RemoteException {
5328 Parcel data = Parcel.obtain();
5329 Parcel reply = Parcel.obtain();
5330 data.writeInterfaceToken(IActivityManager.descriptor);
5331 data.writeInt(requestType);
5332 data.writeStrongBinder(receiver.asBinder());
5333 mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
5334 reply.readException();
5335 data.recycle();
5336 reply.recycle();
5337 }
5338
Adam Skory7140a252013-09-11 12:04:58 +01005339 public void reportAssistContextExtras(IBinder token, Bundle extras)
Adam Skorydfc7fd72013-08-05 19:23:41 -07005340 throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005341 Parcel data = Parcel.obtain();
5342 Parcel reply = Parcel.obtain();
5343 data.writeInterfaceToken(IActivityManager.descriptor);
5344 data.writeStrongBinder(token);
5345 data.writeBundle(extras);
Adam Skorydfc7fd72013-08-05 19:23:41 -07005346 mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005347 reply.readException();
5348 data.recycle();
5349 reply.recycle();
5350 }
5351
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07005352 public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle)
5353 throws RemoteException {
5354 Parcel data = Parcel.obtain();
5355 Parcel reply = Parcel.obtain();
5356 data.writeInterfaceToken(IActivityManager.descriptor);
5357 intent.writeToParcel(data, 0);
5358 data.writeInt(requestType);
5359 data.writeString(hint);
5360 data.writeInt(userHandle);
5361 mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0);
5362 reply.readException();
5363 boolean res = reply.readInt() != 0;
5364 data.recycle();
5365 reply.recycle();
5366 return res;
5367 }
5368
Dianne Hackbornf1b78242013-04-08 22:28:59 -07005369 public void killUid(int uid, String reason) throws RemoteException {
5370 Parcel data = Parcel.obtain();
5371 Parcel reply = Parcel.obtain();
5372 data.writeInterfaceToken(IActivityManager.descriptor);
5373 data.writeInt(uid);
5374 data.writeString(reason);
5375 mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0);
5376 reply.readException();
5377 data.recycle();
5378 reply.recycle();
5379 }
5380
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07005381 public void hang(IBinder who, boolean allowRestart) throws RemoteException {
5382 Parcel data = Parcel.obtain();
5383 Parcel reply = Parcel.obtain();
5384 data.writeInterfaceToken(IActivityManager.descriptor);
5385 data.writeStrongBinder(who);
5386 data.writeInt(allowRestart ? 1 : 0);
5387 mRemote.transact(HANG_TRANSACTION, data, reply, 0);
5388 reply.readException();
5389 data.recycle();
5390 reply.recycle();
5391 }
5392
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07005393 public void reportActivityFullyDrawn(IBinder token) throws RemoteException {
5394 Parcel data = Parcel.obtain();
5395 Parcel reply = Parcel.obtain();
5396 data.writeInterfaceToken(IActivityManager.descriptor);
5397 data.writeStrongBinder(token);
5398 mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0);
5399 reply.readException();
5400 data.recycle();
5401 reply.recycle();
5402 }
5403
Craig Mautner5eda9b32013-07-02 11:58:16 -07005404 public void notifyActivityDrawn(IBinder token) throws RemoteException {
5405 Parcel data = Parcel.obtain();
5406 Parcel reply = Parcel.obtain();
5407 data.writeInterfaceToken(IActivityManager.descriptor);
5408 data.writeStrongBinder(token);
5409 mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
5410 reply.readException();
5411 data.recycle();
5412 reply.recycle();
5413 }
5414
Dianne Hackborn57a7f592013-07-22 18:21:32 -07005415 public void restart() throws RemoteException {
5416 Parcel data = Parcel.obtain();
5417 Parcel reply = Parcel.obtain();
5418 data.writeInterfaceToken(IActivityManager.descriptor);
5419 mRemote.transact(RESTART_TRANSACTION, data, reply, 0);
5420 reply.readException();
5421 data.recycle();
5422 reply.recycle();
5423 }
5424
Dianne Hackborn35f72be2013-09-16 10:57:39 -07005425 public void performIdleMaintenance() throws RemoteException {
5426 Parcel data = Parcel.obtain();
5427 Parcel reply = Parcel.obtain();
5428 data.writeInterfaceToken(IActivityManager.descriptor);
5429 mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0);
5430 reply.readException();
5431 data.recycle();
5432 reply.recycle();
5433 }
5434
Todd Kennedyca4d8422015-01-15 15:19:22 -08005435 public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken,
Craig Mautner4a1cb222013-12-04 16:14:06 -08005436 IActivityContainerCallback callback) throws RemoteException {
5437 Parcel data = Parcel.obtain();
5438 Parcel reply = Parcel.obtain();
5439 data.writeInterfaceToken(IActivityManager.descriptor);
5440 data.writeStrongBinder(parentActivityToken);
Craig Mautnere3a00d72014-04-16 08:31:19 -07005441 data.writeStrongBinder(callback == null ? null : callback.asBinder());
Todd Kennedyca4d8422015-01-15 15:19:22 -08005442 mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
Craig Mautner4a1cb222013-12-04 16:14:06 -08005443 reply.readException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08005444 final int result = reply.readInt();
5445 final IActivityContainer res;
5446 if (result == 1) {
5447 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5448 } else {
5449 res = null;
5450 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08005451 data.recycle();
5452 reply.recycle();
5453 return res;
5454 }
5455
Craig Mautner95da1082014-02-24 17:54:35 -08005456 public void deleteActivityContainer(IActivityContainer activityContainer)
5457 throws RemoteException {
5458 Parcel data = Parcel.obtain();
5459 Parcel reply = Parcel.obtain();
5460 data.writeInterfaceToken(IActivityManager.descriptor);
5461 data.writeStrongBinder(activityContainer.asBinder());
5462 mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
5463 reply.readException();
5464 data.recycle();
5465 reply.recycle();
5466 }
5467
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005468 @Override
Todd Kennedy4900bf92015-01-16 16:05:14 -08005469 public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException {
5470 Parcel data = Parcel.obtain();
5471 Parcel reply = Parcel.obtain();
5472 data.writeInterfaceToken(IActivityManager.descriptor);
5473 data.writeInt(displayId);
5474 mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0);
5475 reply.readException();
5476 final int result = reply.readInt();
5477 final IActivityContainer res;
5478 if (result == 1) {
5479 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5480 } else {
5481 res = null;
5482 }
5483 data.recycle();
5484 reply.recycle();
5485 return res;
5486 }
5487
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005488 @Override
5489 public int getActivityDisplayId(IBinder activityToken)
Craig Mautnere0a38842013-12-16 16:14:02 -08005490 throws RemoteException {
5491 Parcel data = Parcel.obtain();
5492 Parcel reply = Parcel.obtain();
5493 data.writeInterfaceToken(IActivityManager.descriptor);
5494 data.writeStrongBinder(activityToken);
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005495 mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0);
Craig Mautnere0a38842013-12-16 16:14:02 -08005496 reply.readException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005497 final int displayId = reply.readInt();
Craig Mautnere0a38842013-12-16 16:14:02 -08005498 data.recycle();
5499 reply.recycle();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005500 return displayId;
Craig Mautnere0a38842013-12-16 16:14:02 -08005501 }
5502
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005503 @Override
Craig Mautner4a1cb222013-12-04 16:14:06 -08005504 public IBinder getHomeActivityToken() throws RemoteException {
5505 Parcel data = Parcel.obtain();
5506 Parcel reply = Parcel.obtain();
5507 data.writeInterfaceToken(IActivityManager.descriptor);
5508 mRemote.transact(GET_HOME_ACTIVITY_TOKEN_TRANSACTION, data, reply, 0);
5509 reply.readException();
5510 IBinder res = reply.readStrongBinder();
5511 data.recycle();
5512 reply.recycle();
5513 return res;
5514 }
5515
Craig Mautneraea74a52014-03-08 14:23:10 -08005516 @Override
5517 public void startLockTaskMode(int taskId) throws RemoteException {
5518 Parcel data = Parcel.obtain();
5519 Parcel reply = Parcel.obtain();
5520 data.writeInterfaceToken(IActivityManager.descriptor);
5521 data.writeInt(taskId);
5522 mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0);
5523 reply.readException();
5524 data.recycle();
5525 reply.recycle();
5526 }
5527
5528 @Override
5529 public void startLockTaskMode(IBinder token) throws RemoteException {
5530 Parcel data = Parcel.obtain();
5531 Parcel reply = Parcel.obtain();
5532 data.writeInterfaceToken(IActivityManager.descriptor);
5533 data.writeStrongBinder(token);
5534 mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0);
5535 reply.readException();
5536 data.recycle();
5537 reply.recycle();
5538 }
5539
5540 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005541 public void startLockTaskModeOnCurrent() throws RemoteException {
5542 Parcel data = Parcel.obtain();
5543 Parcel reply = Parcel.obtain();
5544 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005545 mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005546 reply.readException();
5547 data.recycle();
5548 reply.recycle();
5549 }
5550
5551 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005552 public void stopLockTaskMode() throws RemoteException {
5553 Parcel data = Parcel.obtain();
5554 Parcel reply = Parcel.obtain();
5555 data.writeInterfaceToken(IActivityManager.descriptor);
5556 mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5557 reply.readException();
5558 data.recycle();
5559 reply.recycle();
5560 }
5561
5562 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005563 public void stopLockTaskModeOnCurrent() throws RemoteException {
5564 Parcel data = Parcel.obtain();
5565 Parcel reply = Parcel.obtain();
5566 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005567 mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005568 reply.readException();
5569 data.recycle();
5570 reply.recycle();
5571 }
5572
5573 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005574 public boolean isInLockTaskMode() throws RemoteException {
5575 Parcel data = Parcel.obtain();
5576 Parcel reply = Parcel.obtain();
5577 data.writeInterfaceToken(IActivityManager.descriptor);
5578 mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5579 reply.readException();
5580 boolean isInLockTaskMode = reply.readInt() == 1;
5581 data.recycle();
5582 reply.recycle();
5583 return isInLockTaskMode;
5584 }
5585
Craig Mautner688b5102014-03-27 16:55:03 -07005586 @Override
Benjamin Franz43261142015-02-11 15:59:44 +00005587 public int getLockTaskModeState() throws RemoteException {
5588 Parcel data = Parcel.obtain();
5589 Parcel reply = Parcel.obtain();
5590 data.writeInterfaceToken(IActivityManager.descriptor);
5591 mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0);
5592 reply.readException();
5593 int lockTaskModeState = reply.readInt();
5594 data.recycle();
5595 reply.recycle();
5596 return lockTaskModeState;
5597 }
5598
5599 @Override
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07005600 public void showLockTaskEscapeMessage(IBinder token) throws RemoteException {
5601 Parcel data = Parcel.obtain();
5602 Parcel reply = Parcel.obtain();
5603 data.writeInterfaceToken(IActivityManager.descriptor);
5604 data.writeStrongBinder(token);
5605 mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply,
5606 IBinder.FLAG_ONEWAY);
5607 reply.readException();
5608 data.recycle();
5609 reply.recycle();
5610 }
5611
5612 @Override
Winson Chunga449dc02014-05-16 11:15:04 -07005613 public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values)
Winson Chung03a9bae2014-05-02 09:56:12 -07005614 throws RemoteException {
Craig Mautner2fbd7542014-03-21 09:34:07 -07005615 Parcel data = Parcel.obtain();
5616 Parcel reply = Parcel.obtain();
5617 data.writeInterfaceToken(IActivityManager.descriptor);
5618 data.writeStrongBinder(token);
Winson Chung03a9bae2014-05-02 09:56:12 -07005619 values.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005620 mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0);
Craig Mautner2fbd7542014-03-21 09:34:07 -07005621 reply.readException();
5622 data.recycle();
5623 reply.recycle();
5624 }
5625
Craig Mautneree2e45a2014-06-27 12:10:03 -07005626 @Override
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08005627 public void setTaskResizeable(int taskId, boolean resizeable) throws RemoteException {
5628 Parcel data = Parcel.obtain();
5629 Parcel reply = Parcel.obtain();
5630 data.writeInterfaceToken(IActivityManager.descriptor);
5631 data.writeInt(taskId);
5632 data.writeInt(resizeable ? 1 : 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005633 mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0);
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08005634 reply.readException();
5635 data.recycle();
5636 reply.recycle();
5637 }
5638
5639 @Override
Wale Ogunwale53a29a92015-02-23 15:42:52 -08005640 public void resizeTask(int taskId, Rect r) throws RemoteException
5641 {
5642 Parcel data = Parcel.obtain();
5643 Parcel reply = Parcel.obtain();
5644 data.writeInterfaceToken(IActivityManager.descriptor);
5645 data.writeInt(taskId);
5646 r.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005647 mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08005648 reply.readException();
5649 data.recycle();
5650 reply.recycle();
5651 }
5652
5653 @Override
Craig Mautner648f69b2014-09-18 14:16:26 -07005654 public Bitmap getTaskDescriptionIcon(String filename) throws RemoteException {
5655 Parcel data = Parcel.obtain();
5656 Parcel reply = Parcel.obtain();
5657 data.writeInterfaceToken(IActivityManager.descriptor);
5658 data.writeString(filename);
5659 mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0);
5660 reply.readException();
5661 final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply);
5662 data.recycle();
5663 reply.recycle();
5664 return icon;
5665 }
5666
5667 @Override
Winson Chung044d5292014-11-06 11:05:19 -08005668 public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options)
5669 throws RemoteException {
5670 Parcel data = Parcel.obtain();
5671 Parcel reply = Parcel.obtain();
5672 data.writeInterfaceToken(IActivityManager.descriptor);
5673 if (options == null) {
5674 data.writeInt(0);
5675 } else {
5676 data.writeInt(1);
5677 data.writeBundle(options.toBundle());
5678 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07005679 mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0);
Winson Chung044d5292014-11-06 11:05:19 -08005680 reply.readException();
5681 data.recycle();
5682 reply.recycle();
5683 }
5684
5685 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005686 public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005687 Parcel data = Parcel.obtain();
5688 Parcel reply = Parcel.obtain();
5689 data.writeInterfaceToken(IActivityManager.descriptor);
5690 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07005691 data.writeInt(visible ? 1 : 0);
5692 mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005693 reply.readException();
5694 boolean success = reply.readInt() > 0;
5695 data.recycle();
5696 reply.recycle();
5697 return success;
5698 }
5699
5700 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005701 public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005702 Parcel data = Parcel.obtain();
5703 Parcel reply = Parcel.obtain();
5704 data.writeInterfaceToken(IActivityManager.descriptor);
5705 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07005706 mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005707 reply.readException();
Jose Lima4b6c6692014-08-12 17:41:12 -07005708 final boolean visible = reply.readInt() > 0;
Craig Mautneree2e45a2014-06-27 12:10:03 -07005709 data.recycle();
5710 reply.recycle();
Jose Lima4b6c6692014-08-12 17:41:12 -07005711 return visible;
Craig Mautneree2e45a2014-06-27 12:10:03 -07005712 }
5713
5714 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005715 public void backgroundResourcesReleased(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005716 Parcel data = Parcel.obtain();
5717 Parcel reply = Parcel.obtain();
5718 data.writeInterfaceToken(IActivityManager.descriptor);
5719 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005720 mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0);
Craig Mautnerbb742462014-07-07 15:28:55 -07005721 reply.readException();
5722 data.recycle();
5723 reply.recycle();
5724 }
5725
5726 @Override
5727 public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException {
5728 Parcel data = Parcel.obtain();
5729 Parcel reply = Parcel.obtain();
5730 data.writeInterfaceToken(IActivityManager.descriptor);
5731 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005732 mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005733 reply.readException();
5734 data.recycle();
5735 reply.recycle();
5736 }
5737
Craig Mautner8746a472014-07-24 15:12:54 -07005738 @Override
5739 public void notifyEnterAnimationComplete(IBinder token) throws RemoteException {
5740 Parcel data = Parcel.obtain();
5741 Parcel reply = Parcel.obtain();
5742 data.writeInterfaceToken(IActivityManager.descriptor);
5743 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005744 mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautner8746a472014-07-24 15:12:54 -07005745 reply.readException();
5746 data.recycle();
5747 reply.recycle();
5748 }
5749
Craig Mautner6e2f3952014-09-09 14:26:41 -07005750 @Override
5751 public void bootAnimationComplete() throws RemoteException {
5752 Parcel data = Parcel.obtain();
5753 Parcel reply = Parcel.obtain();
5754 data.writeInterfaceToken(IActivityManager.descriptor);
5755 mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
5756 reply.readException();
5757 data.recycle();
5758 reply.recycle();
5759 }
5760
Wale Ogunwale18795a22014-12-03 11:38:33 -08005761 @Override
5762 public void systemBackupRestored() throws RemoteException {
5763 Parcel data = Parcel.obtain();
5764 Parcel reply = Parcel.obtain();
5765 data.writeInterfaceToken(IActivityManager.descriptor);
5766 mRemote.transact(SYSTEM_BACKUP_RESTORED, data, reply, 0);
5767 reply.readException();
5768 data.recycle();
5769 reply.recycle();
5770 }
5771
Jeff Sharkeyc2ae6fb2015-01-15 21:27:13 -08005772 @Override
Jeff Sharkey605eb792014-11-04 13:34:06 -08005773 public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException {
5774 Parcel data = Parcel.obtain();
5775 Parcel reply = Parcel.obtain();
5776 data.writeInterfaceToken(IActivityManager.descriptor);
5777 data.writeInt(uid);
5778 data.writeByteArray(firstPacket);
5779 mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0);
5780 reply.readException();
5781 data.recycle();
5782 reply.recycle();
5783 }
5784
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005785 @Override
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07005786 public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize,
5787 String reportPackage) throws RemoteException {
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005788 Parcel data = Parcel.obtain();
5789 Parcel reply = Parcel.obtain();
5790 data.writeInterfaceToken(IActivityManager.descriptor);
5791 data.writeString(processName);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07005792 data.writeInt(uid);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005793 data.writeLong(maxMemSize);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07005794 data.writeString(reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005795 mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0);
5796 reply.readException();
5797 data.recycle();
5798 reply.recycle();
5799 }
5800
5801 @Override
5802 public void dumpHeapFinished(String path) throws RemoteException {
5803 Parcel data = Parcel.obtain();
5804 Parcel reply = Parcel.obtain();
5805 data.writeInterfaceToken(IActivityManager.descriptor);
5806 data.writeString(path);
5807 mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0);
5808 reply.readException();
5809 data.recycle();
5810 reply.recycle();
5811 }
5812
Dianne Hackborn3d07c942015-03-13 18:02:54 -07005813 @Override
5814 public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake)
5815 throws RemoteException {
5816 Parcel data = Parcel.obtain();
5817 Parcel reply = Parcel.obtain();
5818 data.writeInterfaceToken(IActivityManager.descriptor);
5819 data.writeStrongBinder(session.asBinder());
5820 data.writeInt(keepAwake ? 1 : 0);
5821 mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0);
5822 reply.readException();
5823 data.recycle();
5824 reply.recycle();
5825 }
5826
Craig Mautnere5600772015-04-03 21:36:37 -07005827 @Override
5828 public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException {
5829 Parcel data = Parcel.obtain();
5830 Parcel reply = Parcel.obtain();
5831 data.writeInterfaceToken(IActivityManager.descriptor);
5832 data.writeInt(userId);
5833 data.writeStringArray(packages);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005834 mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0);
Craig Mautnere5600772015-04-03 21:36:37 -07005835 reply.readException();
5836 data.recycle();
5837 reply.recycle();
5838 }
5839
Dianne Hackborn1e383822015-04-10 14:02:33 -07005840 @Override
Craig Mautner015c5e52015-04-23 10:39:39 -07005841 public void updateDeviceOwner(String packageName) throws RemoteException {
5842 Parcel data = Parcel.obtain();
5843 Parcel reply = Parcel.obtain();
5844 data.writeInterfaceToken(IActivityManager.descriptor);
5845 data.writeString(packageName);
5846 mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0);
5847 reply.readException();
5848 data.recycle();
5849 reply.recycle();
5850 }
5851
5852 @Override
Julia Reynolds13c58ba2015-04-20 16:42:54 -04005853 public void updatePreferredSetupActivity(ComponentName preferredActivity, int userId)
5854 throws RemoteException {
5855 Parcel data = Parcel.obtain();
5856 Parcel reply = Parcel.obtain();
5857 data.writeInterfaceToken(IActivityManager.descriptor);
5858 ComponentName.writeToParcel(preferredActivity, data);
5859 data.writeInt(userId);
5860 mRemote.transact(UPDATE_PREFERRED_SETUP_ACTIVITY_TRANSACTION, data, reply, 0);
5861 reply.readException();
5862 data.recycle();
5863 reply.recycle();
5864 }
5865
5866 @Override
Dianne Hackborn1e383822015-04-10 14:02:33 -07005867 public int getPackageProcessState(String packageName) throws RemoteException {
5868 Parcel data = Parcel.obtain();
5869 Parcel reply = Parcel.obtain();
5870 data.writeInterfaceToken(IActivityManager.descriptor);
5871 data.writeString(packageName);
5872 mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0);
5873 reply.readException();
5874 int res = reply.readInt();
5875 data.recycle();
5876 reply.recycle();
5877 return res;
5878 }
5879
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005880 private IBinder mRemote;
5881}