blob: 6ae21eb2d25ab055b67b12ee2d890e5d2414b7f9 [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;
Dianne Hackborn69c6adc2015-06-02 10:52:59 -070020import android.app.assist.AssistContent;
21import android.app.assist.AssistStructure;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080022import android.content.ComponentName;
Adam Powelldd8fab22012-03-22 17:47:27 -070023import android.content.IIntentReceiver;
24import android.content.IIntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080025import android.content.Intent;
26import android.content.IntentFilter;
Dianne Hackbornfa82f222009-09-17 15:14:12 -070027import android.content.IntentSender;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070028import android.content.UriPermission;
Christopher Tate181fafa2009-05-14 11:12:14 -070029import android.content.pm.ApplicationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080030import android.content.pm.ConfigurationInfo;
31import android.content.pm.IPackageDataObserver;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070032import android.content.pm.ParceledListSlice;
Amith Yamasani52f1d752012-03-28 18:19:29 -070033import android.content.pm.UserInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080034import android.content.res.Configuration;
Dianne Hackbornaec68bb2014-08-20 15:25:13 -070035import android.graphics.Bitmap;
36import android.graphics.Point;
Craig Mautnerbdc748af2013-12-02 14:08:25 -080037import android.graphics.Rect;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080038import android.net.Uri;
39import android.os.Binder;
40import android.os.Bundle;
Dianne Hackborn3025ef32009-08-31 21:31:47 -070041import android.os.Debug;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080042import android.os.IBinder;
43import android.os.Parcel;
Adam Powelldd8fab22012-03-22 17:47:27 -070044import android.os.ParcelFileDescriptor;
45import android.os.Parcelable;
Craig Mautnera0026042014-04-23 11:45:37 -070046import android.os.PersistableBundle;
Adam Powelldd8fab22012-03-22 17:47:27 -070047import android.os.RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080048import android.os.ServiceManager;
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -070049import android.os.StrictMode;
Dianne Hackborn91097de2014-04-04 18:02:06 -070050import android.service.voice.IVoiceInteractionSession;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080051import android.text.TextUtils;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080052import android.util.Log;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080053import android.util.Singleton;
Dianne Hackborn91097de2014-04-04 18:02:06 -070054import com.android.internal.app.IVoiceInteractor;
Dianne Hackbornae6688b2015-02-11 17:02:41 -080055import com.android.internal.os.IResultReceiver;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080057import java.util.ArrayList;
58import java.util.List;
59
60/** {@hide} */
61public abstract class ActivityManagerNative extends Binder implements IActivityManager
62{
63 /**
64 * Cast a Binder object into an activity manager interface, generating
65 * a proxy if needed.
66 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080067 static public IActivityManager asInterface(IBinder obj) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080068 if (obj == null) {
69 return null;
70 }
71 IActivityManager in =
72 (IActivityManager)obj.queryLocalInterface(descriptor);
73 if (in != null) {
74 return in;
75 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080076
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080077 return new ActivityManagerProxy(obj);
78 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080079
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080080 /**
81 * Retrieve the system's default/global activity manager.
82 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080083 static public IActivityManager getDefault() {
84 return gDefault.get();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080085 }
86
87 /**
88 * Convenience for checking whether the system is ready. For internal use only.
89 */
90 static public boolean isSystemReady() {
91 if (!sSystemReady) {
92 sSystemReady = getDefault().testIsSystemReady();
93 }
94 return sSystemReady;
95 }
96 static boolean sSystemReady = false;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080097
Svet Ganov16a16892015-04-16 10:32:04 -070098 static public void broadcastStickyIntent(Intent intent, String permission, int userId) {
99 broadcastStickyIntent(intent, permission, AppOpsManager.OP_NONE, userId);
100 }
101
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800102 /**
103 * Convenience for sending a sticky broadcast. For internal use only.
104 * If you don't care about permission, use null.
105 */
Svet Ganov16a16892015-04-16 10:32:04 -0700106 static public void broadcastStickyIntent(Intent intent, String permission, int appOp,
107 int userId) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800108 try {
109 getDefault().broadcastIntent(
110 null, intent, null, null, Activity.RESULT_OK, null, null,
Svet Ganov16a16892015-04-16 10:32:04 -0700111 null /*permission*/, appOp, false, true, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800112 } catch (RemoteException ex) {
113 }
114 }
115
Dianne Hackborn1e383822015-04-10 14:02:33 -0700116 static public void noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg,
117 String tag) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800118 try {
Dianne Hackborn1e383822015-04-10 14:02:33 -0700119 getDefault().noteWakeupAlarm(ps.getTarget(), sourceUid, sourcePkg, tag);
120 } catch (RemoteException ex) {
121 }
122 }
123
124 static public void noteAlarmStart(PendingIntent ps, int sourceUid, String tag) {
125 try {
126 getDefault().noteAlarmStart(ps.getTarget(), sourceUid, tag);
127 } catch (RemoteException ex) {
128 }
129 }
130
131 static public void noteAlarmFinish(PendingIntent ps, int sourceUid, String tag) {
132 try {
133 getDefault().noteAlarmFinish(ps.getTarget(), sourceUid, tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800134 } catch (RemoteException ex) {
135 }
136 }
137
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -0800138 public ActivityManagerNative() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800139 attachInterface(this, descriptor);
140 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700141
142 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800143 public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
144 throws RemoteException {
145 switch (code) {
146 case START_ACTIVITY_TRANSACTION:
147 {
148 data.enforceInterface(IActivityManager.descriptor);
149 IBinder b = data.readStrongBinder();
150 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800151 String callingPackage = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800152 Intent intent = Intent.CREATOR.createFromParcel(data);
153 String resolvedType = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800154 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800155 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800156 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700157 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700158 ProfilerInfo profilerInfo = data.readInt() != 0
159 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700160 Bundle options = data.readInt() != 0
161 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800162 int result = startActivity(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700163 resultTo, resultWho, requestCode, startFlags, profilerInfo, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800164 reply.writeNoException();
165 reply.writeInt(result);
166 return true;
167 }
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700168
Amith Yamasani82644082012-08-03 13:09:11 -0700169 case START_ACTIVITY_AS_USER_TRANSACTION:
170 {
171 data.enforceInterface(IActivityManager.descriptor);
172 IBinder b = data.readStrongBinder();
173 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800174 String callingPackage = data.readString();
Amith Yamasani82644082012-08-03 13:09:11 -0700175 Intent intent = Intent.CREATOR.createFromParcel(data);
176 String resolvedType = data.readString();
177 IBinder resultTo = data.readStrongBinder();
178 String resultWho = data.readString();
179 int requestCode = data.readInt();
180 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700181 ProfilerInfo profilerInfo = data.readInt() != 0
182 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Amith Yamasani82644082012-08-03 13:09:11 -0700183 Bundle options = data.readInt() != 0
184 ? Bundle.CREATOR.createFromParcel(data) : null;
185 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800186 int result = startActivityAsUser(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700187 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Amith Yamasani82644082012-08-03 13:09:11 -0700188 reply.writeNoException();
189 reply.writeInt(result);
190 return true;
191 }
192
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700193 case START_ACTIVITY_AS_CALLER_TRANSACTION:
194 {
195 data.enforceInterface(IActivityManager.descriptor);
196 IBinder b = data.readStrongBinder();
197 IApplicationThread app = ApplicationThreadNative.asInterface(b);
198 String callingPackage = data.readString();
199 Intent intent = Intent.CREATOR.createFromParcel(data);
200 String resolvedType = data.readString();
201 IBinder resultTo = data.readStrongBinder();
202 String resultWho = data.readString();
203 int requestCode = data.readInt();
204 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700205 ProfilerInfo profilerInfo = data.readInt() != 0
206 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700207 Bundle options = data.readInt() != 0
208 ? Bundle.CREATOR.createFromParcel(data) : null;
Jeff Sharkey97978802014-10-14 10:48:18 -0700209 int userId = data.readInt();
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700210 int result = startActivityAsCaller(app, callingPackage, intent, resolvedType,
Jeff Sharkey97978802014-10-14 10:48:18 -0700211 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700212 reply.writeNoException();
213 reply.writeInt(result);
214 return true;
215 }
216
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800217 case START_ACTIVITY_AND_WAIT_TRANSACTION:
218 {
219 data.enforceInterface(IActivityManager.descriptor);
220 IBinder b = data.readStrongBinder();
221 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800222 String callingPackage = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800223 Intent intent = Intent.CREATOR.createFromParcel(data);
224 String resolvedType = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800225 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800226 String resultWho = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800227 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700228 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700229 ProfilerInfo profilerInfo = data.readInt() != 0
230 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700231 Bundle options = data.readInt() != 0
232 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -0700233 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800234 WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700235 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800236 reply.writeNoException();
237 result.writeToParcel(reply, 0);
238 return true;
239 }
240
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700241 case START_ACTIVITY_WITH_CONFIG_TRANSACTION:
242 {
243 data.enforceInterface(IActivityManager.descriptor);
244 IBinder b = data.readStrongBinder();
245 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800246 String callingPackage = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700247 Intent intent = Intent.CREATOR.createFromParcel(data);
248 String resolvedType = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700249 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700250 String resultWho = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700251 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700252 int startFlags = data.readInt();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700253 Configuration config = Configuration.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700254 Bundle options = data.readInt() != 0
255 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -0700256 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800257 int result = startActivityWithConfig(app, callingPackage, intent, resolvedType,
Dianne Hackborn41203752012-08-31 14:05:51 -0700258 resultTo, resultWho, requestCode, startFlags, config, options, userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700259 reply.writeNoException();
260 reply.writeInt(result);
261 return true;
262 }
263
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700264 case START_ACTIVITY_INTENT_SENDER_TRANSACTION:
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700265 {
266 data.enforceInterface(IActivityManager.descriptor);
267 IBinder b = data.readStrongBinder();
268 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700269 IntentSender intent = IntentSender.CREATOR.createFromParcel(data);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700270 Intent fillInIntent = null;
271 if (data.readInt() != 0) {
272 fillInIntent = Intent.CREATOR.createFromParcel(data);
273 }
274 String resolvedType = data.readString();
275 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700276 String resultWho = data.readString();
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700277 int requestCode = data.readInt();
278 int flagsMask = data.readInt();
279 int flagsValues = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700280 Bundle options = data.readInt() != 0
281 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700282 int result = startActivityIntentSender(app, intent,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700283 fillInIntent, resolvedType, resultTo, resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700284 requestCode, flagsMask, flagsValues, options);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700285 reply.writeNoException();
286 reply.writeInt(result);
287 return true;
288 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700289
Dianne Hackborn91097de2014-04-04 18:02:06 -0700290 case START_VOICE_ACTIVITY_TRANSACTION:
291 {
292 data.enforceInterface(IActivityManager.descriptor);
293 String callingPackage = data.readString();
294 int callingPid = data.readInt();
295 int callingUid = data.readInt();
296 Intent intent = Intent.CREATOR.createFromParcel(data);
297 String resolvedType = data.readString();
298 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
299 data.readStrongBinder());
300 IVoiceInteractor interactor = IVoiceInteractor.Stub.asInterface(
301 data.readStrongBinder());
302 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700303 ProfilerInfo profilerInfo = data.readInt() != 0
304 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborn91097de2014-04-04 18:02:06 -0700305 Bundle options = data.readInt() != 0
306 ? Bundle.CREATOR.createFromParcel(data) : null;
307 int userId = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700308 int result = startVoiceActivity(callingPackage, callingPid, callingUid, intent,
309 resolvedType, session, interactor, startFlags, profilerInfo, options, userId);
Dianne Hackborn91097de2014-04-04 18:02:06 -0700310 reply.writeNoException();
311 reply.writeInt(result);
312 return true;
313 }
314
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800315 case START_NEXT_MATCHING_ACTIVITY_TRANSACTION:
316 {
317 data.enforceInterface(IActivityManager.descriptor);
318 IBinder callingActivity = data.readStrongBinder();
319 Intent intent = Intent.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700320 Bundle options = data.readInt() != 0
321 ? Bundle.CREATOR.createFromParcel(data) : null;
322 boolean result = startNextMatchingActivity(callingActivity, intent, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800323 reply.writeNoException();
324 reply.writeInt(result ? 1 : 0);
325 return true;
326 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700327
Craig Mautnerdc00cbe2014-07-20 17:48:47 -0700328 case START_ACTIVITY_FROM_RECENTS_TRANSACTION:
329 {
330 data.enforceInterface(IActivityManager.descriptor);
331 int taskId = data.readInt();
332 Bundle options = data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data);
333 int result = startActivityFromRecents(taskId, options);
334 reply.writeNoException();
335 reply.writeInt(result);
336 return true;
337 }
338
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800339 case FINISH_ACTIVITY_TRANSACTION: {
340 data.enforceInterface(IActivityManager.descriptor);
341 IBinder token = data.readStrongBinder();
342 Intent resultData = null;
343 int resultCode = data.readInt();
344 if (data.readInt() != 0) {
345 resultData = Intent.CREATOR.createFromParcel(data);
346 }
Winson Chung3b3f4642014-04-22 10:08:18 -0700347 boolean finishTask = (data.readInt() != 0);
348 boolean res = finishActivity(token, resultCode, resultData, finishTask);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800349 reply.writeNoException();
350 reply.writeInt(res ? 1 : 0);
351 return true;
352 }
353
354 case FINISH_SUB_ACTIVITY_TRANSACTION: {
355 data.enforceInterface(IActivityManager.descriptor);
356 IBinder token = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700357 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800358 int requestCode = data.readInt();
359 finishSubActivity(token, resultWho, requestCode);
360 reply.writeNoException();
361 return true;
362 }
363
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700364 case FINISH_ACTIVITY_AFFINITY_TRANSACTION: {
365 data.enforceInterface(IActivityManager.descriptor);
366 IBinder token = data.readStrongBinder();
367 boolean res = finishActivityAffinity(token);
368 reply.writeNoException();
369 reply.writeInt(res ? 1 : 0);
370 return true;
371 }
372
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -0700373 case FINISH_VOICE_TASK_TRANSACTION: {
374 data.enforceInterface(IActivityManager.descriptor);
375 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
376 data.readStrongBinder());
377 finishVoiceTask(session);
378 reply.writeNoException();
379 return true;
380 }
381
Dianne Hackborn89ad4562014-08-24 16:45:38 -0700382 case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: {
383 data.enforceInterface(IActivityManager.descriptor);
384 IBinder token = data.readStrongBinder();
385 boolean res = releaseActivityInstance(token);
386 reply.writeNoException();
387 reply.writeInt(res ? 1 : 0);
388 return true;
389 }
390
391 case RELEASE_SOME_ACTIVITIES_TRANSACTION: {
392 data.enforceInterface(IActivityManager.descriptor);
393 IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder());
394 releaseSomeActivities(app);
395 reply.writeNoException();
396 return true;
397 }
398
Dianne Hackborn061d58a2010-03-12 15:07:06 -0800399 case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: {
400 data.enforceInterface(IActivityManager.descriptor);
401 IBinder token = data.readStrongBinder();
402 boolean res = willActivityBeVisible(token);
403 reply.writeNoException();
404 reply.writeInt(res ? 1 : 0);
405 return true;
406 }
407
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800408 case REGISTER_RECEIVER_TRANSACTION:
409 {
410 data.enforceInterface(IActivityManager.descriptor);
411 IBinder b = data.readStrongBinder();
412 IApplicationThread app =
413 b != null ? ApplicationThreadNative.asInterface(b) : null;
Dianne Hackborn6c418d52011-06-29 14:05:33 -0700414 String packageName = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800415 b = data.readStrongBinder();
416 IIntentReceiver rec
417 = b != null ? IIntentReceiver.Stub.asInterface(b) : null;
418 IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data);
419 String perm = data.readString();
Dianne Hackborn20e80982012-08-31 19:00:44 -0700420 int userId = data.readInt();
421 Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800422 reply.writeNoException();
423 if (intent != null) {
424 reply.writeInt(1);
425 intent.writeToParcel(reply, 0);
426 } else {
427 reply.writeInt(0);
428 }
429 return true;
430 }
431
432 case UNREGISTER_RECEIVER_TRANSACTION:
433 {
434 data.enforceInterface(IActivityManager.descriptor);
435 IBinder b = data.readStrongBinder();
436 if (b == null) {
437 return true;
438 }
439 IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b);
440 unregisterReceiver(rec);
441 reply.writeNoException();
442 return true;
443 }
444
445 case BROADCAST_INTENT_TRANSACTION:
446 {
447 data.enforceInterface(IActivityManager.descriptor);
448 IBinder b = data.readStrongBinder();
449 IApplicationThread app =
450 b != null ? ApplicationThreadNative.asInterface(b) : null;
451 Intent intent = Intent.CREATOR.createFromParcel(data);
452 String resolvedType = data.readString();
453 b = data.readStrongBinder();
454 IIntentReceiver resultTo =
455 b != null ? IIntentReceiver.Stub.asInterface(b) : null;
456 int resultCode = data.readInt();
457 String resultData = data.readString();
458 Bundle resultExtras = data.readBundle();
459 String perm = data.readString();
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800460 int appOp = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800461 boolean serialized = data.readInt() != 0;
462 boolean sticky = data.readInt() != 0;
Amith Yamasani742a6712011-05-04 14:49:28 -0700463 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800464 int res = broadcastIntent(app, intent, resolvedType, resultTo,
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800465 resultCode, resultData, resultExtras, perm, appOp,
Amith Yamasani742a6712011-05-04 14:49:28 -0700466 serialized, sticky, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800467 reply.writeNoException();
468 reply.writeInt(res);
469 return true;
470 }
471
472 case UNBROADCAST_INTENT_TRANSACTION:
473 {
474 data.enforceInterface(IActivityManager.descriptor);
475 IBinder b = data.readStrongBinder();
476 IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null;
477 Intent intent = Intent.CREATOR.createFromParcel(data);
Amith Yamasani742a6712011-05-04 14:49:28 -0700478 int userId = data.readInt();
479 unbroadcastIntent(app, intent, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800480 reply.writeNoException();
481 return true;
482 }
483
484 case FINISH_RECEIVER_TRANSACTION: {
485 data.enforceInterface(IActivityManager.descriptor);
486 IBinder who = data.readStrongBinder();
487 int resultCode = data.readInt();
488 String resultData = data.readString();
489 Bundle resultExtras = data.readBundle();
490 boolean resultAbort = data.readInt() != 0;
riddle_hsu1f5ac4d2015-01-03 15:38:21 +0800491 int intentFlags = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800492 if (who != null) {
riddle_hsu1f5ac4d2015-01-03 15:38:21 +0800493 finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800494 }
495 reply.writeNoException();
496 return true;
497 }
498
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800499 case ATTACH_APPLICATION_TRANSACTION: {
500 data.enforceInterface(IActivityManager.descriptor);
501 IApplicationThread app = ApplicationThreadNative.asInterface(
502 data.readStrongBinder());
503 if (app != null) {
504 attachApplication(app);
505 }
506 reply.writeNoException();
507 return true;
508 }
509
510 case ACTIVITY_IDLE_TRANSACTION: {
511 data.enforceInterface(IActivityManager.descriptor);
512 IBinder token = data.readStrongBinder();
Dianne Hackborne88846e2009-09-30 21:34:25 -0700513 Configuration config = null;
514 if (data.readInt() != 0) {
515 config = Configuration.CREATOR.createFromParcel(data);
516 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700517 boolean stopProfiling = data.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800518 if (token != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700519 activityIdle(token, config, stopProfiling);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800520 }
521 reply.writeNoException();
522 return true;
523 }
524
Dianne Hackbornad9b32112012-09-17 15:35:01 -0700525 case ACTIVITY_RESUMED_TRANSACTION: {
526 data.enforceInterface(IActivityManager.descriptor);
527 IBinder token = data.readStrongBinder();
528 activityResumed(token);
529 reply.writeNoException();
530 return true;
531 }
532
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800533 case ACTIVITY_PAUSED_TRANSACTION: {
534 data.enforceInterface(IActivityManager.descriptor);
535 IBinder token = data.readStrongBinder();
Dianne Hackborna4e102e2014-09-04 22:52:27 -0700536 activityPaused(token);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800537 reply.writeNoException();
538 return true;
539 }
540
541 case ACTIVITY_STOPPED_TRANSACTION: {
542 data.enforceInterface(IActivityManager.descriptor);
543 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800544 Bundle map = data.readBundle();
Craig Mautnera0026042014-04-23 11:45:37 -0700545 PersistableBundle persistentState = data.readPersistableBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800546 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
Craig Mautnera0026042014-04-23 11:45:37 -0700547 activityStopped(token, map, persistentState, description);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800548 reply.writeNoException();
549 return true;
550 }
551
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800552 case ACTIVITY_SLEPT_TRANSACTION: {
553 data.enforceInterface(IActivityManager.descriptor);
554 IBinder token = data.readStrongBinder();
555 activitySlept(token);
556 reply.writeNoException();
557 return true;
558 }
559
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800560 case ACTIVITY_DESTROYED_TRANSACTION: {
561 data.enforceInterface(IActivityManager.descriptor);
562 IBinder token = data.readStrongBinder();
563 activityDestroyed(token);
564 reply.writeNoException();
565 return true;
566 }
567
568 case GET_CALLING_PACKAGE_TRANSACTION: {
569 data.enforceInterface(IActivityManager.descriptor);
570 IBinder token = data.readStrongBinder();
571 String res = token != null ? getCallingPackage(token) : null;
572 reply.writeNoException();
573 reply.writeString(res);
574 return true;
575 }
576
577 case GET_CALLING_ACTIVITY_TRANSACTION: {
578 data.enforceInterface(IActivityManager.descriptor);
579 IBinder token = data.readStrongBinder();
580 ComponentName cn = getCallingActivity(token);
581 reply.writeNoException();
582 ComponentName.writeToParcel(cn, reply);
583 return true;
584 }
585
Winson Chung1147c402014-05-14 11:05:00 -0700586 case GET_APP_TASKS_TRANSACTION: {
587 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -0700588 String callingPackage = data.readString();
589 List<IAppTask> list = getAppTasks(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -0700590 reply.writeNoException();
591 int N = list != null ? list.size() : -1;
592 reply.writeInt(N);
593 int i;
594 for (i=0; i<N; i++) {
595 IAppTask task = list.get(i);
596 reply.writeStrongBinder(task.asBinder());
597 }
598 return true;
599 }
600
Dianne Hackbornaec68bb2014-08-20 15:25:13 -0700601 case ADD_APP_TASK_TRANSACTION: {
602 data.enforceInterface(IActivityManager.descriptor);
603 IBinder activityToken = data.readStrongBinder();
604 Intent intent = Intent.CREATOR.createFromParcel(data);
605 ActivityManager.TaskDescription descr
606 = ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
607 Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data);
608 int res = addAppTask(activityToken, intent, descr, thumbnail);
609 reply.writeNoException();
610 reply.writeInt(res);
611 return true;
612 }
613
614 case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: {
615 data.enforceInterface(IActivityManager.descriptor);
616 Point size = getAppTaskThumbnailSize();
617 reply.writeNoException();
618 size.writeToParcel(reply, 0);
619 return true;
620 }
621
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800622 case GET_TASKS_TRANSACTION: {
623 data.enforceInterface(IActivityManager.descriptor);
624 int maxNum = data.readInt();
625 int fl = data.readInt();
Dianne Hackborn09233282014-04-30 11:33:59 -0700626 List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800627 reply.writeNoException();
628 int N = list != null ? list.size() : -1;
629 reply.writeInt(N);
630 int i;
631 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700632 ActivityManager.RunningTaskInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800633 info.writeToParcel(reply, 0);
634 }
635 return true;
636 }
637
638 case GET_RECENT_TASKS_TRANSACTION: {
639 data.enforceInterface(IActivityManager.descriptor);
640 int maxNum = data.readInt();
641 int fl = data.readInt();
Amith Yamasani82644082012-08-03 13:09:11 -0700642 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800643 List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -0700644 fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800645 reply.writeNoException();
646 reply.writeTypedList(list);
647 return true;
648 }
Dianne Hackborn15491c62012-09-19 10:59:14 -0700649
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700650 case GET_TASK_THUMBNAIL_TRANSACTION: {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800651 data.enforceInterface(IActivityManager.descriptor);
652 int id = data.readInt();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700653 ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id);
Dianne Hackbornd94df452011-02-16 18:53:31 -0800654 reply.writeNoException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700655 if (taskThumbnail != null) {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800656 reply.writeInt(1);
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700657 taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn15491c62012-09-19 10:59:14 -0700658 } else {
659 reply.writeInt(0);
660 }
661 return true;
662 }
663
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800664 case GET_SERVICES_TRANSACTION: {
665 data.enforceInterface(IActivityManager.descriptor);
666 int maxNum = data.readInt();
667 int fl = data.readInt();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700668 List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800669 reply.writeNoException();
670 int N = list != null ? list.size() : -1;
671 reply.writeInt(N);
672 int i;
673 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700674 ActivityManager.RunningServiceInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800675 info.writeToParcel(reply, 0);
676 }
677 return true;
678 }
679
680 case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: {
681 data.enforceInterface(IActivityManager.descriptor);
682 List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState();
683 reply.writeNoException();
684 reply.writeTypedList(list);
685 return true;
686 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700687
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800688 case GET_RUNNING_APP_PROCESSES_TRANSACTION: {
689 data.enforceInterface(IActivityManager.descriptor);
690 List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses();
691 reply.writeNoException();
692 reply.writeTypedList(list);
693 return true;
694 }
695
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -0700696 case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: {
697 data.enforceInterface(IActivityManager.descriptor);
698 List<ApplicationInfo> list = getRunningExternalApplications();
699 reply.writeNoException();
700 reply.writeTypedList(list);
701 return true;
702 }
703
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800704 case MOVE_TASK_TO_FRONT_TRANSACTION: {
705 data.enforceInterface(IActivityManager.descriptor);
706 int task = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800707 int fl = data.readInt();
Dianne Hackborn8078d8c2012-03-20 11:11:26 -0700708 Bundle options = data.readInt() != 0
709 ? Bundle.CREATOR.createFromParcel(data) : null;
710 moveTaskToFront(task, fl, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800711 reply.writeNoException();
712 return true;
713 }
714
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800715 case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: {
716 data.enforceInterface(IActivityManager.descriptor);
717 IBinder token = data.readStrongBinder();
718 boolean nonRoot = data.readInt() != 0;
719 boolean res = moveActivityTaskToBack(token, nonRoot);
720 reply.writeNoException();
721 reply.writeInt(res ? 1 : 0);
722 return true;
723 }
724
725 case MOVE_TASK_BACKWARDS_TRANSACTION: {
726 data.enforceInterface(IActivityManager.descriptor);
727 int task = data.readInt();
728 moveTaskBackwards(task);
729 reply.writeNoException();
730 return true;
731 }
732
Craig Mautnerc00204b2013-03-05 15:02:14 -0800733 case MOVE_TASK_TO_STACK_TRANSACTION: {
734 data.enforceInterface(IActivityManager.descriptor);
735 int taskId = data.readInt();
736 int stackId = data.readInt();
737 boolean toTop = data.readInt() != 0;
738 moveTaskToStack(taskId, stackId, toTop);
739 reply.writeNoException();
740 return true;
741 }
742
743 case RESIZE_STACK_TRANSACTION: {
744 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800745 int stackId = data.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800746 Rect r = Rect.CREATOR.createFromParcel(data);
747 resizeStack(stackId, r);
Craig Mautnerc00204b2013-03-05 15:02:14 -0800748 reply.writeNoException();
749 return true;
750 }
751
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800752 case GET_ALL_STACK_INFOS_TRANSACTION: {
Craig Mautner5ff12102013-05-24 12:50:15 -0700753 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800754 List<StackInfo> list = getAllStackInfos();
Craig Mautner5ff12102013-05-24 12:50:15 -0700755 reply.writeNoException();
756 reply.writeTypedList(list);
757 return true;
758 }
759
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800760 case GET_STACK_INFO_TRANSACTION: {
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700761 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800762 int stackId = data.readInt();
763 StackInfo info = getStackInfo(stackId);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700764 reply.writeNoException();
765 if (info != null) {
766 reply.writeInt(1);
767 info.writeToParcel(reply, 0);
768 } else {
769 reply.writeInt(0);
770 }
771 return true;
772 }
773
Winson Chung303e1ff2014-03-07 15:06:19 -0800774 case IS_IN_HOME_STACK_TRANSACTION: {
775 data.enforceInterface(IActivityManager.descriptor);
776 int taskId = data.readInt();
777 boolean isInHomeStack = isInHomeStack(taskId);
778 reply.writeNoException();
779 reply.writeInt(isInHomeStack ? 1 : 0);
780 return true;
781 }
782
Craig Mautnercf910b02013-04-23 11:23:27 -0700783 case SET_FOCUSED_STACK_TRANSACTION: {
784 data.enforceInterface(IActivityManager.descriptor);
785 int stackId = data.readInt();
786 setFocusedStack(stackId);
787 reply.writeNoException();
788 return true;
789 }
790
Winson Chungd16c5652015-01-26 16:11:07 -0800791 case GET_FOCUSED_STACK_ID_TRANSACTION: {
792 data.enforceInterface(IActivityManager.descriptor);
793 int focusedStackId = getFocusedStackId();
794 reply.writeNoException();
795 reply.writeInt(focusedStackId);
796 return true;
797 }
798
Winson Chung740c3ac2014-11-12 16:14:38 -0800799 case REGISTER_TASK_STACK_LISTENER_TRANSACTION: {
800 data.enforceInterface(IActivityManager.descriptor);
801 IBinder token = data.readStrongBinder();
802 registerTaskStackListener(ITaskStackListener.Stub.asInterface(token));
803 reply.writeNoException();
804 return true;
805 }
806
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800807 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
808 data.enforceInterface(IActivityManager.descriptor);
809 IBinder token = data.readStrongBinder();
810 boolean onlyRoot = data.readInt() != 0;
811 int res = token != null
812 ? getTaskForActivity(token, onlyRoot) : -1;
813 reply.writeNoException();
814 reply.writeInt(res);
815 return true;
816 }
817
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800818 case GET_CONTENT_PROVIDER_TRANSACTION: {
819 data.enforceInterface(IActivityManager.descriptor);
820 IBinder b = data.readStrongBinder();
821 IApplicationThread app = ApplicationThreadNative.asInterface(b);
822 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700823 int userId = data.readInt();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700824 boolean stable = data.readInt() != 0;
Jeff Sharkey6d515712012-09-20 16:06:08 -0700825 ContentProviderHolder cph = getContentProvider(app, name, userId, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800826 reply.writeNoException();
827 if (cph != null) {
828 reply.writeInt(1);
829 cph.writeToParcel(reply, 0);
830 } else {
831 reply.writeInt(0);
832 }
833 return true;
834 }
835
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800836 case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
837 data.enforceInterface(IActivityManager.descriptor);
838 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700839 int userId = data.readInt();
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800840 IBinder token = data.readStrongBinder();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700841 ContentProviderHolder cph = getContentProviderExternal(name, userId, token);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800842 reply.writeNoException();
843 if (cph != null) {
844 reply.writeInt(1);
845 cph.writeToParcel(reply, 0);
846 } else {
847 reply.writeInt(0);
848 }
849 return true;
850 }
851
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800852 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
853 data.enforceInterface(IActivityManager.descriptor);
854 IBinder b = data.readStrongBinder();
855 IApplicationThread app = ApplicationThreadNative.asInterface(b);
856 ArrayList<ContentProviderHolder> providers =
857 data.createTypedArrayList(ContentProviderHolder.CREATOR);
858 publishContentProviders(app, providers);
859 reply.writeNoException();
860 return true;
861 }
862
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700863 case REF_CONTENT_PROVIDER_TRANSACTION: {
864 data.enforceInterface(IActivityManager.descriptor);
865 IBinder b = data.readStrongBinder();
866 int stable = data.readInt();
867 int unstable = data.readInt();
868 boolean res = refContentProvider(b, stable, unstable);
869 reply.writeNoException();
870 reply.writeInt(res ? 1 : 0);
871 return true;
872 }
873
874 case UNSTABLE_PROVIDER_DIED_TRANSACTION: {
875 data.enforceInterface(IActivityManager.descriptor);
876 IBinder b = data.readStrongBinder();
877 unstableProviderDied(b);
878 reply.writeNoException();
879 return true;
880 }
881
Jeff Sharkey7aa76012013-09-30 14:26:27 -0700882 case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: {
883 data.enforceInterface(IActivityManager.descriptor);
884 IBinder b = data.readStrongBinder();
885 appNotRespondingViaProvider(b);
886 reply.writeNoException();
887 return true;
888 }
889
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800890 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
891 data.enforceInterface(IActivityManager.descriptor);
892 IBinder b = data.readStrongBinder();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700893 boolean stable = data.readInt() != 0;
894 removeContentProvider(b, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800895 reply.writeNoException();
896 return true;
897 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800898
899 case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
900 data.enforceInterface(IActivityManager.descriptor);
901 String name = data.readString();
902 IBinder token = data.readStrongBinder();
903 removeContentProviderExternal(name, token);
904 reply.writeNoException();
905 return true;
906 }
907
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700908 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
909 data.enforceInterface(IActivityManager.descriptor);
910 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
911 PendingIntent pi = getRunningServiceControlPanel(comp);
912 reply.writeNoException();
913 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
914 return true;
915 }
916
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800917 case START_SERVICE_TRANSACTION: {
918 data.enforceInterface(IActivityManager.descriptor);
919 IBinder b = data.readStrongBinder();
920 IApplicationThread app = ApplicationThreadNative.asInterface(b);
921 Intent service = Intent.CREATOR.createFromParcel(data);
922 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700923 int userId = data.readInt();
924 ComponentName cn = startService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800925 reply.writeNoException();
926 ComponentName.writeToParcel(cn, reply);
927 return true;
928 }
929
930 case STOP_SERVICE_TRANSACTION: {
931 data.enforceInterface(IActivityManager.descriptor);
932 IBinder b = data.readStrongBinder();
933 IApplicationThread app = ApplicationThreadNative.asInterface(b);
934 Intent service = Intent.CREATOR.createFromParcel(data);
935 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700936 int userId = data.readInt();
937 int res = stopService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800938 reply.writeNoException();
939 reply.writeInt(res);
940 return true;
941 }
942
943 case STOP_SERVICE_TOKEN_TRANSACTION: {
944 data.enforceInterface(IActivityManager.descriptor);
945 ComponentName className = ComponentName.readFromParcel(data);
946 IBinder token = data.readStrongBinder();
947 int startId = data.readInt();
948 boolean res = stopServiceToken(className, token, startId);
949 reply.writeNoException();
950 reply.writeInt(res ? 1 : 0);
951 return true;
952 }
953
954 case SET_SERVICE_FOREGROUND_TRANSACTION: {
955 data.enforceInterface(IActivityManager.descriptor);
956 ComponentName className = ComponentName.readFromParcel(data);
957 IBinder token = data.readStrongBinder();
Dianne Hackbornd8a43f62009-08-17 23:33:56 -0700958 int id = data.readInt();
959 Notification notification = null;
960 if (data.readInt() != 0) {
961 notification = Notification.CREATOR.createFromParcel(data);
962 }
963 boolean removeNotification = data.readInt() != 0;
964 setServiceForeground(className, token, id, notification, removeNotification);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800965 reply.writeNoException();
966 return true;
967 }
968
969 case BIND_SERVICE_TRANSACTION: {
970 data.enforceInterface(IActivityManager.descriptor);
971 IBinder b = data.readStrongBinder();
972 IApplicationThread app = ApplicationThreadNative.asInterface(b);
973 IBinder token = data.readStrongBinder();
974 Intent service = Intent.CREATOR.createFromParcel(data);
975 String resolvedType = data.readString();
976 b = data.readStrongBinder();
977 int fl = data.readInt();
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800978 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800979 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800980 int res = bindService(app, token, service, resolvedType, conn, fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800981 reply.writeNoException();
982 reply.writeInt(res);
983 return true;
984 }
985
986 case UNBIND_SERVICE_TRANSACTION: {
987 data.enforceInterface(IActivityManager.descriptor);
988 IBinder b = data.readStrongBinder();
989 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
990 boolean res = unbindService(conn);
991 reply.writeNoException();
992 reply.writeInt(res ? 1 : 0);
993 return true;
994 }
995
996 case PUBLISH_SERVICE_TRANSACTION: {
997 data.enforceInterface(IActivityManager.descriptor);
998 IBinder token = data.readStrongBinder();
999 Intent intent = Intent.CREATOR.createFromParcel(data);
1000 IBinder service = data.readStrongBinder();
1001 publishService(token, intent, service);
1002 reply.writeNoException();
1003 return true;
1004 }
1005
1006 case UNBIND_FINISHED_TRANSACTION: {
1007 data.enforceInterface(IActivityManager.descriptor);
1008 IBinder token = data.readStrongBinder();
1009 Intent intent = Intent.CREATOR.createFromParcel(data);
1010 boolean doRebind = data.readInt() != 0;
1011 unbindFinished(token, intent, doRebind);
1012 reply.writeNoException();
1013 return true;
1014 }
1015
1016 case SERVICE_DONE_EXECUTING_TRANSACTION: {
1017 data.enforceInterface(IActivityManager.descriptor);
1018 IBinder token = data.readStrongBinder();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07001019 int type = data.readInt();
1020 int startId = data.readInt();
1021 int res = data.readInt();
1022 serviceDoneExecuting(token, type, startId, res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001023 reply.writeNoException();
1024 return true;
1025 }
1026
1027 case START_INSTRUMENTATION_TRANSACTION: {
1028 data.enforceInterface(IActivityManager.descriptor);
1029 ComponentName className = ComponentName.readFromParcel(data);
1030 String profileFile = data.readString();
1031 int fl = data.readInt();
1032 Bundle arguments = data.readBundle();
1033 IBinder b = data.readStrongBinder();
1034 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08001035 b = data.readStrongBinder();
1036 IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001037 int userId = data.readInt();
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01001038 String abiOverride = data.readString();
1039 boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId,
1040 abiOverride);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001041 reply.writeNoException();
1042 reply.writeInt(res ? 1 : 0);
1043 return true;
1044 }
1045
1046
1047 case FINISH_INSTRUMENTATION_TRANSACTION: {
1048 data.enforceInterface(IActivityManager.descriptor);
1049 IBinder b = data.readStrongBinder();
1050 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1051 int resultCode = data.readInt();
1052 Bundle results = data.readBundle();
1053 finishInstrumentation(app, resultCode, results);
1054 reply.writeNoException();
1055 return true;
1056 }
1057
1058 case GET_CONFIGURATION_TRANSACTION: {
1059 data.enforceInterface(IActivityManager.descriptor);
1060 Configuration config = getConfiguration();
1061 reply.writeNoException();
1062 config.writeToParcel(reply, 0);
1063 return true;
1064 }
1065
1066 case UPDATE_CONFIGURATION_TRANSACTION: {
1067 data.enforceInterface(IActivityManager.descriptor);
1068 Configuration config = Configuration.CREATOR.createFromParcel(data);
1069 updateConfiguration(config);
1070 reply.writeNoException();
1071 return true;
1072 }
1073
1074 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
1075 data.enforceInterface(IActivityManager.descriptor);
1076 IBinder token = data.readStrongBinder();
1077 int requestedOrientation = data.readInt();
1078 setRequestedOrientation(token, requestedOrientation);
1079 reply.writeNoException();
1080 return true;
1081 }
1082
1083 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
1084 data.enforceInterface(IActivityManager.descriptor);
1085 IBinder token = data.readStrongBinder();
1086 int req = getRequestedOrientation(token);
1087 reply.writeNoException();
1088 reply.writeInt(req);
1089 return true;
1090 }
1091
1092 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
1093 data.enforceInterface(IActivityManager.descriptor);
1094 IBinder token = data.readStrongBinder();
1095 ComponentName cn = getActivityClassForToken(token);
1096 reply.writeNoException();
1097 ComponentName.writeToParcel(cn, reply);
1098 return true;
1099 }
1100
1101 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
1102 data.enforceInterface(IActivityManager.descriptor);
1103 IBinder token = data.readStrongBinder();
1104 reply.writeNoException();
1105 reply.writeString(getPackageForToken(token));
1106 return true;
1107 }
1108
1109 case GET_INTENT_SENDER_TRANSACTION: {
1110 data.enforceInterface(IActivityManager.descriptor);
1111 int type = data.readInt();
1112 String packageName = data.readString();
1113 IBinder token = data.readStrongBinder();
1114 String resultWho = data.readString();
1115 int requestCode = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001116 Intent[] requestIntents;
1117 String[] requestResolvedTypes;
1118 if (data.readInt() != 0) {
1119 requestIntents = data.createTypedArray(Intent.CREATOR);
1120 requestResolvedTypes = data.createStringArray();
1121 } else {
1122 requestIntents = null;
1123 requestResolvedTypes = null;
1124 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001125 int fl = data.readInt();
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07001126 Bundle options = data.readInt() != 0
1127 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -07001128 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001129 IIntentSender res = getIntentSender(type, packageName, token,
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001130 resultWho, requestCode, requestIntents,
Dianne Hackborn41203752012-08-31 14:05:51 -07001131 requestResolvedTypes, fl, options, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001132 reply.writeNoException();
1133 reply.writeStrongBinder(res != null ? res.asBinder() : null);
1134 return true;
1135 }
1136
1137 case CANCEL_INTENT_SENDER_TRANSACTION: {
1138 data.enforceInterface(IActivityManager.descriptor);
1139 IIntentSender r = IIntentSender.Stub.asInterface(
1140 data.readStrongBinder());
1141 cancelIntentSender(r);
1142 reply.writeNoException();
1143 return true;
1144 }
1145
1146 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
1147 data.enforceInterface(IActivityManager.descriptor);
1148 IIntentSender r = IIntentSender.Stub.asInterface(
1149 data.readStrongBinder());
1150 String res = getPackageForIntentSender(r);
1151 reply.writeNoException();
1152 reply.writeString(res);
1153 return true;
1154 }
1155
Christopher Tatec4a07d12012-04-06 14:19:13 -07001156 case GET_UID_FOR_INTENT_SENDER_TRANSACTION: {
1157 data.enforceInterface(IActivityManager.descriptor);
1158 IIntentSender r = IIntentSender.Stub.asInterface(
1159 data.readStrongBinder());
1160 int res = getUidForIntentSender(r);
1161 reply.writeNoException();
1162 reply.writeInt(res);
1163 return true;
1164 }
1165
Dianne Hackborn41203752012-08-31 14:05:51 -07001166 case HANDLE_INCOMING_USER_TRANSACTION: {
1167 data.enforceInterface(IActivityManager.descriptor);
1168 int callingPid = data.readInt();
1169 int callingUid = data.readInt();
1170 int userId = data.readInt();
1171 boolean allowAll = data.readInt() != 0 ;
1172 boolean requireFull = data.readInt() != 0;
1173 String name = data.readString();
1174 String callerPackage = data.readString();
1175 int res = handleIncomingUser(callingPid, callingUid, userId, allowAll,
1176 requireFull, name, callerPackage);
1177 reply.writeNoException();
1178 reply.writeInt(res);
1179 return true;
1180 }
1181
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001182 case SET_PROCESS_LIMIT_TRANSACTION: {
1183 data.enforceInterface(IActivityManager.descriptor);
1184 int max = data.readInt();
1185 setProcessLimit(max);
1186 reply.writeNoException();
1187 return true;
1188 }
1189
1190 case GET_PROCESS_LIMIT_TRANSACTION: {
1191 data.enforceInterface(IActivityManager.descriptor);
1192 int limit = getProcessLimit();
1193 reply.writeNoException();
1194 reply.writeInt(limit);
1195 return true;
1196 }
1197
1198 case SET_PROCESS_FOREGROUND_TRANSACTION: {
1199 data.enforceInterface(IActivityManager.descriptor);
1200 IBinder token = data.readStrongBinder();
1201 int pid = data.readInt();
1202 boolean isForeground = data.readInt() != 0;
1203 setProcessForeground(token, pid, isForeground);
1204 reply.writeNoException();
1205 return true;
1206 }
1207
1208 case CHECK_PERMISSION_TRANSACTION: {
1209 data.enforceInterface(IActivityManager.descriptor);
1210 String perm = data.readString();
1211 int pid = data.readInt();
1212 int uid = data.readInt();
1213 int res = checkPermission(perm, pid, uid);
1214 reply.writeNoException();
1215 reply.writeInt(res);
1216 return true;
1217 }
1218
Dianne Hackbornff170242014-11-19 10:59:01 -08001219 case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: {
1220 data.enforceInterface(IActivityManager.descriptor);
1221 String perm = data.readString();
1222 int pid = data.readInt();
1223 int uid = data.readInt();
1224 IBinder token = data.readStrongBinder();
1225 int res = checkPermissionWithToken(perm, pid, uid, token);
1226 reply.writeNoException();
1227 reply.writeInt(res);
1228 return true;
1229 }
1230
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001231 case CHECK_URI_PERMISSION_TRANSACTION: {
1232 data.enforceInterface(IActivityManager.descriptor);
1233 Uri uri = Uri.CREATOR.createFromParcel(data);
1234 int pid = data.readInt();
1235 int uid = data.readInt();
1236 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001237 int userId = data.readInt();
Dianne Hackbornff170242014-11-19 10:59:01 -08001238 IBinder callerToken = data.readStrongBinder();
1239 int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001240 reply.writeNoException();
1241 reply.writeInt(res);
1242 return true;
1243 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001244
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001245 case CLEAR_APP_DATA_TRANSACTION: {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001246 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001247 String packageName = data.readString();
1248 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
1249 data.readStrongBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -07001250 int userId = data.readInt();
1251 boolean res = clearApplicationUserData(packageName, observer, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001252 reply.writeNoException();
1253 reply.writeInt(res ? 1 : 0);
1254 return true;
1255 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001256
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001257 case GRANT_URI_PERMISSION_TRANSACTION: {
1258 data.enforceInterface(IActivityManager.descriptor);
1259 IBinder b = data.readStrongBinder();
1260 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1261 String targetPkg = data.readString();
1262 Uri uri = Uri.CREATOR.createFromParcel(data);
1263 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001264 int userId = data.readInt();
1265 grantUriPermission(app, targetPkg, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001266 reply.writeNoException();
1267 return true;
1268 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001269
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001270 case REVOKE_URI_PERMISSION_TRANSACTION: {
1271 data.enforceInterface(IActivityManager.descriptor);
1272 IBinder b = data.readStrongBinder();
1273 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1274 Uri uri = Uri.CREATOR.createFromParcel(data);
1275 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001276 int userId = data.readInt();
1277 revokeUriPermission(app, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001278 reply.writeNoException();
1279 return true;
1280 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001281
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001282 case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1283 data.enforceInterface(IActivityManager.descriptor);
1284 Uri uri = Uri.CREATOR.createFromParcel(data);
1285 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001286 int userId = data.readInt();
1287 takePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001288 reply.writeNoException();
1289 return true;
1290 }
1291
1292 case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1293 data.enforceInterface(IActivityManager.descriptor);
1294 Uri uri = Uri.CREATOR.createFromParcel(data);
1295 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001296 int userId = data.readInt();
1297 releasePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001298 reply.writeNoException();
1299 return true;
1300 }
1301
1302 case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: {
1303 data.enforceInterface(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07001304 final String packageName = data.readString();
1305 final boolean incoming = data.readInt() != 0;
1306 final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions(
1307 packageName, incoming);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001308 reply.writeNoException();
1309 perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1310 return true;
1311 }
1312
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001313 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
1314 data.enforceInterface(IActivityManager.descriptor);
1315 IBinder b = data.readStrongBinder();
1316 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1317 boolean waiting = data.readInt() != 0;
1318 showWaitingForDebugger(app, waiting);
1319 reply.writeNoException();
1320 return true;
1321 }
1322
1323 case GET_MEMORY_INFO_TRANSACTION: {
1324 data.enforceInterface(IActivityManager.descriptor);
1325 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
1326 getMemoryInfo(mi);
1327 reply.writeNoException();
1328 mi.writeToParcel(reply, 0);
1329 return true;
1330 }
1331
1332 case UNHANDLED_BACK_TRANSACTION: {
1333 data.enforceInterface(IActivityManager.descriptor);
1334 unhandledBack();
1335 reply.writeNoException();
1336 return true;
1337 }
1338
1339 case OPEN_CONTENT_URI_TRANSACTION: {
1340 data.enforceInterface(IActivityManager.descriptor);
1341 Uri uri = Uri.parse(data.readString());
1342 ParcelFileDescriptor pfd = openContentUri(uri);
1343 reply.writeNoException();
1344 if (pfd != null) {
1345 reply.writeInt(1);
1346 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1347 } else {
1348 reply.writeInt(0);
1349 }
1350 return true;
1351 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001352
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001353 case SET_LOCK_SCREEN_SHOWN_TRANSACTION: {
1354 data.enforceInterface(IActivityManager.descriptor);
1355 setLockScreenShown(data.readInt() != 0);
1356 reply.writeNoException();
1357 return true;
1358 }
1359
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001360 case SET_DEBUG_APP_TRANSACTION: {
1361 data.enforceInterface(IActivityManager.descriptor);
1362 String pn = data.readString();
1363 boolean wfd = data.readInt() != 0;
1364 boolean per = data.readInt() != 0;
1365 setDebugApp(pn, wfd, per);
1366 reply.writeNoException();
1367 return true;
1368 }
1369
1370 case SET_ALWAYS_FINISH_TRANSACTION: {
1371 data.enforceInterface(IActivityManager.descriptor);
1372 boolean enabled = data.readInt() != 0;
1373 setAlwaysFinish(enabled);
1374 reply.writeNoException();
1375 return true;
1376 }
1377
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001378 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001379 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001380 IActivityController watcher = IActivityController.Stub.asInterface(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001381 data.readStrongBinder());
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001382 setActivityController(watcher);
Sungmin Choicdb86bb2012-12-20 14:08:59 +09001383 reply.writeNoException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001384 return true;
1385 }
1386
1387 case ENTER_SAFE_MODE_TRANSACTION: {
1388 data.enforceInterface(IActivityManager.descriptor);
1389 enterSafeMode();
1390 reply.writeNoException();
1391 return true;
1392 }
1393
1394 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1395 data.enforceInterface(IActivityManager.descriptor);
1396 IIntentSender is = IIntentSender.Stub.asInterface(
1397 data.readStrongBinder());
Dianne Hackborn099bc622014-01-22 13:39:16 -08001398 int sourceUid = data.readInt();
1399 String sourcePkg = data.readString();
Dianne Hackborn1e383822015-04-10 14:02:33 -07001400 String tag = data.readString();
1401 noteWakeupAlarm(is, sourceUid, sourcePkg, tag);
1402 reply.writeNoException();
1403 return true;
1404 }
1405
1406 case NOTE_ALARM_START_TRANSACTION: {
1407 data.enforceInterface(IActivityManager.descriptor);
1408 IIntentSender is = IIntentSender.Stub.asInterface(
1409 data.readStrongBinder());
1410 int sourceUid = data.readInt();
1411 String tag = data.readString();
1412 noteAlarmStart(is, sourceUid, tag);
1413 reply.writeNoException();
1414 return true;
1415 }
1416
1417 case NOTE_ALARM_FINISH_TRANSACTION: {
1418 data.enforceInterface(IActivityManager.descriptor);
1419 IIntentSender is = IIntentSender.Stub.asInterface(
1420 data.readStrongBinder());
1421 int sourceUid = data.readInt();
1422 String tag = data.readString();
1423 noteAlarmFinish(is, sourceUid, tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001424 reply.writeNoException();
1425 return true;
1426 }
1427
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001428 case KILL_PIDS_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001429 data.enforceInterface(IActivityManager.descriptor);
1430 int[] pids = data.createIntArray();
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001431 String reason = data.readString();
Dianne Hackborn64825172011-03-02 21:32:58 -08001432 boolean secure = data.readInt() != 0;
1433 boolean res = killPids(pids, reason, secure);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001434 reply.writeNoException();
1435 reply.writeInt(res ? 1 : 0);
1436 return true;
1437 }
1438
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07001439 case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: {
1440 data.enforceInterface(IActivityManager.descriptor);
1441 String reason = data.readString();
1442 boolean res = killProcessesBelowForeground(reason);
1443 reply.writeNoException();
1444 reply.writeInt(res ? 1 : 0);
1445 return true;
1446 }
1447
Dan Egnor60d87622009-12-16 16:32:58 -08001448 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1449 data.enforceInterface(IActivityManager.descriptor);
1450 IBinder app = data.readStrongBinder();
1451 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1452 handleApplicationCrash(app, ci);
1453 reply.writeNoException();
1454 return true;
1455 }
1456
1457 case HANDLE_APPLICATION_WTF_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001458 data.enforceInterface(IActivityManager.descriptor);
1459 IBinder app = data.readStrongBinder();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001460 String tag = data.readString();
Dianne Hackborn52322712014-08-26 22:47:26 -07001461 boolean system = data.readInt() != 0;
Dan Egnorb7f03672009-12-09 16:22:32 -08001462 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
Dianne Hackborn52322712014-08-26 22:47:26 -07001463 boolean res = handleApplicationWtf(app, tag, system, ci);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001464 reply.writeNoException();
Dan Egnor60d87622009-12-16 16:32:58 -08001465 reply.writeInt(res ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001466 return true;
1467 }
Dan Egnorb7f03672009-12-09 16:22:32 -08001468
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001469 case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: {
1470 data.enforceInterface(IActivityManager.descriptor);
1471 IBinder app = data.readStrongBinder();
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07001472 int violationMask = data.readInt();
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07001473 StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data);
1474 handleApplicationStrictModeViolation(app, violationMask, info);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001475 reply.writeNoException();
1476 return true;
1477 }
1478
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001479 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1480 data.enforceInterface(IActivityManager.descriptor);
1481 int sig = data.readInt();
1482 signalPersistentProcesses(sig);
1483 reply.writeNoException();
1484 return true;
1485 }
1486
Dianne Hackborn03abb812010-01-04 18:43:19 -08001487 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1488 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001489 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001490 int userId = data.readInt();
1491 killBackgroundProcesses(packageName, userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08001492 reply.writeNoException();
1493 return true;
1494 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08001495
1496 case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
1497 data.enforceInterface(IActivityManager.descriptor);
1498 killAllBackgroundProcesses();
1499 reply.writeNoException();
1500 return true;
1501 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001502
Dianne Hackborn03abb812010-01-04 18:43:19 -08001503 case FORCE_STOP_PACKAGE_TRANSACTION: {
1504 data.enforceInterface(IActivityManager.descriptor);
1505 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001506 int userId = data.readInt();
1507 forceStopPackage(packageName, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001508 reply.writeNoException();
1509 return true;
1510 }
Dianne Hackborn27ff9132012-03-06 14:57:58 -08001511
1512 case GET_MY_MEMORY_STATE_TRANSACTION: {
1513 data.enforceInterface(IActivityManager.descriptor);
1514 ActivityManager.RunningAppProcessInfo info =
1515 new ActivityManager.RunningAppProcessInfo();
1516 getMyMemoryState(info);
1517 reply.writeNoException();
1518 info.writeToParcel(reply, 0);
1519 return true;
1520 }
1521
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001522 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1523 data.enforceInterface(IActivityManager.descriptor);
1524 ConfigurationInfo config = getDeviceConfigurationInfo();
1525 reply.writeNoException();
1526 config.writeToParcel(reply, 0);
1527 return true;
1528 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001529
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001530 case PROFILE_CONTROL_TRANSACTION: {
1531 data.enforceInterface(IActivityManager.descriptor);
1532 String process = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001533 int userId = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001534 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001535 int profileType = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -07001536 ProfilerInfo profilerInfo = data.readInt() != 0
1537 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
1538 boolean res = profileControl(process, userId, start, profilerInfo, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001539 reply.writeNoException();
1540 reply.writeInt(res ? 1 : 0);
1541 return true;
1542 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001543
Dianne Hackborn55280a92009-05-07 15:53:46 -07001544 case SHUTDOWN_TRANSACTION: {
1545 data.enforceInterface(IActivityManager.descriptor);
1546 boolean res = shutdown(data.readInt());
1547 reply.writeNoException();
1548 reply.writeInt(res ? 1 : 0);
1549 return true;
1550 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001551
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001552 case STOP_APP_SWITCHES_TRANSACTION: {
1553 data.enforceInterface(IActivityManager.descriptor);
1554 stopAppSwitches();
1555 reply.writeNoException();
1556 return true;
1557 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001558
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001559 case RESUME_APP_SWITCHES_TRANSACTION: {
1560 data.enforceInterface(IActivityManager.descriptor);
1561 resumeAppSwitches();
1562 reply.writeNoException();
1563 return true;
1564 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001565
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001566 case PEEK_SERVICE_TRANSACTION: {
1567 data.enforceInterface(IActivityManager.descriptor);
1568 Intent service = Intent.CREATOR.createFromParcel(data);
1569 String resolvedType = data.readString();
1570 IBinder binder = peekService(service, resolvedType);
1571 reply.writeNoException();
1572 reply.writeStrongBinder(binder);
1573 return true;
1574 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001575
Christopher Tate181fafa2009-05-14 11:12:14 -07001576 case START_BACKUP_AGENT_TRANSACTION: {
1577 data.enforceInterface(IActivityManager.descriptor);
1578 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1579 int backupRestoreMode = data.readInt();
1580 boolean success = bindBackupAgent(info, backupRestoreMode);
1581 reply.writeNoException();
1582 reply.writeInt(success ? 1 : 0);
1583 return true;
1584 }
1585
1586 case BACKUP_AGENT_CREATED_TRANSACTION: {
1587 data.enforceInterface(IActivityManager.descriptor);
1588 String packageName = data.readString();
1589 IBinder agent = data.readStrongBinder();
1590 backupAgentCreated(packageName, agent);
1591 reply.writeNoException();
1592 return true;
1593 }
1594
1595 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1596 data.enforceInterface(IActivityManager.descriptor);
1597 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1598 unbindBackupAgent(info);
1599 reply.writeNoException();
1600 return true;
1601 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001602
1603 case ADD_PACKAGE_DEPENDENCY_TRANSACTION: {
1604 data.enforceInterface(IActivityManager.descriptor);
1605 String packageName = data.readString();
1606 addPackageDependency(packageName);
1607 reply.writeNoException();
1608 return true;
1609 }
1610
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001611 case KILL_APPLICATION_WITH_APPID_TRANSACTION: {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001612 data.enforceInterface(IActivityManager.descriptor);
1613 String pkg = data.readString();
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001614 int appid = data.readInt();
Dianne Hackborn21d9b562013-05-28 17:46:59 -07001615 String reason = data.readString();
1616 killApplicationWithAppId(pkg, appid, reason);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001617 reply.writeNoException();
1618 return true;
1619 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001620
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001621 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1622 data.enforceInterface(IActivityManager.descriptor);
1623 String reason = data.readString();
1624 closeSystemDialogs(reason);
1625 reply.writeNoException();
1626 return true;
1627 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001628
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001629 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1630 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001631 int[] pids = data.createIntArray();
1632 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001633 reply.writeNoException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001634 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001635 return true;
1636 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001637
1638 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1639 data.enforceInterface(IActivityManager.descriptor);
1640 String processName = data.readString();
1641 int uid = data.readInt();
1642 killApplicationProcess(processName, uid);
1643 reply.writeNoException();
1644 return true;
1645 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001646
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001647 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1648 data.enforceInterface(IActivityManager.descriptor);
1649 IBinder token = data.readStrongBinder();
1650 String packageName = data.readString();
1651 int enterAnim = data.readInt();
1652 int exitAnim = data.readInt();
1653 overridePendingTransition(token, packageName, enterAnim, exitAnim);
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001654 reply.writeNoException();
1655 return true;
1656 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001657
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001658 case IS_USER_A_MONKEY_TRANSACTION: {
1659 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001660 boolean areThey = isUserAMonkey();
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001661 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001662 reply.writeInt(areThey ? 1 : 0);
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001663 return true;
1664 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001665
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07001666 case SET_USER_IS_MONKEY_TRANSACTION: {
1667 data.enforceInterface(IActivityManager.descriptor);
1668 final boolean monkey = (data.readInt() == 1);
1669 setUserIsMonkey(monkey);
1670 reply.writeNoException();
1671 return true;
1672 }
1673
Dianne Hackborn860755f2010-06-03 18:47:52 -07001674 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1675 data.enforceInterface(IActivityManager.descriptor);
1676 finishHeavyWeightApp();
1677 reply.writeNoException();
1678 return true;
1679 }
Daniel Sandler69a48172010-06-23 16:29:36 -04001680
1681 case IS_IMMERSIVE_TRANSACTION: {
1682 data.enforceInterface(IActivityManager.descriptor);
1683 IBinder token = data.readStrongBinder();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001684 boolean isit = isImmersive(token);
Daniel Sandler69a48172010-06-23 16:29:36 -04001685 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001686 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001687 return true;
1688 }
1689
Craig Mautnerd61dc202014-07-07 11:09:11 -07001690 case IS_TOP_OF_TASK_TRANSACTION: {
1691 data.enforceInterface(IActivityManager.descriptor);
1692 IBinder token = data.readStrongBinder();
1693 final boolean isTopOfTask = isTopOfTask(token);
1694 reply.writeNoException();
1695 reply.writeInt(isTopOfTask ? 1 : 0);
1696 return true;
1697 }
1698
Craig Mautner5eda9b32013-07-02 11:58:16 -07001699 case CONVERT_FROM_TRANSLUCENT_TRANSACTION: {
Craig Mautner4addfc52013-06-25 08:05:45 -07001700 data.enforceInterface(IActivityManager.descriptor);
1701 IBinder token = data.readStrongBinder();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001702 boolean converted = convertFromTranslucent(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001703 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001704 reply.writeInt(converted ? 1 : 0);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001705 return true;
1706 }
1707
1708 case CONVERT_TO_TRANSLUCENT_TRANSACTION: {
1709 data.enforceInterface(IActivityManager.descriptor);
1710 IBinder token = data.readStrongBinder();
Craig Mautner233ceee2014-05-09 17:05:11 -07001711 final Bundle bundle;
1712 if (data.readInt() == 0) {
1713 bundle = null;
1714 } else {
1715 bundle = data.readBundle();
1716 }
1717 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
1718 boolean converted = convertToTranslucent(token, options);
Craig Mautner4addfc52013-06-25 08:05:45 -07001719 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001720 reply.writeInt(converted ? 1 : 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07001721 return true;
1722 }
1723
Craig Mautner233ceee2014-05-09 17:05:11 -07001724 case GET_ACTIVITY_OPTIONS_TRANSACTION: {
1725 data.enforceInterface(IActivityManager.descriptor);
1726 IBinder token = data.readStrongBinder();
1727 final ActivityOptions options = getActivityOptions(token);
1728 reply.writeNoException();
1729 reply.writeBundle(options == null ? null : options.toBundle());
1730 return true;
1731 }
1732
Daniel Sandler69a48172010-06-23 16:29:36 -04001733 case SET_IMMERSIVE_TRANSACTION: {
1734 data.enforceInterface(IActivityManager.descriptor);
1735 IBinder token = data.readStrongBinder();
1736 boolean imm = data.readInt() == 1;
1737 setImmersive(token, imm);
1738 reply.writeNoException();
1739 return true;
1740 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001741
Daniel Sandler69a48172010-06-23 16:29:36 -04001742 case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
1743 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001744 boolean isit = isTopActivityImmersive();
Daniel Sandler69a48172010-06-23 16:29:36 -04001745 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001746 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001747 return true;
1748 }
1749
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001750 case CRASH_APPLICATION_TRANSACTION: {
1751 data.enforceInterface(IActivityManager.descriptor);
1752 int uid = data.readInt();
1753 int initialPid = data.readInt();
1754 String packageName = data.readString();
1755 String message = data.readString();
1756 crashApplication(uid, initialPid, packageName, message);
1757 reply.writeNoException();
1758 return true;
1759 }
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001760
1761 case GET_PROVIDER_MIME_TYPE_TRANSACTION: {
1762 data.enforceInterface(IActivityManager.descriptor);
1763 Uri uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001764 int userId = data.readInt();
1765 String type = getProviderMimeType(uri, userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001766 reply.writeNoException();
1767 reply.writeString(type);
1768 return true;
1769 }
1770
Dianne Hackborn7e269642010-08-25 19:50:20 -07001771 case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
1772 data.enforceInterface(IActivityManager.descriptor);
1773 String name = data.readString();
1774 IBinder perm = newUriPermissionOwner(name);
1775 reply.writeNoException();
1776 reply.writeStrongBinder(perm);
1777 return true;
1778 }
1779
1780 case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1781 data.enforceInterface(IActivityManager.descriptor);
1782 IBinder owner = data.readStrongBinder();
1783 int fromUid = data.readInt();
1784 String targetPkg = data.readString();
1785 Uri uri = Uri.CREATOR.createFromParcel(data);
1786 int mode = data.readInt();
Nicolas Prevotf1939902014-06-25 09:29:02 +01001787 int sourceUserId = data.readInt();
1788 int targetUserId = data.readInt();
1789 grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId,
1790 targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001791 reply.writeNoException();
1792 return true;
1793 }
1794
1795 case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1796 data.enforceInterface(IActivityManager.descriptor);
1797 IBinder owner = data.readStrongBinder();
1798 Uri uri = null;
1799 if (data.readInt() != 0) {
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001800 uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001801 }
1802 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001803 int userId = data.readInt();
1804 revokeUriPermissionFromOwner(owner, uri, mode, userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001805 reply.writeNoException();
1806 return true;
1807 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001808
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001809 case CHECK_GRANT_URI_PERMISSION_TRANSACTION: {
1810 data.enforceInterface(IActivityManager.descriptor);
1811 int callingUid = data.readInt();
1812 String targetPkg = data.readString();
1813 Uri uri = Uri.CREATOR.createFromParcel(data);
1814 int modeFlags = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001815 int userId = data.readInt();
1816 int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001817 reply.writeNoException();
1818 reply.writeInt(res);
1819 return true;
1820 }
1821
Andy McFadden824c5102010-07-09 16:26:57 -07001822 case DUMP_HEAP_TRANSACTION: {
1823 data.enforceInterface(IActivityManager.descriptor);
1824 String process = data.readString();
Dianne Hackbornb12e1352012-09-26 11:39:20 -07001825 int userId = data.readInt();
Andy McFadden824c5102010-07-09 16:26:57 -07001826 boolean managed = data.readInt() != 0;
1827 String path = data.readString();
1828 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -07001829 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborn1676c852012-09-10 14:52:30 -07001830 boolean res = dumpHeap(process, userId, managed, path, fd);
Andy McFadden824c5102010-07-09 16:26:57 -07001831 reply.writeNoException();
1832 reply.writeInt(res ? 1 : 0);
1833 return true;
1834 }
1835
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001836 case START_ACTIVITIES_TRANSACTION:
1837 {
1838 data.enforceInterface(IActivityManager.descriptor);
1839 IBinder b = data.readStrongBinder();
1840 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001841 String callingPackage = data.readString();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001842 Intent[] intents = data.createTypedArray(Intent.CREATOR);
1843 String[] resolvedTypes = data.createStringArray();
1844 IBinder resultTo = data.readStrongBinder();
Dianne Hackborna4972e92012-03-14 10:38:05 -07001845 Bundle options = data.readInt() != 0
1846 ? Bundle.CREATOR.createFromParcel(data) : null;
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001847 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001848 int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001849 options, userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001850 reply.writeNoException();
1851 reply.writeInt(result);
1852 return true;
1853 }
1854
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001855 case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1856 {
1857 data.enforceInterface(IActivityManager.descriptor);
1858 int mode = getFrontActivityScreenCompatMode();
1859 reply.writeNoException();
1860 reply.writeInt(mode);
1861 return true;
1862 }
1863
1864 case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1865 {
1866 data.enforceInterface(IActivityManager.descriptor);
1867 int mode = data.readInt();
1868 setFrontActivityScreenCompatMode(mode);
1869 reply.writeNoException();
1870 reply.writeInt(mode);
1871 return true;
1872 }
1873
1874 case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1875 {
1876 data.enforceInterface(IActivityManager.descriptor);
1877 String pkg = data.readString();
1878 int mode = getPackageScreenCompatMode(pkg);
1879 reply.writeNoException();
1880 reply.writeInt(mode);
1881 return true;
1882 }
1883
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001884 case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1885 {
1886 data.enforceInterface(IActivityManager.descriptor);
1887 String pkg = data.readString();
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001888 int mode = data.readInt();
1889 setPackageScreenCompatMode(pkg, mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001890 reply.writeNoException();
1891 return true;
1892 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001893
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001894 case SWITCH_USER_TRANSACTION: {
1895 data.enforceInterface(IActivityManager.descriptor);
1896 int userid = data.readInt();
1897 boolean result = switchUser(userid);
1898 reply.writeNoException();
1899 reply.writeInt(result ? 1 : 0);
1900 return true;
1901 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07001902
Kenny Guy08488bf2014-02-21 17:40:37 +00001903 case START_USER_IN_BACKGROUND_TRANSACTION: {
1904 data.enforceInterface(IActivityManager.descriptor);
1905 int userid = data.readInt();
1906 boolean result = startUserInBackground(userid);
1907 reply.writeNoException();
1908 reply.writeInt(result ? 1 : 0);
1909 return true;
1910 }
1911
Dianne Hackborn80a4af22012-08-27 19:18:31 -07001912 case STOP_USER_TRANSACTION: {
1913 data.enforceInterface(IActivityManager.descriptor);
1914 int userid = data.readInt();
1915 IStopUserCallback callback = IStopUserCallback.Stub.asInterface(
1916 data.readStrongBinder());
1917 int result = stopUser(userid, callback);
1918 reply.writeNoException();
1919 reply.writeInt(result);
1920 return true;
1921 }
1922
Amith Yamasani52f1d752012-03-28 18:19:29 -07001923 case GET_CURRENT_USER_TRANSACTION: {
1924 data.enforceInterface(IActivityManager.descriptor);
1925 UserInfo userInfo = getCurrentUser();
1926 reply.writeNoException();
1927 userInfo.writeToParcel(reply, 0);
1928 return true;
1929 }
1930
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001931 case IS_USER_RUNNING_TRANSACTION: {
1932 data.enforceInterface(IActivityManager.descriptor);
1933 int userid = data.readInt();
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07001934 boolean orStopping = data.readInt() != 0;
1935 boolean result = isUserRunning(userid, orStopping);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001936 reply.writeNoException();
1937 reply.writeInt(result ? 1 : 0);
1938 return true;
1939 }
1940
Dianne Hackbornc72fc672012-09-20 13:12:03 -07001941 case GET_RUNNING_USER_IDS_TRANSACTION: {
1942 data.enforceInterface(IActivityManager.descriptor);
1943 int[] result = getRunningUserIds();
1944 reply.writeNoException();
1945 reply.writeIntArray(result);
1946 return true;
1947 }
1948
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001949 case REMOVE_TASK_TRANSACTION:
1950 {
1951 data.enforceInterface(IActivityManager.descriptor);
1952 int taskId = data.readInt();
Wale Ogunwaled54b5782014-10-23 15:55:23 -07001953 boolean result = removeTask(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001954 reply.writeNoException();
1955 reply.writeInt(result ? 1 : 0);
1956 return true;
1957 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001958
Jeff Sharkeya4620792011-05-20 15:29:23 -07001959 case REGISTER_PROCESS_OBSERVER_TRANSACTION: {
1960 data.enforceInterface(IActivityManager.descriptor);
1961 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1962 data.readStrongBinder());
1963 registerProcessObserver(observer);
1964 return true;
1965 }
1966
1967 case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: {
1968 data.enforceInterface(IActivityManager.descriptor);
1969 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1970 data.readStrongBinder());
1971 unregisterProcessObserver(observer);
1972 return true;
1973 }
1974
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07001975 case REGISTER_UID_OBSERVER_TRANSACTION: {
1976 data.enforceInterface(IActivityManager.descriptor);
1977 IUidObserver observer = IUidObserver.Stub.asInterface(
1978 data.readStrongBinder());
1979 registerUidObserver(observer);
1980 return true;
1981 }
1982
1983 case UNREGISTER_UID_OBSERVER_TRANSACTION: {
1984 data.enforceInterface(IActivityManager.descriptor);
1985 IUidObserver observer = IUidObserver.Stub.asInterface(
1986 data.readStrongBinder());
1987 unregisterUidObserver(observer);
1988 return true;
1989 }
1990
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07001991 case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1992 {
1993 data.enforceInterface(IActivityManager.descriptor);
1994 String pkg = data.readString();
1995 boolean ask = getPackageAskScreenCompat(pkg);
1996 reply.writeNoException();
1997 reply.writeInt(ask ? 1 : 0);
1998 return true;
1999 }
2000
2001 case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
2002 {
2003 data.enforceInterface(IActivityManager.descriptor);
2004 String pkg = data.readString();
2005 boolean ask = data.readInt() != 0;
2006 setPackageAskScreenCompat(pkg, ask);
2007 reply.writeNoException();
2008 return true;
2009 }
2010
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002011 case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: {
2012 data.enforceInterface(IActivityManager.descriptor);
2013 IIntentSender r = IIntentSender.Stub.asInterface(
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002014 data.readStrongBinder());
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002015 boolean res = isIntentSenderTargetedToPackage(r);
2016 reply.writeNoException();
2017 reply.writeInt(res ? 1 : 0);
2018 return true;
2019 }
2020
Dianne Hackborn1927ae82012-06-22 15:21:36 -07002021 case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: {
2022 data.enforceInterface(IActivityManager.descriptor);
2023 IIntentSender r = IIntentSender.Stub.asInterface(
2024 data.readStrongBinder());
2025 boolean res = isIntentSenderAnActivity(r);
2026 reply.writeNoException();
2027 reply.writeInt(res ? 1 : 0);
2028 return true;
2029 }
2030
Dianne Hackborn81038902012-11-26 17:04:09 -08002031 case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: {
2032 data.enforceInterface(IActivityManager.descriptor);
2033 IIntentSender r = IIntentSender.Stub.asInterface(
2034 data.readStrongBinder());
2035 Intent intent = getIntentForIntentSender(r);
2036 reply.writeNoException();
2037 if (intent != null) {
2038 reply.writeInt(1);
2039 intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2040 } else {
2041 reply.writeInt(0);
2042 }
2043 return true;
2044 }
2045
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08002046 case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: {
2047 data.enforceInterface(IActivityManager.descriptor);
2048 IIntentSender r = IIntentSender.Stub.asInterface(
2049 data.readStrongBinder());
2050 String prefix = data.readString();
2051 String tag = getTagForIntentSender(r, prefix);
2052 reply.writeNoException();
2053 reply.writeString(tag);
2054 return true;
2055 }
2056
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002057 case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
2058 data.enforceInterface(IActivityManager.descriptor);
2059 Configuration config = Configuration.CREATOR.createFromParcel(data);
2060 updatePersistentConfiguration(config);
2061 reply.writeNoException();
2062 return true;
2063 }
2064
Dianne Hackbornb437e092011-08-05 17:50:29 -07002065 case GET_PROCESS_PSS_TRANSACTION: {
2066 data.enforceInterface(IActivityManager.descriptor);
2067 int[] pids = data.createIntArray();
2068 long[] pss = getProcessPss(pids);
2069 reply.writeNoException();
2070 reply.writeLongArray(pss);
2071 return true;
2072 }
2073
Dianne Hackborn661cd522011-08-22 00:26:20 -07002074 case SHOW_BOOT_MESSAGE_TRANSACTION: {
2075 data.enforceInterface(IActivityManager.descriptor);
2076 CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
2077 boolean always = data.readInt() != 0;
2078 showBootMessage(msg, always);
2079 reply.writeNoException();
2080 return true;
2081 }
2082
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002083 case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002084 data.enforceInterface(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002085 keyguardWaitingForActivityDrawn();
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002086 reply.writeNoException();
2087 return true;
2088 }
2089
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07002090 case KEYGUARD_GOING_AWAY_TRANSACTION: {
2091 data.enforceInterface(IActivityManager.descriptor);
2092 keyguardGoingAway(data.readInt() != 0, data.readInt() != 0);
2093 reply.writeNoException();
2094 return true;
2095 }
2096
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002097 case SHOULD_UP_RECREATE_TASK_TRANSACTION: {
Adam Powelldd8fab22012-03-22 17:47:27 -07002098 data.enforceInterface(IActivityManager.descriptor);
2099 IBinder token = data.readStrongBinder();
2100 String destAffinity = data.readString();
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002101 boolean res = shouldUpRecreateTask(token, destAffinity);
Adam Powelldd8fab22012-03-22 17:47:27 -07002102 reply.writeNoException();
2103 reply.writeInt(res ? 1 : 0);
2104 return true;
2105 }
2106
2107 case NAVIGATE_UP_TO_TRANSACTION: {
2108 data.enforceInterface(IActivityManager.descriptor);
2109 IBinder token = data.readStrongBinder();
2110 Intent target = Intent.CREATOR.createFromParcel(data);
2111 int resultCode = data.readInt();
2112 Intent resultData = null;
2113 if (data.readInt() != 0) {
2114 resultData = Intent.CREATOR.createFromParcel(data);
2115 }
2116 boolean res = navigateUpTo(token, target, resultCode, resultData);
2117 reply.writeNoException();
2118 reply.writeInt(res ? 1 : 0);
2119 return true;
2120 }
2121
Dianne Hackborn5320eb82012-05-18 12:05:04 -07002122 case GET_LAUNCHED_FROM_UID_TRANSACTION: {
2123 data.enforceInterface(IActivityManager.descriptor);
2124 IBinder token = data.readStrongBinder();
2125 int res = getLaunchedFromUid(token);
2126 reply.writeNoException();
2127 reply.writeInt(res);
2128 return true;
2129 }
2130
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002131 case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: {
2132 data.enforceInterface(IActivityManager.descriptor);
2133 IBinder token = data.readStrongBinder();
2134 String res = getLaunchedFromPackage(token);
2135 reply.writeNoException();
2136 reply.writeString(res);
2137 return true;
2138 }
2139
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002140 case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2141 data.enforceInterface(IActivityManager.descriptor);
2142 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2143 data.readStrongBinder());
2144 registerUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002145 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002146 return true;
2147 }
2148
2149 case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2150 data.enforceInterface(IActivityManager.descriptor);
2151 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2152 data.readStrongBinder());
2153 unregisterUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002154 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002155 return true;
2156 }
2157
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002158 case REQUEST_BUG_REPORT_TRANSACTION: {
2159 data.enforceInterface(IActivityManager.descriptor);
2160 requestBugReport();
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002161 reply.writeNoException();
2162 return true;
2163 }
2164
2165 case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: {
2166 data.enforceInterface(IActivityManager.descriptor);
2167 int pid = data.readInt();
2168 boolean aboveSystem = data.readInt() != 0;
Jeff Brownbd181bb2013-09-10 16:44:24 -07002169 String reason = data.readString();
2170 long res = inputDispatchingTimedOut(pid, aboveSystem, reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002171 reply.writeNoException();
2172 reply.writeLong(res);
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002173 return true;
2174 }
2175
Adam Skorydfc7fd72013-08-05 19:23:41 -07002176 case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002177 data.enforceInterface(IActivityManager.descriptor);
2178 int requestType = data.readInt();
Adam Skorydfc7fd72013-08-05 19:23:41 -07002179 Bundle res = getAssistContextExtras(requestType);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002180 reply.writeNoException();
2181 reply.writeBundle(res);
2182 return true;
2183 }
2184
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002185 case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
2186 data.enforceInterface(IActivityManager.descriptor);
2187 int requestType = data.readInt();
2188 IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder());
2189 requestAssistContextExtras(requestType, receiver);
2190 reply.writeNoException();
2191 return true;
2192 }
2193
Adam Skorydfc7fd72013-08-05 19:23:41 -07002194 case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002195 data.enforceInterface(IActivityManager.descriptor);
2196 IBinder token = data.readStrongBinder();
2197 Bundle extras = data.readBundle();
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07002198 AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data);
2199 AssistContent content = AssistContent.CREATOR.createFromParcel(data);
Dianne Hackborna3acdb32015-06-08 17:07:40 -07002200 Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null;
2201 reportAssistContextExtras(token, extras, structure, content, referrer);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002202 reply.writeNoException();
2203 return true;
2204 }
2205
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002206 case LAUNCH_ASSIST_INTENT_TRANSACTION: {
2207 data.enforceInterface(IActivityManager.descriptor);
2208 Intent intent = Intent.CREATOR.createFromParcel(data);
2209 int requestType = data.readInt();
2210 String hint = data.readString();
2211 int userHandle = data.readInt();
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07002212 Bundle args = data.readBundle();
2213 boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args);
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002214 reply.writeNoException();
2215 reply.writeInt(res ? 1 : 0);
2216 return true;
2217 }
2218
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002219 case KILL_UID_TRANSACTION: {
2220 data.enforceInterface(IActivityManager.descriptor);
2221 int uid = data.readInt();
2222 String reason = data.readString();
2223 killUid(uid, reason);
2224 reply.writeNoException();
2225 return true;
2226 }
2227
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07002228 case HANG_TRANSACTION: {
2229 data.enforceInterface(IActivityManager.descriptor);
2230 IBinder who = data.readStrongBinder();
2231 boolean allowRestart = data.readInt() != 0;
2232 hang(who, allowRestart);
2233 reply.writeNoException();
2234 return true;
2235 }
2236
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07002237 case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: {
2238 data.enforceInterface(IActivityManager.descriptor);
2239 IBinder token = data.readStrongBinder();
2240 reportActivityFullyDrawn(token);
2241 reply.writeNoException();
2242 return true;
2243 }
2244
Craig Mautner5eda9b32013-07-02 11:58:16 -07002245 case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: {
2246 data.enforceInterface(IActivityManager.descriptor);
2247 IBinder token = data.readStrongBinder();
2248 notifyActivityDrawn(token);
2249 reply.writeNoException();
2250 return true;
2251 }
Dianne Hackborn57a7f592013-07-22 18:21:32 -07002252
2253 case RESTART_TRANSACTION: {
2254 data.enforceInterface(IActivityManager.descriptor);
2255 restart();
2256 reply.writeNoException();
2257 return true;
2258 }
Jeff Sharkey08da7a12013-08-11 20:53:18 -07002259
Dianne Hackborn35f72be2013-09-16 10:57:39 -07002260 case PERFORM_IDLE_MAINTENANCE_TRANSACTION: {
2261 data.enforceInterface(IActivityManager.descriptor);
2262 performIdleMaintenance();
2263 reply.writeNoException();
2264 return true;
2265 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002266
Todd Kennedyca4d8422015-01-15 15:19:22 -08002267 case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: {
Craig Mautner4a1cb222013-12-04 16:14:06 -08002268 data.enforceInterface(IActivityManager.descriptor);
2269 IBinder parentActivityToken = data.readStrongBinder();
2270 IActivityContainerCallback callback =
Craig Mautnere3a00d72014-04-16 08:31:19 -07002271 IActivityContainerCallback.Stub.asInterface(data.readStrongBinder());
Craig Mautner4a1cb222013-12-04 16:14:06 -08002272 IActivityContainer activityContainer =
Todd Kennedyca4d8422015-01-15 15:19:22 -08002273 createVirtualActivityContainer(parentActivityToken, callback);
Craig Mautner4a1cb222013-12-04 16:14:06 -08002274 reply.writeNoException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08002275 if (activityContainer != null) {
2276 reply.writeInt(1);
2277 reply.writeStrongBinder(activityContainer.asBinder());
2278 } else {
2279 reply.writeInt(0);
2280 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002281 return true;
2282 }
2283
Craig Mautner95da1082014-02-24 17:54:35 -08002284 case DELETE_ACTIVITY_CONTAINER_TRANSACTION: {
2285 data.enforceInterface(IActivityManager.descriptor);
2286 IActivityContainer activityContainer =
2287 IActivityContainer.Stub.asInterface(data.readStrongBinder());
2288 deleteActivityContainer(activityContainer);
2289 reply.writeNoException();
2290 return true;
2291 }
2292
Todd Kennedy4900bf92015-01-16 16:05:14 -08002293 case CREATE_STACK_ON_DISPLAY: {
2294 data.enforceInterface(IActivityManager.descriptor);
2295 int displayId = data.readInt();
2296 IActivityContainer activityContainer = createStackOnDisplay(displayId);
2297 reply.writeNoException();
2298 if (activityContainer != null) {
2299 reply.writeInt(1);
2300 reply.writeStrongBinder(activityContainer.asBinder());
2301 } else {
2302 reply.writeInt(0);
2303 }
2304 return true;
2305 }
2306
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002307 case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: {
Craig Mautnere0a38842013-12-16 16:14:02 -08002308 data.enforceInterface(IActivityManager.descriptor);
2309 IBinder activityToken = data.readStrongBinder();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002310 int displayId = getActivityDisplayId(activityToken);
Craig Mautnere0a38842013-12-16 16:14:02 -08002311 reply.writeNoException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002312 reply.writeInt(displayId);
Craig Mautnere0a38842013-12-16 16:14:02 -08002313 return true;
2314 }
2315
Craig Mautneraea74a52014-03-08 14:23:10 -08002316 case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: {
2317 data.enforceInterface(IActivityManager.descriptor);
2318 final int taskId = data.readInt();
2319 startLockTaskMode(taskId);
2320 reply.writeNoException();
2321 return true;
2322 }
2323
2324 case START_LOCK_TASK_BY_TOKEN_TRANSACTION: {
2325 data.enforceInterface(IActivityManager.descriptor);
2326 IBinder token = data.readStrongBinder();
2327 startLockTaskMode(token);
2328 reply.writeNoException();
2329 return true;
2330 }
2331
Craig Mautnerd61dc202014-07-07 11:09:11 -07002332 case START_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002333 data.enforceInterface(IActivityManager.descriptor);
2334 startLockTaskModeOnCurrent();
2335 reply.writeNoException();
2336 return true;
2337 }
2338
Craig Mautneraea74a52014-03-08 14:23:10 -08002339 case STOP_LOCK_TASK_MODE_TRANSACTION: {
2340 data.enforceInterface(IActivityManager.descriptor);
2341 stopLockTaskMode();
2342 reply.writeNoException();
2343 return true;
2344 }
2345
Craig Mautnerd61dc202014-07-07 11:09:11 -07002346 case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002347 data.enforceInterface(IActivityManager.descriptor);
2348 stopLockTaskModeOnCurrent();
2349 reply.writeNoException();
2350 return true;
2351 }
2352
Craig Mautneraea74a52014-03-08 14:23:10 -08002353 case IS_IN_LOCK_TASK_MODE_TRANSACTION: {
2354 data.enforceInterface(IActivityManager.descriptor);
2355 final boolean isInLockTaskMode = isInLockTaskMode();
2356 reply.writeNoException();
2357 reply.writeInt(isInLockTaskMode ? 1 : 0);
2358 return true;
2359 }
Craig Mautner2fbd7542014-03-21 09:34:07 -07002360
Benjamin Franz43261142015-02-11 15:59:44 +00002361 case GET_LOCK_TASK_MODE_STATE_TRANSACTION: {
2362 data.enforceInterface(IActivityManager.descriptor);
2363 final int lockTaskModeState = getLockTaskModeState();
2364 reply.writeNoException();
2365 reply.writeInt(lockTaskModeState);
2366 return true;
2367 }
2368
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07002369 case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: {
2370 data.enforceInterface(IActivityManager.descriptor);
2371 final IBinder token = data.readStrongBinder();
2372 showLockTaskEscapeMessage(token);
2373 reply.writeNoException();
2374 return true;
2375 }
2376
Winson Chunga449dc02014-05-16 11:15:04 -07002377 case SET_TASK_DESCRIPTION_TRANSACTION: {
Craig Mautner2fbd7542014-03-21 09:34:07 -07002378 data.enforceInterface(IActivityManager.descriptor);
2379 IBinder token = data.readStrongBinder();
Winson Chunga449dc02014-05-16 11:15:04 -07002380 ActivityManager.TaskDescription values =
2381 ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
2382 setTaskDescription(token, values);
Craig Mautner2fbd7542014-03-21 09:34:07 -07002383 reply.writeNoException();
2384 return true;
2385 }
Craig Mautneree2e45a2014-06-27 12:10:03 -07002386
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08002387 case SET_TASK_RESIZEABLE_TRANSACTION: {
2388 data.enforceInterface(IActivityManager.descriptor);
2389 int taskId = data.readInt();
2390 boolean resizeable = (data.readInt() == 1) ? true : false;
2391 setTaskResizeable(taskId, resizeable);
2392 reply.writeNoException();
2393 return true;
2394 }
2395
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002396 case RESIZE_TASK_TRANSACTION: {
2397 data.enforceInterface(IActivityManager.descriptor);
2398 int taskId = data.readInt();
2399 Rect r = Rect.CREATOR.createFromParcel(data);
2400 resizeTask(taskId, r);
2401 reply.writeNoException();
2402 return true;
2403 }
2404
Craig Mautner648f69b2014-09-18 14:16:26 -07002405 case GET_TASK_DESCRIPTION_ICON_TRANSACTION: {
2406 data.enforceInterface(IActivityManager.descriptor);
2407 String filename = data.readString();
2408 Bitmap icon = getTaskDescriptionIcon(filename);
2409 reply.writeNoException();
2410 if (icon == null) {
2411 reply.writeInt(0);
2412 } else {
2413 reply.writeInt(1);
2414 icon.writeToParcel(reply, 0);
2415 }
2416 return true;
2417 }
2418
Winson Chung044d5292014-11-06 11:05:19 -08002419 case START_IN_PLACE_ANIMATION_TRANSACTION: {
2420 data.enforceInterface(IActivityManager.descriptor);
2421 final Bundle bundle;
2422 if (data.readInt() == 0) {
2423 bundle = null;
2424 } else {
2425 bundle = data.readBundle();
2426 }
2427 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
2428 startInPlaceAnimationOnFrontMostApplication(options);
2429 reply.writeNoException();
2430 return true;
2431 }
2432
Jose Lima4b6c6692014-08-12 17:41:12 -07002433 case REQUEST_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002434 data.enforceInterface(IActivityManager.descriptor);
2435 IBinder token = data.readStrongBinder();
2436 boolean enable = data.readInt() > 0;
Jose Lima4b6c6692014-08-12 17:41:12 -07002437 boolean success = requestVisibleBehind(token, enable);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002438 reply.writeNoException();
2439 reply.writeInt(success ? 1 : 0);
2440 return true;
2441 }
2442
Jose Lima4b6c6692014-08-12 17:41:12 -07002443 case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002444 data.enforceInterface(IActivityManager.descriptor);
2445 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002446 final boolean enabled = isBackgroundVisibleBehind(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002447 reply.writeNoException();
2448 reply.writeInt(enabled ? 1 : 0);
2449 return true;
2450 }
2451
Jose Lima4b6c6692014-08-12 17:41:12 -07002452 case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002453 data.enforceInterface(IActivityManager.descriptor);
2454 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002455 backgroundResourcesReleased(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002456 reply.writeNoException();
2457 return true;
2458 }
Craig Mautnerbb742462014-07-07 15:28:55 -07002459
2460 case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: {
2461 data.enforceInterface(IActivityManager.descriptor);
2462 IBinder token = data.readStrongBinder();
2463 notifyLaunchTaskBehindComplete(token);
2464 reply.writeNoException();
2465 return true;
2466 }
Craig Mautner8746a472014-07-24 15:12:54 -07002467
2468 case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: {
2469 data.enforceInterface(IActivityManager.descriptor);
2470 IBinder token = data.readStrongBinder();
2471 notifyEnterAnimationComplete(token);
2472 reply.writeNoException();
2473 return true;
2474 }
Craig Mautner6e2f3952014-09-09 14:26:41 -07002475
2476 case BOOT_ANIMATION_COMPLETE_TRANSACTION: {
2477 data.enforceInterface(IActivityManager.descriptor);
2478 bootAnimationComplete();
2479 reply.writeNoException();
2480 return true;
2481 }
Wale Ogunwale18795a22014-12-03 11:38:33 -08002482
Jeff Sharkey605eb792014-11-04 13:34:06 -08002483 case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: {
2484 data.enforceInterface(IActivityManager.descriptor);
2485 final int uid = data.readInt();
2486 final byte[] firstPacket = data.createByteArray();
2487 notifyCleartextNetwork(uid, firstPacket);
2488 reply.writeNoException();
2489 return true;
2490 }
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002491
2492 case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: {
2493 data.enforceInterface(IActivityManager.descriptor);
2494 String procName = data.readString();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002495 int uid = data.readInt();
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002496 long maxMemSize = data.readLong();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002497 String reportPackage = data.readString();
2498 setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002499 reply.writeNoException();
2500 return true;
2501 }
2502
2503 case DUMP_HEAP_FINISHED_TRANSACTION: {
2504 data.enforceInterface(IActivityManager.descriptor);
2505 String path = data.readString();
2506 dumpHeapFinished(path);
2507 reply.writeNoException();
2508 return true;
2509 }
Dianne Hackborn3d07c942015-03-13 18:02:54 -07002510
2511 case SET_VOICE_KEEP_AWAKE_TRANSACTION: {
2512 data.enforceInterface(IActivityManager.descriptor);
2513 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
2514 data.readStrongBinder());
2515 boolean keepAwake = data.readInt() != 0;
2516 setVoiceKeepAwake(session, keepAwake);
2517 reply.writeNoException();
2518 return true;
2519 }
Craig Mautnere5600772015-04-03 21:36:37 -07002520
2521 case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: {
2522 data.enforceInterface(IActivityManager.descriptor);
2523 int userId = data.readInt();
2524 String[] packages = data.readStringArray();
2525 updateLockTaskPackages(userId, packages);
2526 reply.writeNoException();
2527 return true;
2528 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07002529
Craig Mautner015c5e52015-04-23 10:39:39 -07002530 case UPDATE_DEVICE_OWNER_TRANSACTION: {
2531 data.enforceInterface(IActivityManager.descriptor);
2532 String packageName = data.readString();
2533 updateDeviceOwner(packageName);
2534 reply.writeNoException();
2535 return true;
2536 }
2537
Dianne Hackborn1e383822015-04-10 14:02:33 -07002538 case GET_PACKAGE_PROCESS_STATE_TRANSACTION: {
2539 data.enforceInterface(IActivityManager.descriptor);
2540 String pkg = data.readString();
2541 int res = getPackageProcessState(pkg);
2542 reply.writeNoException();
2543 reply.writeInt(res);
2544 return true;
2545 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07002546
2547 case SET_PROCESS_MEMORY_TRIM_TRANSACTION: {
2548 data.enforceInterface(IActivityManager.descriptor);
2549 String process = data.readString();
2550 int userId = data.readInt();
2551 int level = data.readInt();
2552 boolean res = setProcessMemoryTrimLevel(process, userId, level);
2553 reply.writeNoException();
2554 reply.writeInt(res ? 1 : 0);
2555 return true;
2556 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002557 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002558
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002559 return super.onTransact(code, data, reply, flags);
2560 }
2561
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002562 public IBinder asBinder() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002563 return this;
2564 }
2565
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002566 private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
2567 protected IActivityManager create() {
2568 IBinder b = ServiceManager.getService("activity");
Joe Onorato43a17652011-04-06 19:22:23 -07002569 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002570 Log.v("ActivityManager", "default service binder = " + b);
2571 }
2572 IActivityManager am = asInterface(b);
Joe Onorato43a17652011-04-06 19:22:23 -07002573 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002574 Log.v("ActivityManager", "default service = " + am);
2575 }
2576 return am;
2577 }
2578 };
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002579}
2580
2581class ActivityManagerProxy implements IActivityManager
2582{
2583 public ActivityManagerProxy(IBinder remote)
2584 {
2585 mRemote = remote;
2586 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002587
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002588 public IBinder asBinder()
2589 {
2590 return mRemote;
2591 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002592
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002593 public int startActivity(IApplicationThread caller, String callingPackage, Intent intent,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002594 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002595 int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002596 Parcel data = Parcel.obtain();
2597 Parcel reply = Parcel.obtain();
2598 data.writeInterfaceToken(IActivityManager.descriptor);
2599 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002600 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002601 intent.writeToParcel(data, 0);
2602 data.writeString(resolvedType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002603 data.writeStrongBinder(resultTo);
2604 data.writeString(resultWho);
2605 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002606 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002607 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002608 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002609 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002610 } else {
2611 data.writeInt(0);
2612 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002613 if (options != null) {
2614 data.writeInt(1);
2615 options.writeToParcel(data, 0);
2616 } else {
2617 data.writeInt(0);
2618 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002619 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2620 reply.readException();
2621 int result = reply.readInt();
2622 reply.recycle();
2623 data.recycle();
2624 return result;
2625 }
Amith Yamasani82644082012-08-03 13:09:11 -07002626
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002627 public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent,
Amith Yamasani82644082012-08-03 13:09:11 -07002628 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002629 int startFlags, ProfilerInfo profilerInfo, Bundle options,
2630 int userId) throws RemoteException {
Amith Yamasani82644082012-08-03 13:09:11 -07002631 Parcel data = Parcel.obtain();
2632 Parcel reply = Parcel.obtain();
2633 data.writeInterfaceToken(IActivityManager.descriptor);
2634 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002635 data.writeString(callingPackage);
Amith Yamasani82644082012-08-03 13:09:11 -07002636 intent.writeToParcel(data, 0);
2637 data.writeString(resolvedType);
2638 data.writeStrongBinder(resultTo);
2639 data.writeString(resultWho);
2640 data.writeInt(requestCode);
2641 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002642 if (profilerInfo != null) {
Amith Yamasani82644082012-08-03 13:09:11 -07002643 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002644 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Amith Yamasani82644082012-08-03 13:09:11 -07002645 } else {
2646 data.writeInt(0);
2647 }
2648 if (options != null) {
2649 data.writeInt(1);
2650 options.writeToParcel(data, 0);
2651 } else {
2652 data.writeInt(0);
2653 }
2654 data.writeInt(userId);
2655 mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0);
2656 reply.readException();
2657 int result = reply.readInt();
2658 reply.recycle();
2659 data.recycle();
2660 return result;
2661 }
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002662 public int startActivityAsCaller(IApplicationThread caller, String callingPackage,
2663 Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Sharkey97978802014-10-14 10:48:18 -07002664 int startFlags, ProfilerInfo profilerInfo, Bundle options, int userId) throws RemoteException {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002665 Parcel data = Parcel.obtain();
2666 Parcel reply = Parcel.obtain();
2667 data.writeInterfaceToken(IActivityManager.descriptor);
2668 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2669 data.writeString(callingPackage);
2670 intent.writeToParcel(data, 0);
2671 data.writeString(resolvedType);
2672 data.writeStrongBinder(resultTo);
2673 data.writeString(resultWho);
2674 data.writeInt(requestCode);
2675 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002676 if (profilerInfo != null) {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002677 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002678 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002679 } else {
2680 data.writeInt(0);
2681 }
2682 if (options != null) {
2683 data.writeInt(1);
2684 options.writeToParcel(data, 0);
2685 } else {
2686 data.writeInt(0);
2687 }
Jeff Sharkey97978802014-10-14 10:48:18 -07002688 data.writeInt(userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002689 mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0);
2690 reply.readException();
2691 int result = reply.readInt();
2692 reply.recycle();
2693 data.recycle();
2694 return result;
2695 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002696 public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage,
2697 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Jeff Hao1b012d32014-08-20 10:35:34 -07002698 int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options,
2699 int userId) throws RemoteException {
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002700 Parcel data = Parcel.obtain();
2701 Parcel reply = Parcel.obtain();
2702 data.writeInterfaceToken(IActivityManager.descriptor);
2703 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002704 data.writeString(callingPackage);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002705 intent.writeToParcel(data, 0);
2706 data.writeString(resolvedType);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002707 data.writeStrongBinder(resultTo);
2708 data.writeString(resultWho);
2709 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002710 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002711 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002712 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002713 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002714 } else {
2715 data.writeInt(0);
2716 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002717 if (options != null) {
2718 data.writeInt(1);
2719 options.writeToParcel(data, 0);
2720 } else {
2721 data.writeInt(0);
2722 }
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002723 data.writeInt(userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002724 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
2725 reply.readException();
2726 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
2727 reply.recycle();
2728 data.recycle();
2729 return result;
2730 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002731 public int startActivityWithConfig(IApplicationThread caller, String callingPackage,
2732 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002733 int requestCode, int startFlags, Configuration config,
Dianne Hackborn41203752012-08-31 14:05:51 -07002734 Bundle options, int userId) throws RemoteException {
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002735 Parcel data = Parcel.obtain();
2736 Parcel reply = Parcel.obtain();
2737 data.writeInterfaceToken(IActivityManager.descriptor);
2738 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002739 data.writeString(callingPackage);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002740 intent.writeToParcel(data, 0);
2741 data.writeString(resolvedType);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002742 data.writeStrongBinder(resultTo);
2743 data.writeString(resultWho);
2744 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002745 data.writeInt(startFlags);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002746 config.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002747 if (options != null) {
2748 data.writeInt(1);
2749 options.writeToParcel(data, 0);
2750 } else {
2751 data.writeInt(0);
2752 }
Dianne Hackborn41203752012-08-31 14:05:51 -07002753 data.writeInt(userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002754 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2755 reply.readException();
2756 int result = reply.readInt();
2757 reply.recycle();
2758 data.recycle();
2759 return result;
2760 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002761 public int startActivityIntentSender(IApplicationThread caller,
2762 IntentSender intent, Intent fillInIntent, String resolvedType,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002763 IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002764 int flagsMask, int flagsValues, Bundle options) throws RemoteException {
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002765 Parcel data = Parcel.obtain();
2766 Parcel reply = Parcel.obtain();
2767 data.writeInterfaceToken(IActivityManager.descriptor);
2768 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2769 intent.writeToParcel(data, 0);
2770 if (fillInIntent != null) {
2771 data.writeInt(1);
2772 fillInIntent.writeToParcel(data, 0);
2773 } else {
2774 data.writeInt(0);
2775 }
2776 data.writeString(resolvedType);
2777 data.writeStrongBinder(resultTo);
2778 data.writeString(resultWho);
2779 data.writeInt(requestCode);
2780 data.writeInt(flagsMask);
2781 data.writeInt(flagsValues);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002782 if (options != null) {
2783 data.writeInt(1);
2784 options.writeToParcel(data, 0);
2785 } else {
2786 data.writeInt(0);
2787 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002788 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002789 reply.readException();
2790 int result = reply.readInt();
2791 reply.recycle();
2792 data.recycle();
2793 return result;
2794 }
Dianne Hackborn91097de2014-04-04 18:02:06 -07002795 public int startVoiceActivity(String callingPackage, int callingPid, int callingUid,
2796 Intent intent, String resolvedType, IVoiceInteractionSession session,
Jeff Hao1b012d32014-08-20 10:35:34 -07002797 IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo,
2798 Bundle options, int userId) throws RemoteException {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002799 Parcel data = Parcel.obtain();
2800 Parcel reply = Parcel.obtain();
2801 data.writeInterfaceToken(IActivityManager.descriptor);
2802 data.writeString(callingPackage);
2803 data.writeInt(callingPid);
2804 data.writeInt(callingUid);
2805 intent.writeToParcel(data, 0);
2806 data.writeString(resolvedType);
2807 data.writeStrongBinder(session.asBinder());
2808 data.writeStrongBinder(interactor.asBinder());
2809 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002810 if (profilerInfo != null) {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002811 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002812 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn91097de2014-04-04 18:02:06 -07002813 } else {
2814 data.writeInt(0);
2815 }
2816 if (options != null) {
2817 data.writeInt(1);
2818 options.writeToParcel(data, 0);
2819 } else {
2820 data.writeInt(0);
2821 }
2822 data.writeInt(userId);
2823 mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0);
2824 reply.readException();
2825 int result = reply.readInt();
2826 reply.recycle();
2827 data.recycle();
2828 return result;
2829 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002830 public boolean startNextMatchingActivity(IBinder callingActivity,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002831 Intent intent, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002832 Parcel data = Parcel.obtain();
2833 Parcel reply = Parcel.obtain();
2834 data.writeInterfaceToken(IActivityManager.descriptor);
2835 data.writeStrongBinder(callingActivity);
2836 intent.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002837 if (options != null) {
2838 data.writeInt(1);
2839 options.writeToParcel(data, 0);
2840 } else {
2841 data.writeInt(0);
2842 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002843 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
2844 reply.readException();
2845 int result = reply.readInt();
2846 reply.recycle();
2847 data.recycle();
2848 return result != 0;
2849 }
Craig Mautnerdc00cbe2014-07-20 17:48:47 -07002850 public int startActivityFromRecents(int taskId, Bundle options) throws RemoteException {
2851 Parcel data = Parcel.obtain();
2852 Parcel reply = Parcel.obtain();
2853 data.writeInterfaceToken(IActivityManager.descriptor);
2854 data.writeInt(taskId);
2855 if (options == null) {
2856 data.writeInt(0);
2857 } else {
2858 data.writeInt(1);
2859 options.writeToParcel(data, 0);
2860 }
2861 mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0);
2862 reply.readException();
2863 int result = reply.readInt();
2864 reply.recycle();
2865 data.recycle();
2866 return result;
2867 }
Winson Chung3b3f4642014-04-22 10:08:18 -07002868 public boolean finishActivity(IBinder token, int resultCode, Intent resultData, boolean finishTask)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002869 throws RemoteException {
2870 Parcel data = Parcel.obtain();
2871 Parcel reply = Parcel.obtain();
2872 data.writeInterfaceToken(IActivityManager.descriptor);
2873 data.writeStrongBinder(token);
2874 data.writeInt(resultCode);
2875 if (resultData != null) {
2876 data.writeInt(1);
2877 resultData.writeToParcel(data, 0);
2878 } else {
2879 data.writeInt(0);
2880 }
Winson Chung3b3f4642014-04-22 10:08:18 -07002881 data.writeInt(finishTask ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002882 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
2883 reply.readException();
2884 boolean res = reply.readInt() != 0;
2885 data.recycle();
2886 reply.recycle();
2887 return res;
2888 }
2889 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
2890 {
2891 Parcel data = Parcel.obtain();
2892 Parcel reply = Parcel.obtain();
2893 data.writeInterfaceToken(IActivityManager.descriptor);
2894 data.writeStrongBinder(token);
2895 data.writeString(resultWho);
2896 data.writeInt(requestCode);
2897 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
2898 reply.readException();
2899 data.recycle();
2900 reply.recycle();
2901 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -07002902 public boolean finishActivityAffinity(IBinder token) throws RemoteException {
2903 Parcel data = Parcel.obtain();
2904 Parcel reply = Parcel.obtain();
2905 data.writeInterfaceToken(IActivityManager.descriptor);
2906 data.writeStrongBinder(token);
2907 mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0);
2908 reply.readException();
2909 boolean res = reply.readInt() != 0;
2910 data.recycle();
2911 reply.recycle();
2912 return res;
2913 }
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -07002914 public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException {
2915 Parcel data = Parcel.obtain();
2916 Parcel reply = Parcel.obtain();
2917 data.writeInterfaceToken(IActivityManager.descriptor);
2918 data.writeStrongBinder(session.asBinder());
2919 mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0);
2920 reply.readException();
2921 data.recycle();
2922 reply.recycle();
2923 }
Dianne Hackborn89ad4562014-08-24 16:45:38 -07002924 public boolean releaseActivityInstance(IBinder token) throws RemoteException {
2925 Parcel data = Parcel.obtain();
2926 Parcel reply = Parcel.obtain();
2927 data.writeInterfaceToken(IActivityManager.descriptor);
2928 data.writeStrongBinder(token);
2929 mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0);
2930 reply.readException();
2931 boolean res = reply.readInt() != 0;
2932 data.recycle();
2933 reply.recycle();
2934 return res;
2935 }
2936 public void releaseSomeActivities(IApplicationThread app) throws RemoteException {
2937 Parcel data = Parcel.obtain();
2938 Parcel reply = Parcel.obtain();
2939 data.writeInterfaceToken(IActivityManager.descriptor);
2940 data.writeStrongBinder(app.asBinder());
2941 mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0);
2942 reply.readException();
2943 data.recycle();
2944 reply.recycle();
2945 }
Dianne Hackborn061d58a2010-03-12 15:07:06 -08002946 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
2947 Parcel data = Parcel.obtain();
2948 Parcel reply = Parcel.obtain();
2949 data.writeInterfaceToken(IActivityManager.descriptor);
2950 data.writeStrongBinder(token);
2951 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
2952 reply.readException();
2953 boolean res = reply.readInt() != 0;
2954 data.recycle();
2955 reply.recycle();
2956 return res;
2957 }
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002958 public Intent registerReceiver(IApplicationThread caller, String packageName,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002959 IIntentReceiver receiver,
Dianne Hackborn20e80982012-08-31 19:00:44 -07002960 IntentFilter filter, String perm, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002961 {
2962 Parcel data = Parcel.obtain();
2963 Parcel reply = Parcel.obtain();
2964 data.writeInterfaceToken(IActivityManager.descriptor);
2965 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002966 data.writeString(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002967 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
2968 filter.writeToParcel(data, 0);
2969 data.writeString(perm);
Dianne Hackborn20e80982012-08-31 19:00:44 -07002970 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002971 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2972 reply.readException();
2973 Intent intent = null;
2974 int haveIntent = reply.readInt();
2975 if (haveIntent != 0) {
2976 intent = Intent.CREATOR.createFromParcel(reply);
2977 }
2978 reply.recycle();
2979 data.recycle();
2980 return intent;
2981 }
2982 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
2983 {
2984 Parcel data = Parcel.obtain();
2985 Parcel reply = Parcel.obtain();
2986 data.writeInterfaceToken(IActivityManager.descriptor);
2987 data.writeStrongBinder(receiver.asBinder());
2988 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2989 reply.readException();
2990 data.recycle();
2991 reply.recycle();
2992 }
2993 public int broadcastIntent(IApplicationThread caller,
2994 Intent intent, String resolvedType, IIntentReceiver resultTo,
2995 int resultCode, String resultData, Bundle map,
Dianne Hackbornf51f6122013-02-04 18:23:34 -08002996 String requiredPermission, int appOp, boolean serialized,
Amith Yamasani742a6712011-05-04 14:49:28 -07002997 boolean sticky, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002998 {
2999 Parcel data = Parcel.obtain();
3000 Parcel reply = Parcel.obtain();
3001 data.writeInterfaceToken(IActivityManager.descriptor);
3002 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3003 intent.writeToParcel(data, 0);
3004 data.writeString(resolvedType);
3005 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
3006 data.writeInt(resultCode);
3007 data.writeString(resultData);
3008 data.writeBundle(map);
3009 data.writeString(requiredPermission);
Dianne Hackbornf51f6122013-02-04 18:23:34 -08003010 data.writeInt(appOp);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003011 data.writeInt(serialized ? 1 : 0);
3012 data.writeInt(sticky ? 1 : 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003013 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003014 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
3015 reply.readException();
3016 int res = reply.readInt();
3017 reply.recycle();
3018 data.recycle();
3019 return res;
3020 }
Amith Yamasani742a6712011-05-04 14:49:28 -07003021 public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
3022 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003023 {
3024 Parcel data = Parcel.obtain();
3025 Parcel reply = Parcel.obtain();
3026 data.writeInterfaceToken(IActivityManager.descriptor);
3027 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3028 intent.writeToParcel(data, 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003029 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003030 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
3031 reply.readException();
3032 data.recycle();
3033 reply.recycle();
3034 }
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003035 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map,
3036 boolean abortBroadcast, int flags) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003037 {
3038 Parcel data = Parcel.obtain();
3039 Parcel reply = Parcel.obtain();
3040 data.writeInterfaceToken(IActivityManager.descriptor);
3041 data.writeStrongBinder(who);
3042 data.writeInt(resultCode);
3043 data.writeString(resultData);
3044 data.writeBundle(map);
3045 data.writeInt(abortBroadcast ? 1 : 0);
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003046 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003047 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3048 reply.readException();
3049 data.recycle();
3050 reply.recycle();
3051 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003052 public void attachApplication(IApplicationThread app) throws RemoteException
3053 {
3054 Parcel data = Parcel.obtain();
3055 Parcel reply = Parcel.obtain();
3056 data.writeInterfaceToken(IActivityManager.descriptor);
3057 data.writeStrongBinder(app.asBinder());
3058 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
3059 reply.readException();
3060 data.recycle();
3061 reply.recycle();
3062 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003063 public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
3064 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003065 {
3066 Parcel data = Parcel.obtain();
3067 Parcel reply = Parcel.obtain();
3068 data.writeInterfaceToken(IActivityManager.descriptor);
3069 data.writeStrongBinder(token);
Dianne Hackborne88846e2009-09-30 21:34:25 -07003070 if (config != null) {
3071 data.writeInt(1);
3072 config.writeToParcel(data, 0);
3073 } else {
3074 data.writeInt(0);
3075 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003076 data.writeInt(stopProfiling ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003077 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3078 reply.readException();
3079 data.recycle();
3080 reply.recycle();
3081 }
Dianne Hackbornad9b32112012-09-17 15:35:01 -07003082 public void activityResumed(IBinder token) throws RemoteException
3083 {
3084 Parcel data = Parcel.obtain();
3085 Parcel reply = Parcel.obtain();
3086 data.writeInterfaceToken(IActivityManager.descriptor);
3087 data.writeStrongBinder(token);
3088 mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0);
3089 reply.readException();
3090 data.recycle();
3091 reply.recycle();
3092 }
Dianne Hackborna4e102e2014-09-04 22:52:27 -07003093 public void activityPaused(IBinder token) throws RemoteException
Dianne Hackborn0aae2d42010-12-07 23:51:29 -08003094 {
3095 Parcel data = Parcel.obtain();
3096 Parcel reply = Parcel.obtain();
3097 data.writeInterfaceToken(IActivityManager.descriptor);
3098 data.writeStrongBinder(token);
3099 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
3100 reply.readException();
3101 data.recycle();
3102 reply.recycle();
3103 }
3104 public void activityStopped(IBinder token, Bundle state,
Craig Mautnera0026042014-04-23 11:45:37 -07003105 PersistableBundle persistentState, CharSequence description) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003106 {
3107 Parcel data = Parcel.obtain();
3108 Parcel reply = Parcel.obtain();
3109 data.writeInterfaceToken(IActivityManager.descriptor);
3110 data.writeStrongBinder(token);
3111 data.writeBundle(state);
Craig Mautnera0026042014-04-23 11:45:37 -07003112 data.writePersistableBundle(persistentState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003113 TextUtils.writeToParcel(description, data, 0);
3114 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3115 reply.readException();
3116 data.recycle();
3117 reply.recycle();
3118 }
Dianne Hackborn4eba96b2011-01-21 13:34:36 -08003119 public void activitySlept(IBinder token) throws RemoteException
3120 {
3121 Parcel data = Parcel.obtain();
3122 Parcel reply = Parcel.obtain();
3123 data.writeInterfaceToken(IActivityManager.descriptor);
3124 data.writeStrongBinder(token);
3125 mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3126 reply.readException();
3127 data.recycle();
3128 reply.recycle();
3129 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003130 public void activityDestroyed(IBinder token) throws RemoteException
3131 {
3132 Parcel data = Parcel.obtain();
3133 Parcel reply = Parcel.obtain();
3134 data.writeInterfaceToken(IActivityManager.descriptor);
3135 data.writeStrongBinder(token);
3136 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3137 reply.readException();
3138 data.recycle();
3139 reply.recycle();
3140 }
3141 public String getCallingPackage(IBinder token) throws RemoteException
3142 {
3143 Parcel data = Parcel.obtain();
3144 Parcel reply = Parcel.obtain();
3145 data.writeInterfaceToken(IActivityManager.descriptor);
3146 data.writeStrongBinder(token);
3147 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
3148 reply.readException();
3149 String res = reply.readString();
3150 data.recycle();
3151 reply.recycle();
3152 return res;
3153 }
3154 public ComponentName getCallingActivity(IBinder token)
3155 throws RemoteException {
3156 Parcel data = Parcel.obtain();
3157 Parcel reply = Parcel.obtain();
3158 data.writeInterfaceToken(IActivityManager.descriptor);
3159 data.writeStrongBinder(token);
3160 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
3161 reply.readException();
3162 ComponentName res = ComponentName.readFromParcel(reply);
3163 data.recycle();
3164 reply.recycle();
3165 return res;
3166 }
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003167 public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException {
Winson Chung1147c402014-05-14 11:05:00 -07003168 Parcel data = Parcel.obtain();
3169 Parcel reply = Parcel.obtain();
3170 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003171 data.writeString(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -07003172 mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0);
3173 reply.readException();
3174 ArrayList<IAppTask> list = null;
3175 int N = reply.readInt();
3176 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003177 list = new ArrayList<>();
Winson Chung1147c402014-05-14 11:05:00 -07003178 while (N > 0) {
3179 IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder());
3180 list.add(task);
3181 N--;
3182 }
3183 }
3184 data.recycle();
3185 reply.recycle();
3186 return list;
3187 }
Dianne Hackbornaec68bb2014-08-20 15:25:13 -07003188 public int addAppTask(IBinder activityToken, Intent intent,
3189 ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException {
3190 Parcel data = Parcel.obtain();
3191 Parcel reply = Parcel.obtain();
3192 data.writeInterfaceToken(IActivityManager.descriptor);
3193 data.writeStrongBinder(activityToken);
3194 intent.writeToParcel(data, 0);
3195 description.writeToParcel(data, 0);
3196 thumbnail.writeToParcel(data, 0);
3197 mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0);
3198 reply.readException();
3199 int res = reply.readInt();
3200 data.recycle();
3201 reply.recycle();
3202 return res;
3203 }
3204 public Point getAppTaskThumbnailSize() throws RemoteException {
3205 Parcel data = Parcel.obtain();
3206 Parcel reply = Parcel.obtain();
3207 data.writeInterfaceToken(IActivityManager.descriptor);
3208 mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0);
3209 reply.readException();
3210 Point size = Point.CREATOR.createFromParcel(reply);
3211 data.recycle();
3212 reply.recycle();
3213 return size;
3214 }
Todd Kennedye635f662015-01-20 10:36:49 -08003215 public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags)
3216 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003217 Parcel data = Parcel.obtain();
3218 Parcel reply = Parcel.obtain();
3219 data.writeInterfaceToken(IActivityManager.descriptor);
3220 data.writeInt(maxNum);
3221 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003222 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
3223 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003224 ArrayList<ActivityManager.RunningTaskInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003225 int N = reply.readInt();
3226 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003227 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003228 while (N > 0) {
3229 ActivityManager.RunningTaskInfo info =
3230 ActivityManager.RunningTaskInfo.CREATOR
Winson Chung1147c402014-05-14 11:05:00 -07003231 .createFromParcel(reply);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003232 list.add(info);
3233 N--;
3234 }
3235 }
3236 data.recycle();
3237 reply.recycle();
3238 return list;
3239 }
3240 public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -07003241 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003242 Parcel data = Parcel.obtain();
3243 Parcel reply = Parcel.obtain();
3244 data.writeInterfaceToken(IActivityManager.descriptor);
3245 data.writeInt(maxNum);
3246 data.writeInt(flags);
Amith Yamasani82644082012-08-03 13:09:11 -07003247 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003248 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
3249 reply.readException();
3250 ArrayList<ActivityManager.RecentTaskInfo> list
3251 = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR);
3252 data.recycle();
3253 reply.recycle();
3254 return list;
3255 }
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003256 public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException {
Dianne Hackbornd94df452011-02-16 18:53:31 -08003257 Parcel data = Parcel.obtain();
3258 Parcel reply = Parcel.obtain();
3259 data.writeInterfaceToken(IActivityManager.descriptor);
3260 data.writeInt(id);
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003261 mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003262 reply.readException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003263 ActivityManager.TaskThumbnail taskThumbnail = null;
Dianne Hackbornd94df452011-02-16 18:53:31 -08003264 if (reply.readInt() != 0) {
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003265 taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003266 }
3267 data.recycle();
3268 reply.recycle();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003269 return taskThumbnail;
Dianne Hackborn15491c62012-09-19 10:59:14 -07003270 }
Todd Kennedye635f662015-01-20 10:36:49 -08003271 public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags)
3272 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003273 Parcel data = Parcel.obtain();
3274 Parcel reply = Parcel.obtain();
3275 data.writeInterfaceToken(IActivityManager.descriptor);
3276 data.writeInt(maxNum);
3277 data.writeInt(flags);
3278 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
3279 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003280 ArrayList<ActivityManager.RunningServiceInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003281 int N = reply.readInt();
3282 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003283 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003284 while (N > 0) {
3285 ActivityManager.RunningServiceInfo info =
3286 ActivityManager.RunningServiceInfo.CREATOR
3287 .createFromParcel(reply);
3288 list.add(info);
3289 N--;
3290 }
3291 }
3292 data.recycle();
3293 reply.recycle();
3294 return list;
3295 }
3296 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
3297 throws RemoteException {
3298 Parcel data = Parcel.obtain();
3299 Parcel reply = Parcel.obtain();
3300 data.writeInterfaceToken(IActivityManager.descriptor);
3301 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
3302 reply.readException();
3303 ArrayList<ActivityManager.ProcessErrorStateInfo> list
3304 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
3305 data.recycle();
3306 reply.recycle();
3307 return list;
3308 }
3309 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
3310 throws RemoteException {
3311 Parcel data = Parcel.obtain();
3312 Parcel reply = Parcel.obtain();
3313 data.writeInterfaceToken(IActivityManager.descriptor);
3314 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
3315 reply.readException();
3316 ArrayList<ActivityManager.RunningAppProcessInfo> list
3317 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
3318 data.recycle();
3319 reply.recycle();
3320 return list;
3321 }
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -07003322 public List<ApplicationInfo> getRunningExternalApplications()
3323 throws RemoteException {
3324 Parcel data = Parcel.obtain();
3325 Parcel reply = Parcel.obtain();
3326 data.writeInterfaceToken(IActivityManager.descriptor);
3327 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
3328 reply.readException();
3329 ArrayList<ApplicationInfo> list
3330 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
3331 data.recycle();
3332 reply.recycle();
3333 return list;
3334 }
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003335 public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003336 {
3337 Parcel data = Parcel.obtain();
3338 Parcel reply = Parcel.obtain();
3339 data.writeInterfaceToken(IActivityManager.descriptor);
3340 data.writeInt(task);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003341 data.writeInt(flags);
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003342 if (options != null) {
3343 data.writeInt(1);
3344 options.writeToParcel(data, 0);
3345 } else {
3346 data.writeInt(0);
3347 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003348 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
3349 reply.readException();
3350 data.recycle();
3351 reply.recycle();
3352 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003353 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
3354 throws RemoteException {
3355 Parcel data = Parcel.obtain();
3356 Parcel reply = Parcel.obtain();
3357 data.writeInterfaceToken(IActivityManager.descriptor);
3358 data.writeStrongBinder(token);
3359 data.writeInt(nonRoot ? 1 : 0);
3360 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
3361 reply.readException();
3362 boolean res = reply.readInt() != 0;
3363 data.recycle();
3364 reply.recycle();
3365 return res;
3366 }
3367 public void moveTaskBackwards(int task) throws RemoteException
3368 {
3369 Parcel data = Parcel.obtain();
3370 Parcel reply = Parcel.obtain();
3371 data.writeInterfaceToken(IActivityManager.descriptor);
3372 data.writeInt(task);
3373 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
3374 reply.readException();
3375 data.recycle();
3376 reply.recycle();
3377 }
Craig Mautnerc00204b2013-03-05 15:02:14 -08003378 @Override
Craig Mautnerc00204b2013-03-05 15:02:14 -08003379 public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException
3380 {
3381 Parcel data = Parcel.obtain();
3382 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003383 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003384 data.writeInt(taskId);
3385 data.writeInt(stackId);
3386 data.writeInt(toTop ? 1 : 0);
3387 mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0);
3388 reply.readException();
3389 data.recycle();
3390 reply.recycle();
3391 }
3392 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003393 public void resizeStack(int stackBoxId, Rect r) throws RemoteException
Craig Mautnerc00204b2013-03-05 15:02:14 -08003394 {
3395 Parcel data = Parcel.obtain();
3396 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003397 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautner5a449152013-05-24 15:49:29 -07003398 data.writeInt(stackBoxId);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003399 r.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07003400 mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003401 reply.readException();
3402 data.recycle();
3403 reply.recycle();
3404 }
Craig Mautner967212c2013-04-13 21:10:58 -07003405 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003406 public List<StackInfo> getAllStackInfos() throws RemoteException
Craig Mautner5ff12102013-05-24 12:50:15 -07003407 {
3408 Parcel data = Parcel.obtain();
3409 Parcel reply = Parcel.obtain();
3410 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003411 mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0);
Craig Mautner5ff12102013-05-24 12:50:15 -07003412 reply.readException();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003413 ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR);
Craig Mautner967212c2013-04-13 21:10:58 -07003414 data.recycle();
3415 reply.recycle();
3416 return list;
3417 }
Craig Mautnercf910b02013-04-23 11:23:27 -07003418 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003419 public StackInfo getStackInfo(int stackId) throws RemoteException
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003420 {
3421 Parcel data = Parcel.obtain();
3422 Parcel reply = Parcel.obtain();
3423 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003424 data.writeInt(stackId);
3425 mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003426 reply.readException();
3427 int res = reply.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003428 StackInfo info = null;
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003429 if (res != 0) {
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003430 info = StackInfo.CREATOR.createFromParcel(reply);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003431 }
3432 data.recycle();
3433 reply.recycle();
3434 return info;
3435 }
3436 @Override
Winson Chung303e1ff2014-03-07 15:06:19 -08003437 public boolean isInHomeStack(int taskId) throws RemoteException {
3438 Parcel data = Parcel.obtain();
3439 Parcel reply = Parcel.obtain();
3440 data.writeInterfaceToken(IActivityManager.descriptor);
3441 data.writeInt(taskId);
3442 mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0);
3443 reply.readException();
3444 boolean isInHomeStack = reply.readInt() > 0;
3445 data.recycle();
3446 reply.recycle();
3447 return isInHomeStack;
3448 }
3449 @Override
Craig Mautnercf910b02013-04-23 11:23:27 -07003450 public void setFocusedStack(int stackId) throws RemoteException
3451 {
3452 Parcel data = Parcel.obtain();
3453 Parcel reply = Parcel.obtain();
3454 data.writeInterfaceToken(IActivityManager.descriptor);
3455 data.writeInt(stackId);
Dianne Hackborn1e383822015-04-10 14:02:33 -07003456 mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0);
Craig Mautnercf910b02013-04-23 11:23:27 -07003457 reply.readException();
3458 data.recycle();
3459 reply.recycle();
3460 }
Winson Chung740c3ac2014-11-12 16:14:38 -08003461 @Override
Winson Chungd16c5652015-01-26 16:11:07 -08003462 public int getFocusedStackId() throws RemoteException {
3463 Parcel data = Parcel.obtain();
3464 Parcel reply = Parcel.obtain();
3465 data.writeInterfaceToken(IActivityManager.descriptor);
3466 mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0);
3467 reply.readException();
3468 int focusedStackId = reply.readInt();
3469 data.recycle();
3470 reply.recycle();
3471 return focusedStackId;
3472 }
3473 @Override
Winson Chung740c3ac2014-11-12 16:14:38 -08003474 public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException
3475 {
3476 Parcel data = Parcel.obtain();
3477 Parcel reply = Parcel.obtain();
3478 data.writeInterfaceToken(IActivityManager.descriptor);
3479 data.writeStrongBinder(listener.asBinder());
Dianne Hackborn1e383822015-04-10 14:02:33 -07003480 mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0);
Winson Chung740c3ac2014-11-12 16:14:38 -08003481 reply.readException();
3482 data.recycle();
3483 reply.recycle();
3484 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003485 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
3486 {
3487 Parcel data = Parcel.obtain();
3488 Parcel reply = Parcel.obtain();
3489 data.writeInterfaceToken(IActivityManager.descriptor);
3490 data.writeStrongBinder(token);
3491 data.writeInt(onlyRoot ? 1 : 0);
3492 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
3493 reply.readException();
3494 int res = reply.readInt();
3495 data.recycle();
3496 reply.recycle();
3497 return res;
3498 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003499 public ContentProviderHolder getContentProvider(IApplicationThread caller,
Jeff Sharkey6d515712012-09-20 16:06:08 -07003500 String name, int userId, boolean stable) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003501 Parcel data = Parcel.obtain();
3502 Parcel reply = Parcel.obtain();
3503 data.writeInterfaceToken(IActivityManager.descriptor);
3504 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3505 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003506 data.writeInt(userId);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003507 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003508 mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3509 reply.readException();
3510 int res = reply.readInt();
3511 ContentProviderHolder cph = null;
3512 if (res != 0) {
3513 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3514 }
3515 data.recycle();
3516 reply.recycle();
3517 return cph;
3518 }
Jeff Sharkey6d515712012-09-20 16:06:08 -07003519 public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token)
3520 throws RemoteException {
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003521 Parcel data = Parcel.obtain();
3522 Parcel reply = Parcel.obtain();
3523 data.writeInterfaceToken(IActivityManager.descriptor);
3524 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003525 data.writeInt(userId);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003526 data.writeStrongBinder(token);
3527 mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3528 reply.readException();
3529 int res = reply.readInt();
3530 ContentProviderHolder cph = null;
3531 if (res != 0) {
3532 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3533 }
3534 data.recycle();
3535 reply.recycle();
3536 return cph;
3537 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003538 public void publishContentProviders(IApplicationThread caller,
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003539 List<ContentProviderHolder> providers) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003540 {
3541 Parcel data = Parcel.obtain();
3542 Parcel reply = Parcel.obtain();
3543 data.writeInterfaceToken(IActivityManager.descriptor);
3544 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3545 data.writeTypedList(providers);
3546 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
3547 reply.readException();
3548 data.recycle();
3549 reply.recycle();
3550 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003551 public boolean refContentProvider(IBinder connection, int stable, int unstable)
3552 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003553 Parcel data = Parcel.obtain();
3554 Parcel reply = Parcel.obtain();
3555 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003556 data.writeStrongBinder(connection);
3557 data.writeInt(stable);
3558 data.writeInt(unstable);
3559 mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3560 reply.readException();
3561 boolean res = reply.readInt() != 0;
3562 data.recycle();
3563 reply.recycle();
3564 return res;
3565 }
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003566
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003567 public void unstableProviderDied(IBinder connection) throws RemoteException {
3568 Parcel data = Parcel.obtain();
3569 Parcel reply = Parcel.obtain();
3570 data.writeInterfaceToken(IActivityManager.descriptor);
3571 data.writeStrongBinder(connection);
3572 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0);
3573 reply.readException();
3574 data.recycle();
3575 reply.recycle();
3576 }
3577
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003578 @Override
3579 public void appNotRespondingViaProvider(IBinder connection) throws RemoteException {
3580 Parcel data = Parcel.obtain();
3581 Parcel reply = Parcel.obtain();
3582 data.writeInterfaceToken(IActivityManager.descriptor);
3583 data.writeStrongBinder(connection);
3584 mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0);
3585 reply.readException();
3586 data.recycle();
3587 reply.recycle();
3588 }
3589
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003590 public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException {
3591 Parcel data = Parcel.obtain();
3592 Parcel reply = Parcel.obtain();
3593 data.writeInterfaceToken(IActivityManager.descriptor);
3594 data.writeStrongBinder(connection);
3595 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003596 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3597 reply.readException();
3598 data.recycle();
3599 reply.recycle();
3600 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003601
3602 public void removeContentProviderExternal(String name, IBinder token) throws RemoteException {
3603 Parcel data = Parcel.obtain();
3604 Parcel reply = Parcel.obtain();
3605 data.writeInterfaceToken(IActivityManager.descriptor);
3606 data.writeString(name);
3607 data.writeStrongBinder(token);
3608 mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3609 reply.readException();
3610 data.recycle();
3611 reply.recycle();
3612 }
3613
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07003614 public PendingIntent getRunningServiceControlPanel(ComponentName service)
3615 throws RemoteException
3616 {
3617 Parcel data = Parcel.obtain();
3618 Parcel reply = Parcel.obtain();
3619 data.writeInterfaceToken(IActivityManager.descriptor);
3620 service.writeToParcel(data, 0);
3621 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
3622 reply.readException();
3623 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
3624 data.recycle();
3625 reply.recycle();
3626 return res;
3627 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003628
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003629 public ComponentName startService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003630 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003631 {
3632 Parcel data = Parcel.obtain();
3633 Parcel reply = Parcel.obtain();
3634 data.writeInterfaceToken(IActivityManager.descriptor);
3635 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3636 service.writeToParcel(data, 0);
3637 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003638 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003639 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
3640 reply.readException();
3641 ComponentName res = ComponentName.readFromParcel(reply);
3642 data.recycle();
3643 reply.recycle();
3644 return res;
3645 }
3646 public int stopService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003647 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003648 {
3649 Parcel data = Parcel.obtain();
3650 Parcel reply = Parcel.obtain();
3651 data.writeInterfaceToken(IActivityManager.descriptor);
3652 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3653 service.writeToParcel(data, 0);
3654 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003655 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003656 mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0);
3657 reply.readException();
3658 int res = reply.readInt();
3659 reply.recycle();
3660 data.recycle();
3661 return res;
3662 }
3663 public boolean stopServiceToken(ComponentName className, IBinder token,
3664 int startId) throws RemoteException {
3665 Parcel data = Parcel.obtain();
3666 Parcel reply = Parcel.obtain();
3667 data.writeInterfaceToken(IActivityManager.descriptor);
3668 ComponentName.writeToParcel(className, data);
3669 data.writeStrongBinder(token);
3670 data.writeInt(startId);
3671 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
3672 reply.readException();
3673 boolean res = reply.readInt() != 0;
3674 data.recycle();
3675 reply.recycle();
3676 return res;
3677 }
3678 public void setServiceForeground(ComponentName className, IBinder token,
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003679 int id, Notification notification, boolean removeNotification) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003680 Parcel data = Parcel.obtain();
3681 Parcel reply = Parcel.obtain();
3682 data.writeInterfaceToken(IActivityManager.descriptor);
3683 ComponentName.writeToParcel(className, data);
3684 data.writeStrongBinder(token);
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003685 data.writeInt(id);
3686 if (notification != null) {
3687 data.writeInt(1);
3688 notification.writeToParcel(data, 0);
3689 } else {
3690 data.writeInt(0);
3691 }
3692 data.writeInt(removeNotification ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003693 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
3694 reply.readException();
3695 data.recycle();
3696 reply.recycle();
3697 }
3698 public int bindService(IApplicationThread caller, IBinder token,
3699 Intent service, String resolvedType, IServiceConnection connection,
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003700 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003701 Parcel data = Parcel.obtain();
3702 Parcel reply = Parcel.obtain();
3703 data.writeInterfaceToken(IActivityManager.descriptor);
3704 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3705 data.writeStrongBinder(token);
3706 service.writeToParcel(data, 0);
3707 data.writeString(resolvedType);
3708 data.writeStrongBinder(connection.asBinder());
3709 data.writeInt(flags);
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003710 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003711 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
3712 reply.readException();
3713 int res = reply.readInt();
3714 data.recycle();
3715 reply.recycle();
3716 return res;
3717 }
3718 public boolean unbindService(IServiceConnection connection) throws RemoteException
3719 {
3720 Parcel data = Parcel.obtain();
3721 Parcel reply = Parcel.obtain();
3722 data.writeInterfaceToken(IActivityManager.descriptor);
3723 data.writeStrongBinder(connection.asBinder());
3724 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
3725 reply.readException();
3726 boolean res = reply.readInt() != 0;
3727 data.recycle();
3728 reply.recycle();
3729 return res;
3730 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003731
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003732 public void publishService(IBinder token,
3733 Intent intent, IBinder service) throws RemoteException {
3734 Parcel data = Parcel.obtain();
3735 Parcel reply = Parcel.obtain();
3736 data.writeInterfaceToken(IActivityManager.descriptor);
3737 data.writeStrongBinder(token);
3738 intent.writeToParcel(data, 0);
3739 data.writeStrongBinder(service);
3740 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
3741 reply.readException();
3742 data.recycle();
3743 reply.recycle();
3744 }
3745
3746 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
3747 throws RemoteException {
3748 Parcel data = Parcel.obtain();
3749 Parcel reply = Parcel.obtain();
3750 data.writeInterfaceToken(IActivityManager.descriptor);
3751 data.writeStrongBinder(token);
3752 intent.writeToParcel(data, 0);
3753 data.writeInt(doRebind ? 1 : 0);
3754 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
3755 reply.readException();
3756 data.recycle();
3757 reply.recycle();
3758 }
3759
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003760 public void serviceDoneExecuting(IBinder token, int type, int startId,
3761 int res) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003762 Parcel data = Parcel.obtain();
3763 Parcel reply = Parcel.obtain();
3764 data.writeInterfaceToken(IActivityManager.descriptor);
3765 data.writeStrongBinder(token);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003766 data.writeInt(type);
3767 data.writeInt(startId);
3768 data.writeInt(res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003769 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3770 reply.readException();
3771 data.recycle();
3772 reply.recycle();
3773 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003774
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003775 public IBinder peekService(Intent service, String resolvedType) throws RemoteException {
3776 Parcel data = Parcel.obtain();
3777 Parcel reply = Parcel.obtain();
3778 data.writeInterfaceToken(IActivityManager.descriptor);
3779 service.writeToParcel(data, 0);
3780 data.writeString(resolvedType);
3781 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
3782 reply.readException();
3783 IBinder binder = reply.readStrongBinder();
3784 reply.recycle();
3785 data.recycle();
3786 return binder;
3787 }
3788
Christopher Tate181fafa2009-05-14 11:12:14 -07003789 public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
3790 throws RemoteException {
3791 Parcel data = Parcel.obtain();
3792 Parcel reply = Parcel.obtain();
3793 data.writeInterfaceToken(IActivityManager.descriptor);
3794 app.writeToParcel(data, 0);
3795 data.writeInt(backupRestoreMode);
3796 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3797 reply.readException();
3798 boolean success = reply.readInt() != 0;
3799 reply.recycle();
3800 data.recycle();
3801 return success;
3802 }
3803
Christopher Tate346acb12012-10-15 19:20:25 -07003804 public void clearPendingBackup() throws RemoteException {
3805 Parcel data = Parcel.obtain();
3806 Parcel reply = Parcel.obtain();
3807 data.writeInterfaceToken(IActivityManager.descriptor);
3808 mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0);
3809 reply.recycle();
3810 data.recycle();
3811 }
3812
Christopher Tate181fafa2009-05-14 11:12:14 -07003813 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
3814 Parcel data = Parcel.obtain();
3815 Parcel reply = Parcel.obtain();
3816 data.writeInterfaceToken(IActivityManager.descriptor);
3817 data.writeString(packageName);
3818 data.writeStrongBinder(agent);
3819 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
3820 reply.recycle();
3821 data.recycle();
3822 }
3823
3824 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
3825 Parcel data = Parcel.obtain();
3826 Parcel reply = Parcel.obtain();
3827 data.writeInterfaceToken(IActivityManager.descriptor);
3828 app.writeToParcel(data, 0);
3829 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3830 reply.readException();
3831 reply.recycle();
3832 data.recycle();
3833 }
3834
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003835 public boolean startInstrumentation(ComponentName className, String profileFile,
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003836 int flags, Bundle arguments, IInstrumentationWatcher watcher,
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01003837 IUiAutomationConnection connection, int userId, String instructionSet)
3838 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003839 Parcel data = Parcel.obtain();
3840 Parcel reply = Parcel.obtain();
3841 data.writeInterfaceToken(IActivityManager.descriptor);
3842 ComponentName.writeToParcel(className, data);
3843 data.writeString(profileFile);
3844 data.writeInt(flags);
3845 data.writeBundle(arguments);
3846 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003847 data.writeStrongBinder(connection != null ? connection.asBinder() : null);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07003848 data.writeInt(userId);
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01003849 data.writeString(instructionSet);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003850 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3851 reply.readException();
3852 boolean res = reply.readInt() != 0;
3853 reply.recycle();
3854 data.recycle();
3855 return res;
3856 }
3857
3858 public void finishInstrumentation(IApplicationThread target,
3859 int resultCode, Bundle results) throws RemoteException {
3860 Parcel data = Parcel.obtain();
3861 Parcel reply = Parcel.obtain();
3862 data.writeInterfaceToken(IActivityManager.descriptor);
3863 data.writeStrongBinder(target != null ? target.asBinder() : null);
3864 data.writeInt(resultCode);
3865 data.writeBundle(results);
3866 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3867 reply.readException();
3868 data.recycle();
3869 reply.recycle();
3870 }
3871 public Configuration getConfiguration() throws RemoteException
3872 {
3873 Parcel data = Parcel.obtain();
3874 Parcel reply = Parcel.obtain();
3875 data.writeInterfaceToken(IActivityManager.descriptor);
3876 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
3877 reply.readException();
3878 Configuration res = Configuration.CREATOR.createFromParcel(reply);
3879 reply.recycle();
3880 data.recycle();
3881 return res;
3882 }
3883 public void updateConfiguration(Configuration values) throws RemoteException
3884 {
3885 Parcel data = Parcel.obtain();
3886 Parcel reply = Parcel.obtain();
3887 data.writeInterfaceToken(IActivityManager.descriptor);
3888 values.writeToParcel(data, 0);
3889 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
3890 reply.readException();
3891 data.recycle();
3892 reply.recycle();
3893 }
3894 public void setRequestedOrientation(IBinder token, int requestedOrientation)
3895 throws RemoteException {
3896 Parcel data = Parcel.obtain();
3897 Parcel reply = Parcel.obtain();
3898 data.writeInterfaceToken(IActivityManager.descriptor);
3899 data.writeStrongBinder(token);
3900 data.writeInt(requestedOrientation);
3901 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3902 reply.readException();
3903 data.recycle();
3904 reply.recycle();
3905 }
3906 public int getRequestedOrientation(IBinder token) throws RemoteException {
3907 Parcel data = Parcel.obtain();
3908 Parcel reply = Parcel.obtain();
3909 data.writeInterfaceToken(IActivityManager.descriptor);
3910 data.writeStrongBinder(token);
3911 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3912 reply.readException();
3913 int res = reply.readInt();
3914 data.recycle();
3915 reply.recycle();
3916 return res;
3917 }
3918 public ComponentName getActivityClassForToken(IBinder token)
3919 throws RemoteException {
3920 Parcel data = Parcel.obtain();
3921 Parcel reply = Parcel.obtain();
3922 data.writeInterfaceToken(IActivityManager.descriptor);
3923 data.writeStrongBinder(token);
3924 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
3925 reply.readException();
3926 ComponentName res = ComponentName.readFromParcel(reply);
3927 data.recycle();
3928 reply.recycle();
3929 return res;
3930 }
3931 public String getPackageForToken(IBinder token) throws RemoteException
3932 {
3933 Parcel data = Parcel.obtain();
3934 Parcel reply = Parcel.obtain();
3935 data.writeInterfaceToken(IActivityManager.descriptor);
3936 data.writeStrongBinder(token);
3937 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
3938 reply.readException();
3939 String res = reply.readString();
3940 data.recycle();
3941 reply.recycle();
3942 return res;
3943 }
3944 public IIntentSender getIntentSender(int type,
3945 String packageName, IBinder token, String resultWho,
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003946 int requestCode, Intent[] intents, String[] resolvedTypes, int flags,
Dianne Hackborn41203752012-08-31 14:05:51 -07003947 Bundle options, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003948 Parcel data = Parcel.obtain();
3949 Parcel reply = Parcel.obtain();
3950 data.writeInterfaceToken(IActivityManager.descriptor);
3951 data.writeInt(type);
3952 data.writeString(packageName);
3953 data.writeStrongBinder(token);
3954 data.writeString(resultWho);
3955 data.writeInt(requestCode);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003956 if (intents != null) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003957 data.writeInt(1);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003958 data.writeTypedArray(intents, 0);
3959 data.writeStringArray(resolvedTypes);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003960 } else {
3961 data.writeInt(0);
3962 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003963 data.writeInt(flags);
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003964 if (options != null) {
3965 data.writeInt(1);
3966 options.writeToParcel(data, 0);
3967 } else {
3968 data.writeInt(0);
3969 }
Dianne Hackborn41203752012-08-31 14:05:51 -07003970 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003971 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
3972 reply.readException();
3973 IIntentSender res = IIntentSender.Stub.asInterface(
Dianne Hackbornff170242014-11-19 10:59:01 -08003974 reply.readStrongBinder());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003975 data.recycle();
3976 reply.recycle();
3977 return res;
3978 }
3979 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
3980 Parcel data = Parcel.obtain();
3981 Parcel reply = Parcel.obtain();
3982 data.writeInterfaceToken(IActivityManager.descriptor);
3983 data.writeStrongBinder(sender.asBinder());
3984 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
3985 reply.readException();
3986 data.recycle();
3987 reply.recycle();
3988 }
3989 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
3990 Parcel data = Parcel.obtain();
3991 Parcel reply = Parcel.obtain();
3992 data.writeInterfaceToken(IActivityManager.descriptor);
3993 data.writeStrongBinder(sender.asBinder());
3994 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
3995 reply.readException();
3996 String res = reply.readString();
3997 data.recycle();
3998 reply.recycle();
3999 return res;
4000 }
Christopher Tatec4a07d12012-04-06 14:19:13 -07004001 public int getUidForIntentSender(IIntentSender sender) throws RemoteException {
4002 Parcel data = Parcel.obtain();
4003 Parcel reply = Parcel.obtain();
4004 data.writeInterfaceToken(IActivityManager.descriptor);
4005 data.writeStrongBinder(sender.asBinder());
4006 mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4007 reply.readException();
4008 int res = reply.readInt();
4009 data.recycle();
4010 reply.recycle();
4011 return res;
4012 }
Dianne Hackborn41203752012-08-31 14:05:51 -07004013 public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
4014 boolean requireFull, String name, String callerPackage) throws RemoteException {
4015 Parcel data = Parcel.obtain();
4016 Parcel reply = Parcel.obtain();
4017 data.writeInterfaceToken(IActivityManager.descriptor);
4018 data.writeInt(callingPid);
4019 data.writeInt(callingUid);
4020 data.writeInt(userId);
4021 data.writeInt(allowAll ? 1 : 0);
4022 data.writeInt(requireFull ? 1 : 0);
4023 data.writeString(name);
4024 data.writeString(callerPackage);
4025 mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0);
4026 reply.readException();
4027 int res = reply.readInt();
4028 data.recycle();
4029 reply.recycle();
4030 return res;
4031 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004032 public void setProcessLimit(int max) throws RemoteException
4033 {
4034 Parcel data = Parcel.obtain();
4035 Parcel reply = Parcel.obtain();
4036 data.writeInterfaceToken(IActivityManager.descriptor);
4037 data.writeInt(max);
4038 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4039 reply.readException();
4040 data.recycle();
4041 reply.recycle();
4042 }
4043 public int getProcessLimit() throws RemoteException
4044 {
4045 Parcel data = Parcel.obtain();
4046 Parcel reply = Parcel.obtain();
4047 data.writeInterfaceToken(IActivityManager.descriptor);
4048 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4049 reply.readException();
4050 int res = reply.readInt();
4051 data.recycle();
4052 reply.recycle();
4053 return res;
4054 }
4055 public void setProcessForeground(IBinder token, int pid,
4056 boolean isForeground) throws RemoteException {
4057 Parcel data = Parcel.obtain();
4058 Parcel reply = Parcel.obtain();
4059 data.writeInterfaceToken(IActivityManager.descriptor);
4060 data.writeStrongBinder(token);
4061 data.writeInt(pid);
4062 data.writeInt(isForeground ? 1 : 0);
4063 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
4064 reply.readException();
4065 data.recycle();
4066 reply.recycle();
4067 }
4068 public int checkPermission(String permission, int pid, int uid)
4069 throws RemoteException {
4070 Parcel data = Parcel.obtain();
4071 Parcel reply = Parcel.obtain();
4072 data.writeInterfaceToken(IActivityManager.descriptor);
4073 data.writeString(permission);
4074 data.writeInt(pid);
4075 data.writeInt(uid);
4076 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
4077 reply.readException();
4078 int res = reply.readInt();
4079 data.recycle();
4080 reply.recycle();
4081 return res;
4082 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004083 public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken)
4084 throws RemoteException {
4085 Parcel data = Parcel.obtain();
4086 Parcel reply = Parcel.obtain();
4087 data.writeInterfaceToken(IActivityManager.descriptor);
4088 data.writeString(permission);
4089 data.writeInt(pid);
4090 data.writeInt(uid);
4091 data.writeStrongBinder(callerToken);
4092 mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0);
4093 reply.readException();
4094 int res = reply.readInt();
4095 data.recycle();
4096 reply.recycle();
4097 return res;
4098 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004099 public boolean clearApplicationUserData(final String packageName,
Amith Yamasani742a6712011-05-04 14:49:28 -07004100 final IPackageDataObserver observer, final int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004101 Parcel data = Parcel.obtain();
4102 Parcel reply = Parcel.obtain();
4103 data.writeInterfaceToken(IActivityManager.descriptor);
4104 data.writeString(packageName);
Christopher Tate31b65f92013-09-09 14:17:27 -07004105 data.writeStrongBinder((observer != null) ? observer.asBinder() : null);
Amith Yamasani742a6712011-05-04 14:49:28 -07004106 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004107 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
4108 reply.readException();
4109 boolean res = reply.readInt() != 0;
4110 data.recycle();
4111 reply.recycle();
4112 return res;
4113 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004114 public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId,
4115 IBinder callerToken) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004116 Parcel data = Parcel.obtain();
4117 Parcel reply = Parcel.obtain();
4118 data.writeInterfaceToken(IActivityManager.descriptor);
4119 uri.writeToParcel(data, 0);
4120 data.writeInt(pid);
4121 data.writeInt(uid);
4122 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004123 data.writeInt(userId);
Dianne Hackbornff170242014-11-19 10:59:01 -08004124 data.writeStrongBinder(callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004125 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
4126 reply.readException();
4127 int res = reply.readInt();
4128 data.recycle();
4129 reply.recycle();
4130 return res;
4131 }
4132 public void grantUriPermission(IApplicationThread caller, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004133 Uri uri, int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004134 Parcel data = Parcel.obtain();
4135 Parcel reply = Parcel.obtain();
4136 data.writeInterfaceToken(IActivityManager.descriptor);
4137 data.writeStrongBinder(caller.asBinder());
4138 data.writeString(targetPkg);
4139 uri.writeToParcel(data, 0);
4140 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004141 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004142 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4143 reply.readException();
4144 data.recycle();
4145 reply.recycle();
4146 }
4147 public void revokeUriPermission(IApplicationThread caller, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004148 int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004149 Parcel data = Parcel.obtain();
4150 Parcel reply = Parcel.obtain();
4151 data.writeInterfaceToken(IActivityManager.descriptor);
4152 data.writeStrongBinder(caller.asBinder());
4153 uri.writeToParcel(data, 0);
4154 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004155 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004156 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4157 reply.readException();
4158 data.recycle();
4159 reply.recycle();
4160 }
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004161
4162 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004163 public void takePersistableUriPermission(Uri uri, int mode, int userId)
4164 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004165 Parcel data = Parcel.obtain();
4166 Parcel reply = Parcel.obtain();
4167 data.writeInterfaceToken(IActivityManager.descriptor);
4168 uri.writeToParcel(data, 0);
4169 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004170 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004171 mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4172 reply.readException();
4173 data.recycle();
4174 reply.recycle();
4175 }
4176
4177 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004178 public void releasePersistableUriPermission(Uri uri, int mode, int userId)
4179 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004180 Parcel data = Parcel.obtain();
4181 Parcel reply = Parcel.obtain();
4182 data.writeInterfaceToken(IActivityManager.descriptor);
4183 uri.writeToParcel(data, 0);
4184 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004185 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004186 mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4187 reply.readException();
4188 data.recycle();
4189 reply.recycle();
4190 }
4191
4192 @Override
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004193 public ParceledListSlice<UriPermission> getPersistedUriPermissions(
4194 String packageName, boolean incoming) throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004195 Parcel data = Parcel.obtain();
4196 Parcel reply = Parcel.obtain();
4197 data.writeInterfaceToken(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004198 data.writeString(packageName);
4199 data.writeInt(incoming ? 1 : 0);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004200 mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
4201 reply.readException();
4202 final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel(
4203 reply);
4204 data.recycle();
4205 reply.recycle();
4206 return perms;
4207 }
4208
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004209 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
4210 throws RemoteException {
4211 Parcel data = Parcel.obtain();
4212 Parcel reply = Parcel.obtain();
4213 data.writeInterfaceToken(IActivityManager.descriptor);
4214 data.writeStrongBinder(who.asBinder());
4215 data.writeInt(waiting ? 1 : 0);
4216 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
4217 reply.readException();
4218 data.recycle();
4219 reply.recycle();
4220 }
4221 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
4222 Parcel data = Parcel.obtain();
4223 Parcel reply = Parcel.obtain();
4224 data.writeInterfaceToken(IActivityManager.descriptor);
4225 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
4226 reply.readException();
4227 outInfo.readFromParcel(reply);
4228 data.recycle();
4229 reply.recycle();
4230 }
4231 public void unhandledBack() throws RemoteException
4232 {
4233 Parcel data = Parcel.obtain();
4234 Parcel reply = Parcel.obtain();
4235 data.writeInterfaceToken(IActivityManager.descriptor);
4236 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
4237 reply.readException();
4238 data.recycle();
4239 reply.recycle();
4240 }
4241 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
4242 {
4243 Parcel data = Parcel.obtain();
4244 Parcel reply = Parcel.obtain();
4245 data.writeInterfaceToken(IActivityManager.descriptor);
4246 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
4247 reply.readException();
4248 ParcelFileDescriptor pfd = null;
4249 if (reply.readInt() != 0) {
4250 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
4251 }
4252 data.recycle();
4253 reply.recycle();
4254 return pfd;
4255 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07004256 public void setLockScreenShown(boolean shown) throws RemoteException
4257 {
4258 Parcel data = Parcel.obtain();
4259 Parcel reply = Parcel.obtain();
4260 data.writeInterfaceToken(IActivityManager.descriptor);
4261 data.writeInt(shown ? 1 : 0);
4262 mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0);
4263 reply.readException();
4264 data.recycle();
4265 reply.recycle();
4266 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004267 public void setDebugApp(
4268 String packageName, boolean waitForDebugger, boolean persistent)
4269 throws RemoteException
4270 {
4271 Parcel data = Parcel.obtain();
4272 Parcel reply = Parcel.obtain();
4273 data.writeInterfaceToken(IActivityManager.descriptor);
4274 data.writeString(packageName);
4275 data.writeInt(waitForDebugger ? 1 : 0);
4276 data.writeInt(persistent ? 1 : 0);
4277 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
4278 reply.readException();
4279 data.recycle();
4280 reply.recycle();
4281 }
4282 public void setAlwaysFinish(boolean enabled) throws RemoteException
4283 {
4284 Parcel data = Parcel.obtain();
4285 Parcel reply = Parcel.obtain();
4286 data.writeInterfaceToken(IActivityManager.descriptor);
4287 data.writeInt(enabled ? 1 : 0);
4288 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
4289 reply.readException();
4290 data.recycle();
4291 reply.recycle();
4292 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004293 public void setActivityController(IActivityController watcher) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004294 {
4295 Parcel data = Parcel.obtain();
4296 Parcel reply = Parcel.obtain();
4297 data.writeInterfaceToken(IActivityManager.descriptor);
4298 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004299 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004300 reply.readException();
4301 data.recycle();
4302 reply.recycle();
4303 }
4304 public void enterSafeMode() throws RemoteException {
4305 Parcel data = Parcel.obtain();
4306 data.writeInterfaceToken(IActivityManager.descriptor);
4307 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
4308 data.recycle();
4309 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07004310 public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag)
Dianne Hackborn099bc622014-01-22 13:39:16 -08004311 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004312 Parcel data = Parcel.obtain();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004313 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn099bc622014-01-22 13:39:16 -08004314 data.writeStrongBinder(sender.asBinder());
4315 data.writeInt(sourceUid);
4316 data.writeString(sourcePkg);
Dianne Hackborn1e383822015-04-10 14:02:33 -07004317 data.writeString(tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004318 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
4319 data.recycle();
4320 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07004321 public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag)
4322 throws RemoteException {
4323 Parcel data = Parcel.obtain();
4324 data.writeInterfaceToken(IActivityManager.descriptor);
4325 data.writeStrongBinder(sender.asBinder());
4326 data.writeInt(sourceUid);
4327 data.writeString(tag);
4328 mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0);
4329 data.recycle();
4330 }
4331 public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag)
4332 throws RemoteException {
4333 Parcel data = Parcel.obtain();
4334 data.writeInterfaceToken(IActivityManager.descriptor);
4335 data.writeStrongBinder(sender.asBinder());
4336 data.writeInt(sourceUid);
4337 data.writeString(tag);
4338 mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0);
4339 data.recycle();
4340 }
Dianne Hackborn64825172011-03-02 21:32:58 -08004341 public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004342 Parcel data = Parcel.obtain();
4343 Parcel reply = Parcel.obtain();
4344 data.writeInterfaceToken(IActivityManager.descriptor);
4345 data.writeIntArray(pids);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004346 data.writeString(reason);
Dianne Hackborn64825172011-03-02 21:32:58 -08004347 data.writeInt(secure ? 1 : 0);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004348 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07004349 reply.readException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004350 boolean res = reply.readInt() != 0;
4351 data.recycle();
4352 reply.recycle();
4353 return res;
4354 }
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07004355 @Override
4356 public boolean killProcessesBelowForeground(String reason) throws RemoteException {
4357 Parcel data = Parcel.obtain();
4358 Parcel reply = Parcel.obtain();
4359 data.writeInterfaceToken(IActivityManager.descriptor);
4360 data.writeString(reason);
4361 mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0);
4362 boolean res = reply.readInt() != 0;
4363 data.recycle();
4364 reply.recycle();
4365 return res;
4366 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004367 public boolean testIsSystemReady()
4368 {
4369 /* this base class version is never called */
4370 return true;
4371 }
Dan Egnor60d87622009-12-16 16:32:58 -08004372 public void handleApplicationCrash(IBinder app,
4373 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
4374 {
4375 Parcel data = Parcel.obtain();
4376 Parcel reply = Parcel.obtain();
4377 data.writeInterfaceToken(IActivityManager.descriptor);
4378 data.writeStrongBinder(app);
4379 crashInfo.writeToParcel(data, 0);
4380 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
4381 reply.readException();
4382 reply.recycle();
4383 data.recycle();
4384 }
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004385
Dianne Hackborn52322712014-08-26 22:47:26 -07004386 public boolean handleApplicationWtf(IBinder app, String tag, boolean system,
Dan Egnorb7f03672009-12-09 16:22:32 -08004387 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004388 {
4389 Parcel data = Parcel.obtain();
4390 Parcel reply = Parcel.obtain();
4391 data.writeInterfaceToken(IActivityManager.descriptor);
4392 data.writeStrongBinder(app);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004393 data.writeString(tag);
Dianne Hackborn52322712014-08-26 22:47:26 -07004394 data.writeInt(system ? 1 : 0);
Dan Egnorb7f03672009-12-09 16:22:32 -08004395 crashInfo.writeToParcel(data, 0);
Dan Egnor60d87622009-12-16 16:32:58 -08004396 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004397 reply.readException();
Dan Egnor60d87622009-12-16 16:32:58 -08004398 boolean res = reply.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004399 reply.recycle();
4400 data.recycle();
Dan Egnor60d87622009-12-16 16:32:58 -08004401 return res;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004402 }
Dan Egnorb7f03672009-12-09 16:22:32 -08004403
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004404 public void handleApplicationStrictModeViolation(IBinder app,
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004405 int violationMask,
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004406 StrictMode.ViolationInfo info) throws RemoteException
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004407 {
4408 Parcel data = Parcel.obtain();
4409 Parcel reply = Parcel.obtain();
4410 data.writeInterfaceToken(IActivityManager.descriptor);
4411 data.writeStrongBinder(app);
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004412 data.writeInt(violationMask);
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004413 info.writeToParcel(data, 0);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004414 mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0);
4415 reply.readException();
4416 reply.recycle();
4417 data.recycle();
4418 }
4419
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004420 public void signalPersistentProcesses(int sig) throws RemoteException {
4421 Parcel data = Parcel.obtain();
4422 Parcel reply = Parcel.obtain();
4423 data.writeInterfaceToken(IActivityManager.descriptor);
4424 data.writeInt(sig);
4425 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
4426 reply.readException();
4427 data.recycle();
4428 reply.recycle();
4429 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004430
Dianne Hackborn1676c852012-09-10 14:52:30 -07004431 public void killBackgroundProcesses(String packageName, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004432 Parcel data = Parcel.obtain();
4433 Parcel reply = Parcel.obtain();
4434 data.writeInterfaceToken(IActivityManager.descriptor);
4435 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004436 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004437 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4438 reply.readException();
4439 data.recycle();
4440 reply.recycle();
4441 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004442
4443 public void killAllBackgroundProcesses() throws RemoteException {
4444 Parcel data = Parcel.obtain();
4445 Parcel reply = Parcel.obtain();
4446 data.writeInterfaceToken(IActivityManager.descriptor);
4447 mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4448 reply.readException();
4449 data.recycle();
4450 reply.recycle();
4451 }
4452
Dianne Hackborn1676c852012-09-10 14:52:30 -07004453 public void forceStopPackage(String packageName, int userId) throws RemoteException {
Dianne Hackborn03abb812010-01-04 18:43:19 -08004454 Parcel data = Parcel.obtain();
4455 Parcel reply = Parcel.obtain();
4456 data.writeInterfaceToken(IActivityManager.descriptor);
4457 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004458 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004459 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004460 reply.readException();
4461 data.recycle();
4462 reply.recycle();
4463 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004464
Dianne Hackborn27ff9132012-03-06 14:57:58 -08004465 public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
4466 throws RemoteException
4467 {
4468 Parcel data = Parcel.obtain();
4469 Parcel reply = Parcel.obtain();
4470 data.writeInterfaceToken(IActivityManager.descriptor);
4471 mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0);
4472 reply.readException();
4473 outInfo.readFromParcel(reply);
4474 reply.recycle();
4475 data.recycle();
4476 }
4477
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004478 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
4479 {
4480 Parcel data = Parcel.obtain();
4481 Parcel reply = Parcel.obtain();
4482 data.writeInterfaceToken(IActivityManager.descriptor);
4483 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
4484 reply.readException();
4485 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
4486 reply.recycle();
4487 data.recycle();
4488 return res;
4489 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004490
Dianne Hackborn1676c852012-09-10 14:52:30 -07004491 public boolean profileControl(String process, int userId, boolean start,
Jeff Hao1b012d32014-08-20 10:35:34 -07004492 ProfilerInfo profilerInfo, int profileType) throws RemoteException
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004493 {
4494 Parcel data = Parcel.obtain();
4495 Parcel reply = Parcel.obtain();
4496 data.writeInterfaceToken(IActivityManager.descriptor);
4497 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004498 data.writeInt(userId);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004499 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07004500 data.writeInt(profileType);
Jeff Hao1b012d32014-08-20 10:35:34 -07004501 if (profilerInfo != null) {
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004502 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07004503 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004504 } else {
4505 data.writeInt(0);
4506 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004507 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
4508 reply.readException();
4509 boolean res = reply.readInt() != 0;
4510 reply.recycle();
4511 data.recycle();
4512 return res;
4513 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004514
Dianne Hackborn55280a92009-05-07 15:53:46 -07004515 public boolean shutdown(int timeout) throws RemoteException
4516 {
4517 Parcel data = Parcel.obtain();
4518 Parcel reply = Parcel.obtain();
4519 data.writeInterfaceToken(IActivityManager.descriptor);
4520 data.writeInt(timeout);
4521 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
4522 reply.readException();
4523 boolean res = reply.readInt() != 0;
4524 reply.recycle();
4525 data.recycle();
4526 return res;
4527 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004528
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07004529 public void stopAppSwitches() throws RemoteException {
4530 Parcel data = Parcel.obtain();
4531 Parcel reply = Parcel.obtain();
4532 data.writeInterfaceToken(IActivityManager.descriptor);
4533 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
4534 reply.readException();
4535 reply.recycle();
4536 data.recycle();
4537 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004538
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07004539 public void resumeAppSwitches() throws RemoteException {
4540 Parcel data = Parcel.obtain();
4541 Parcel reply = Parcel.obtain();
4542 data.writeInterfaceToken(IActivityManager.descriptor);
4543 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
4544 reply.readException();
4545 reply.recycle();
4546 data.recycle();
4547 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07004548
4549 public void addPackageDependency(String packageName) throws RemoteException {
4550 Parcel data = Parcel.obtain();
4551 Parcel reply = Parcel.obtain();
4552 data.writeInterfaceToken(IActivityManager.descriptor);
4553 data.writeString(packageName);
4554 mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0);
4555 reply.readException();
4556 data.recycle();
4557 reply.recycle();
4558 }
4559
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004560 public void killApplicationWithAppId(String pkg, int appid, String reason)
4561 throws RemoteException {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004562 Parcel data = Parcel.obtain();
4563 Parcel reply = Parcel.obtain();
4564 data.writeInterfaceToken(IActivityManager.descriptor);
4565 data.writeString(pkg);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004566 data.writeInt(appid);
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004567 data.writeString(reason);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004568 mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004569 reply.readException();
4570 data.recycle();
4571 reply.recycle();
4572 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004573
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07004574 public void closeSystemDialogs(String reason) throws RemoteException {
4575 Parcel data = Parcel.obtain();
4576 Parcel reply = Parcel.obtain();
4577 data.writeInterfaceToken(IActivityManager.descriptor);
4578 data.writeString(reason);
4579 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
4580 reply.readException();
4581 data.recycle();
4582 reply.recycle();
4583 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004584
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004585 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004586 throws RemoteException {
4587 Parcel data = Parcel.obtain();
4588 Parcel reply = Parcel.obtain();
4589 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004590 data.writeIntArray(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004591 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
4592 reply.readException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004593 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004594 data.recycle();
4595 reply.recycle();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004596 return res;
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004597 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07004598
4599 public void killApplicationProcess(String processName, int uid) throws RemoteException {
4600 Parcel data = Parcel.obtain();
4601 Parcel reply = Parcel.obtain();
4602 data.writeInterfaceToken(IActivityManager.descriptor);
4603 data.writeString(processName);
4604 data.writeInt(uid);
4605 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
4606 reply.readException();
4607 data.recycle();
4608 reply.recycle();
4609 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004610
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07004611 public void overridePendingTransition(IBinder token, String packageName,
4612 int enterAnim, int exitAnim) throws RemoteException {
4613 Parcel data = Parcel.obtain();
4614 Parcel reply = Parcel.obtain();
4615 data.writeInterfaceToken(IActivityManager.descriptor);
4616 data.writeStrongBinder(token);
4617 data.writeString(packageName);
4618 data.writeInt(enterAnim);
4619 data.writeInt(exitAnim);
4620 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
4621 reply.readException();
4622 data.recycle();
4623 reply.recycle();
4624 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004625
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08004626 public boolean isUserAMonkey() throws RemoteException {
4627 Parcel data = Parcel.obtain();
4628 Parcel reply = Parcel.obtain();
4629 data.writeInterfaceToken(IActivityManager.descriptor);
4630 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
4631 reply.readException();
4632 boolean res = reply.readInt() != 0;
4633 data.recycle();
4634 reply.recycle();
4635 return res;
4636 }
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07004637
4638 public void setUserIsMonkey(boolean monkey) throws RemoteException {
4639 Parcel data = Parcel.obtain();
4640 Parcel reply = Parcel.obtain();
4641 data.writeInterfaceToken(IActivityManager.descriptor);
4642 data.writeInt(monkey ? 1 : 0);
4643 mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0);
4644 reply.readException();
4645 data.recycle();
4646 reply.recycle();
4647 }
4648
Dianne Hackborn860755f2010-06-03 18:47:52 -07004649 public void finishHeavyWeightApp() throws RemoteException {
4650 Parcel data = Parcel.obtain();
4651 Parcel reply = Parcel.obtain();
4652 data.writeInterfaceToken(IActivityManager.descriptor);
4653 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
4654 reply.readException();
4655 data.recycle();
4656 reply.recycle();
4657 }
Craig Mautner4addfc52013-06-25 08:05:45 -07004658
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004659 public boolean convertFromTranslucent(IBinder token)
Craig Mautner4addfc52013-06-25 08:05:45 -07004660 throws RemoteException {
4661 Parcel data = Parcel.obtain();
4662 Parcel reply = Parcel.obtain();
4663 data.writeInterfaceToken(IActivityManager.descriptor);
4664 data.writeStrongBinder(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07004665 mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0);
4666 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004667 boolean res = reply.readInt() != 0;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004668 data.recycle();
4669 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004670 return res;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004671 }
4672
Craig Mautner233ceee2014-05-09 17:05:11 -07004673 public boolean convertToTranslucent(IBinder token, ActivityOptions options)
Craig Mautner5eda9b32013-07-02 11:58:16 -07004674 throws RemoteException {
4675 Parcel data = Parcel.obtain();
4676 Parcel reply = Parcel.obtain();
4677 data.writeInterfaceToken(IActivityManager.descriptor);
4678 data.writeStrongBinder(token);
Craig Mautner233ceee2014-05-09 17:05:11 -07004679 if (options == null) {
4680 data.writeInt(0);
4681 } else {
4682 data.writeInt(1);
4683 data.writeBundle(options.toBundle());
4684 }
Craig Mautner5eda9b32013-07-02 11:58:16 -07004685 mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07004686 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004687 boolean res = reply.readInt() != 0;
Craig Mautner4addfc52013-06-25 08:05:45 -07004688 data.recycle();
4689 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004690 return res;
Craig Mautner4addfc52013-06-25 08:05:45 -07004691 }
4692
Craig Mautner233ceee2014-05-09 17:05:11 -07004693 public ActivityOptions getActivityOptions(IBinder token) throws RemoteException {
4694 Parcel data = Parcel.obtain();
4695 Parcel reply = Parcel.obtain();
4696 data.writeInterfaceToken(IActivityManager.descriptor);
4697 data.writeStrongBinder(token);
4698 mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0);
4699 reply.readException();
4700 Bundle bundle = reply.readBundle();
4701 ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
4702 data.recycle();
4703 reply.recycle();
4704 return options;
4705 }
4706
Daniel Sandler69a48172010-06-23 16:29:36 -04004707 public void setImmersive(IBinder token, boolean immersive)
4708 throws RemoteException {
4709 Parcel data = Parcel.obtain();
4710 Parcel reply = Parcel.obtain();
4711 data.writeInterfaceToken(IActivityManager.descriptor);
4712 data.writeStrongBinder(token);
4713 data.writeInt(immersive ? 1 : 0);
4714 mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
4715 reply.readException();
4716 data.recycle();
4717 reply.recycle();
4718 }
4719
4720 public boolean isImmersive(IBinder token)
4721 throws RemoteException {
4722 Parcel data = Parcel.obtain();
4723 Parcel reply = Parcel.obtain();
4724 data.writeInterfaceToken(IActivityManager.descriptor);
4725 data.writeStrongBinder(token);
4726 mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004727 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004728 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004729 data.recycle();
4730 reply.recycle();
4731 return res;
4732 }
4733
Craig Mautnerd61dc202014-07-07 11:09:11 -07004734 public boolean isTopOfTask(IBinder token) throws RemoteException {
4735 Parcel data = Parcel.obtain();
4736 Parcel reply = Parcel.obtain();
4737 data.writeInterfaceToken(IActivityManager.descriptor);
4738 data.writeStrongBinder(token);
4739 mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0);
4740 reply.readException();
4741 boolean res = reply.readInt() == 1;
4742 data.recycle();
4743 reply.recycle();
4744 return res;
4745 }
4746
Daniel Sandler69a48172010-06-23 16:29:36 -04004747 public boolean isTopActivityImmersive()
4748 throws RemoteException {
4749 Parcel data = Parcel.obtain();
4750 Parcel reply = Parcel.obtain();
4751 data.writeInterfaceToken(IActivityManager.descriptor);
4752 mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004753 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004754 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004755 data.recycle();
4756 reply.recycle();
4757 return res;
4758 }
4759
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004760 public void crashApplication(int uid, int initialPid, String packageName,
4761 String message) throws RemoteException {
4762 Parcel data = Parcel.obtain();
4763 Parcel reply = Parcel.obtain();
4764 data.writeInterfaceToken(IActivityManager.descriptor);
4765 data.writeInt(uid);
4766 data.writeInt(initialPid);
4767 data.writeString(packageName);
4768 data.writeString(message);
4769 mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0);
4770 reply.readException();
4771 data.recycle();
4772 reply.recycle();
4773 }
Andy McFadden824c5102010-07-09 16:26:57 -07004774
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004775 public String getProviderMimeType(Uri uri, int userId) throws RemoteException {
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004776 Parcel data = Parcel.obtain();
4777 Parcel reply = Parcel.obtain();
4778 data.writeInterfaceToken(IActivityManager.descriptor);
4779 uri.writeToParcel(data, 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004780 data.writeInt(userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004781 mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0);
4782 reply.readException();
4783 String res = reply.readString();
4784 data.recycle();
4785 reply.recycle();
4786 return res;
4787 }
4788
Dianne Hackborn7e269642010-08-25 19:50:20 -07004789 public IBinder newUriPermissionOwner(String name)
4790 throws RemoteException {
4791 Parcel data = Parcel.obtain();
4792 Parcel reply = Parcel.obtain();
4793 data.writeInterfaceToken(IActivityManager.descriptor);
4794 data.writeString(name);
4795 mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
4796 reply.readException();
4797 IBinder res = reply.readStrongBinder();
4798 data.recycle();
4799 reply.recycle();
4800 return res;
4801 }
4802
4803 public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
Nicolas Prevotf1939902014-06-25 09:29:02 +01004804 Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07004805 Parcel data = Parcel.obtain();
4806 Parcel reply = Parcel.obtain();
4807 data.writeInterfaceToken(IActivityManager.descriptor);
4808 data.writeStrongBinder(owner);
4809 data.writeInt(fromUid);
4810 data.writeString(targetPkg);
4811 uri.writeToParcel(data, 0);
4812 data.writeInt(mode);
Nicolas Prevotf1939902014-06-25 09:29:02 +01004813 data.writeInt(sourceUserId);
4814 data.writeInt(targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07004815 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4816 reply.readException();
4817 data.recycle();
4818 reply.recycle();
4819 }
4820
4821 public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004822 int mode, int userId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07004823 Parcel data = Parcel.obtain();
4824 Parcel reply = Parcel.obtain();
4825 data.writeInterfaceToken(IActivityManager.descriptor);
4826 data.writeStrongBinder(owner);
4827 if (uri != null) {
4828 data.writeInt(1);
4829 uri.writeToParcel(data, 0);
4830 } else {
4831 data.writeInt(0);
4832 }
4833 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004834 data.writeInt(userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07004835 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4836 reply.readException();
4837 data.recycle();
4838 reply.recycle();
4839 }
Dianne Hackbornc8f84972010-08-25 23:14:44 -07004840
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004841 public int checkGrantUriPermission(int callingUid, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004842 Uri uri, int modeFlags, int userId) throws RemoteException {
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004843 Parcel data = Parcel.obtain();
4844 Parcel reply = Parcel.obtain();
4845 data.writeInterfaceToken(IActivityManager.descriptor);
4846 data.writeInt(callingUid);
4847 data.writeString(targetPkg);
4848 uri.writeToParcel(data, 0);
4849 data.writeInt(modeFlags);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004850 data.writeInt(userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004851 mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4852 reply.readException();
4853 int res = reply.readInt();
4854 data.recycle();
4855 reply.recycle();
4856 return res;
4857 }
4858
Dianne Hackborn1676c852012-09-10 14:52:30 -07004859 public boolean dumpHeap(String process, int userId, boolean managed,
Andy McFadden824c5102010-07-09 16:26:57 -07004860 String path, ParcelFileDescriptor fd) throws RemoteException {
4861 Parcel data = Parcel.obtain();
4862 Parcel reply = Parcel.obtain();
4863 data.writeInterfaceToken(IActivityManager.descriptor);
4864 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004865 data.writeInt(userId);
Andy McFadden824c5102010-07-09 16:26:57 -07004866 data.writeInt(managed ? 1 : 0);
4867 data.writeString(path);
4868 if (fd != null) {
4869 data.writeInt(1);
4870 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
4871 } else {
4872 data.writeInt(0);
4873 }
4874 mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
4875 reply.readException();
4876 boolean res = reply.readInt() != 0;
4877 reply.recycle();
4878 data.recycle();
4879 return res;
4880 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004881
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004882 public int startActivities(IApplicationThread caller, String callingPackage,
Dianne Hackborna4972e92012-03-14 10:38:05 -07004883 Intent[] intents, String[] resolvedTypes, IBinder resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004884 Bundle options, int userId) throws RemoteException {
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004885 Parcel data = Parcel.obtain();
4886 Parcel reply = Parcel.obtain();
4887 data.writeInterfaceToken(IActivityManager.descriptor);
4888 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004889 data.writeString(callingPackage);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004890 data.writeTypedArray(intents, 0);
4891 data.writeStringArray(resolvedTypes);
4892 data.writeStrongBinder(resultTo);
Dianne Hackborna4972e92012-03-14 10:38:05 -07004893 if (options != null) {
4894 data.writeInt(1);
4895 options.writeToParcel(data, 0);
4896 } else {
4897 data.writeInt(0);
4898 }
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004899 data.writeInt(userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004900 mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0);
4901 reply.readException();
4902 int result = reply.readInt();
4903 reply.recycle();
4904 data.recycle();
4905 return result;
4906 }
4907
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004908 public int getFrontActivityScreenCompatMode() throws RemoteException {
4909 Parcel data = Parcel.obtain();
4910 Parcel reply = Parcel.obtain();
4911 data.writeInterfaceToken(IActivityManager.descriptor);
4912 mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4913 reply.readException();
4914 int mode = reply.readInt();
4915 reply.recycle();
4916 data.recycle();
4917 return mode;
4918 }
4919
4920 public void setFrontActivityScreenCompatMode(int mode) throws RemoteException {
4921 Parcel data = Parcel.obtain();
4922 Parcel reply = Parcel.obtain();
4923 data.writeInterfaceToken(IActivityManager.descriptor);
4924 data.writeInt(mode);
4925 mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4926 reply.readException();
4927 reply.recycle();
4928 data.recycle();
4929 }
4930
4931 public int getPackageScreenCompatMode(String packageName) throws RemoteException {
4932 Parcel data = Parcel.obtain();
4933 Parcel reply = Parcel.obtain();
4934 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004935 data.writeString(packageName);
4936 mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004937 reply.readException();
4938 int mode = reply.readInt();
4939 reply.recycle();
4940 data.recycle();
4941 return mode;
4942 }
4943
4944 public void setPackageScreenCompatMode(String packageName, int mode)
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004945 throws RemoteException {
4946 Parcel data = Parcel.obtain();
4947 Parcel reply = Parcel.obtain();
4948 data.writeInterfaceToken(IActivityManager.descriptor);
4949 data.writeString(packageName);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004950 data.writeInt(mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004951 mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4952 reply.readException();
4953 reply.recycle();
4954 data.recycle();
4955 }
4956
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004957 public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
4958 Parcel data = Parcel.obtain();
4959 Parcel reply = Parcel.obtain();
4960 data.writeInterfaceToken(IActivityManager.descriptor);
4961 data.writeString(packageName);
4962 mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4963 reply.readException();
4964 boolean ask = reply.readInt() != 0;
4965 reply.recycle();
4966 data.recycle();
4967 return ask;
4968 }
4969
4970 public void setPackageAskScreenCompat(String packageName, boolean ask)
4971 throws RemoteException {
4972 Parcel data = Parcel.obtain();
4973 Parcel reply = Parcel.obtain();
4974 data.writeInterfaceToken(IActivityManager.descriptor);
4975 data.writeString(packageName);
4976 data.writeInt(ask ? 1 : 0);
4977 mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4978 reply.readException();
4979 reply.recycle();
4980 data.recycle();
4981 }
4982
Amith Yamasani4b2e9342011-03-31 12:38:53 -07004983 public boolean switchUser(int userid) throws RemoteException {
4984 Parcel data = Parcel.obtain();
4985 Parcel reply = Parcel.obtain();
4986 data.writeInterfaceToken(IActivityManager.descriptor);
4987 data.writeInt(userid);
4988 mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0);
4989 reply.readException();
4990 boolean result = reply.readInt() != 0;
4991 reply.recycle();
4992 data.recycle();
4993 return result;
4994 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07004995
Kenny Guy08488bf2014-02-21 17:40:37 +00004996 public boolean startUserInBackground(int userid) throws RemoteException {
4997 Parcel data = Parcel.obtain();
4998 Parcel reply = Parcel.obtain();
4999 data.writeInterfaceToken(IActivityManager.descriptor);
5000 data.writeInt(userid);
5001 mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0);
5002 reply.readException();
5003 boolean result = reply.readInt() != 0;
5004 reply.recycle();
5005 data.recycle();
5006 return result;
5007 }
5008
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005009 public int stopUser(int userid, IStopUserCallback callback) throws RemoteException {
5010 Parcel data = Parcel.obtain();
5011 Parcel reply = Parcel.obtain();
5012 data.writeInterfaceToken(IActivityManager.descriptor);
5013 data.writeInt(userid);
5014 data.writeStrongInterface(callback);
5015 mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0);
5016 reply.readException();
5017 int result = reply.readInt();
5018 reply.recycle();
5019 data.recycle();
5020 return result;
5021 }
5022
Amith Yamasani52f1d752012-03-28 18:19:29 -07005023 public UserInfo getCurrentUser() throws RemoteException {
5024 Parcel data = Parcel.obtain();
5025 Parcel reply = Parcel.obtain();
5026 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005027 mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0);
Amith Yamasani52f1d752012-03-28 18:19:29 -07005028 reply.readException();
5029 UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply);
5030 reply.recycle();
5031 data.recycle();
5032 return userInfo;
5033 }
5034
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07005035 public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException {
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005036 Parcel data = Parcel.obtain();
5037 Parcel reply = Parcel.obtain();
5038 data.writeInterfaceToken(IActivityManager.descriptor);
5039 data.writeInt(userid);
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07005040 data.writeInt(orStopping ? 1 : 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005041 mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0);
5042 reply.readException();
5043 boolean result = reply.readInt() != 0;
5044 reply.recycle();
5045 data.recycle();
5046 return result;
5047 }
5048
Dianne Hackbornc72fc672012-09-20 13:12:03 -07005049 public int[] getRunningUserIds() throws RemoteException {
5050 Parcel data = Parcel.obtain();
5051 Parcel reply = Parcel.obtain();
5052 data.writeInterfaceToken(IActivityManager.descriptor);
5053 mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0);
5054 reply.readException();
5055 int[] result = reply.createIntArray();
5056 reply.recycle();
5057 data.recycle();
5058 return result;
5059 }
5060
Wale Ogunwaled54b5782014-10-23 15:55:23 -07005061 public boolean removeTask(int taskId) throws RemoteException {
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005062 Parcel data = Parcel.obtain();
5063 Parcel reply = Parcel.obtain();
5064 data.writeInterfaceToken(IActivityManager.descriptor);
5065 data.writeInt(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005066 mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
5067 reply.readException();
5068 boolean result = reply.readInt() != 0;
5069 reply.recycle();
5070 data.recycle();
5071 return result;
5072 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07005073
Jeff Sharkeya4620792011-05-20 15:29:23 -07005074 public void registerProcessObserver(IProcessObserver observer) throws RemoteException {
5075 Parcel data = Parcel.obtain();
5076 Parcel reply = Parcel.obtain();
5077 data.writeInterfaceToken(IActivityManager.descriptor);
5078 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5079 mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5080 reply.readException();
5081 data.recycle();
5082 reply.recycle();
5083 }
5084
5085 public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException {
5086 Parcel data = Parcel.obtain();
5087 Parcel reply = Parcel.obtain();
5088 data.writeInterfaceToken(IActivityManager.descriptor);
5089 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5090 mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5091 reply.readException();
5092 data.recycle();
5093 reply.recycle();
5094 }
5095
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07005096 public void registerUidObserver(IUidObserver observer) throws RemoteException {
5097 Parcel data = Parcel.obtain();
5098 Parcel reply = Parcel.obtain();
5099 data.writeInterfaceToken(IActivityManager.descriptor);
5100 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5101 mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0);
5102 reply.readException();
5103 data.recycle();
5104 reply.recycle();
5105 }
5106
5107 public void unregisterUidObserver(IUidObserver observer) throws RemoteException {
5108 Parcel data = Parcel.obtain();
5109 Parcel reply = Parcel.obtain();
5110 data.writeInterfaceToken(IActivityManager.descriptor);
5111 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5112 mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0);
5113 reply.readException();
5114 data.recycle();
5115 reply.recycle();
5116 }
5117
Dianne Hackborn6c418d52011-06-29 14:05:33 -07005118 public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException {
5119 Parcel data = Parcel.obtain();
5120 Parcel reply = Parcel.obtain();
5121 data.writeInterfaceToken(IActivityManager.descriptor);
5122 data.writeStrongBinder(sender.asBinder());
5123 mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0);
5124 reply.readException();
5125 boolean res = reply.readInt() != 0;
5126 data.recycle();
5127 reply.recycle();
5128 return res;
5129 }
5130
Dianne Hackborn1927ae82012-06-22 15:21:36 -07005131 public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException {
5132 Parcel data = Parcel.obtain();
5133 Parcel reply = Parcel.obtain();
5134 data.writeInterfaceToken(IActivityManager.descriptor);
5135 data.writeStrongBinder(sender.asBinder());
5136 mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0);
5137 reply.readException();
5138 boolean res = reply.readInt() != 0;
5139 data.recycle();
5140 reply.recycle();
5141 return res;
5142 }
5143
Dianne Hackborn81038902012-11-26 17:04:09 -08005144 public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException {
5145 Parcel data = Parcel.obtain();
5146 Parcel reply = Parcel.obtain();
5147 data.writeInterfaceToken(IActivityManager.descriptor);
5148 data.writeStrongBinder(sender.asBinder());
5149 mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5150 reply.readException();
5151 Intent res = reply.readInt() != 0
5152 ? Intent.CREATOR.createFromParcel(reply) : null;
5153 data.recycle();
5154 reply.recycle();
5155 return res;
5156 }
5157
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08005158 public String getTagForIntentSender(IIntentSender sender, String prefix)
5159 throws RemoteException {
5160 Parcel data = Parcel.obtain();
5161 Parcel reply = Parcel.obtain();
5162 data.writeInterfaceToken(IActivityManager.descriptor);
5163 data.writeStrongBinder(sender.asBinder());
5164 data.writeString(prefix);
5165 mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5166 reply.readException();
5167 String res = reply.readString();
5168 data.recycle();
5169 reply.recycle();
5170 return res;
5171 }
5172
Dianne Hackborn31ca8542011-07-19 14:58:28 -07005173 public void updatePersistentConfiguration(Configuration values) throws RemoteException
5174 {
5175 Parcel data = Parcel.obtain();
5176 Parcel reply = Parcel.obtain();
5177 data.writeInterfaceToken(IActivityManager.descriptor);
5178 values.writeToParcel(data, 0);
5179 mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0);
5180 reply.readException();
5181 data.recycle();
5182 reply.recycle();
5183 }
5184
Dianne Hackbornb437e092011-08-05 17:50:29 -07005185 public long[] getProcessPss(int[] pids) throws RemoteException {
5186 Parcel data = Parcel.obtain();
5187 Parcel reply = Parcel.obtain();
5188 data.writeInterfaceToken(IActivityManager.descriptor);
5189 data.writeIntArray(pids);
5190 mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0);
5191 reply.readException();
5192 long[] res = reply.createLongArray();
5193 data.recycle();
5194 reply.recycle();
5195 return res;
5196 }
5197
Dianne Hackborn661cd522011-08-22 00:26:20 -07005198 public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
5199 Parcel data = Parcel.obtain();
5200 Parcel reply = Parcel.obtain();
5201 data.writeInterfaceToken(IActivityManager.descriptor);
5202 TextUtils.writeToParcel(msg, data, 0);
5203 data.writeInt(always ? 1 : 0);
5204 mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
5205 reply.readException();
5206 data.recycle();
5207 reply.recycle();
5208 }
5209
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02005210 public void keyguardWaitingForActivityDrawn() throws RemoteException {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07005211 Parcel data = Parcel.obtain();
5212 Parcel reply = Parcel.obtain();
5213 data.writeInterfaceToken(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02005214 mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
Dianne Hackborn90c52de2011-09-23 12:57:44 -07005215 reply.readException();
5216 data.recycle();
5217 reply.recycle();
5218 }
5219
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07005220 public void keyguardGoingAway(boolean disableWindowAnimations,
5221 boolean keyguardGoingToNotificationShade) throws RemoteException {
5222 Parcel data = Parcel.obtain();
5223 Parcel reply = Parcel.obtain();
5224 data.writeInterfaceToken(IActivityManager.descriptor);
5225 data.writeInt(disableWindowAnimations ? 1 : 0);
5226 data.writeInt(keyguardGoingToNotificationShade ? 1 : 0);
5227 mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0);
5228 reply.readException();
5229 data.recycle();
5230 reply.recycle();
5231 }
5232
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07005233 public boolean shouldUpRecreateTask(IBinder token, String destAffinity)
Adam Powelldd8fab22012-03-22 17:47:27 -07005234 throws RemoteException {
5235 Parcel data = Parcel.obtain();
5236 Parcel reply = Parcel.obtain();
5237 data.writeInterfaceToken(IActivityManager.descriptor);
5238 data.writeStrongBinder(token);
5239 data.writeString(destAffinity);
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07005240 mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0);
Adam Powelldd8fab22012-03-22 17:47:27 -07005241 reply.readException();
5242 boolean result = reply.readInt() != 0;
5243 data.recycle();
5244 reply.recycle();
5245 return result;
5246 }
5247
5248 public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData)
5249 throws RemoteException {
5250 Parcel data = Parcel.obtain();
5251 Parcel reply = Parcel.obtain();
5252 data.writeInterfaceToken(IActivityManager.descriptor);
5253 data.writeStrongBinder(token);
5254 target.writeToParcel(data, 0);
5255 data.writeInt(resultCode);
5256 if (resultData != null) {
5257 data.writeInt(1);
5258 resultData.writeToParcel(data, 0);
5259 } else {
5260 data.writeInt(0);
5261 }
5262 mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0);
5263 reply.readException();
5264 boolean result = reply.readInt() != 0;
5265 data.recycle();
5266 reply.recycle();
5267 return result;
5268 }
5269
Dianne Hackborn5320eb82012-05-18 12:05:04 -07005270 public int getLaunchedFromUid(IBinder activityToken) throws RemoteException {
5271 Parcel data = Parcel.obtain();
5272 Parcel reply = Parcel.obtain();
5273 data.writeInterfaceToken(IActivityManager.descriptor);
5274 data.writeStrongBinder(activityToken);
5275 mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0);
5276 reply.readException();
5277 int result = reply.readInt();
5278 data.recycle();
5279 reply.recycle();
5280 return result;
5281 }
5282
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005283 public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException {
5284 Parcel data = Parcel.obtain();
5285 Parcel reply = Parcel.obtain();
5286 data.writeInterfaceToken(IActivityManager.descriptor);
5287 data.writeStrongBinder(activityToken);
5288 mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0);
5289 reply.readException();
5290 String result = reply.readString();
5291 data.recycle();
5292 reply.recycle();
5293 return result;
5294 }
5295
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07005296 public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5297 Parcel data = Parcel.obtain();
5298 Parcel reply = Parcel.obtain();
5299 data.writeInterfaceToken(IActivityManager.descriptor);
5300 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5301 mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5302 reply.readException();
5303 data.recycle();
5304 reply.recycle();
5305 }
5306
5307 public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5308 Parcel data = Parcel.obtain();
5309 Parcel reply = Parcel.obtain();
5310 data.writeInterfaceToken(IActivityManager.descriptor);
5311 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5312 mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5313 reply.readException();
5314 data.recycle();
5315 reply.recycle();
5316 }
5317
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07005318 public void requestBugReport() throws RemoteException {
5319 Parcel data = Parcel.obtain();
5320 Parcel reply = Parcel.obtain();
5321 data.writeInterfaceToken(IActivityManager.descriptor);
5322 mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0);
5323 reply.readException();
5324 data.recycle();
5325 reply.recycle();
5326 }
5327
Jeff Brownbd181bb2013-09-10 16:44:24 -07005328 public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason)
5329 throws RemoteException {
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005330 Parcel data = Parcel.obtain();
5331 Parcel reply = Parcel.obtain();
5332 data.writeInterfaceToken(IActivityManager.descriptor);
5333 data.writeInt(pid);
5334 data.writeInt(aboveSystem ? 1 : 0);
Jeff Brownbd181bb2013-09-10 16:44:24 -07005335 data.writeString(reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005336 mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0);
5337 reply.readException();
5338 long res = reply.readInt();
5339 data.recycle();
5340 reply.recycle();
5341 return res;
5342 }
5343
Adam Skorydfc7fd72013-08-05 19:23:41 -07005344 public Bundle getAssistContextExtras(int requestType) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005345 Parcel data = Parcel.obtain();
5346 Parcel reply = Parcel.obtain();
5347 data.writeInterfaceToken(IActivityManager.descriptor);
5348 data.writeInt(requestType);
Adam Skorydfc7fd72013-08-05 19:23:41 -07005349 mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005350 reply.readException();
5351 Bundle res = reply.readBundle();
5352 data.recycle();
5353 reply.recycle();
5354 return res;
5355 }
5356
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005357 public void requestAssistContextExtras(int requestType, IResultReceiver receiver)
5358 throws RemoteException {
5359 Parcel data = Parcel.obtain();
5360 Parcel reply = Parcel.obtain();
5361 data.writeInterfaceToken(IActivityManager.descriptor);
5362 data.writeInt(requestType);
5363 data.writeStrongBinder(receiver.asBinder());
5364 mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
5365 reply.readException();
5366 data.recycle();
5367 reply.recycle();
5368 }
5369
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07005370 public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure,
Dianne Hackborna3acdb32015-06-08 17:07:40 -07005371 AssistContent content, Uri referrer) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005372 Parcel data = Parcel.obtain();
5373 Parcel reply = Parcel.obtain();
5374 data.writeInterfaceToken(IActivityManager.descriptor);
5375 data.writeStrongBinder(token);
5376 data.writeBundle(extras);
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07005377 structure.writeToParcel(data, 0);
5378 content.writeToParcel(data, 0);
Dianne Hackborna3acdb32015-06-08 17:07:40 -07005379 if (referrer != null) {
5380 data.writeInt(1);
5381 referrer.writeToParcel(data, 0);
5382 } else {
5383 data.writeInt(0);
5384 }
Adam Skorydfc7fd72013-08-05 19:23:41 -07005385 mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005386 reply.readException();
5387 data.recycle();
5388 reply.recycle();
5389 }
5390
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07005391 public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle,
5392 Bundle args) throws RemoteException {
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07005393 Parcel data = Parcel.obtain();
5394 Parcel reply = Parcel.obtain();
5395 data.writeInterfaceToken(IActivityManager.descriptor);
5396 intent.writeToParcel(data, 0);
5397 data.writeInt(requestType);
5398 data.writeString(hint);
5399 data.writeInt(userHandle);
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07005400 data.writeBundle(args);
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07005401 mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0);
5402 reply.readException();
5403 boolean res = reply.readInt() != 0;
5404 data.recycle();
5405 reply.recycle();
5406 return res;
5407 }
5408
Dianne Hackbornf1b78242013-04-08 22:28:59 -07005409 public void killUid(int uid, String reason) throws RemoteException {
5410 Parcel data = Parcel.obtain();
5411 Parcel reply = Parcel.obtain();
5412 data.writeInterfaceToken(IActivityManager.descriptor);
5413 data.writeInt(uid);
5414 data.writeString(reason);
5415 mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0);
5416 reply.readException();
5417 data.recycle();
5418 reply.recycle();
5419 }
5420
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07005421 public void hang(IBinder who, boolean allowRestart) throws RemoteException {
5422 Parcel data = Parcel.obtain();
5423 Parcel reply = Parcel.obtain();
5424 data.writeInterfaceToken(IActivityManager.descriptor);
5425 data.writeStrongBinder(who);
5426 data.writeInt(allowRestart ? 1 : 0);
5427 mRemote.transact(HANG_TRANSACTION, data, reply, 0);
5428 reply.readException();
5429 data.recycle();
5430 reply.recycle();
5431 }
5432
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07005433 public void reportActivityFullyDrawn(IBinder token) throws RemoteException {
5434 Parcel data = Parcel.obtain();
5435 Parcel reply = Parcel.obtain();
5436 data.writeInterfaceToken(IActivityManager.descriptor);
5437 data.writeStrongBinder(token);
5438 mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0);
5439 reply.readException();
5440 data.recycle();
5441 reply.recycle();
5442 }
5443
Craig Mautner5eda9b32013-07-02 11:58:16 -07005444 public void notifyActivityDrawn(IBinder token) throws RemoteException {
5445 Parcel data = Parcel.obtain();
5446 Parcel reply = Parcel.obtain();
5447 data.writeInterfaceToken(IActivityManager.descriptor);
5448 data.writeStrongBinder(token);
5449 mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
5450 reply.readException();
5451 data.recycle();
5452 reply.recycle();
5453 }
5454
Dianne Hackborn57a7f592013-07-22 18:21:32 -07005455 public void restart() throws RemoteException {
5456 Parcel data = Parcel.obtain();
5457 Parcel reply = Parcel.obtain();
5458 data.writeInterfaceToken(IActivityManager.descriptor);
5459 mRemote.transact(RESTART_TRANSACTION, data, reply, 0);
5460 reply.readException();
5461 data.recycle();
5462 reply.recycle();
5463 }
5464
Dianne Hackborn35f72be2013-09-16 10:57:39 -07005465 public void performIdleMaintenance() throws RemoteException {
5466 Parcel data = Parcel.obtain();
5467 Parcel reply = Parcel.obtain();
5468 data.writeInterfaceToken(IActivityManager.descriptor);
5469 mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0);
5470 reply.readException();
5471 data.recycle();
5472 reply.recycle();
5473 }
5474
Todd Kennedyca4d8422015-01-15 15:19:22 -08005475 public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken,
Craig Mautner4a1cb222013-12-04 16:14:06 -08005476 IActivityContainerCallback callback) throws RemoteException {
5477 Parcel data = Parcel.obtain();
5478 Parcel reply = Parcel.obtain();
5479 data.writeInterfaceToken(IActivityManager.descriptor);
5480 data.writeStrongBinder(parentActivityToken);
Craig Mautnere3a00d72014-04-16 08:31:19 -07005481 data.writeStrongBinder(callback == null ? null : callback.asBinder());
Todd Kennedyca4d8422015-01-15 15:19:22 -08005482 mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
Craig Mautner4a1cb222013-12-04 16:14:06 -08005483 reply.readException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08005484 final int result = reply.readInt();
5485 final IActivityContainer res;
5486 if (result == 1) {
5487 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5488 } else {
5489 res = null;
5490 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08005491 data.recycle();
5492 reply.recycle();
5493 return res;
5494 }
5495
Craig Mautner95da1082014-02-24 17:54:35 -08005496 public void deleteActivityContainer(IActivityContainer activityContainer)
5497 throws RemoteException {
5498 Parcel data = Parcel.obtain();
5499 Parcel reply = Parcel.obtain();
5500 data.writeInterfaceToken(IActivityManager.descriptor);
5501 data.writeStrongBinder(activityContainer.asBinder());
5502 mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
5503 reply.readException();
5504 data.recycle();
5505 reply.recycle();
5506 }
5507
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005508 @Override
Todd Kennedy4900bf92015-01-16 16:05:14 -08005509 public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException {
5510 Parcel data = Parcel.obtain();
5511 Parcel reply = Parcel.obtain();
5512 data.writeInterfaceToken(IActivityManager.descriptor);
5513 data.writeInt(displayId);
5514 mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0);
5515 reply.readException();
5516 final int result = reply.readInt();
5517 final IActivityContainer res;
5518 if (result == 1) {
5519 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5520 } else {
5521 res = null;
5522 }
5523 data.recycle();
5524 reply.recycle();
5525 return res;
5526 }
5527
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005528 @Override
5529 public int getActivityDisplayId(IBinder activityToken)
Craig Mautnere0a38842013-12-16 16:14:02 -08005530 throws RemoteException {
5531 Parcel data = Parcel.obtain();
5532 Parcel reply = Parcel.obtain();
5533 data.writeInterfaceToken(IActivityManager.descriptor);
5534 data.writeStrongBinder(activityToken);
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005535 mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0);
Craig Mautnere0a38842013-12-16 16:14:02 -08005536 reply.readException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005537 final int displayId = reply.readInt();
Craig Mautnere0a38842013-12-16 16:14:02 -08005538 data.recycle();
5539 reply.recycle();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005540 return displayId;
Craig Mautnere0a38842013-12-16 16:14:02 -08005541 }
5542
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005543 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005544 public void startLockTaskMode(int taskId) throws RemoteException {
5545 Parcel data = Parcel.obtain();
5546 Parcel reply = Parcel.obtain();
5547 data.writeInterfaceToken(IActivityManager.descriptor);
5548 data.writeInt(taskId);
5549 mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0);
5550 reply.readException();
5551 data.recycle();
5552 reply.recycle();
5553 }
5554
5555 @Override
5556 public void startLockTaskMode(IBinder token) throws RemoteException {
5557 Parcel data = Parcel.obtain();
5558 Parcel reply = Parcel.obtain();
5559 data.writeInterfaceToken(IActivityManager.descriptor);
5560 data.writeStrongBinder(token);
5561 mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0);
5562 reply.readException();
5563 data.recycle();
5564 reply.recycle();
5565 }
5566
5567 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005568 public void startLockTaskModeOnCurrent() throws RemoteException {
5569 Parcel data = Parcel.obtain();
5570 Parcel reply = Parcel.obtain();
5571 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005572 mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005573 reply.readException();
5574 data.recycle();
5575 reply.recycle();
5576 }
5577
5578 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005579 public void stopLockTaskMode() throws RemoteException {
5580 Parcel data = Parcel.obtain();
5581 Parcel reply = Parcel.obtain();
5582 data.writeInterfaceToken(IActivityManager.descriptor);
5583 mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5584 reply.readException();
5585 data.recycle();
5586 reply.recycle();
5587 }
5588
5589 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005590 public void stopLockTaskModeOnCurrent() throws RemoteException {
5591 Parcel data = Parcel.obtain();
5592 Parcel reply = Parcel.obtain();
5593 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005594 mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005595 reply.readException();
5596 data.recycle();
5597 reply.recycle();
5598 }
5599
5600 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005601 public boolean isInLockTaskMode() throws RemoteException {
5602 Parcel data = Parcel.obtain();
5603 Parcel reply = Parcel.obtain();
5604 data.writeInterfaceToken(IActivityManager.descriptor);
5605 mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5606 reply.readException();
5607 boolean isInLockTaskMode = reply.readInt() == 1;
5608 data.recycle();
5609 reply.recycle();
5610 return isInLockTaskMode;
5611 }
5612
Craig Mautner688b5102014-03-27 16:55:03 -07005613 @Override
Benjamin Franz43261142015-02-11 15:59:44 +00005614 public int getLockTaskModeState() throws RemoteException {
5615 Parcel data = Parcel.obtain();
5616 Parcel reply = Parcel.obtain();
5617 data.writeInterfaceToken(IActivityManager.descriptor);
5618 mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0);
5619 reply.readException();
5620 int lockTaskModeState = reply.readInt();
5621 data.recycle();
5622 reply.recycle();
5623 return lockTaskModeState;
5624 }
5625
5626 @Override
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07005627 public void showLockTaskEscapeMessage(IBinder token) throws RemoteException {
5628 Parcel data = Parcel.obtain();
5629 Parcel reply = Parcel.obtain();
5630 data.writeInterfaceToken(IActivityManager.descriptor);
5631 data.writeStrongBinder(token);
5632 mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply,
5633 IBinder.FLAG_ONEWAY);
5634 reply.readException();
5635 data.recycle();
5636 reply.recycle();
5637 }
5638
5639 @Override
Winson Chunga449dc02014-05-16 11:15:04 -07005640 public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values)
Winson Chung03a9bae2014-05-02 09:56:12 -07005641 throws RemoteException {
Craig Mautner2fbd7542014-03-21 09:34:07 -07005642 Parcel data = Parcel.obtain();
5643 Parcel reply = Parcel.obtain();
5644 data.writeInterfaceToken(IActivityManager.descriptor);
5645 data.writeStrongBinder(token);
Winson Chung03a9bae2014-05-02 09:56:12 -07005646 values.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005647 mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0);
Craig Mautner2fbd7542014-03-21 09:34:07 -07005648 reply.readException();
5649 data.recycle();
5650 reply.recycle();
5651 }
5652
Craig Mautneree2e45a2014-06-27 12:10:03 -07005653 @Override
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08005654 public void setTaskResizeable(int taskId, boolean resizeable) throws RemoteException {
5655 Parcel data = Parcel.obtain();
5656 Parcel reply = Parcel.obtain();
5657 data.writeInterfaceToken(IActivityManager.descriptor);
5658 data.writeInt(taskId);
5659 data.writeInt(resizeable ? 1 : 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005660 mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0);
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08005661 reply.readException();
5662 data.recycle();
5663 reply.recycle();
5664 }
5665
5666 @Override
Wale Ogunwale53a29a92015-02-23 15:42:52 -08005667 public void resizeTask(int taskId, Rect r) throws RemoteException
5668 {
5669 Parcel data = Parcel.obtain();
5670 Parcel reply = Parcel.obtain();
5671 data.writeInterfaceToken(IActivityManager.descriptor);
5672 data.writeInt(taskId);
5673 r.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005674 mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08005675 reply.readException();
5676 data.recycle();
5677 reply.recycle();
5678 }
5679
5680 @Override
Craig Mautner648f69b2014-09-18 14:16:26 -07005681 public Bitmap getTaskDescriptionIcon(String filename) throws RemoteException {
5682 Parcel data = Parcel.obtain();
5683 Parcel reply = Parcel.obtain();
5684 data.writeInterfaceToken(IActivityManager.descriptor);
5685 data.writeString(filename);
5686 mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0);
5687 reply.readException();
5688 final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply);
5689 data.recycle();
5690 reply.recycle();
5691 return icon;
5692 }
5693
5694 @Override
Winson Chung044d5292014-11-06 11:05:19 -08005695 public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options)
5696 throws RemoteException {
5697 Parcel data = Parcel.obtain();
5698 Parcel reply = Parcel.obtain();
5699 data.writeInterfaceToken(IActivityManager.descriptor);
5700 if (options == null) {
5701 data.writeInt(0);
5702 } else {
5703 data.writeInt(1);
5704 data.writeBundle(options.toBundle());
5705 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07005706 mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0);
Winson Chung044d5292014-11-06 11:05:19 -08005707 reply.readException();
5708 data.recycle();
5709 reply.recycle();
5710 }
5711
5712 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005713 public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005714 Parcel data = Parcel.obtain();
5715 Parcel reply = Parcel.obtain();
5716 data.writeInterfaceToken(IActivityManager.descriptor);
5717 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07005718 data.writeInt(visible ? 1 : 0);
5719 mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005720 reply.readException();
5721 boolean success = reply.readInt() > 0;
5722 data.recycle();
5723 reply.recycle();
5724 return success;
5725 }
5726
5727 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005728 public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005729 Parcel data = Parcel.obtain();
5730 Parcel reply = Parcel.obtain();
5731 data.writeInterfaceToken(IActivityManager.descriptor);
5732 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07005733 mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005734 reply.readException();
Jose Lima4b6c6692014-08-12 17:41:12 -07005735 final boolean visible = reply.readInt() > 0;
Craig Mautneree2e45a2014-06-27 12:10:03 -07005736 data.recycle();
5737 reply.recycle();
Jose Lima4b6c6692014-08-12 17:41:12 -07005738 return visible;
Craig Mautneree2e45a2014-06-27 12:10:03 -07005739 }
5740
5741 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005742 public void backgroundResourcesReleased(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005743 Parcel data = Parcel.obtain();
5744 Parcel reply = Parcel.obtain();
5745 data.writeInterfaceToken(IActivityManager.descriptor);
5746 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005747 mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0);
Craig Mautnerbb742462014-07-07 15:28:55 -07005748 reply.readException();
5749 data.recycle();
5750 reply.recycle();
5751 }
5752
5753 @Override
5754 public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException {
5755 Parcel data = Parcel.obtain();
5756 Parcel reply = Parcel.obtain();
5757 data.writeInterfaceToken(IActivityManager.descriptor);
5758 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005759 mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005760 reply.readException();
5761 data.recycle();
5762 reply.recycle();
5763 }
5764
Craig Mautner8746a472014-07-24 15:12:54 -07005765 @Override
5766 public void notifyEnterAnimationComplete(IBinder token) throws RemoteException {
5767 Parcel data = Parcel.obtain();
5768 Parcel reply = Parcel.obtain();
5769 data.writeInterfaceToken(IActivityManager.descriptor);
5770 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005771 mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautner8746a472014-07-24 15:12:54 -07005772 reply.readException();
5773 data.recycle();
5774 reply.recycle();
5775 }
5776
Craig Mautner6e2f3952014-09-09 14:26:41 -07005777 @Override
5778 public void bootAnimationComplete() throws RemoteException {
5779 Parcel data = Parcel.obtain();
5780 Parcel reply = Parcel.obtain();
5781 data.writeInterfaceToken(IActivityManager.descriptor);
5782 mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
5783 reply.readException();
5784 data.recycle();
5785 reply.recycle();
5786 }
5787
Wale Ogunwale18795a22014-12-03 11:38:33 -08005788 @Override
Jeff Sharkey605eb792014-11-04 13:34:06 -08005789 public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException {
5790 Parcel data = Parcel.obtain();
5791 Parcel reply = Parcel.obtain();
5792 data.writeInterfaceToken(IActivityManager.descriptor);
5793 data.writeInt(uid);
5794 data.writeByteArray(firstPacket);
5795 mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0);
5796 reply.readException();
5797 data.recycle();
5798 reply.recycle();
5799 }
5800
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005801 @Override
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07005802 public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize,
5803 String reportPackage) throws RemoteException {
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005804 Parcel data = Parcel.obtain();
5805 Parcel reply = Parcel.obtain();
5806 data.writeInterfaceToken(IActivityManager.descriptor);
5807 data.writeString(processName);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07005808 data.writeInt(uid);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005809 data.writeLong(maxMemSize);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07005810 data.writeString(reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005811 mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0);
5812 reply.readException();
5813 data.recycle();
5814 reply.recycle();
5815 }
5816
5817 @Override
5818 public void dumpHeapFinished(String path) throws RemoteException {
5819 Parcel data = Parcel.obtain();
5820 Parcel reply = Parcel.obtain();
5821 data.writeInterfaceToken(IActivityManager.descriptor);
5822 data.writeString(path);
5823 mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0);
5824 reply.readException();
5825 data.recycle();
5826 reply.recycle();
5827 }
5828
Dianne Hackborn3d07c942015-03-13 18:02:54 -07005829 @Override
5830 public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake)
5831 throws RemoteException {
5832 Parcel data = Parcel.obtain();
5833 Parcel reply = Parcel.obtain();
5834 data.writeInterfaceToken(IActivityManager.descriptor);
5835 data.writeStrongBinder(session.asBinder());
5836 data.writeInt(keepAwake ? 1 : 0);
5837 mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0);
5838 reply.readException();
5839 data.recycle();
5840 reply.recycle();
5841 }
5842
Craig Mautnere5600772015-04-03 21:36:37 -07005843 @Override
5844 public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException {
5845 Parcel data = Parcel.obtain();
5846 Parcel reply = Parcel.obtain();
5847 data.writeInterfaceToken(IActivityManager.descriptor);
5848 data.writeInt(userId);
5849 data.writeStringArray(packages);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005850 mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0);
Craig Mautnere5600772015-04-03 21:36:37 -07005851 reply.readException();
5852 data.recycle();
5853 reply.recycle();
5854 }
5855
Dianne Hackborn1e383822015-04-10 14:02:33 -07005856 @Override
Craig Mautner015c5e52015-04-23 10:39:39 -07005857 public void updateDeviceOwner(String packageName) throws RemoteException {
5858 Parcel data = Parcel.obtain();
5859 Parcel reply = Parcel.obtain();
5860 data.writeInterfaceToken(IActivityManager.descriptor);
5861 data.writeString(packageName);
5862 mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0);
5863 reply.readException();
5864 data.recycle();
5865 reply.recycle();
5866 }
5867
5868 @Override
Dianne Hackborn1e383822015-04-10 14:02:33 -07005869 public int getPackageProcessState(String packageName) throws RemoteException {
5870 Parcel data = Parcel.obtain();
5871 Parcel reply = Parcel.obtain();
5872 data.writeInterfaceToken(IActivityManager.descriptor);
5873 data.writeString(packageName);
5874 mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0);
5875 reply.readException();
5876 int res = reply.readInt();
5877 data.recycle();
5878 reply.recycle();
5879 return res;
5880 }
5881
Stefan Kuhne16045c22015-06-05 07:18:06 -07005882 @Override
5883 public boolean setProcessMemoryTrimLevel(String process, int userId, int level)
5884 throws RemoteException {
5885 Parcel data = Parcel.obtain();
5886 Parcel reply = Parcel.obtain();
5887 data.writeInterfaceToken(IActivityManager.descriptor);
5888 data.writeString(process);
5889 data.writeInt(userId);
5890 data.writeInt(level);
5891 mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0);
5892 reply.readException();
5893 int res = reply.readInt();
5894 data.recycle();
5895 reply.recycle();
5896 return res != 0;
5897 }
5898
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005899 private IBinder mRemote;
5900}