blob: bfb92c4079ead0fbd1c2f02dcc7d85d15ce1f8a5 [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,
Dianne Hackborna750a632015-06-16 17:18:23 -0700111 null /*permission*/, appOp, null, 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;
Dianne Hackborna7cfbe02015-07-16 10:52:52 -0700209 boolean ignoreTargetSecurity = data.readInt() != 0;
Jeff Sharkey97978802014-10-14 10:48:18 -0700210 int userId = data.readInt();
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700211 int result = startActivityAsCaller(app, callingPackage, intent, resolvedType,
Dianne Hackborna7cfbe02015-07-16 10:52:52 -0700212 resultTo, resultWho, requestCode, startFlags, profilerInfo, options,
213 ignoreTargetSecurity, userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700214 reply.writeNoException();
215 reply.writeInt(result);
216 return true;
217 }
218
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800219 case START_ACTIVITY_AND_WAIT_TRANSACTION:
220 {
221 data.enforceInterface(IActivityManager.descriptor);
222 IBinder b = data.readStrongBinder();
223 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800224 String callingPackage = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800225 Intent intent = Intent.CREATOR.createFromParcel(data);
226 String resolvedType = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800227 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800228 String resultWho = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800229 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700230 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700231 ProfilerInfo profilerInfo = data.readInt() != 0
232 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700233 Bundle options = data.readInt() != 0
234 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -0700235 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800236 WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700237 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800238 reply.writeNoException();
239 result.writeToParcel(reply, 0);
240 return true;
241 }
242
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700243 case START_ACTIVITY_WITH_CONFIG_TRANSACTION:
244 {
245 data.enforceInterface(IActivityManager.descriptor);
246 IBinder b = data.readStrongBinder();
247 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800248 String callingPackage = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700249 Intent intent = Intent.CREATOR.createFromParcel(data);
250 String resolvedType = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700251 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700252 String resultWho = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700253 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700254 int startFlags = data.readInt();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700255 Configuration config = Configuration.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700256 Bundle options = data.readInt() != 0
257 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -0700258 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800259 int result = startActivityWithConfig(app, callingPackage, intent, resolvedType,
Dianne Hackborn41203752012-08-31 14:05:51 -0700260 resultTo, resultWho, requestCode, startFlags, config, options, userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700261 reply.writeNoException();
262 reply.writeInt(result);
263 return true;
264 }
265
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700266 case START_ACTIVITY_INTENT_SENDER_TRANSACTION:
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700267 {
268 data.enforceInterface(IActivityManager.descriptor);
269 IBinder b = data.readStrongBinder();
270 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700271 IntentSender intent = IntentSender.CREATOR.createFromParcel(data);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700272 Intent fillInIntent = null;
273 if (data.readInt() != 0) {
274 fillInIntent = Intent.CREATOR.createFromParcel(data);
275 }
276 String resolvedType = data.readString();
277 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700278 String resultWho = data.readString();
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700279 int requestCode = data.readInt();
280 int flagsMask = data.readInt();
281 int flagsValues = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700282 Bundle options = data.readInt() != 0
283 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700284 int result = startActivityIntentSender(app, intent,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700285 fillInIntent, resolvedType, resultTo, resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700286 requestCode, flagsMask, flagsValues, options);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700287 reply.writeNoException();
288 reply.writeInt(result);
289 return true;
290 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700291
Dianne Hackborn91097de2014-04-04 18:02:06 -0700292 case START_VOICE_ACTIVITY_TRANSACTION:
293 {
294 data.enforceInterface(IActivityManager.descriptor);
295 String callingPackage = data.readString();
296 int callingPid = data.readInt();
297 int callingUid = data.readInt();
298 Intent intent = Intent.CREATOR.createFromParcel(data);
299 String resolvedType = data.readString();
300 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
301 data.readStrongBinder());
302 IVoiceInteractor interactor = IVoiceInteractor.Stub.asInterface(
303 data.readStrongBinder());
304 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700305 ProfilerInfo profilerInfo = data.readInt() != 0
306 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborn91097de2014-04-04 18:02:06 -0700307 Bundle options = data.readInt() != 0
308 ? Bundle.CREATOR.createFromParcel(data) : null;
309 int userId = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700310 int result = startVoiceActivity(callingPackage, callingPid, callingUid, intent,
311 resolvedType, session, interactor, startFlags, profilerInfo, options, userId);
Dianne Hackborn91097de2014-04-04 18:02:06 -0700312 reply.writeNoException();
313 reply.writeInt(result);
314 return true;
315 }
316
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800317 case START_NEXT_MATCHING_ACTIVITY_TRANSACTION:
318 {
319 data.enforceInterface(IActivityManager.descriptor);
320 IBinder callingActivity = data.readStrongBinder();
321 Intent intent = Intent.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700322 Bundle options = data.readInt() != 0
323 ? Bundle.CREATOR.createFromParcel(data) : null;
324 boolean result = startNextMatchingActivity(callingActivity, intent, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800325 reply.writeNoException();
326 reply.writeInt(result ? 1 : 0);
327 return true;
328 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700329
Craig Mautnerdc00cbe2014-07-20 17:48:47 -0700330 case START_ACTIVITY_FROM_RECENTS_TRANSACTION:
331 {
332 data.enforceInterface(IActivityManager.descriptor);
333 int taskId = data.readInt();
334 Bundle options = data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data);
335 int result = startActivityFromRecents(taskId, options);
336 reply.writeNoException();
337 reply.writeInt(result);
338 return true;
339 }
340
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800341 case FINISH_ACTIVITY_TRANSACTION: {
342 data.enforceInterface(IActivityManager.descriptor);
343 IBinder token = data.readStrongBinder();
344 Intent resultData = null;
345 int resultCode = data.readInt();
346 if (data.readInt() != 0) {
347 resultData = Intent.CREATOR.createFromParcel(data);
348 }
Winson Chung3b3f4642014-04-22 10:08:18 -0700349 boolean finishTask = (data.readInt() != 0);
350 boolean res = finishActivity(token, resultCode, resultData, finishTask);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800351 reply.writeNoException();
352 reply.writeInt(res ? 1 : 0);
353 return true;
354 }
355
356 case FINISH_SUB_ACTIVITY_TRANSACTION: {
357 data.enforceInterface(IActivityManager.descriptor);
358 IBinder token = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700359 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800360 int requestCode = data.readInt();
361 finishSubActivity(token, resultWho, requestCode);
362 reply.writeNoException();
363 return true;
364 }
365
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700366 case FINISH_ACTIVITY_AFFINITY_TRANSACTION: {
367 data.enforceInterface(IActivityManager.descriptor);
368 IBinder token = data.readStrongBinder();
369 boolean res = finishActivityAffinity(token);
370 reply.writeNoException();
371 reply.writeInt(res ? 1 : 0);
372 return true;
373 }
374
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -0700375 case FINISH_VOICE_TASK_TRANSACTION: {
376 data.enforceInterface(IActivityManager.descriptor);
377 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
378 data.readStrongBinder());
379 finishVoiceTask(session);
380 reply.writeNoException();
381 return true;
382 }
383
Dianne Hackborn89ad4562014-08-24 16:45:38 -0700384 case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: {
385 data.enforceInterface(IActivityManager.descriptor);
386 IBinder token = data.readStrongBinder();
387 boolean res = releaseActivityInstance(token);
388 reply.writeNoException();
389 reply.writeInt(res ? 1 : 0);
390 return true;
391 }
392
393 case RELEASE_SOME_ACTIVITIES_TRANSACTION: {
394 data.enforceInterface(IActivityManager.descriptor);
395 IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder());
396 releaseSomeActivities(app);
397 reply.writeNoException();
398 return true;
399 }
400
Dianne Hackborn061d58a2010-03-12 15:07:06 -0800401 case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: {
402 data.enforceInterface(IActivityManager.descriptor);
403 IBinder token = data.readStrongBinder();
404 boolean res = willActivityBeVisible(token);
405 reply.writeNoException();
406 reply.writeInt(res ? 1 : 0);
407 return true;
408 }
409
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800410 case REGISTER_RECEIVER_TRANSACTION:
411 {
412 data.enforceInterface(IActivityManager.descriptor);
413 IBinder b = data.readStrongBinder();
414 IApplicationThread app =
415 b != null ? ApplicationThreadNative.asInterface(b) : null;
Dianne Hackborn6c418d52011-06-29 14:05:33 -0700416 String packageName = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800417 b = data.readStrongBinder();
418 IIntentReceiver rec
419 = b != null ? IIntentReceiver.Stub.asInterface(b) : null;
420 IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data);
421 String perm = data.readString();
Dianne Hackborn20e80982012-08-31 19:00:44 -0700422 int userId = data.readInt();
423 Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800424 reply.writeNoException();
425 if (intent != null) {
426 reply.writeInt(1);
427 intent.writeToParcel(reply, 0);
428 } else {
429 reply.writeInt(0);
430 }
431 return true;
432 }
433
434 case UNREGISTER_RECEIVER_TRANSACTION:
435 {
436 data.enforceInterface(IActivityManager.descriptor);
437 IBinder b = data.readStrongBinder();
438 if (b == null) {
439 return true;
440 }
441 IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b);
442 unregisterReceiver(rec);
443 reply.writeNoException();
444 return true;
445 }
446
447 case BROADCAST_INTENT_TRANSACTION:
448 {
449 data.enforceInterface(IActivityManager.descriptor);
450 IBinder b = data.readStrongBinder();
451 IApplicationThread app =
452 b != null ? ApplicationThreadNative.asInterface(b) : null;
453 Intent intent = Intent.CREATOR.createFromParcel(data);
454 String resolvedType = data.readString();
455 b = data.readStrongBinder();
456 IIntentReceiver resultTo =
457 b != null ? IIntentReceiver.Stub.asInterface(b) : null;
458 int resultCode = data.readInt();
459 String resultData = data.readString();
460 Bundle resultExtras = data.readBundle();
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -0700461 String[] perms = data.readStringArray();
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800462 int appOp = data.readInt();
Dianne Hackborna750a632015-06-16 17:18:23 -0700463 Bundle options = data.readBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800464 boolean serialized = data.readInt() != 0;
465 boolean sticky = data.readInt() != 0;
Amith Yamasani742a6712011-05-04 14:49:28 -0700466 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800467 int res = broadcastIntent(app, intent, resolvedType, resultTo,
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -0700468 resultCode, resultData, resultExtras, perms, appOp,
Dianne Hackborna750a632015-06-16 17:18:23 -0700469 options, serialized, sticky, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800470 reply.writeNoException();
471 reply.writeInt(res);
472 return true;
473 }
474
475 case UNBROADCAST_INTENT_TRANSACTION:
476 {
477 data.enforceInterface(IActivityManager.descriptor);
478 IBinder b = data.readStrongBinder();
479 IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null;
480 Intent intent = Intent.CREATOR.createFromParcel(data);
Amith Yamasani742a6712011-05-04 14:49:28 -0700481 int userId = data.readInt();
482 unbroadcastIntent(app, intent, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800483 reply.writeNoException();
484 return true;
485 }
486
487 case FINISH_RECEIVER_TRANSACTION: {
488 data.enforceInterface(IActivityManager.descriptor);
489 IBinder who = data.readStrongBinder();
490 int resultCode = data.readInt();
491 String resultData = data.readString();
492 Bundle resultExtras = data.readBundle();
493 boolean resultAbort = data.readInt() != 0;
riddle_hsu1f5ac4d2015-01-03 15:38:21 +0800494 int intentFlags = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800495 if (who != null) {
riddle_hsu1f5ac4d2015-01-03 15:38:21 +0800496 finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800497 }
498 reply.writeNoException();
499 return true;
500 }
501
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800502 case ATTACH_APPLICATION_TRANSACTION: {
503 data.enforceInterface(IActivityManager.descriptor);
504 IApplicationThread app = ApplicationThreadNative.asInterface(
505 data.readStrongBinder());
506 if (app != null) {
507 attachApplication(app);
508 }
509 reply.writeNoException();
510 return true;
511 }
512
513 case ACTIVITY_IDLE_TRANSACTION: {
514 data.enforceInterface(IActivityManager.descriptor);
515 IBinder token = data.readStrongBinder();
Dianne Hackborne88846e2009-09-30 21:34:25 -0700516 Configuration config = null;
517 if (data.readInt() != 0) {
518 config = Configuration.CREATOR.createFromParcel(data);
519 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700520 boolean stopProfiling = data.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800521 if (token != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700522 activityIdle(token, config, stopProfiling);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800523 }
524 reply.writeNoException();
525 return true;
526 }
527
Dianne Hackbornad9b32112012-09-17 15:35:01 -0700528 case ACTIVITY_RESUMED_TRANSACTION: {
529 data.enforceInterface(IActivityManager.descriptor);
530 IBinder token = data.readStrongBinder();
531 activityResumed(token);
532 reply.writeNoException();
533 return true;
534 }
535
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800536 case ACTIVITY_PAUSED_TRANSACTION: {
537 data.enforceInterface(IActivityManager.descriptor);
538 IBinder token = data.readStrongBinder();
Dianne Hackborna4e102e2014-09-04 22:52:27 -0700539 activityPaused(token);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800540 reply.writeNoException();
541 return true;
542 }
543
544 case ACTIVITY_STOPPED_TRANSACTION: {
545 data.enforceInterface(IActivityManager.descriptor);
546 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800547 Bundle map = data.readBundle();
Craig Mautnera0026042014-04-23 11:45:37 -0700548 PersistableBundle persistentState = data.readPersistableBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800549 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
Craig Mautnera0026042014-04-23 11:45:37 -0700550 activityStopped(token, map, persistentState, description);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800551 reply.writeNoException();
552 return true;
553 }
554
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800555 case ACTIVITY_SLEPT_TRANSACTION: {
556 data.enforceInterface(IActivityManager.descriptor);
557 IBinder token = data.readStrongBinder();
558 activitySlept(token);
559 reply.writeNoException();
560 return true;
561 }
562
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800563 case ACTIVITY_DESTROYED_TRANSACTION: {
564 data.enforceInterface(IActivityManager.descriptor);
565 IBinder token = data.readStrongBinder();
566 activityDestroyed(token);
567 reply.writeNoException();
568 return true;
569 }
570
571 case GET_CALLING_PACKAGE_TRANSACTION: {
572 data.enforceInterface(IActivityManager.descriptor);
573 IBinder token = data.readStrongBinder();
574 String res = token != null ? getCallingPackage(token) : null;
575 reply.writeNoException();
576 reply.writeString(res);
577 return true;
578 }
579
580 case GET_CALLING_ACTIVITY_TRANSACTION: {
581 data.enforceInterface(IActivityManager.descriptor);
582 IBinder token = data.readStrongBinder();
583 ComponentName cn = getCallingActivity(token);
584 reply.writeNoException();
585 ComponentName.writeToParcel(cn, reply);
586 return true;
587 }
588
Winson Chung1147c402014-05-14 11:05:00 -0700589 case GET_APP_TASKS_TRANSACTION: {
590 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -0700591 String callingPackage = data.readString();
592 List<IAppTask> list = getAppTasks(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -0700593 reply.writeNoException();
594 int N = list != null ? list.size() : -1;
595 reply.writeInt(N);
596 int i;
597 for (i=0; i<N; i++) {
598 IAppTask task = list.get(i);
599 reply.writeStrongBinder(task.asBinder());
600 }
601 return true;
602 }
603
Dianne Hackbornaec68bb2014-08-20 15:25:13 -0700604 case ADD_APP_TASK_TRANSACTION: {
605 data.enforceInterface(IActivityManager.descriptor);
606 IBinder activityToken = data.readStrongBinder();
607 Intent intent = Intent.CREATOR.createFromParcel(data);
608 ActivityManager.TaskDescription descr
609 = ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
610 Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data);
611 int res = addAppTask(activityToken, intent, descr, thumbnail);
612 reply.writeNoException();
613 reply.writeInt(res);
614 return true;
615 }
616
617 case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: {
618 data.enforceInterface(IActivityManager.descriptor);
619 Point size = getAppTaskThumbnailSize();
620 reply.writeNoException();
621 size.writeToParcel(reply, 0);
622 return true;
623 }
624
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800625 case GET_TASKS_TRANSACTION: {
626 data.enforceInterface(IActivityManager.descriptor);
627 int maxNum = data.readInt();
628 int fl = data.readInt();
Dianne Hackborn09233282014-04-30 11:33:59 -0700629 List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800630 reply.writeNoException();
631 int N = list != null ? list.size() : -1;
632 reply.writeInt(N);
633 int i;
634 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700635 ActivityManager.RunningTaskInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800636 info.writeToParcel(reply, 0);
637 }
638 return true;
639 }
640
641 case GET_RECENT_TASKS_TRANSACTION: {
642 data.enforceInterface(IActivityManager.descriptor);
643 int maxNum = data.readInt();
644 int fl = data.readInt();
Amith Yamasani82644082012-08-03 13:09:11 -0700645 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800646 List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -0700647 fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800648 reply.writeNoException();
649 reply.writeTypedList(list);
650 return true;
651 }
Dianne Hackborn15491c62012-09-19 10:59:14 -0700652
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700653 case GET_TASK_THUMBNAIL_TRANSACTION: {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800654 data.enforceInterface(IActivityManager.descriptor);
655 int id = data.readInt();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700656 ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id);
Dianne Hackbornd94df452011-02-16 18:53:31 -0800657 reply.writeNoException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700658 if (taskThumbnail != null) {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800659 reply.writeInt(1);
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700660 taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn15491c62012-09-19 10:59:14 -0700661 } else {
662 reply.writeInt(0);
663 }
664 return true;
665 }
666
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800667 case GET_SERVICES_TRANSACTION: {
668 data.enforceInterface(IActivityManager.descriptor);
669 int maxNum = data.readInt();
670 int fl = data.readInt();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700671 List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800672 reply.writeNoException();
673 int N = list != null ? list.size() : -1;
674 reply.writeInt(N);
675 int i;
676 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700677 ActivityManager.RunningServiceInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800678 info.writeToParcel(reply, 0);
679 }
680 return true;
681 }
682
683 case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: {
684 data.enforceInterface(IActivityManager.descriptor);
685 List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState();
686 reply.writeNoException();
687 reply.writeTypedList(list);
688 return true;
689 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700690
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800691 case GET_RUNNING_APP_PROCESSES_TRANSACTION: {
692 data.enforceInterface(IActivityManager.descriptor);
693 List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses();
694 reply.writeNoException();
695 reply.writeTypedList(list);
696 return true;
697 }
698
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -0700699 case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: {
700 data.enforceInterface(IActivityManager.descriptor);
701 List<ApplicationInfo> list = getRunningExternalApplications();
702 reply.writeNoException();
703 reply.writeTypedList(list);
704 return true;
705 }
706
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800707 case MOVE_TASK_TO_FRONT_TRANSACTION: {
708 data.enforceInterface(IActivityManager.descriptor);
709 int task = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800710 int fl = data.readInt();
Dianne Hackborn8078d8c2012-03-20 11:11:26 -0700711 Bundle options = data.readInt() != 0
712 ? Bundle.CREATOR.createFromParcel(data) : null;
713 moveTaskToFront(task, fl, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800714 reply.writeNoException();
715 return true;
716 }
717
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800718 case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: {
719 data.enforceInterface(IActivityManager.descriptor);
720 IBinder token = data.readStrongBinder();
721 boolean nonRoot = data.readInt() != 0;
722 boolean res = moveActivityTaskToBack(token, nonRoot);
723 reply.writeNoException();
724 reply.writeInt(res ? 1 : 0);
725 return true;
726 }
727
728 case MOVE_TASK_BACKWARDS_TRANSACTION: {
729 data.enforceInterface(IActivityManager.descriptor);
730 int task = data.readInt();
731 moveTaskBackwards(task);
732 reply.writeNoException();
733 return true;
734 }
735
Craig Mautnerc00204b2013-03-05 15:02:14 -0800736 case MOVE_TASK_TO_STACK_TRANSACTION: {
737 data.enforceInterface(IActivityManager.descriptor);
738 int taskId = data.readInt();
739 int stackId = data.readInt();
740 boolean toTop = data.readInt() != 0;
741 moveTaskToStack(taskId, stackId, toTop);
742 reply.writeNoException();
743 return true;
744 }
745
746 case RESIZE_STACK_TRANSACTION: {
747 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800748 int stackId = data.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800749 Rect r = Rect.CREATOR.createFromParcel(data);
750 resizeStack(stackId, r);
Craig Mautnerc00204b2013-03-05 15:02:14 -0800751 reply.writeNoException();
752 return true;
753 }
754
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800755 case GET_ALL_STACK_INFOS_TRANSACTION: {
Craig Mautner5ff12102013-05-24 12:50:15 -0700756 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800757 List<StackInfo> list = getAllStackInfos();
Craig Mautner5ff12102013-05-24 12:50:15 -0700758 reply.writeNoException();
759 reply.writeTypedList(list);
760 return true;
761 }
762
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800763 case GET_STACK_INFO_TRANSACTION: {
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700764 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800765 int stackId = data.readInt();
766 StackInfo info = getStackInfo(stackId);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700767 reply.writeNoException();
768 if (info != null) {
769 reply.writeInt(1);
770 info.writeToParcel(reply, 0);
771 } else {
772 reply.writeInt(0);
773 }
774 return true;
775 }
776
Winson Chung303e1ff2014-03-07 15:06:19 -0800777 case IS_IN_HOME_STACK_TRANSACTION: {
778 data.enforceInterface(IActivityManager.descriptor);
779 int taskId = data.readInt();
780 boolean isInHomeStack = isInHomeStack(taskId);
781 reply.writeNoException();
782 reply.writeInt(isInHomeStack ? 1 : 0);
783 return true;
784 }
785
Craig Mautnercf910b02013-04-23 11:23:27 -0700786 case SET_FOCUSED_STACK_TRANSACTION: {
787 data.enforceInterface(IActivityManager.descriptor);
788 int stackId = data.readInt();
789 setFocusedStack(stackId);
790 reply.writeNoException();
791 return true;
792 }
793
Winson Chungd16c5652015-01-26 16:11:07 -0800794 case GET_FOCUSED_STACK_ID_TRANSACTION: {
795 data.enforceInterface(IActivityManager.descriptor);
796 int focusedStackId = getFocusedStackId();
797 reply.writeNoException();
798 reply.writeInt(focusedStackId);
799 return true;
800 }
801
Winson Chung740c3ac2014-11-12 16:14:38 -0800802 case REGISTER_TASK_STACK_LISTENER_TRANSACTION: {
803 data.enforceInterface(IActivityManager.descriptor);
804 IBinder token = data.readStrongBinder();
805 registerTaskStackListener(ITaskStackListener.Stub.asInterface(token));
806 reply.writeNoException();
807 return true;
808 }
809
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800810 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
811 data.enforceInterface(IActivityManager.descriptor);
812 IBinder token = data.readStrongBinder();
813 boolean onlyRoot = data.readInt() != 0;
814 int res = token != null
815 ? getTaskForActivity(token, onlyRoot) : -1;
816 reply.writeNoException();
817 reply.writeInt(res);
818 return true;
819 }
820
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800821 case GET_CONTENT_PROVIDER_TRANSACTION: {
822 data.enforceInterface(IActivityManager.descriptor);
823 IBinder b = data.readStrongBinder();
824 IApplicationThread app = ApplicationThreadNative.asInterface(b);
825 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700826 int userId = data.readInt();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700827 boolean stable = data.readInt() != 0;
Jeff Sharkey6d515712012-09-20 16:06:08 -0700828 ContentProviderHolder cph = getContentProvider(app, name, userId, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800829 reply.writeNoException();
830 if (cph != null) {
831 reply.writeInt(1);
832 cph.writeToParcel(reply, 0);
833 } else {
834 reply.writeInt(0);
835 }
836 return true;
837 }
838
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800839 case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
840 data.enforceInterface(IActivityManager.descriptor);
841 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700842 int userId = data.readInt();
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800843 IBinder token = data.readStrongBinder();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700844 ContentProviderHolder cph = getContentProviderExternal(name, userId, token);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800845 reply.writeNoException();
846 if (cph != null) {
847 reply.writeInt(1);
848 cph.writeToParcel(reply, 0);
849 } else {
850 reply.writeInt(0);
851 }
852 return true;
853 }
854
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800855 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
856 data.enforceInterface(IActivityManager.descriptor);
857 IBinder b = data.readStrongBinder();
858 IApplicationThread app = ApplicationThreadNative.asInterface(b);
859 ArrayList<ContentProviderHolder> providers =
860 data.createTypedArrayList(ContentProviderHolder.CREATOR);
861 publishContentProviders(app, providers);
862 reply.writeNoException();
863 return true;
864 }
865
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700866 case REF_CONTENT_PROVIDER_TRANSACTION: {
867 data.enforceInterface(IActivityManager.descriptor);
868 IBinder b = data.readStrongBinder();
869 int stable = data.readInt();
870 int unstable = data.readInt();
871 boolean res = refContentProvider(b, stable, unstable);
872 reply.writeNoException();
873 reply.writeInt(res ? 1 : 0);
874 return true;
875 }
876
877 case UNSTABLE_PROVIDER_DIED_TRANSACTION: {
878 data.enforceInterface(IActivityManager.descriptor);
879 IBinder b = data.readStrongBinder();
880 unstableProviderDied(b);
881 reply.writeNoException();
882 return true;
883 }
884
Jeff Sharkey7aa76012013-09-30 14:26:27 -0700885 case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: {
886 data.enforceInterface(IActivityManager.descriptor);
887 IBinder b = data.readStrongBinder();
888 appNotRespondingViaProvider(b);
889 reply.writeNoException();
890 return true;
891 }
892
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800893 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
894 data.enforceInterface(IActivityManager.descriptor);
895 IBinder b = data.readStrongBinder();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700896 boolean stable = data.readInt() != 0;
897 removeContentProvider(b, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800898 reply.writeNoException();
899 return true;
900 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800901
902 case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
903 data.enforceInterface(IActivityManager.descriptor);
904 String name = data.readString();
905 IBinder token = data.readStrongBinder();
906 removeContentProviderExternal(name, token);
907 reply.writeNoException();
908 return true;
909 }
910
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700911 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
912 data.enforceInterface(IActivityManager.descriptor);
913 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
914 PendingIntent pi = getRunningServiceControlPanel(comp);
915 reply.writeNoException();
916 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
917 return true;
918 }
919
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800920 case START_SERVICE_TRANSACTION: {
921 data.enforceInterface(IActivityManager.descriptor);
922 IBinder b = data.readStrongBinder();
923 IApplicationThread app = ApplicationThreadNative.asInterface(b);
924 Intent service = Intent.CREATOR.createFromParcel(data);
925 String resolvedType = data.readString();
Svet Ganov99b60432015-06-27 13:15:22 -0700926 String callingPackage = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700927 int userId = data.readInt();
Svet Ganov99b60432015-06-27 13:15:22 -0700928 ComponentName cn = startService(app, service, resolvedType, callingPackage, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800929 reply.writeNoException();
930 ComponentName.writeToParcel(cn, reply);
931 return true;
932 }
933
934 case STOP_SERVICE_TRANSACTION: {
935 data.enforceInterface(IActivityManager.descriptor);
936 IBinder b = data.readStrongBinder();
937 IApplicationThread app = ApplicationThreadNative.asInterface(b);
938 Intent service = Intent.CREATOR.createFromParcel(data);
939 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700940 int userId = data.readInt();
941 int res = stopService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800942 reply.writeNoException();
943 reply.writeInt(res);
944 return true;
945 }
946
947 case STOP_SERVICE_TOKEN_TRANSACTION: {
948 data.enforceInterface(IActivityManager.descriptor);
949 ComponentName className = ComponentName.readFromParcel(data);
950 IBinder token = data.readStrongBinder();
951 int startId = data.readInt();
952 boolean res = stopServiceToken(className, token, startId);
953 reply.writeNoException();
954 reply.writeInt(res ? 1 : 0);
955 return true;
956 }
957
958 case SET_SERVICE_FOREGROUND_TRANSACTION: {
959 data.enforceInterface(IActivityManager.descriptor);
960 ComponentName className = ComponentName.readFromParcel(data);
961 IBinder token = data.readStrongBinder();
Dianne Hackbornd8a43f62009-08-17 23:33:56 -0700962 int id = data.readInt();
963 Notification notification = null;
964 if (data.readInt() != 0) {
965 notification = Notification.CREATOR.createFromParcel(data);
966 }
967 boolean removeNotification = data.readInt() != 0;
968 setServiceForeground(className, token, id, notification, removeNotification);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800969 reply.writeNoException();
970 return true;
971 }
972
973 case BIND_SERVICE_TRANSACTION: {
974 data.enforceInterface(IActivityManager.descriptor);
975 IBinder b = data.readStrongBinder();
976 IApplicationThread app = ApplicationThreadNative.asInterface(b);
977 IBinder token = data.readStrongBinder();
978 Intent service = Intent.CREATOR.createFromParcel(data);
979 String resolvedType = data.readString();
980 b = data.readStrongBinder();
981 int fl = data.readInt();
Svet Ganov99b60432015-06-27 13:15:22 -0700982 String callingPackage = data.readString();
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800983 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800984 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
Svet Ganov99b60432015-06-27 13:15:22 -0700985 int res = bindService(app, token, service, resolvedType, conn, fl,
986 callingPackage, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800987 reply.writeNoException();
988 reply.writeInt(res);
989 return true;
990 }
991
992 case UNBIND_SERVICE_TRANSACTION: {
993 data.enforceInterface(IActivityManager.descriptor);
994 IBinder b = data.readStrongBinder();
995 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
996 boolean res = unbindService(conn);
997 reply.writeNoException();
998 reply.writeInt(res ? 1 : 0);
999 return true;
1000 }
1001
1002 case PUBLISH_SERVICE_TRANSACTION: {
1003 data.enforceInterface(IActivityManager.descriptor);
1004 IBinder token = data.readStrongBinder();
1005 Intent intent = Intent.CREATOR.createFromParcel(data);
1006 IBinder service = data.readStrongBinder();
1007 publishService(token, intent, service);
1008 reply.writeNoException();
1009 return true;
1010 }
1011
1012 case UNBIND_FINISHED_TRANSACTION: {
1013 data.enforceInterface(IActivityManager.descriptor);
1014 IBinder token = data.readStrongBinder();
1015 Intent intent = Intent.CREATOR.createFromParcel(data);
1016 boolean doRebind = data.readInt() != 0;
1017 unbindFinished(token, intent, doRebind);
1018 reply.writeNoException();
1019 return true;
1020 }
1021
1022 case SERVICE_DONE_EXECUTING_TRANSACTION: {
1023 data.enforceInterface(IActivityManager.descriptor);
1024 IBinder token = data.readStrongBinder();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07001025 int type = data.readInt();
1026 int startId = data.readInt();
1027 int res = data.readInt();
1028 serviceDoneExecuting(token, type, startId, res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001029 reply.writeNoException();
1030 return true;
1031 }
1032
1033 case START_INSTRUMENTATION_TRANSACTION: {
1034 data.enforceInterface(IActivityManager.descriptor);
1035 ComponentName className = ComponentName.readFromParcel(data);
1036 String profileFile = data.readString();
1037 int fl = data.readInt();
1038 Bundle arguments = data.readBundle();
1039 IBinder b = data.readStrongBinder();
1040 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08001041 b = data.readStrongBinder();
1042 IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001043 int userId = data.readInt();
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01001044 String abiOverride = data.readString();
1045 boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId,
1046 abiOverride);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001047 reply.writeNoException();
1048 reply.writeInt(res ? 1 : 0);
1049 return true;
1050 }
1051
1052
1053 case FINISH_INSTRUMENTATION_TRANSACTION: {
1054 data.enforceInterface(IActivityManager.descriptor);
1055 IBinder b = data.readStrongBinder();
1056 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1057 int resultCode = data.readInt();
1058 Bundle results = data.readBundle();
1059 finishInstrumentation(app, resultCode, results);
1060 reply.writeNoException();
1061 return true;
1062 }
1063
1064 case GET_CONFIGURATION_TRANSACTION: {
1065 data.enforceInterface(IActivityManager.descriptor);
1066 Configuration config = getConfiguration();
1067 reply.writeNoException();
1068 config.writeToParcel(reply, 0);
1069 return true;
1070 }
1071
1072 case UPDATE_CONFIGURATION_TRANSACTION: {
1073 data.enforceInterface(IActivityManager.descriptor);
1074 Configuration config = Configuration.CREATOR.createFromParcel(data);
1075 updateConfiguration(config);
1076 reply.writeNoException();
1077 return true;
1078 }
1079
1080 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
1081 data.enforceInterface(IActivityManager.descriptor);
1082 IBinder token = data.readStrongBinder();
1083 int requestedOrientation = data.readInt();
1084 setRequestedOrientation(token, requestedOrientation);
1085 reply.writeNoException();
1086 return true;
1087 }
1088
1089 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
1090 data.enforceInterface(IActivityManager.descriptor);
1091 IBinder token = data.readStrongBinder();
1092 int req = getRequestedOrientation(token);
1093 reply.writeNoException();
1094 reply.writeInt(req);
1095 return true;
1096 }
1097
1098 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
1099 data.enforceInterface(IActivityManager.descriptor);
1100 IBinder token = data.readStrongBinder();
1101 ComponentName cn = getActivityClassForToken(token);
1102 reply.writeNoException();
1103 ComponentName.writeToParcel(cn, reply);
1104 return true;
1105 }
1106
1107 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
1108 data.enforceInterface(IActivityManager.descriptor);
1109 IBinder token = data.readStrongBinder();
1110 reply.writeNoException();
1111 reply.writeString(getPackageForToken(token));
1112 return true;
1113 }
1114
1115 case GET_INTENT_SENDER_TRANSACTION: {
1116 data.enforceInterface(IActivityManager.descriptor);
1117 int type = data.readInt();
1118 String packageName = data.readString();
1119 IBinder token = data.readStrongBinder();
1120 String resultWho = data.readString();
1121 int requestCode = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001122 Intent[] requestIntents;
1123 String[] requestResolvedTypes;
1124 if (data.readInt() != 0) {
1125 requestIntents = data.createTypedArray(Intent.CREATOR);
1126 requestResolvedTypes = data.createStringArray();
1127 } else {
1128 requestIntents = null;
1129 requestResolvedTypes = null;
1130 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001131 int fl = data.readInt();
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07001132 Bundle options = data.readInt() != 0
1133 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -07001134 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001135 IIntentSender res = getIntentSender(type, packageName, token,
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001136 resultWho, requestCode, requestIntents,
Dianne Hackborn41203752012-08-31 14:05:51 -07001137 requestResolvedTypes, fl, options, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001138 reply.writeNoException();
1139 reply.writeStrongBinder(res != null ? res.asBinder() : null);
1140 return true;
1141 }
1142
1143 case CANCEL_INTENT_SENDER_TRANSACTION: {
1144 data.enforceInterface(IActivityManager.descriptor);
1145 IIntentSender r = IIntentSender.Stub.asInterface(
1146 data.readStrongBinder());
1147 cancelIntentSender(r);
1148 reply.writeNoException();
1149 return true;
1150 }
1151
1152 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
1153 data.enforceInterface(IActivityManager.descriptor);
1154 IIntentSender r = IIntentSender.Stub.asInterface(
1155 data.readStrongBinder());
1156 String res = getPackageForIntentSender(r);
1157 reply.writeNoException();
1158 reply.writeString(res);
1159 return true;
1160 }
1161
Christopher Tatec4a07d12012-04-06 14:19:13 -07001162 case GET_UID_FOR_INTENT_SENDER_TRANSACTION: {
1163 data.enforceInterface(IActivityManager.descriptor);
1164 IIntentSender r = IIntentSender.Stub.asInterface(
1165 data.readStrongBinder());
1166 int res = getUidForIntentSender(r);
1167 reply.writeNoException();
1168 reply.writeInt(res);
1169 return true;
1170 }
1171
Dianne Hackborn41203752012-08-31 14:05:51 -07001172 case HANDLE_INCOMING_USER_TRANSACTION: {
1173 data.enforceInterface(IActivityManager.descriptor);
1174 int callingPid = data.readInt();
1175 int callingUid = data.readInt();
1176 int userId = data.readInt();
1177 boolean allowAll = data.readInt() != 0 ;
1178 boolean requireFull = data.readInt() != 0;
1179 String name = data.readString();
1180 String callerPackage = data.readString();
1181 int res = handleIncomingUser(callingPid, callingUid, userId, allowAll,
1182 requireFull, name, callerPackage);
1183 reply.writeNoException();
1184 reply.writeInt(res);
1185 return true;
1186 }
1187
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001188 case SET_PROCESS_LIMIT_TRANSACTION: {
1189 data.enforceInterface(IActivityManager.descriptor);
1190 int max = data.readInt();
1191 setProcessLimit(max);
1192 reply.writeNoException();
1193 return true;
1194 }
1195
1196 case GET_PROCESS_LIMIT_TRANSACTION: {
1197 data.enforceInterface(IActivityManager.descriptor);
1198 int limit = getProcessLimit();
1199 reply.writeNoException();
1200 reply.writeInt(limit);
1201 return true;
1202 }
1203
1204 case SET_PROCESS_FOREGROUND_TRANSACTION: {
1205 data.enforceInterface(IActivityManager.descriptor);
1206 IBinder token = data.readStrongBinder();
1207 int pid = data.readInt();
1208 boolean isForeground = data.readInt() != 0;
1209 setProcessForeground(token, pid, isForeground);
1210 reply.writeNoException();
1211 return true;
1212 }
1213
1214 case CHECK_PERMISSION_TRANSACTION: {
1215 data.enforceInterface(IActivityManager.descriptor);
1216 String perm = data.readString();
1217 int pid = data.readInt();
1218 int uid = data.readInt();
1219 int res = checkPermission(perm, pid, uid);
1220 reply.writeNoException();
1221 reply.writeInt(res);
1222 return true;
1223 }
1224
Dianne Hackbornff170242014-11-19 10:59:01 -08001225 case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: {
1226 data.enforceInterface(IActivityManager.descriptor);
1227 String perm = data.readString();
1228 int pid = data.readInt();
1229 int uid = data.readInt();
1230 IBinder token = data.readStrongBinder();
1231 int res = checkPermissionWithToken(perm, pid, uid, token);
1232 reply.writeNoException();
1233 reply.writeInt(res);
1234 return true;
1235 }
1236
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001237 case CHECK_URI_PERMISSION_TRANSACTION: {
1238 data.enforceInterface(IActivityManager.descriptor);
1239 Uri uri = Uri.CREATOR.createFromParcel(data);
1240 int pid = data.readInt();
1241 int uid = data.readInt();
1242 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001243 int userId = data.readInt();
Dianne Hackbornff170242014-11-19 10:59:01 -08001244 IBinder callerToken = data.readStrongBinder();
1245 int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001246 reply.writeNoException();
1247 reply.writeInt(res);
1248 return true;
1249 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001250
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001251 case CLEAR_APP_DATA_TRANSACTION: {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001252 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001253 String packageName = data.readString();
1254 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
1255 data.readStrongBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -07001256 int userId = data.readInt();
1257 boolean res = clearApplicationUserData(packageName, observer, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001258 reply.writeNoException();
1259 reply.writeInt(res ? 1 : 0);
1260 return true;
1261 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001262
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001263 case GRANT_URI_PERMISSION_TRANSACTION: {
1264 data.enforceInterface(IActivityManager.descriptor);
1265 IBinder b = data.readStrongBinder();
1266 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1267 String targetPkg = data.readString();
1268 Uri uri = Uri.CREATOR.createFromParcel(data);
1269 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001270 int userId = data.readInt();
1271 grantUriPermission(app, targetPkg, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001272 reply.writeNoException();
1273 return true;
1274 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001275
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001276 case REVOKE_URI_PERMISSION_TRANSACTION: {
1277 data.enforceInterface(IActivityManager.descriptor);
1278 IBinder b = data.readStrongBinder();
1279 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1280 Uri uri = Uri.CREATOR.createFromParcel(data);
1281 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001282 int userId = data.readInt();
1283 revokeUriPermission(app, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001284 reply.writeNoException();
1285 return true;
1286 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001287
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001288 case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1289 data.enforceInterface(IActivityManager.descriptor);
1290 Uri uri = Uri.CREATOR.createFromParcel(data);
1291 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001292 int userId = data.readInt();
1293 takePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001294 reply.writeNoException();
1295 return true;
1296 }
1297
1298 case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1299 data.enforceInterface(IActivityManager.descriptor);
1300 Uri uri = Uri.CREATOR.createFromParcel(data);
1301 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001302 int userId = data.readInt();
1303 releasePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001304 reply.writeNoException();
1305 return true;
1306 }
1307
1308 case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: {
1309 data.enforceInterface(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07001310 final String packageName = data.readString();
1311 final boolean incoming = data.readInt() != 0;
1312 final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions(
1313 packageName, incoming);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001314 reply.writeNoException();
1315 perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1316 return true;
1317 }
1318
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001319 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
1320 data.enforceInterface(IActivityManager.descriptor);
1321 IBinder b = data.readStrongBinder();
1322 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1323 boolean waiting = data.readInt() != 0;
1324 showWaitingForDebugger(app, waiting);
1325 reply.writeNoException();
1326 return true;
1327 }
1328
1329 case GET_MEMORY_INFO_TRANSACTION: {
1330 data.enforceInterface(IActivityManager.descriptor);
1331 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
1332 getMemoryInfo(mi);
1333 reply.writeNoException();
1334 mi.writeToParcel(reply, 0);
1335 return true;
1336 }
1337
1338 case UNHANDLED_BACK_TRANSACTION: {
1339 data.enforceInterface(IActivityManager.descriptor);
1340 unhandledBack();
1341 reply.writeNoException();
1342 return true;
1343 }
1344
1345 case OPEN_CONTENT_URI_TRANSACTION: {
1346 data.enforceInterface(IActivityManager.descriptor);
1347 Uri uri = Uri.parse(data.readString());
1348 ParcelFileDescriptor pfd = openContentUri(uri);
1349 reply.writeNoException();
1350 if (pfd != null) {
1351 reply.writeInt(1);
1352 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1353 } else {
1354 reply.writeInt(0);
1355 }
1356 return true;
1357 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001358
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001359 case SET_LOCK_SCREEN_SHOWN_TRANSACTION: {
1360 data.enforceInterface(IActivityManager.descriptor);
1361 setLockScreenShown(data.readInt() != 0);
1362 reply.writeNoException();
1363 return true;
1364 }
1365
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001366 case SET_DEBUG_APP_TRANSACTION: {
1367 data.enforceInterface(IActivityManager.descriptor);
1368 String pn = data.readString();
1369 boolean wfd = data.readInt() != 0;
1370 boolean per = data.readInt() != 0;
1371 setDebugApp(pn, wfd, per);
1372 reply.writeNoException();
1373 return true;
1374 }
1375
1376 case SET_ALWAYS_FINISH_TRANSACTION: {
1377 data.enforceInterface(IActivityManager.descriptor);
1378 boolean enabled = data.readInt() != 0;
1379 setAlwaysFinish(enabled);
1380 reply.writeNoException();
1381 return true;
1382 }
1383
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001384 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001385 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001386 IActivityController watcher = IActivityController.Stub.asInterface(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001387 data.readStrongBinder());
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001388 setActivityController(watcher);
Sungmin Choicdb86bb2012-12-20 14:08:59 +09001389 reply.writeNoException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001390 return true;
1391 }
1392
1393 case ENTER_SAFE_MODE_TRANSACTION: {
1394 data.enforceInterface(IActivityManager.descriptor);
1395 enterSafeMode();
1396 reply.writeNoException();
1397 return true;
1398 }
1399
1400 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1401 data.enforceInterface(IActivityManager.descriptor);
1402 IIntentSender is = IIntentSender.Stub.asInterface(
1403 data.readStrongBinder());
Dianne Hackborn099bc622014-01-22 13:39:16 -08001404 int sourceUid = data.readInt();
1405 String sourcePkg = data.readString();
Dianne Hackborn1e383822015-04-10 14:02:33 -07001406 String tag = data.readString();
1407 noteWakeupAlarm(is, sourceUid, sourcePkg, tag);
1408 reply.writeNoException();
1409 return true;
1410 }
1411
1412 case NOTE_ALARM_START_TRANSACTION: {
1413 data.enforceInterface(IActivityManager.descriptor);
1414 IIntentSender is = IIntentSender.Stub.asInterface(
1415 data.readStrongBinder());
1416 int sourceUid = data.readInt();
1417 String tag = data.readString();
1418 noteAlarmStart(is, sourceUid, tag);
1419 reply.writeNoException();
1420 return true;
1421 }
1422
1423 case NOTE_ALARM_FINISH_TRANSACTION: {
1424 data.enforceInterface(IActivityManager.descriptor);
1425 IIntentSender is = IIntentSender.Stub.asInterface(
1426 data.readStrongBinder());
1427 int sourceUid = data.readInt();
1428 String tag = data.readString();
1429 noteAlarmFinish(is, sourceUid, tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001430 reply.writeNoException();
1431 return true;
1432 }
1433
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001434 case KILL_PIDS_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001435 data.enforceInterface(IActivityManager.descriptor);
1436 int[] pids = data.createIntArray();
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001437 String reason = data.readString();
Dianne Hackborn64825172011-03-02 21:32:58 -08001438 boolean secure = data.readInt() != 0;
1439 boolean res = killPids(pids, reason, secure);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001440 reply.writeNoException();
1441 reply.writeInt(res ? 1 : 0);
1442 return true;
1443 }
1444
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07001445 case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: {
1446 data.enforceInterface(IActivityManager.descriptor);
1447 String reason = data.readString();
1448 boolean res = killProcessesBelowForeground(reason);
1449 reply.writeNoException();
1450 reply.writeInt(res ? 1 : 0);
1451 return true;
1452 }
1453
Dan Egnor60d87622009-12-16 16:32:58 -08001454 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1455 data.enforceInterface(IActivityManager.descriptor);
1456 IBinder app = data.readStrongBinder();
1457 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1458 handleApplicationCrash(app, ci);
1459 reply.writeNoException();
1460 return true;
1461 }
1462
1463 case HANDLE_APPLICATION_WTF_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001464 data.enforceInterface(IActivityManager.descriptor);
1465 IBinder app = data.readStrongBinder();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001466 String tag = data.readString();
Dianne Hackborn52322712014-08-26 22:47:26 -07001467 boolean system = data.readInt() != 0;
Dan Egnorb7f03672009-12-09 16:22:32 -08001468 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
Dianne Hackborn52322712014-08-26 22:47:26 -07001469 boolean res = handleApplicationWtf(app, tag, system, ci);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001470 reply.writeNoException();
Dan Egnor60d87622009-12-16 16:32:58 -08001471 reply.writeInt(res ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001472 return true;
1473 }
Dan Egnorb7f03672009-12-09 16:22:32 -08001474
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001475 case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: {
1476 data.enforceInterface(IActivityManager.descriptor);
1477 IBinder app = data.readStrongBinder();
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07001478 int violationMask = data.readInt();
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07001479 StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data);
1480 handleApplicationStrictModeViolation(app, violationMask, info);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001481 reply.writeNoException();
1482 return true;
1483 }
1484
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001485 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1486 data.enforceInterface(IActivityManager.descriptor);
1487 int sig = data.readInt();
1488 signalPersistentProcesses(sig);
1489 reply.writeNoException();
1490 return true;
1491 }
1492
Dianne Hackborn03abb812010-01-04 18:43:19 -08001493 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1494 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001495 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001496 int userId = data.readInt();
1497 killBackgroundProcesses(packageName, userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08001498 reply.writeNoException();
1499 return true;
1500 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08001501
1502 case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
1503 data.enforceInterface(IActivityManager.descriptor);
1504 killAllBackgroundProcesses();
1505 reply.writeNoException();
1506 return true;
1507 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001508
Dianne Hackborn03abb812010-01-04 18:43:19 -08001509 case FORCE_STOP_PACKAGE_TRANSACTION: {
1510 data.enforceInterface(IActivityManager.descriptor);
1511 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001512 int userId = data.readInt();
1513 forceStopPackage(packageName, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001514 reply.writeNoException();
1515 return true;
1516 }
Dianne Hackborn27ff9132012-03-06 14:57:58 -08001517
1518 case GET_MY_MEMORY_STATE_TRANSACTION: {
1519 data.enforceInterface(IActivityManager.descriptor);
1520 ActivityManager.RunningAppProcessInfo info =
1521 new ActivityManager.RunningAppProcessInfo();
1522 getMyMemoryState(info);
1523 reply.writeNoException();
1524 info.writeToParcel(reply, 0);
1525 return true;
1526 }
1527
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001528 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1529 data.enforceInterface(IActivityManager.descriptor);
1530 ConfigurationInfo config = getDeviceConfigurationInfo();
1531 reply.writeNoException();
1532 config.writeToParcel(reply, 0);
1533 return true;
1534 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001535
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001536 case PROFILE_CONTROL_TRANSACTION: {
1537 data.enforceInterface(IActivityManager.descriptor);
1538 String process = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001539 int userId = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001540 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001541 int profileType = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -07001542 ProfilerInfo profilerInfo = data.readInt() != 0
1543 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
1544 boolean res = profileControl(process, userId, start, profilerInfo, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001545 reply.writeNoException();
1546 reply.writeInt(res ? 1 : 0);
1547 return true;
1548 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001549
Dianne Hackborn55280a92009-05-07 15:53:46 -07001550 case SHUTDOWN_TRANSACTION: {
1551 data.enforceInterface(IActivityManager.descriptor);
1552 boolean res = shutdown(data.readInt());
1553 reply.writeNoException();
1554 reply.writeInt(res ? 1 : 0);
1555 return true;
1556 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001557
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001558 case STOP_APP_SWITCHES_TRANSACTION: {
1559 data.enforceInterface(IActivityManager.descriptor);
1560 stopAppSwitches();
1561 reply.writeNoException();
1562 return true;
1563 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001564
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001565 case RESUME_APP_SWITCHES_TRANSACTION: {
1566 data.enforceInterface(IActivityManager.descriptor);
1567 resumeAppSwitches();
1568 reply.writeNoException();
1569 return true;
1570 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001571
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001572 case PEEK_SERVICE_TRANSACTION: {
1573 data.enforceInterface(IActivityManager.descriptor);
1574 Intent service = Intent.CREATOR.createFromParcel(data);
1575 String resolvedType = data.readString();
Svet Ganov99b60432015-06-27 13:15:22 -07001576 String callingPackage = data.readString();
1577 IBinder binder = peekService(service, resolvedType, callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001578 reply.writeNoException();
1579 reply.writeStrongBinder(binder);
1580 return true;
1581 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001582
Christopher Tate181fafa2009-05-14 11:12:14 -07001583 case START_BACKUP_AGENT_TRANSACTION: {
1584 data.enforceInterface(IActivityManager.descriptor);
1585 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1586 int backupRestoreMode = data.readInt();
1587 boolean success = bindBackupAgent(info, backupRestoreMode);
1588 reply.writeNoException();
1589 reply.writeInt(success ? 1 : 0);
1590 return true;
1591 }
1592
1593 case BACKUP_AGENT_CREATED_TRANSACTION: {
1594 data.enforceInterface(IActivityManager.descriptor);
1595 String packageName = data.readString();
1596 IBinder agent = data.readStrongBinder();
1597 backupAgentCreated(packageName, agent);
1598 reply.writeNoException();
1599 return true;
1600 }
1601
1602 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1603 data.enforceInterface(IActivityManager.descriptor);
1604 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1605 unbindBackupAgent(info);
1606 reply.writeNoException();
1607 return true;
1608 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001609
1610 case ADD_PACKAGE_DEPENDENCY_TRANSACTION: {
1611 data.enforceInterface(IActivityManager.descriptor);
1612 String packageName = data.readString();
1613 addPackageDependency(packageName);
1614 reply.writeNoException();
1615 return true;
1616 }
1617
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001618 case KILL_APPLICATION_WITH_APPID_TRANSACTION: {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001619 data.enforceInterface(IActivityManager.descriptor);
1620 String pkg = data.readString();
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001621 int appid = data.readInt();
Dianne Hackborn21d9b562013-05-28 17:46:59 -07001622 String reason = data.readString();
1623 killApplicationWithAppId(pkg, appid, reason);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001624 reply.writeNoException();
1625 return true;
1626 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001627
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001628 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1629 data.enforceInterface(IActivityManager.descriptor);
1630 String reason = data.readString();
1631 closeSystemDialogs(reason);
1632 reply.writeNoException();
1633 return true;
1634 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001635
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001636 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1637 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001638 int[] pids = data.createIntArray();
1639 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001640 reply.writeNoException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001641 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001642 return true;
1643 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001644
1645 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1646 data.enforceInterface(IActivityManager.descriptor);
1647 String processName = data.readString();
1648 int uid = data.readInt();
1649 killApplicationProcess(processName, uid);
1650 reply.writeNoException();
1651 return true;
1652 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001653
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001654 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1655 data.enforceInterface(IActivityManager.descriptor);
1656 IBinder token = data.readStrongBinder();
1657 String packageName = data.readString();
1658 int enterAnim = data.readInt();
1659 int exitAnim = data.readInt();
1660 overridePendingTransition(token, packageName, enterAnim, exitAnim);
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001661 reply.writeNoException();
1662 return true;
1663 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001664
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001665 case IS_USER_A_MONKEY_TRANSACTION: {
1666 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001667 boolean areThey = isUserAMonkey();
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001668 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001669 reply.writeInt(areThey ? 1 : 0);
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001670 return true;
1671 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001672
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07001673 case SET_USER_IS_MONKEY_TRANSACTION: {
1674 data.enforceInterface(IActivityManager.descriptor);
1675 final boolean monkey = (data.readInt() == 1);
1676 setUserIsMonkey(monkey);
1677 reply.writeNoException();
1678 return true;
1679 }
1680
Dianne Hackborn860755f2010-06-03 18:47:52 -07001681 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1682 data.enforceInterface(IActivityManager.descriptor);
1683 finishHeavyWeightApp();
1684 reply.writeNoException();
1685 return true;
1686 }
Daniel Sandler69a48172010-06-23 16:29:36 -04001687
1688 case IS_IMMERSIVE_TRANSACTION: {
1689 data.enforceInterface(IActivityManager.descriptor);
1690 IBinder token = data.readStrongBinder();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001691 boolean isit = isImmersive(token);
Daniel Sandler69a48172010-06-23 16:29:36 -04001692 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001693 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001694 return true;
1695 }
1696
Craig Mautnerd61dc202014-07-07 11:09:11 -07001697 case IS_TOP_OF_TASK_TRANSACTION: {
1698 data.enforceInterface(IActivityManager.descriptor);
1699 IBinder token = data.readStrongBinder();
1700 final boolean isTopOfTask = isTopOfTask(token);
1701 reply.writeNoException();
1702 reply.writeInt(isTopOfTask ? 1 : 0);
1703 return true;
1704 }
1705
Craig Mautner5eda9b32013-07-02 11:58:16 -07001706 case CONVERT_FROM_TRANSLUCENT_TRANSACTION: {
Craig Mautner4addfc52013-06-25 08:05:45 -07001707 data.enforceInterface(IActivityManager.descriptor);
1708 IBinder token = data.readStrongBinder();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001709 boolean converted = convertFromTranslucent(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001710 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001711 reply.writeInt(converted ? 1 : 0);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001712 return true;
1713 }
1714
1715 case CONVERT_TO_TRANSLUCENT_TRANSACTION: {
1716 data.enforceInterface(IActivityManager.descriptor);
1717 IBinder token = data.readStrongBinder();
Craig Mautner233ceee2014-05-09 17:05:11 -07001718 final Bundle bundle;
1719 if (data.readInt() == 0) {
1720 bundle = null;
1721 } else {
1722 bundle = data.readBundle();
1723 }
1724 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
1725 boolean converted = convertToTranslucent(token, options);
Craig Mautner4addfc52013-06-25 08:05:45 -07001726 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001727 reply.writeInt(converted ? 1 : 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07001728 return true;
1729 }
1730
Craig Mautner233ceee2014-05-09 17:05:11 -07001731 case GET_ACTIVITY_OPTIONS_TRANSACTION: {
1732 data.enforceInterface(IActivityManager.descriptor);
1733 IBinder token = data.readStrongBinder();
1734 final ActivityOptions options = getActivityOptions(token);
1735 reply.writeNoException();
1736 reply.writeBundle(options == null ? null : options.toBundle());
1737 return true;
1738 }
1739
Daniel Sandler69a48172010-06-23 16:29:36 -04001740 case SET_IMMERSIVE_TRANSACTION: {
1741 data.enforceInterface(IActivityManager.descriptor);
1742 IBinder token = data.readStrongBinder();
1743 boolean imm = data.readInt() == 1;
1744 setImmersive(token, imm);
1745 reply.writeNoException();
1746 return true;
1747 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001748
Daniel Sandler69a48172010-06-23 16:29:36 -04001749 case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
1750 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001751 boolean isit = isTopActivityImmersive();
Daniel Sandler69a48172010-06-23 16:29:36 -04001752 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001753 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001754 return true;
1755 }
1756
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001757 case CRASH_APPLICATION_TRANSACTION: {
1758 data.enforceInterface(IActivityManager.descriptor);
1759 int uid = data.readInt();
1760 int initialPid = data.readInt();
1761 String packageName = data.readString();
1762 String message = data.readString();
1763 crashApplication(uid, initialPid, packageName, message);
1764 reply.writeNoException();
1765 return true;
1766 }
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001767
1768 case GET_PROVIDER_MIME_TYPE_TRANSACTION: {
1769 data.enforceInterface(IActivityManager.descriptor);
1770 Uri uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001771 int userId = data.readInt();
1772 String type = getProviderMimeType(uri, userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001773 reply.writeNoException();
1774 reply.writeString(type);
1775 return true;
1776 }
1777
Dianne Hackborn7e269642010-08-25 19:50:20 -07001778 case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
1779 data.enforceInterface(IActivityManager.descriptor);
1780 String name = data.readString();
1781 IBinder perm = newUriPermissionOwner(name);
1782 reply.writeNoException();
1783 reply.writeStrongBinder(perm);
1784 return true;
1785 }
1786
1787 case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1788 data.enforceInterface(IActivityManager.descriptor);
1789 IBinder owner = data.readStrongBinder();
1790 int fromUid = data.readInt();
1791 String targetPkg = data.readString();
1792 Uri uri = Uri.CREATOR.createFromParcel(data);
1793 int mode = data.readInt();
Nicolas Prevotf1939902014-06-25 09:29:02 +01001794 int sourceUserId = data.readInt();
1795 int targetUserId = data.readInt();
1796 grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId,
1797 targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001798 reply.writeNoException();
1799 return true;
1800 }
1801
1802 case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1803 data.enforceInterface(IActivityManager.descriptor);
1804 IBinder owner = data.readStrongBinder();
1805 Uri uri = null;
1806 if (data.readInt() != 0) {
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001807 uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001808 }
1809 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001810 int userId = data.readInt();
1811 revokeUriPermissionFromOwner(owner, uri, mode, userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001812 reply.writeNoException();
1813 return true;
1814 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001815
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001816 case CHECK_GRANT_URI_PERMISSION_TRANSACTION: {
1817 data.enforceInterface(IActivityManager.descriptor);
1818 int callingUid = data.readInt();
1819 String targetPkg = data.readString();
1820 Uri uri = Uri.CREATOR.createFromParcel(data);
1821 int modeFlags = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001822 int userId = data.readInt();
1823 int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001824 reply.writeNoException();
1825 reply.writeInt(res);
1826 return true;
1827 }
1828
Andy McFadden824c5102010-07-09 16:26:57 -07001829 case DUMP_HEAP_TRANSACTION: {
1830 data.enforceInterface(IActivityManager.descriptor);
1831 String process = data.readString();
Dianne Hackbornb12e1352012-09-26 11:39:20 -07001832 int userId = data.readInt();
Andy McFadden824c5102010-07-09 16:26:57 -07001833 boolean managed = data.readInt() != 0;
1834 String path = data.readString();
1835 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -07001836 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborn1676c852012-09-10 14:52:30 -07001837 boolean res = dumpHeap(process, userId, managed, path, fd);
Andy McFadden824c5102010-07-09 16:26:57 -07001838 reply.writeNoException();
1839 reply.writeInt(res ? 1 : 0);
1840 return true;
1841 }
1842
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001843 case START_ACTIVITIES_TRANSACTION:
1844 {
1845 data.enforceInterface(IActivityManager.descriptor);
1846 IBinder b = data.readStrongBinder();
1847 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001848 String callingPackage = data.readString();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001849 Intent[] intents = data.createTypedArray(Intent.CREATOR);
1850 String[] resolvedTypes = data.createStringArray();
1851 IBinder resultTo = data.readStrongBinder();
Dianne Hackborna4972e92012-03-14 10:38:05 -07001852 Bundle options = data.readInt() != 0
1853 ? Bundle.CREATOR.createFromParcel(data) : null;
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001854 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001855 int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001856 options, userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001857 reply.writeNoException();
1858 reply.writeInt(result);
1859 return true;
1860 }
1861
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001862 case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1863 {
1864 data.enforceInterface(IActivityManager.descriptor);
1865 int mode = getFrontActivityScreenCompatMode();
1866 reply.writeNoException();
1867 reply.writeInt(mode);
1868 return true;
1869 }
1870
1871 case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1872 {
1873 data.enforceInterface(IActivityManager.descriptor);
1874 int mode = data.readInt();
1875 setFrontActivityScreenCompatMode(mode);
1876 reply.writeNoException();
1877 reply.writeInt(mode);
1878 return true;
1879 }
1880
1881 case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1882 {
1883 data.enforceInterface(IActivityManager.descriptor);
1884 String pkg = data.readString();
1885 int mode = getPackageScreenCompatMode(pkg);
1886 reply.writeNoException();
1887 reply.writeInt(mode);
1888 return true;
1889 }
1890
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001891 case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1892 {
1893 data.enforceInterface(IActivityManager.descriptor);
1894 String pkg = data.readString();
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001895 int mode = data.readInt();
1896 setPackageScreenCompatMode(pkg, mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001897 reply.writeNoException();
1898 return true;
1899 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001900
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001901 case SWITCH_USER_TRANSACTION: {
1902 data.enforceInterface(IActivityManager.descriptor);
1903 int userid = data.readInt();
1904 boolean result = switchUser(userid);
1905 reply.writeNoException();
1906 reply.writeInt(result ? 1 : 0);
1907 return true;
1908 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07001909
Kenny Guy08488bf2014-02-21 17:40:37 +00001910 case START_USER_IN_BACKGROUND_TRANSACTION: {
1911 data.enforceInterface(IActivityManager.descriptor);
1912 int userid = data.readInt();
1913 boolean result = startUserInBackground(userid);
1914 reply.writeNoException();
1915 reply.writeInt(result ? 1 : 0);
1916 return true;
1917 }
1918
Dianne Hackborn80a4af22012-08-27 19:18:31 -07001919 case STOP_USER_TRANSACTION: {
1920 data.enforceInterface(IActivityManager.descriptor);
1921 int userid = data.readInt();
1922 IStopUserCallback callback = IStopUserCallback.Stub.asInterface(
1923 data.readStrongBinder());
1924 int result = stopUser(userid, callback);
1925 reply.writeNoException();
1926 reply.writeInt(result);
1927 return true;
1928 }
1929
Amith Yamasani52f1d752012-03-28 18:19:29 -07001930 case GET_CURRENT_USER_TRANSACTION: {
1931 data.enforceInterface(IActivityManager.descriptor);
1932 UserInfo userInfo = getCurrentUser();
1933 reply.writeNoException();
1934 userInfo.writeToParcel(reply, 0);
1935 return true;
1936 }
1937
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001938 case IS_USER_RUNNING_TRANSACTION: {
1939 data.enforceInterface(IActivityManager.descriptor);
1940 int userid = data.readInt();
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07001941 boolean orStopping = data.readInt() != 0;
1942 boolean result = isUserRunning(userid, orStopping);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001943 reply.writeNoException();
1944 reply.writeInt(result ? 1 : 0);
1945 return true;
1946 }
1947
Dianne Hackbornc72fc672012-09-20 13:12:03 -07001948 case GET_RUNNING_USER_IDS_TRANSACTION: {
1949 data.enforceInterface(IActivityManager.descriptor);
1950 int[] result = getRunningUserIds();
1951 reply.writeNoException();
1952 reply.writeIntArray(result);
1953 return true;
1954 }
1955
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001956 case REMOVE_TASK_TRANSACTION:
1957 {
1958 data.enforceInterface(IActivityManager.descriptor);
1959 int taskId = data.readInt();
Wale Ogunwaled54b5782014-10-23 15:55:23 -07001960 boolean result = removeTask(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001961 reply.writeNoException();
1962 reply.writeInt(result ? 1 : 0);
1963 return true;
1964 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001965
Jeff Sharkeya4620792011-05-20 15:29:23 -07001966 case REGISTER_PROCESS_OBSERVER_TRANSACTION: {
1967 data.enforceInterface(IActivityManager.descriptor);
1968 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1969 data.readStrongBinder());
1970 registerProcessObserver(observer);
1971 return true;
1972 }
1973
1974 case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: {
1975 data.enforceInterface(IActivityManager.descriptor);
1976 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1977 data.readStrongBinder());
1978 unregisterProcessObserver(observer);
1979 return true;
1980 }
1981
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07001982 case REGISTER_UID_OBSERVER_TRANSACTION: {
1983 data.enforceInterface(IActivityManager.descriptor);
1984 IUidObserver observer = IUidObserver.Stub.asInterface(
1985 data.readStrongBinder());
1986 registerUidObserver(observer);
1987 return true;
1988 }
1989
1990 case UNREGISTER_UID_OBSERVER_TRANSACTION: {
1991 data.enforceInterface(IActivityManager.descriptor);
1992 IUidObserver observer = IUidObserver.Stub.asInterface(
1993 data.readStrongBinder());
1994 unregisterUidObserver(observer);
1995 return true;
1996 }
1997
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07001998 case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1999 {
2000 data.enforceInterface(IActivityManager.descriptor);
2001 String pkg = data.readString();
2002 boolean ask = getPackageAskScreenCompat(pkg);
2003 reply.writeNoException();
2004 reply.writeInt(ask ? 1 : 0);
2005 return true;
2006 }
2007
2008 case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
2009 {
2010 data.enforceInterface(IActivityManager.descriptor);
2011 String pkg = data.readString();
2012 boolean ask = data.readInt() != 0;
2013 setPackageAskScreenCompat(pkg, ask);
2014 reply.writeNoException();
2015 return true;
2016 }
2017
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002018 case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: {
2019 data.enforceInterface(IActivityManager.descriptor);
2020 IIntentSender r = IIntentSender.Stub.asInterface(
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002021 data.readStrongBinder());
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002022 boolean res = isIntentSenderTargetedToPackage(r);
2023 reply.writeNoException();
2024 reply.writeInt(res ? 1 : 0);
2025 return true;
2026 }
2027
Dianne Hackborn1927ae82012-06-22 15:21:36 -07002028 case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: {
2029 data.enforceInterface(IActivityManager.descriptor);
2030 IIntentSender r = IIntentSender.Stub.asInterface(
2031 data.readStrongBinder());
2032 boolean res = isIntentSenderAnActivity(r);
2033 reply.writeNoException();
2034 reply.writeInt(res ? 1 : 0);
2035 return true;
2036 }
2037
Dianne Hackborn81038902012-11-26 17:04:09 -08002038 case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: {
2039 data.enforceInterface(IActivityManager.descriptor);
2040 IIntentSender r = IIntentSender.Stub.asInterface(
2041 data.readStrongBinder());
2042 Intent intent = getIntentForIntentSender(r);
2043 reply.writeNoException();
2044 if (intent != null) {
2045 reply.writeInt(1);
2046 intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2047 } else {
2048 reply.writeInt(0);
2049 }
2050 return true;
2051 }
2052
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08002053 case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: {
2054 data.enforceInterface(IActivityManager.descriptor);
2055 IIntentSender r = IIntentSender.Stub.asInterface(
2056 data.readStrongBinder());
2057 String prefix = data.readString();
2058 String tag = getTagForIntentSender(r, prefix);
2059 reply.writeNoException();
2060 reply.writeString(tag);
2061 return true;
2062 }
2063
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002064 case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
2065 data.enforceInterface(IActivityManager.descriptor);
2066 Configuration config = Configuration.CREATOR.createFromParcel(data);
2067 updatePersistentConfiguration(config);
2068 reply.writeNoException();
2069 return true;
2070 }
2071
Dianne Hackbornb437e092011-08-05 17:50:29 -07002072 case GET_PROCESS_PSS_TRANSACTION: {
2073 data.enforceInterface(IActivityManager.descriptor);
2074 int[] pids = data.createIntArray();
2075 long[] pss = getProcessPss(pids);
2076 reply.writeNoException();
2077 reply.writeLongArray(pss);
2078 return true;
2079 }
2080
Dianne Hackborn661cd522011-08-22 00:26:20 -07002081 case SHOW_BOOT_MESSAGE_TRANSACTION: {
2082 data.enforceInterface(IActivityManager.descriptor);
2083 CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
2084 boolean always = data.readInt() != 0;
2085 showBootMessage(msg, always);
2086 reply.writeNoException();
2087 return true;
2088 }
2089
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002090 case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002091 data.enforceInterface(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002092 keyguardWaitingForActivityDrawn();
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002093 reply.writeNoException();
2094 return true;
2095 }
2096
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07002097 case KEYGUARD_GOING_AWAY_TRANSACTION: {
2098 data.enforceInterface(IActivityManager.descriptor);
2099 keyguardGoingAway(data.readInt() != 0, data.readInt() != 0);
2100 reply.writeNoException();
2101 return true;
2102 }
2103
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002104 case SHOULD_UP_RECREATE_TASK_TRANSACTION: {
Adam Powelldd8fab22012-03-22 17:47:27 -07002105 data.enforceInterface(IActivityManager.descriptor);
2106 IBinder token = data.readStrongBinder();
2107 String destAffinity = data.readString();
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002108 boolean res = shouldUpRecreateTask(token, destAffinity);
Adam Powelldd8fab22012-03-22 17:47:27 -07002109 reply.writeNoException();
2110 reply.writeInt(res ? 1 : 0);
2111 return true;
2112 }
2113
2114 case NAVIGATE_UP_TO_TRANSACTION: {
2115 data.enforceInterface(IActivityManager.descriptor);
2116 IBinder token = data.readStrongBinder();
2117 Intent target = Intent.CREATOR.createFromParcel(data);
2118 int resultCode = data.readInt();
2119 Intent resultData = null;
2120 if (data.readInt() != 0) {
2121 resultData = Intent.CREATOR.createFromParcel(data);
2122 }
2123 boolean res = navigateUpTo(token, target, resultCode, resultData);
2124 reply.writeNoException();
2125 reply.writeInt(res ? 1 : 0);
2126 return true;
2127 }
2128
Dianne Hackborn5320eb82012-05-18 12:05:04 -07002129 case GET_LAUNCHED_FROM_UID_TRANSACTION: {
2130 data.enforceInterface(IActivityManager.descriptor);
2131 IBinder token = data.readStrongBinder();
2132 int res = getLaunchedFromUid(token);
2133 reply.writeNoException();
2134 reply.writeInt(res);
2135 return true;
2136 }
2137
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002138 case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: {
2139 data.enforceInterface(IActivityManager.descriptor);
2140 IBinder token = data.readStrongBinder();
2141 String res = getLaunchedFromPackage(token);
2142 reply.writeNoException();
2143 reply.writeString(res);
2144 return true;
2145 }
2146
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002147 case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2148 data.enforceInterface(IActivityManager.descriptor);
2149 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2150 data.readStrongBinder());
2151 registerUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002152 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002153 return true;
2154 }
2155
2156 case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2157 data.enforceInterface(IActivityManager.descriptor);
2158 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2159 data.readStrongBinder());
2160 unregisterUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002161 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002162 return true;
2163 }
2164
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002165 case REQUEST_BUG_REPORT_TRANSACTION: {
2166 data.enforceInterface(IActivityManager.descriptor);
2167 requestBugReport();
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002168 reply.writeNoException();
2169 return true;
2170 }
2171
2172 case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: {
2173 data.enforceInterface(IActivityManager.descriptor);
2174 int pid = data.readInt();
2175 boolean aboveSystem = data.readInt() != 0;
Jeff Brownbd181bb2013-09-10 16:44:24 -07002176 String reason = data.readString();
2177 long res = inputDispatchingTimedOut(pid, aboveSystem, reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002178 reply.writeNoException();
2179 reply.writeLong(res);
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002180 return true;
2181 }
2182
Adam Skorydfc7fd72013-08-05 19:23:41 -07002183 case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002184 data.enforceInterface(IActivityManager.descriptor);
2185 int requestType = data.readInt();
Adam Skorydfc7fd72013-08-05 19:23:41 -07002186 Bundle res = getAssistContextExtras(requestType);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002187 reply.writeNoException();
2188 reply.writeBundle(res);
2189 return true;
2190 }
2191
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002192 case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
2193 data.enforceInterface(IActivityManager.descriptor);
2194 int requestType = data.readInt();
2195 IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder());
2196 requestAssistContextExtras(requestType, receiver);
2197 reply.writeNoException();
2198 return true;
2199 }
2200
Adam Skorydfc7fd72013-08-05 19:23:41 -07002201 case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002202 data.enforceInterface(IActivityManager.descriptor);
2203 IBinder token = data.readStrongBinder();
2204 Bundle extras = data.readBundle();
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07002205 AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data);
2206 AssistContent content = AssistContent.CREATOR.createFromParcel(data);
Dianne Hackborna3acdb32015-06-08 17:07:40 -07002207 Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null;
2208 reportAssistContextExtras(token, extras, structure, content, referrer);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002209 reply.writeNoException();
2210 return true;
2211 }
2212
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002213 case LAUNCH_ASSIST_INTENT_TRANSACTION: {
2214 data.enforceInterface(IActivityManager.descriptor);
2215 Intent intent = Intent.CREATOR.createFromParcel(data);
2216 int requestType = data.readInt();
2217 String hint = data.readString();
2218 int userHandle = data.readInt();
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07002219 Bundle args = data.readBundle();
2220 boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args);
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002221 reply.writeNoException();
2222 reply.writeInt(res ? 1 : 0);
2223 return true;
2224 }
2225
Benjamin Franzc200f442015-06-25 18:20:04 +01002226 case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: {
2227 data.enforceInterface(IActivityManager.descriptor);
2228 boolean res = isScreenCaptureAllowedOnCurrentActivity();
2229 reply.writeNoException();
2230 reply.writeInt(res ? 1 : 0);
2231 return true;
2232 }
2233
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002234 case KILL_UID_TRANSACTION: {
2235 data.enforceInterface(IActivityManager.descriptor);
2236 int uid = data.readInt();
2237 String reason = data.readString();
2238 killUid(uid, reason);
2239 reply.writeNoException();
2240 return true;
2241 }
2242
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07002243 case HANG_TRANSACTION: {
2244 data.enforceInterface(IActivityManager.descriptor);
2245 IBinder who = data.readStrongBinder();
2246 boolean allowRestart = data.readInt() != 0;
2247 hang(who, allowRestart);
2248 reply.writeNoException();
2249 return true;
2250 }
2251
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07002252 case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: {
2253 data.enforceInterface(IActivityManager.descriptor);
2254 IBinder token = data.readStrongBinder();
2255 reportActivityFullyDrawn(token);
2256 reply.writeNoException();
2257 return true;
2258 }
2259
Craig Mautner5eda9b32013-07-02 11:58:16 -07002260 case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: {
2261 data.enforceInterface(IActivityManager.descriptor);
2262 IBinder token = data.readStrongBinder();
2263 notifyActivityDrawn(token);
2264 reply.writeNoException();
2265 return true;
2266 }
Dianne Hackborn57a7f592013-07-22 18:21:32 -07002267
2268 case RESTART_TRANSACTION: {
2269 data.enforceInterface(IActivityManager.descriptor);
2270 restart();
2271 reply.writeNoException();
2272 return true;
2273 }
Jeff Sharkey08da7a12013-08-11 20:53:18 -07002274
Dianne Hackborn35f72be2013-09-16 10:57:39 -07002275 case PERFORM_IDLE_MAINTENANCE_TRANSACTION: {
2276 data.enforceInterface(IActivityManager.descriptor);
2277 performIdleMaintenance();
2278 reply.writeNoException();
2279 return true;
2280 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002281
Todd Kennedyca4d8422015-01-15 15:19:22 -08002282 case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: {
Craig Mautner4a1cb222013-12-04 16:14:06 -08002283 data.enforceInterface(IActivityManager.descriptor);
2284 IBinder parentActivityToken = data.readStrongBinder();
2285 IActivityContainerCallback callback =
Craig Mautnere3a00d72014-04-16 08:31:19 -07002286 IActivityContainerCallback.Stub.asInterface(data.readStrongBinder());
Craig Mautner4a1cb222013-12-04 16:14:06 -08002287 IActivityContainer activityContainer =
Todd Kennedyca4d8422015-01-15 15:19:22 -08002288 createVirtualActivityContainer(parentActivityToken, callback);
Craig Mautner4a1cb222013-12-04 16:14:06 -08002289 reply.writeNoException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08002290 if (activityContainer != null) {
2291 reply.writeInt(1);
2292 reply.writeStrongBinder(activityContainer.asBinder());
2293 } else {
2294 reply.writeInt(0);
2295 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002296 return true;
2297 }
2298
Craig Mautner95da1082014-02-24 17:54:35 -08002299 case DELETE_ACTIVITY_CONTAINER_TRANSACTION: {
2300 data.enforceInterface(IActivityManager.descriptor);
2301 IActivityContainer activityContainer =
2302 IActivityContainer.Stub.asInterface(data.readStrongBinder());
2303 deleteActivityContainer(activityContainer);
2304 reply.writeNoException();
2305 return true;
2306 }
2307
Todd Kennedy4900bf92015-01-16 16:05:14 -08002308 case CREATE_STACK_ON_DISPLAY: {
2309 data.enforceInterface(IActivityManager.descriptor);
2310 int displayId = data.readInt();
2311 IActivityContainer activityContainer = createStackOnDisplay(displayId);
2312 reply.writeNoException();
2313 if (activityContainer != null) {
2314 reply.writeInt(1);
2315 reply.writeStrongBinder(activityContainer.asBinder());
2316 } else {
2317 reply.writeInt(0);
2318 }
2319 return true;
2320 }
2321
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002322 case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: {
Craig Mautnere0a38842013-12-16 16:14:02 -08002323 data.enforceInterface(IActivityManager.descriptor);
2324 IBinder activityToken = data.readStrongBinder();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002325 int displayId = getActivityDisplayId(activityToken);
Craig Mautnere0a38842013-12-16 16:14:02 -08002326 reply.writeNoException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002327 reply.writeInt(displayId);
Craig Mautnere0a38842013-12-16 16:14:02 -08002328 return true;
2329 }
2330
Craig Mautneraea74a52014-03-08 14:23:10 -08002331 case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: {
2332 data.enforceInterface(IActivityManager.descriptor);
2333 final int taskId = data.readInt();
2334 startLockTaskMode(taskId);
2335 reply.writeNoException();
2336 return true;
2337 }
2338
2339 case START_LOCK_TASK_BY_TOKEN_TRANSACTION: {
2340 data.enforceInterface(IActivityManager.descriptor);
2341 IBinder token = data.readStrongBinder();
2342 startLockTaskMode(token);
2343 reply.writeNoException();
2344 return true;
2345 }
2346
Craig Mautnerd61dc202014-07-07 11:09:11 -07002347 case START_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002348 data.enforceInterface(IActivityManager.descriptor);
2349 startLockTaskModeOnCurrent();
2350 reply.writeNoException();
2351 return true;
2352 }
2353
Craig Mautneraea74a52014-03-08 14:23:10 -08002354 case STOP_LOCK_TASK_MODE_TRANSACTION: {
2355 data.enforceInterface(IActivityManager.descriptor);
2356 stopLockTaskMode();
2357 reply.writeNoException();
2358 return true;
2359 }
2360
Craig Mautnerd61dc202014-07-07 11:09:11 -07002361 case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002362 data.enforceInterface(IActivityManager.descriptor);
2363 stopLockTaskModeOnCurrent();
2364 reply.writeNoException();
2365 return true;
2366 }
2367
Craig Mautneraea74a52014-03-08 14:23:10 -08002368 case IS_IN_LOCK_TASK_MODE_TRANSACTION: {
2369 data.enforceInterface(IActivityManager.descriptor);
2370 final boolean isInLockTaskMode = isInLockTaskMode();
2371 reply.writeNoException();
2372 reply.writeInt(isInLockTaskMode ? 1 : 0);
2373 return true;
2374 }
Craig Mautner2fbd7542014-03-21 09:34:07 -07002375
Benjamin Franz43261142015-02-11 15:59:44 +00002376 case GET_LOCK_TASK_MODE_STATE_TRANSACTION: {
2377 data.enforceInterface(IActivityManager.descriptor);
2378 final int lockTaskModeState = getLockTaskModeState();
2379 reply.writeNoException();
2380 reply.writeInt(lockTaskModeState);
2381 return true;
2382 }
2383
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07002384 case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: {
2385 data.enforceInterface(IActivityManager.descriptor);
2386 final IBinder token = data.readStrongBinder();
2387 showLockTaskEscapeMessage(token);
2388 reply.writeNoException();
2389 return true;
2390 }
2391
Winson Chunga449dc02014-05-16 11:15:04 -07002392 case SET_TASK_DESCRIPTION_TRANSACTION: {
Craig Mautner2fbd7542014-03-21 09:34:07 -07002393 data.enforceInterface(IActivityManager.descriptor);
2394 IBinder token = data.readStrongBinder();
Winson Chunga449dc02014-05-16 11:15:04 -07002395 ActivityManager.TaskDescription values =
2396 ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
2397 setTaskDescription(token, values);
Craig Mautner2fbd7542014-03-21 09:34:07 -07002398 reply.writeNoException();
2399 return true;
2400 }
Craig Mautneree2e45a2014-06-27 12:10:03 -07002401
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08002402 case SET_TASK_RESIZEABLE_TRANSACTION: {
2403 data.enforceInterface(IActivityManager.descriptor);
2404 int taskId = data.readInt();
2405 boolean resizeable = (data.readInt() == 1) ? true : false;
2406 setTaskResizeable(taskId, resizeable);
2407 reply.writeNoException();
2408 return true;
2409 }
2410
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002411 case RESIZE_TASK_TRANSACTION: {
2412 data.enforceInterface(IActivityManager.descriptor);
2413 int taskId = data.readInt();
2414 Rect r = Rect.CREATOR.createFromParcel(data);
2415 resizeTask(taskId, r);
2416 reply.writeNoException();
2417 return true;
2418 }
2419
Craig Mautner648f69b2014-09-18 14:16:26 -07002420 case GET_TASK_DESCRIPTION_ICON_TRANSACTION: {
2421 data.enforceInterface(IActivityManager.descriptor);
2422 String filename = data.readString();
2423 Bitmap icon = getTaskDescriptionIcon(filename);
2424 reply.writeNoException();
2425 if (icon == null) {
2426 reply.writeInt(0);
2427 } else {
2428 reply.writeInt(1);
2429 icon.writeToParcel(reply, 0);
2430 }
2431 return true;
2432 }
2433
Winson Chung044d5292014-11-06 11:05:19 -08002434 case START_IN_PLACE_ANIMATION_TRANSACTION: {
2435 data.enforceInterface(IActivityManager.descriptor);
2436 final Bundle bundle;
2437 if (data.readInt() == 0) {
2438 bundle = null;
2439 } else {
2440 bundle = data.readBundle();
2441 }
2442 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
2443 startInPlaceAnimationOnFrontMostApplication(options);
2444 reply.writeNoException();
2445 return true;
2446 }
2447
Jose Lima4b6c6692014-08-12 17:41:12 -07002448 case REQUEST_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002449 data.enforceInterface(IActivityManager.descriptor);
2450 IBinder token = data.readStrongBinder();
2451 boolean enable = data.readInt() > 0;
Jose Lima4b6c6692014-08-12 17:41:12 -07002452 boolean success = requestVisibleBehind(token, enable);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002453 reply.writeNoException();
2454 reply.writeInt(success ? 1 : 0);
2455 return true;
2456 }
2457
Jose Lima4b6c6692014-08-12 17:41:12 -07002458 case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002459 data.enforceInterface(IActivityManager.descriptor);
2460 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002461 final boolean enabled = isBackgroundVisibleBehind(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002462 reply.writeNoException();
2463 reply.writeInt(enabled ? 1 : 0);
2464 return true;
2465 }
2466
Jose Lima4b6c6692014-08-12 17:41:12 -07002467 case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002468 data.enforceInterface(IActivityManager.descriptor);
2469 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002470 backgroundResourcesReleased(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002471 reply.writeNoException();
2472 return true;
2473 }
Craig Mautnerbb742462014-07-07 15:28:55 -07002474
2475 case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: {
2476 data.enforceInterface(IActivityManager.descriptor);
2477 IBinder token = data.readStrongBinder();
2478 notifyLaunchTaskBehindComplete(token);
2479 reply.writeNoException();
2480 return true;
2481 }
Craig Mautner8746a472014-07-24 15:12:54 -07002482
2483 case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: {
2484 data.enforceInterface(IActivityManager.descriptor);
2485 IBinder token = data.readStrongBinder();
2486 notifyEnterAnimationComplete(token);
2487 reply.writeNoException();
2488 return true;
2489 }
Craig Mautner6e2f3952014-09-09 14:26:41 -07002490
2491 case BOOT_ANIMATION_COMPLETE_TRANSACTION: {
2492 data.enforceInterface(IActivityManager.descriptor);
2493 bootAnimationComplete();
2494 reply.writeNoException();
2495 return true;
2496 }
Wale Ogunwale18795a22014-12-03 11:38:33 -08002497
Jeff Sharkey605eb792014-11-04 13:34:06 -08002498 case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: {
2499 data.enforceInterface(IActivityManager.descriptor);
2500 final int uid = data.readInt();
2501 final byte[] firstPacket = data.createByteArray();
2502 notifyCleartextNetwork(uid, firstPacket);
2503 reply.writeNoException();
2504 return true;
2505 }
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002506
2507 case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: {
2508 data.enforceInterface(IActivityManager.descriptor);
2509 String procName = data.readString();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002510 int uid = data.readInt();
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002511 long maxMemSize = data.readLong();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002512 String reportPackage = data.readString();
2513 setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002514 reply.writeNoException();
2515 return true;
2516 }
2517
2518 case DUMP_HEAP_FINISHED_TRANSACTION: {
2519 data.enforceInterface(IActivityManager.descriptor);
2520 String path = data.readString();
2521 dumpHeapFinished(path);
2522 reply.writeNoException();
2523 return true;
2524 }
Dianne Hackborn3d07c942015-03-13 18:02:54 -07002525
2526 case SET_VOICE_KEEP_AWAKE_TRANSACTION: {
2527 data.enforceInterface(IActivityManager.descriptor);
2528 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
2529 data.readStrongBinder());
2530 boolean keepAwake = data.readInt() != 0;
2531 setVoiceKeepAwake(session, keepAwake);
2532 reply.writeNoException();
2533 return true;
2534 }
Craig Mautnere5600772015-04-03 21:36:37 -07002535
2536 case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: {
2537 data.enforceInterface(IActivityManager.descriptor);
2538 int userId = data.readInt();
2539 String[] packages = data.readStringArray();
2540 updateLockTaskPackages(userId, packages);
2541 reply.writeNoException();
2542 return true;
2543 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07002544
Craig Mautner015c5e52015-04-23 10:39:39 -07002545 case UPDATE_DEVICE_OWNER_TRANSACTION: {
2546 data.enforceInterface(IActivityManager.descriptor);
2547 String packageName = data.readString();
2548 updateDeviceOwner(packageName);
2549 reply.writeNoException();
2550 return true;
2551 }
2552
Dianne Hackborn1e383822015-04-10 14:02:33 -07002553 case GET_PACKAGE_PROCESS_STATE_TRANSACTION: {
2554 data.enforceInterface(IActivityManager.descriptor);
2555 String pkg = data.readString();
Adam Lesinskic30454c2015-06-24 13:24:35 -07002556 String callingPackage = data.readString();
2557 int res = getPackageProcessState(pkg, callingPackage);
Dianne Hackborn1e383822015-04-10 14:02:33 -07002558 reply.writeNoException();
2559 reply.writeInt(res);
2560 return true;
2561 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07002562
2563 case SET_PROCESS_MEMORY_TRIM_TRANSACTION: {
2564 data.enforceInterface(IActivityManager.descriptor);
2565 String process = data.readString();
2566 int userId = data.readInt();
2567 int level = data.readInt();
2568 boolean res = setProcessMemoryTrimLevel(process, userId, level);
2569 reply.writeNoException();
2570 reply.writeInt(res ? 1 : 0);
2571 return true;
2572 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002573 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002574
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002575 return super.onTransact(code, data, reply, flags);
2576 }
2577
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002578 public IBinder asBinder() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002579 return this;
2580 }
2581
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002582 private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
2583 protected IActivityManager create() {
2584 IBinder b = ServiceManager.getService("activity");
Joe Onorato43a17652011-04-06 19:22:23 -07002585 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002586 Log.v("ActivityManager", "default service binder = " + b);
2587 }
2588 IActivityManager am = asInterface(b);
Joe Onorato43a17652011-04-06 19:22:23 -07002589 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002590 Log.v("ActivityManager", "default service = " + am);
2591 }
2592 return am;
2593 }
2594 };
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002595}
2596
2597class ActivityManagerProxy implements IActivityManager
2598{
2599 public ActivityManagerProxy(IBinder remote)
2600 {
2601 mRemote = remote;
2602 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002603
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002604 public IBinder asBinder()
2605 {
2606 return mRemote;
2607 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002608
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002609 public int startActivity(IApplicationThread caller, String callingPackage, Intent intent,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002610 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002611 int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002612 Parcel data = Parcel.obtain();
2613 Parcel reply = Parcel.obtain();
2614 data.writeInterfaceToken(IActivityManager.descriptor);
2615 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002616 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002617 intent.writeToParcel(data, 0);
2618 data.writeString(resolvedType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002619 data.writeStrongBinder(resultTo);
2620 data.writeString(resultWho);
2621 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002622 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002623 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002624 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002625 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002626 } else {
2627 data.writeInt(0);
2628 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002629 if (options != null) {
2630 data.writeInt(1);
2631 options.writeToParcel(data, 0);
2632 } else {
2633 data.writeInt(0);
2634 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002635 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2636 reply.readException();
2637 int result = reply.readInt();
2638 reply.recycle();
2639 data.recycle();
2640 return result;
2641 }
Amith Yamasani82644082012-08-03 13:09:11 -07002642
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002643 public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent,
Amith Yamasani82644082012-08-03 13:09:11 -07002644 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002645 int startFlags, ProfilerInfo profilerInfo, Bundle options,
2646 int userId) throws RemoteException {
Amith Yamasani82644082012-08-03 13:09:11 -07002647 Parcel data = Parcel.obtain();
2648 Parcel reply = Parcel.obtain();
2649 data.writeInterfaceToken(IActivityManager.descriptor);
2650 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002651 data.writeString(callingPackage);
Amith Yamasani82644082012-08-03 13:09:11 -07002652 intent.writeToParcel(data, 0);
2653 data.writeString(resolvedType);
2654 data.writeStrongBinder(resultTo);
2655 data.writeString(resultWho);
2656 data.writeInt(requestCode);
2657 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002658 if (profilerInfo != null) {
Amith Yamasani82644082012-08-03 13:09:11 -07002659 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002660 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Amith Yamasani82644082012-08-03 13:09:11 -07002661 } else {
2662 data.writeInt(0);
2663 }
2664 if (options != null) {
2665 data.writeInt(1);
2666 options.writeToParcel(data, 0);
2667 } else {
2668 data.writeInt(0);
2669 }
2670 data.writeInt(userId);
2671 mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0);
2672 reply.readException();
2673 int result = reply.readInt();
2674 reply.recycle();
2675 data.recycle();
2676 return result;
2677 }
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002678 public int startActivityAsCaller(IApplicationThread caller, String callingPackage,
2679 Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna7cfbe02015-07-16 10:52:52 -07002680 int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity,
2681 int userId) throws RemoteException {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002682 Parcel data = Parcel.obtain();
2683 Parcel reply = Parcel.obtain();
2684 data.writeInterfaceToken(IActivityManager.descriptor);
2685 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2686 data.writeString(callingPackage);
2687 intent.writeToParcel(data, 0);
2688 data.writeString(resolvedType);
2689 data.writeStrongBinder(resultTo);
2690 data.writeString(resultWho);
2691 data.writeInt(requestCode);
2692 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002693 if (profilerInfo != null) {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002694 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002695 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002696 } else {
2697 data.writeInt(0);
2698 }
2699 if (options != null) {
2700 data.writeInt(1);
2701 options.writeToParcel(data, 0);
2702 } else {
2703 data.writeInt(0);
2704 }
Dianne Hackborna7cfbe02015-07-16 10:52:52 -07002705 data.writeInt(ignoreTargetSecurity ? 1 : 0);
Jeff Sharkey97978802014-10-14 10:48:18 -07002706 data.writeInt(userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002707 mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0);
2708 reply.readException();
2709 int result = reply.readInt();
2710 reply.recycle();
2711 data.recycle();
2712 return result;
2713 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002714 public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage,
2715 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Jeff Hao1b012d32014-08-20 10:35:34 -07002716 int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options,
2717 int userId) throws RemoteException {
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002718 Parcel data = Parcel.obtain();
2719 Parcel reply = Parcel.obtain();
2720 data.writeInterfaceToken(IActivityManager.descriptor);
2721 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002722 data.writeString(callingPackage);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002723 intent.writeToParcel(data, 0);
2724 data.writeString(resolvedType);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002725 data.writeStrongBinder(resultTo);
2726 data.writeString(resultWho);
2727 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002728 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002729 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002730 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002731 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002732 } else {
2733 data.writeInt(0);
2734 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002735 if (options != null) {
2736 data.writeInt(1);
2737 options.writeToParcel(data, 0);
2738 } else {
2739 data.writeInt(0);
2740 }
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002741 data.writeInt(userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002742 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
2743 reply.readException();
2744 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
2745 reply.recycle();
2746 data.recycle();
2747 return result;
2748 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002749 public int startActivityWithConfig(IApplicationThread caller, String callingPackage,
2750 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002751 int requestCode, int startFlags, Configuration config,
Dianne Hackborn41203752012-08-31 14:05:51 -07002752 Bundle options, int userId) throws RemoteException {
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002753 Parcel data = Parcel.obtain();
2754 Parcel reply = Parcel.obtain();
2755 data.writeInterfaceToken(IActivityManager.descriptor);
2756 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002757 data.writeString(callingPackage);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002758 intent.writeToParcel(data, 0);
2759 data.writeString(resolvedType);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002760 data.writeStrongBinder(resultTo);
2761 data.writeString(resultWho);
2762 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002763 data.writeInt(startFlags);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002764 config.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002765 if (options != null) {
2766 data.writeInt(1);
2767 options.writeToParcel(data, 0);
2768 } else {
2769 data.writeInt(0);
2770 }
Dianne Hackborn41203752012-08-31 14:05:51 -07002771 data.writeInt(userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002772 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2773 reply.readException();
2774 int result = reply.readInt();
2775 reply.recycle();
2776 data.recycle();
2777 return result;
2778 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002779 public int startActivityIntentSender(IApplicationThread caller,
2780 IntentSender intent, Intent fillInIntent, String resolvedType,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002781 IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002782 int flagsMask, int flagsValues, Bundle options) throws RemoteException {
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002783 Parcel data = Parcel.obtain();
2784 Parcel reply = Parcel.obtain();
2785 data.writeInterfaceToken(IActivityManager.descriptor);
2786 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2787 intent.writeToParcel(data, 0);
2788 if (fillInIntent != null) {
2789 data.writeInt(1);
2790 fillInIntent.writeToParcel(data, 0);
2791 } else {
2792 data.writeInt(0);
2793 }
2794 data.writeString(resolvedType);
2795 data.writeStrongBinder(resultTo);
2796 data.writeString(resultWho);
2797 data.writeInt(requestCode);
2798 data.writeInt(flagsMask);
2799 data.writeInt(flagsValues);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002800 if (options != null) {
2801 data.writeInt(1);
2802 options.writeToParcel(data, 0);
2803 } else {
2804 data.writeInt(0);
2805 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002806 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002807 reply.readException();
2808 int result = reply.readInt();
2809 reply.recycle();
2810 data.recycle();
2811 return result;
2812 }
Dianne Hackborn91097de2014-04-04 18:02:06 -07002813 public int startVoiceActivity(String callingPackage, int callingPid, int callingUid,
2814 Intent intent, String resolvedType, IVoiceInteractionSession session,
Jeff Hao1b012d32014-08-20 10:35:34 -07002815 IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo,
2816 Bundle options, int userId) throws RemoteException {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002817 Parcel data = Parcel.obtain();
2818 Parcel reply = Parcel.obtain();
2819 data.writeInterfaceToken(IActivityManager.descriptor);
2820 data.writeString(callingPackage);
2821 data.writeInt(callingPid);
2822 data.writeInt(callingUid);
2823 intent.writeToParcel(data, 0);
2824 data.writeString(resolvedType);
2825 data.writeStrongBinder(session.asBinder());
2826 data.writeStrongBinder(interactor.asBinder());
2827 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002828 if (profilerInfo != null) {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002829 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002830 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn91097de2014-04-04 18:02:06 -07002831 } else {
2832 data.writeInt(0);
2833 }
2834 if (options != null) {
2835 data.writeInt(1);
2836 options.writeToParcel(data, 0);
2837 } else {
2838 data.writeInt(0);
2839 }
2840 data.writeInt(userId);
2841 mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0);
2842 reply.readException();
2843 int result = reply.readInt();
2844 reply.recycle();
2845 data.recycle();
2846 return result;
2847 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002848 public boolean startNextMatchingActivity(IBinder callingActivity,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002849 Intent intent, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002850 Parcel data = Parcel.obtain();
2851 Parcel reply = Parcel.obtain();
2852 data.writeInterfaceToken(IActivityManager.descriptor);
2853 data.writeStrongBinder(callingActivity);
2854 intent.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002855 if (options != null) {
2856 data.writeInt(1);
2857 options.writeToParcel(data, 0);
2858 } else {
2859 data.writeInt(0);
2860 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002861 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
2862 reply.readException();
2863 int result = reply.readInt();
2864 reply.recycle();
2865 data.recycle();
2866 return result != 0;
2867 }
Craig Mautnerdc00cbe2014-07-20 17:48:47 -07002868 public int startActivityFromRecents(int taskId, Bundle options) throws RemoteException {
2869 Parcel data = Parcel.obtain();
2870 Parcel reply = Parcel.obtain();
2871 data.writeInterfaceToken(IActivityManager.descriptor);
2872 data.writeInt(taskId);
2873 if (options == null) {
2874 data.writeInt(0);
2875 } else {
2876 data.writeInt(1);
2877 options.writeToParcel(data, 0);
2878 }
2879 mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0);
2880 reply.readException();
2881 int result = reply.readInt();
2882 reply.recycle();
2883 data.recycle();
2884 return result;
2885 }
Winson Chung3b3f4642014-04-22 10:08:18 -07002886 public boolean finishActivity(IBinder token, int resultCode, Intent resultData, boolean finishTask)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002887 throws RemoteException {
2888 Parcel data = Parcel.obtain();
2889 Parcel reply = Parcel.obtain();
2890 data.writeInterfaceToken(IActivityManager.descriptor);
2891 data.writeStrongBinder(token);
2892 data.writeInt(resultCode);
2893 if (resultData != null) {
2894 data.writeInt(1);
2895 resultData.writeToParcel(data, 0);
2896 } else {
2897 data.writeInt(0);
2898 }
Winson Chung3b3f4642014-04-22 10:08:18 -07002899 data.writeInt(finishTask ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002900 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
2901 reply.readException();
2902 boolean res = reply.readInt() != 0;
2903 data.recycle();
2904 reply.recycle();
2905 return res;
2906 }
2907 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
2908 {
2909 Parcel data = Parcel.obtain();
2910 Parcel reply = Parcel.obtain();
2911 data.writeInterfaceToken(IActivityManager.descriptor);
2912 data.writeStrongBinder(token);
2913 data.writeString(resultWho);
2914 data.writeInt(requestCode);
2915 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
2916 reply.readException();
2917 data.recycle();
2918 reply.recycle();
2919 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -07002920 public boolean finishActivityAffinity(IBinder token) throws RemoteException {
2921 Parcel data = Parcel.obtain();
2922 Parcel reply = Parcel.obtain();
2923 data.writeInterfaceToken(IActivityManager.descriptor);
2924 data.writeStrongBinder(token);
2925 mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0);
2926 reply.readException();
2927 boolean res = reply.readInt() != 0;
2928 data.recycle();
2929 reply.recycle();
2930 return res;
2931 }
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -07002932 public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException {
2933 Parcel data = Parcel.obtain();
2934 Parcel reply = Parcel.obtain();
2935 data.writeInterfaceToken(IActivityManager.descriptor);
2936 data.writeStrongBinder(session.asBinder());
2937 mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0);
2938 reply.readException();
2939 data.recycle();
2940 reply.recycle();
2941 }
Dianne Hackborn89ad4562014-08-24 16:45:38 -07002942 public boolean releaseActivityInstance(IBinder token) throws RemoteException {
2943 Parcel data = Parcel.obtain();
2944 Parcel reply = Parcel.obtain();
2945 data.writeInterfaceToken(IActivityManager.descriptor);
2946 data.writeStrongBinder(token);
2947 mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0);
2948 reply.readException();
2949 boolean res = reply.readInt() != 0;
2950 data.recycle();
2951 reply.recycle();
2952 return res;
2953 }
2954 public void releaseSomeActivities(IApplicationThread app) throws RemoteException {
2955 Parcel data = Parcel.obtain();
2956 Parcel reply = Parcel.obtain();
2957 data.writeInterfaceToken(IActivityManager.descriptor);
2958 data.writeStrongBinder(app.asBinder());
2959 mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0);
2960 reply.readException();
2961 data.recycle();
2962 reply.recycle();
2963 }
Dianne Hackborn061d58a2010-03-12 15:07:06 -08002964 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
2965 Parcel data = Parcel.obtain();
2966 Parcel reply = Parcel.obtain();
2967 data.writeInterfaceToken(IActivityManager.descriptor);
2968 data.writeStrongBinder(token);
2969 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
2970 reply.readException();
2971 boolean res = reply.readInt() != 0;
2972 data.recycle();
2973 reply.recycle();
2974 return res;
2975 }
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002976 public Intent registerReceiver(IApplicationThread caller, String packageName,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002977 IIntentReceiver receiver,
Dianne Hackborn20e80982012-08-31 19:00:44 -07002978 IntentFilter filter, String perm, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002979 {
2980 Parcel data = Parcel.obtain();
2981 Parcel reply = Parcel.obtain();
2982 data.writeInterfaceToken(IActivityManager.descriptor);
2983 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002984 data.writeString(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002985 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
2986 filter.writeToParcel(data, 0);
2987 data.writeString(perm);
Dianne Hackborn20e80982012-08-31 19:00:44 -07002988 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002989 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2990 reply.readException();
2991 Intent intent = null;
2992 int haveIntent = reply.readInt();
2993 if (haveIntent != 0) {
2994 intent = Intent.CREATOR.createFromParcel(reply);
2995 }
2996 reply.recycle();
2997 data.recycle();
2998 return intent;
2999 }
3000 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
3001 {
3002 Parcel data = Parcel.obtain();
3003 Parcel reply = Parcel.obtain();
3004 data.writeInterfaceToken(IActivityManager.descriptor);
3005 data.writeStrongBinder(receiver.asBinder());
3006 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
3007 reply.readException();
3008 data.recycle();
3009 reply.recycle();
3010 }
3011 public int broadcastIntent(IApplicationThread caller,
Dianne Hackborna750a632015-06-16 17:18:23 -07003012 Intent intent, String resolvedType, IIntentReceiver resultTo,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003013 int resultCode, String resultData, Bundle map,
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -07003014 String[] requiredPermissions, int appOp, Bundle options, boolean serialized,
Amith Yamasani742a6712011-05-04 14:49:28 -07003015 boolean sticky, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003016 {
3017 Parcel data = Parcel.obtain();
3018 Parcel reply = Parcel.obtain();
3019 data.writeInterfaceToken(IActivityManager.descriptor);
3020 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3021 intent.writeToParcel(data, 0);
3022 data.writeString(resolvedType);
3023 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
3024 data.writeInt(resultCode);
3025 data.writeString(resultData);
3026 data.writeBundle(map);
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -07003027 data.writeStringArray(requiredPermissions);
Dianne Hackbornf51f6122013-02-04 18:23:34 -08003028 data.writeInt(appOp);
Dianne Hackborna750a632015-06-16 17:18:23 -07003029 data.writeBundle(options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003030 data.writeInt(serialized ? 1 : 0);
3031 data.writeInt(sticky ? 1 : 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003032 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003033 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
3034 reply.readException();
3035 int res = reply.readInt();
3036 reply.recycle();
3037 data.recycle();
3038 return res;
3039 }
Amith Yamasani742a6712011-05-04 14:49:28 -07003040 public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
3041 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003042 {
3043 Parcel data = Parcel.obtain();
3044 Parcel reply = Parcel.obtain();
3045 data.writeInterfaceToken(IActivityManager.descriptor);
3046 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3047 intent.writeToParcel(data, 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003048 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003049 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
3050 reply.readException();
3051 data.recycle();
3052 reply.recycle();
3053 }
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003054 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map,
3055 boolean abortBroadcast, int flags) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003056 {
3057 Parcel data = Parcel.obtain();
3058 Parcel reply = Parcel.obtain();
3059 data.writeInterfaceToken(IActivityManager.descriptor);
3060 data.writeStrongBinder(who);
3061 data.writeInt(resultCode);
3062 data.writeString(resultData);
3063 data.writeBundle(map);
3064 data.writeInt(abortBroadcast ? 1 : 0);
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003065 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003066 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3067 reply.readException();
3068 data.recycle();
3069 reply.recycle();
3070 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003071 public void attachApplication(IApplicationThread app) throws RemoteException
3072 {
3073 Parcel data = Parcel.obtain();
3074 Parcel reply = Parcel.obtain();
3075 data.writeInterfaceToken(IActivityManager.descriptor);
3076 data.writeStrongBinder(app.asBinder());
3077 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
3078 reply.readException();
3079 data.recycle();
3080 reply.recycle();
3081 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003082 public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
3083 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003084 {
3085 Parcel data = Parcel.obtain();
3086 Parcel reply = Parcel.obtain();
3087 data.writeInterfaceToken(IActivityManager.descriptor);
3088 data.writeStrongBinder(token);
Dianne Hackborne88846e2009-09-30 21:34:25 -07003089 if (config != null) {
3090 data.writeInt(1);
3091 config.writeToParcel(data, 0);
3092 } else {
3093 data.writeInt(0);
3094 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003095 data.writeInt(stopProfiling ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003096 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3097 reply.readException();
3098 data.recycle();
3099 reply.recycle();
3100 }
Dianne Hackbornad9b32112012-09-17 15:35:01 -07003101 public void activityResumed(IBinder token) throws RemoteException
3102 {
3103 Parcel data = Parcel.obtain();
3104 Parcel reply = Parcel.obtain();
3105 data.writeInterfaceToken(IActivityManager.descriptor);
3106 data.writeStrongBinder(token);
3107 mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0);
3108 reply.readException();
3109 data.recycle();
3110 reply.recycle();
3111 }
Dianne Hackborna4e102e2014-09-04 22:52:27 -07003112 public void activityPaused(IBinder token) throws RemoteException
Dianne Hackborn0aae2d42010-12-07 23:51:29 -08003113 {
3114 Parcel data = Parcel.obtain();
3115 Parcel reply = Parcel.obtain();
3116 data.writeInterfaceToken(IActivityManager.descriptor);
3117 data.writeStrongBinder(token);
3118 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
3119 reply.readException();
3120 data.recycle();
3121 reply.recycle();
3122 }
3123 public void activityStopped(IBinder token, Bundle state,
Craig Mautnera0026042014-04-23 11:45:37 -07003124 PersistableBundle persistentState, CharSequence description) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003125 {
3126 Parcel data = Parcel.obtain();
3127 Parcel reply = Parcel.obtain();
3128 data.writeInterfaceToken(IActivityManager.descriptor);
3129 data.writeStrongBinder(token);
3130 data.writeBundle(state);
Craig Mautnera0026042014-04-23 11:45:37 -07003131 data.writePersistableBundle(persistentState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003132 TextUtils.writeToParcel(description, data, 0);
3133 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3134 reply.readException();
3135 data.recycle();
3136 reply.recycle();
3137 }
Dianne Hackborn4eba96b2011-01-21 13:34:36 -08003138 public void activitySlept(IBinder token) throws RemoteException
3139 {
3140 Parcel data = Parcel.obtain();
3141 Parcel reply = Parcel.obtain();
3142 data.writeInterfaceToken(IActivityManager.descriptor);
3143 data.writeStrongBinder(token);
3144 mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3145 reply.readException();
3146 data.recycle();
3147 reply.recycle();
3148 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003149 public void activityDestroyed(IBinder token) throws RemoteException
3150 {
3151 Parcel data = Parcel.obtain();
3152 Parcel reply = Parcel.obtain();
3153 data.writeInterfaceToken(IActivityManager.descriptor);
3154 data.writeStrongBinder(token);
3155 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3156 reply.readException();
3157 data.recycle();
3158 reply.recycle();
3159 }
3160 public String getCallingPackage(IBinder token) throws RemoteException
3161 {
3162 Parcel data = Parcel.obtain();
3163 Parcel reply = Parcel.obtain();
3164 data.writeInterfaceToken(IActivityManager.descriptor);
3165 data.writeStrongBinder(token);
3166 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
3167 reply.readException();
3168 String res = reply.readString();
3169 data.recycle();
3170 reply.recycle();
3171 return res;
3172 }
3173 public ComponentName getCallingActivity(IBinder token)
3174 throws RemoteException {
3175 Parcel data = Parcel.obtain();
3176 Parcel reply = Parcel.obtain();
3177 data.writeInterfaceToken(IActivityManager.descriptor);
3178 data.writeStrongBinder(token);
3179 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
3180 reply.readException();
3181 ComponentName res = ComponentName.readFromParcel(reply);
3182 data.recycle();
3183 reply.recycle();
3184 return res;
3185 }
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003186 public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException {
Winson Chung1147c402014-05-14 11:05:00 -07003187 Parcel data = Parcel.obtain();
3188 Parcel reply = Parcel.obtain();
3189 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003190 data.writeString(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -07003191 mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0);
3192 reply.readException();
3193 ArrayList<IAppTask> list = null;
3194 int N = reply.readInt();
3195 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003196 list = new ArrayList<>();
Winson Chung1147c402014-05-14 11:05:00 -07003197 while (N > 0) {
3198 IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder());
3199 list.add(task);
3200 N--;
3201 }
3202 }
3203 data.recycle();
3204 reply.recycle();
3205 return list;
3206 }
Dianne Hackbornaec68bb2014-08-20 15:25:13 -07003207 public int addAppTask(IBinder activityToken, Intent intent,
3208 ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException {
3209 Parcel data = Parcel.obtain();
3210 Parcel reply = Parcel.obtain();
3211 data.writeInterfaceToken(IActivityManager.descriptor);
3212 data.writeStrongBinder(activityToken);
3213 intent.writeToParcel(data, 0);
3214 description.writeToParcel(data, 0);
3215 thumbnail.writeToParcel(data, 0);
3216 mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0);
3217 reply.readException();
3218 int res = reply.readInt();
3219 data.recycle();
3220 reply.recycle();
3221 return res;
3222 }
3223 public Point getAppTaskThumbnailSize() throws RemoteException {
3224 Parcel data = Parcel.obtain();
3225 Parcel reply = Parcel.obtain();
3226 data.writeInterfaceToken(IActivityManager.descriptor);
3227 mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0);
3228 reply.readException();
3229 Point size = Point.CREATOR.createFromParcel(reply);
3230 data.recycle();
3231 reply.recycle();
3232 return size;
3233 }
Todd Kennedye635f662015-01-20 10:36:49 -08003234 public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags)
3235 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003236 Parcel data = Parcel.obtain();
3237 Parcel reply = Parcel.obtain();
3238 data.writeInterfaceToken(IActivityManager.descriptor);
3239 data.writeInt(maxNum);
3240 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003241 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
3242 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003243 ArrayList<ActivityManager.RunningTaskInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003244 int N = reply.readInt();
3245 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003246 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003247 while (N > 0) {
3248 ActivityManager.RunningTaskInfo info =
3249 ActivityManager.RunningTaskInfo.CREATOR
Winson Chung1147c402014-05-14 11:05:00 -07003250 .createFromParcel(reply);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003251 list.add(info);
3252 N--;
3253 }
3254 }
3255 data.recycle();
3256 reply.recycle();
3257 return list;
3258 }
3259 public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -07003260 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003261 Parcel data = Parcel.obtain();
3262 Parcel reply = Parcel.obtain();
3263 data.writeInterfaceToken(IActivityManager.descriptor);
3264 data.writeInt(maxNum);
3265 data.writeInt(flags);
Amith Yamasani82644082012-08-03 13:09:11 -07003266 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003267 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
3268 reply.readException();
3269 ArrayList<ActivityManager.RecentTaskInfo> list
3270 = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR);
3271 data.recycle();
3272 reply.recycle();
3273 return list;
3274 }
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003275 public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException {
Dianne Hackbornd94df452011-02-16 18:53:31 -08003276 Parcel data = Parcel.obtain();
3277 Parcel reply = Parcel.obtain();
3278 data.writeInterfaceToken(IActivityManager.descriptor);
3279 data.writeInt(id);
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003280 mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003281 reply.readException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003282 ActivityManager.TaskThumbnail taskThumbnail = null;
Dianne Hackbornd94df452011-02-16 18:53:31 -08003283 if (reply.readInt() != 0) {
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003284 taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003285 }
3286 data.recycle();
3287 reply.recycle();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003288 return taskThumbnail;
Dianne Hackborn15491c62012-09-19 10:59:14 -07003289 }
Todd Kennedye635f662015-01-20 10:36:49 -08003290 public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags)
3291 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003292 Parcel data = Parcel.obtain();
3293 Parcel reply = Parcel.obtain();
3294 data.writeInterfaceToken(IActivityManager.descriptor);
3295 data.writeInt(maxNum);
3296 data.writeInt(flags);
3297 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
3298 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003299 ArrayList<ActivityManager.RunningServiceInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003300 int N = reply.readInt();
3301 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003302 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003303 while (N > 0) {
3304 ActivityManager.RunningServiceInfo info =
3305 ActivityManager.RunningServiceInfo.CREATOR
3306 .createFromParcel(reply);
3307 list.add(info);
3308 N--;
3309 }
3310 }
3311 data.recycle();
3312 reply.recycle();
3313 return list;
3314 }
3315 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
3316 throws RemoteException {
3317 Parcel data = Parcel.obtain();
3318 Parcel reply = Parcel.obtain();
3319 data.writeInterfaceToken(IActivityManager.descriptor);
3320 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
3321 reply.readException();
3322 ArrayList<ActivityManager.ProcessErrorStateInfo> list
3323 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
3324 data.recycle();
3325 reply.recycle();
3326 return list;
3327 }
3328 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
3329 throws RemoteException {
3330 Parcel data = Parcel.obtain();
3331 Parcel reply = Parcel.obtain();
3332 data.writeInterfaceToken(IActivityManager.descriptor);
3333 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
3334 reply.readException();
3335 ArrayList<ActivityManager.RunningAppProcessInfo> list
3336 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
3337 data.recycle();
3338 reply.recycle();
3339 return list;
3340 }
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -07003341 public List<ApplicationInfo> getRunningExternalApplications()
3342 throws RemoteException {
3343 Parcel data = Parcel.obtain();
3344 Parcel reply = Parcel.obtain();
3345 data.writeInterfaceToken(IActivityManager.descriptor);
3346 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
3347 reply.readException();
3348 ArrayList<ApplicationInfo> list
3349 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
3350 data.recycle();
3351 reply.recycle();
3352 return list;
3353 }
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003354 public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003355 {
3356 Parcel data = Parcel.obtain();
3357 Parcel reply = Parcel.obtain();
3358 data.writeInterfaceToken(IActivityManager.descriptor);
3359 data.writeInt(task);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003360 data.writeInt(flags);
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003361 if (options != null) {
3362 data.writeInt(1);
3363 options.writeToParcel(data, 0);
3364 } else {
3365 data.writeInt(0);
3366 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003367 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
3368 reply.readException();
3369 data.recycle();
3370 reply.recycle();
3371 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003372 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
3373 throws RemoteException {
3374 Parcel data = Parcel.obtain();
3375 Parcel reply = Parcel.obtain();
3376 data.writeInterfaceToken(IActivityManager.descriptor);
3377 data.writeStrongBinder(token);
3378 data.writeInt(nonRoot ? 1 : 0);
3379 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
3380 reply.readException();
3381 boolean res = reply.readInt() != 0;
3382 data.recycle();
3383 reply.recycle();
3384 return res;
3385 }
3386 public void moveTaskBackwards(int task) throws RemoteException
3387 {
3388 Parcel data = Parcel.obtain();
3389 Parcel reply = Parcel.obtain();
3390 data.writeInterfaceToken(IActivityManager.descriptor);
3391 data.writeInt(task);
3392 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
3393 reply.readException();
3394 data.recycle();
3395 reply.recycle();
3396 }
Craig Mautnerc00204b2013-03-05 15:02:14 -08003397 @Override
Craig Mautnerc00204b2013-03-05 15:02:14 -08003398 public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException
3399 {
3400 Parcel data = Parcel.obtain();
3401 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003402 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003403 data.writeInt(taskId);
3404 data.writeInt(stackId);
3405 data.writeInt(toTop ? 1 : 0);
3406 mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0);
3407 reply.readException();
3408 data.recycle();
3409 reply.recycle();
3410 }
3411 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003412 public void resizeStack(int stackBoxId, Rect r) throws RemoteException
Craig Mautnerc00204b2013-03-05 15:02:14 -08003413 {
3414 Parcel data = Parcel.obtain();
3415 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003416 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautner5a449152013-05-24 15:49:29 -07003417 data.writeInt(stackBoxId);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003418 r.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07003419 mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003420 reply.readException();
3421 data.recycle();
3422 reply.recycle();
3423 }
Craig Mautner967212c2013-04-13 21:10:58 -07003424 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003425 public List<StackInfo> getAllStackInfos() throws RemoteException
Craig Mautner5ff12102013-05-24 12:50:15 -07003426 {
3427 Parcel data = Parcel.obtain();
3428 Parcel reply = Parcel.obtain();
3429 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003430 mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0);
Craig Mautner5ff12102013-05-24 12:50:15 -07003431 reply.readException();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003432 ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR);
Craig Mautner967212c2013-04-13 21:10:58 -07003433 data.recycle();
3434 reply.recycle();
3435 return list;
3436 }
Craig Mautnercf910b02013-04-23 11:23:27 -07003437 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003438 public StackInfo getStackInfo(int stackId) throws RemoteException
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003439 {
3440 Parcel data = Parcel.obtain();
3441 Parcel reply = Parcel.obtain();
3442 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003443 data.writeInt(stackId);
3444 mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003445 reply.readException();
3446 int res = reply.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003447 StackInfo info = null;
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003448 if (res != 0) {
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003449 info = StackInfo.CREATOR.createFromParcel(reply);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003450 }
3451 data.recycle();
3452 reply.recycle();
3453 return info;
3454 }
3455 @Override
Winson Chung303e1ff2014-03-07 15:06:19 -08003456 public boolean isInHomeStack(int taskId) throws RemoteException {
3457 Parcel data = Parcel.obtain();
3458 Parcel reply = Parcel.obtain();
3459 data.writeInterfaceToken(IActivityManager.descriptor);
3460 data.writeInt(taskId);
3461 mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0);
3462 reply.readException();
3463 boolean isInHomeStack = reply.readInt() > 0;
3464 data.recycle();
3465 reply.recycle();
3466 return isInHomeStack;
3467 }
3468 @Override
Craig Mautnercf910b02013-04-23 11:23:27 -07003469 public void setFocusedStack(int stackId) throws RemoteException
3470 {
3471 Parcel data = Parcel.obtain();
3472 Parcel reply = Parcel.obtain();
3473 data.writeInterfaceToken(IActivityManager.descriptor);
3474 data.writeInt(stackId);
Dianne Hackborn1e383822015-04-10 14:02:33 -07003475 mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0);
Craig Mautnercf910b02013-04-23 11:23:27 -07003476 reply.readException();
3477 data.recycle();
3478 reply.recycle();
3479 }
Winson Chung740c3ac2014-11-12 16:14:38 -08003480 @Override
Winson Chungd16c5652015-01-26 16:11:07 -08003481 public int getFocusedStackId() throws RemoteException {
3482 Parcel data = Parcel.obtain();
3483 Parcel reply = Parcel.obtain();
3484 data.writeInterfaceToken(IActivityManager.descriptor);
3485 mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0);
3486 reply.readException();
3487 int focusedStackId = reply.readInt();
3488 data.recycle();
3489 reply.recycle();
3490 return focusedStackId;
3491 }
3492 @Override
Winson Chung740c3ac2014-11-12 16:14:38 -08003493 public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException
3494 {
3495 Parcel data = Parcel.obtain();
3496 Parcel reply = Parcel.obtain();
3497 data.writeInterfaceToken(IActivityManager.descriptor);
3498 data.writeStrongBinder(listener.asBinder());
Dianne Hackborn1e383822015-04-10 14:02:33 -07003499 mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0);
Winson Chung740c3ac2014-11-12 16:14:38 -08003500 reply.readException();
3501 data.recycle();
3502 reply.recycle();
3503 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003504 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
3505 {
3506 Parcel data = Parcel.obtain();
3507 Parcel reply = Parcel.obtain();
3508 data.writeInterfaceToken(IActivityManager.descriptor);
3509 data.writeStrongBinder(token);
3510 data.writeInt(onlyRoot ? 1 : 0);
3511 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
3512 reply.readException();
3513 int res = reply.readInt();
3514 data.recycle();
3515 reply.recycle();
3516 return res;
3517 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003518 public ContentProviderHolder getContentProvider(IApplicationThread caller,
Jeff Sharkey6d515712012-09-20 16:06:08 -07003519 String name, int userId, boolean stable) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003520 Parcel data = Parcel.obtain();
3521 Parcel reply = Parcel.obtain();
3522 data.writeInterfaceToken(IActivityManager.descriptor);
3523 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3524 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003525 data.writeInt(userId);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003526 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003527 mRemote.transact(GET_CONTENT_PROVIDER_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 }
Jeff Sharkey6d515712012-09-20 16:06:08 -07003538 public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token)
3539 throws RemoteException {
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003540 Parcel data = Parcel.obtain();
3541 Parcel reply = Parcel.obtain();
3542 data.writeInterfaceToken(IActivityManager.descriptor);
3543 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003544 data.writeInt(userId);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003545 data.writeStrongBinder(token);
3546 mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3547 reply.readException();
3548 int res = reply.readInt();
3549 ContentProviderHolder cph = null;
3550 if (res != 0) {
3551 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3552 }
3553 data.recycle();
3554 reply.recycle();
3555 return cph;
3556 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003557 public void publishContentProviders(IApplicationThread caller,
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003558 List<ContentProviderHolder> providers) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003559 {
3560 Parcel data = Parcel.obtain();
3561 Parcel reply = Parcel.obtain();
3562 data.writeInterfaceToken(IActivityManager.descriptor);
3563 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3564 data.writeTypedList(providers);
3565 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
3566 reply.readException();
3567 data.recycle();
3568 reply.recycle();
3569 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003570 public boolean refContentProvider(IBinder connection, int stable, int unstable)
3571 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003572 Parcel data = Parcel.obtain();
3573 Parcel reply = Parcel.obtain();
3574 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003575 data.writeStrongBinder(connection);
3576 data.writeInt(stable);
3577 data.writeInt(unstable);
3578 mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3579 reply.readException();
3580 boolean res = reply.readInt() != 0;
3581 data.recycle();
3582 reply.recycle();
3583 return res;
3584 }
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003585
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003586 public void unstableProviderDied(IBinder connection) throws RemoteException {
3587 Parcel data = Parcel.obtain();
3588 Parcel reply = Parcel.obtain();
3589 data.writeInterfaceToken(IActivityManager.descriptor);
3590 data.writeStrongBinder(connection);
3591 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0);
3592 reply.readException();
3593 data.recycle();
3594 reply.recycle();
3595 }
3596
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003597 @Override
3598 public void appNotRespondingViaProvider(IBinder connection) throws RemoteException {
3599 Parcel data = Parcel.obtain();
3600 Parcel reply = Parcel.obtain();
3601 data.writeInterfaceToken(IActivityManager.descriptor);
3602 data.writeStrongBinder(connection);
3603 mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0);
3604 reply.readException();
3605 data.recycle();
3606 reply.recycle();
3607 }
3608
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003609 public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException {
3610 Parcel data = Parcel.obtain();
3611 Parcel reply = Parcel.obtain();
3612 data.writeInterfaceToken(IActivityManager.descriptor);
3613 data.writeStrongBinder(connection);
3614 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003615 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3616 reply.readException();
3617 data.recycle();
3618 reply.recycle();
3619 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003620
3621 public void removeContentProviderExternal(String name, IBinder token) throws RemoteException {
3622 Parcel data = Parcel.obtain();
3623 Parcel reply = Parcel.obtain();
3624 data.writeInterfaceToken(IActivityManager.descriptor);
3625 data.writeString(name);
3626 data.writeStrongBinder(token);
3627 mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3628 reply.readException();
3629 data.recycle();
3630 reply.recycle();
3631 }
3632
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07003633 public PendingIntent getRunningServiceControlPanel(ComponentName service)
3634 throws RemoteException
3635 {
3636 Parcel data = Parcel.obtain();
3637 Parcel reply = Parcel.obtain();
3638 data.writeInterfaceToken(IActivityManager.descriptor);
3639 service.writeToParcel(data, 0);
3640 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
3641 reply.readException();
3642 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
3643 data.recycle();
3644 reply.recycle();
3645 return res;
3646 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003647
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003648 public ComponentName startService(IApplicationThread caller, Intent service,
Svet Ganov99b60432015-06-27 13:15:22 -07003649 String resolvedType, String callingPackage, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003650 {
3651 Parcel data = Parcel.obtain();
3652 Parcel reply = Parcel.obtain();
3653 data.writeInterfaceToken(IActivityManager.descriptor);
3654 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3655 service.writeToParcel(data, 0);
3656 data.writeString(resolvedType);
Svet Ganov99b60432015-06-27 13:15:22 -07003657 data.writeString(callingPackage);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003658 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003659 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
3660 reply.readException();
3661 ComponentName res = ComponentName.readFromParcel(reply);
3662 data.recycle();
3663 reply.recycle();
3664 return res;
3665 }
3666 public int stopService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003667 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003668 {
3669 Parcel data = Parcel.obtain();
3670 Parcel reply = Parcel.obtain();
3671 data.writeInterfaceToken(IActivityManager.descriptor);
3672 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3673 service.writeToParcel(data, 0);
3674 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003675 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003676 mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0);
3677 reply.readException();
3678 int res = reply.readInt();
3679 reply.recycle();
3680 data.recycle();
3681 return res;
3682 }
3683 public boolean stopServiceToken(ComponentName className, IBinder token,
3684 int startId) throws RemoteException {
3685 Parcel data = Parcel.obtain();
3686 Parcel reply = Parcel.obtain();
3687 data.writeInterfaceToken(IActivityManager.descriptor);
3688 ComponentName.writeToParcel(className, data);
3689 data.writeStrongBinder(token);
3690 data.writeInt(startId);
3691 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
3692 reply.readException();
3693 boolean res = reply.readInt() != 0;
3694 data.recycle();
3695 reply.recycle();
3696 return res;
3697 }
3698 public void setServiceForeground(ComponentName className, IBinder token,
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003699 int id, Notification notification, boolean removeNotification) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003700 Parcel data = Parcel.obtain();
3701 Parcel reply = Parcel.obtain();
3702 data.writeInterfaceToken(IActivityManager.descriptor);
3703 ComponentName.writeToParcel(className, data);
3704 data.writeStrongBinder(token);
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003705 data.writeInt(id);
3706 if (notification != null) {
3707 data.writeInt(1);
3708 notification.writeToParcel(data, 0);
3709 } else {
3710 data.writeInt(0);
3711 }
3712 data.writeInt(removeNotification ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003713 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
3714 reply.readException();
3715 data.recycle();
3716 reply.recycle();
3717 }
3718 public int bindService(IApplicationThread caller, IBinder token,
3719 Intent service, String resolvedType, IServiceConnection connection,
Svet Ganov99b60432015-06-27 13:15:22 -07003720 int flags, String callingPackage, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003721 Parcel data = Parcel.obtain();
3722 Parcel reply = Parcel.obtain();
3723 data.writeInterfaceToken(IActivityManager.descriptor);
3724 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3725 data.writeStrongBinder(token);
3726 service.writeToParcel(data, 0);
3727 data.writeString(resolvedType);
3728 data.writeStrongBinder(connection.asBinder());
3729 data.writeInt(flags);
Svet Ganov99b60432015-06-27 13:15:22 -07003730 data.writeString(callingPackage);
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003731 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003732 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
3733 reply.readException();
3734 int res = reply.readInt();
3735 data.recycle();
3736 reply.recycle();
3737 return res;
3738 }
3739 public boolean unbindService(IServiceConnection connection) throws RemoteException
3740 {
3741 Parcel data = Parcel.obtain();
3742 Parcel reply = Parcel.obtain();
3743 data.writeInterfaceToken(IActivityManager.descriptor);
3744 data.writeStrongBinder(connection.asBinder());
3745 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
3746 reply.readException();
3747 boolean res = reply.readInt() != 0;
3748 data.recycle();
3749 reply.recycle();
3750 return res;
3751 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003752
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003753 public void publishService(IBinder token,
3754 Intent intent, IBinder service) throws RemoteException {
3755 Parcel data = Parcel.obtain();
3756 Parcel reply = Parcel.obtain();
3757 data.writeInterfaceToken(IActivityManager.descriptor);
3758 data.writeStrongBinder(token);
3759 intent.writeToParcel(data, 0);
3760 data.writeStrongBinder(service);
3761 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
3762 reply.readException();
3763 data.recycle();
3764 reply.recycle();
3765 }
3766
3767 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
3768 throws RemoteException {
3769 Parcel data = Parcel.obtain();
3770 Parcel reply = Parcel.obtain();
3771 data.writeInterfaceToken(IActivityManager.descriptor);
3772 data.writeStrongBinder(token);
3773 intent.writeToParcel(data, 0);
3774 data.writeInt(doRebind ? 1 : 0);
3775 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
3776 reply.readException();
3777 data.recycle();
3778 reply.recycle();
3779 }
3780
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003781 public void serviceDoneExecuting(IBinder token, int type, int startId,
3782 int res) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003783 Parcel data = Parcel.obtain();
3784 Parcel reply = Parcel.obtain();
3785 data.writeInterfaceToken(IActivityManager.descriptor);
3786 data.writeStrongBinder(token);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003787 data.writeInt(type);
3788 data.writeInt(startId);
3789 data.writeInt(res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003790 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3791 reply.readException();
3792 data.recycle();
3793 reply.recycle();
3794 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003795
Svet Ganov99b60432015-06-27 13:15:22 -07003796 public IBinder peekService(Intent service, String resolvedType, String callingPackage)
3797 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003798 Parcel data = Parcel.obtain();
3799 Parcel reply = Parcel.obtain();
3800 data.writeInterfaceToken(IActivityManager.descriptor);
3801 service.writeToParcel(data, 0);
3802 data.writeString(resolvedType);
Svet Ganov99b60432015-06-27 13:15:22 -07003803 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003804 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
3805 reply.readException();
3806 IBinder binder = reply.readStrongBinder();
3807 reply.recycle();
3808 data.recycle();
3809 return binder;
3810 }
3811
Christopher Tate181fafa2009-05-14 11:12:14 -07003812 public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
3813 throws RemoteException {
3814 Parcel data = Parcel.obtain();
3815 Parcel reply = Parcel.obtain();
3816 data.writeInterfaceToken(IActivityManager.descriptor);
3817 app.writeToParcel(data, 0);
3818 data.writeInt(backupRestoreMode);
3819 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3820 reply.readException();
3821 boolean success = reply.readInt() != 0;
3822 reply.recycle();
3823 data.recycle();
3824 return success;
3825 }
3826
Christopher Tate346acb12012-10-15 19:20:25 -07003827 public void clearPendingBackup() throws RemoteException {
3828 Parcel data = Parcel.obtain();
3829 Parcel reply = Parcel.obtain();
3830 data.writeInterfaceToken(IActivityManager.descriptor);
3831 mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0);
3832 reply.recycle();
3833 data.recycle();
3834 }
3835
Christopher Tate181fafa2009-05-14 11:12:14 -07003836 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
3837 Parcel data = Parcel.obtain();
3838 Parcel reply = Parcel.obtain();
3839 data.writeInterfaceToken(IActivityManager.descriptor);
3840 data.writeString(packageName);
3841 data.writeStrongBinder(agent);
3842 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
3843 reply.recycle();
3844 data.recycle();
3845 }
3846
3847 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
3848 Parcel data = Parcel.obtain();
3849 Parcel reply = Parcel.obtain();
3850 data.writeInterfaceToken(IActivityManager.descriptor);
3851 app.writeToParcel(data, 0);
3852 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3853 reply.readException();
3854 reply.recycle();
3855 data.recycle();
3856 }
3857
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003858 public boolean startInstrumentation(ComponentName className, String profileFile,
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003859 int flags, Bundle arguments, IInstrumentationWatcher watcher,
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01003860 IUiAutomationConnection connection, int userId, String instructionSet)
3861 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003862 Parcel data = Parcel.obtain();
3863 Parcel reply = Parcel.obtain();
3864 data.writeInterfaceToken(IActivityManager.descriptor);
3865 ComponentName.writeToParcel(className, data);
3866 data.writeString(profileFile);
3867 data.writeInt(flags);
3868 data.writeBundle(arguments);
3869 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003870 data.writeStrongBinder(connection != null ? connection.asBinder() : null);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07003871 data.writeInt(userId);
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01003872 data.writeString(instructionSet);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003873 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3874 reply.readException();
3875 boolean res = reply.readInt() != 0;
3876 reply.recycle();
3877 data.recycle();
3878 return res;
3879 }
3880
3881 public void finishInstrumentation(IApplicationThread target,
3882 int resultCode, Bundle results) throws RemoteException {
3883 Parcel data = Parcel.obtain();
3884 Parcel reply = Parcel.obtain();
3885 data.writeInterfaceToken(IActivityManager.descriptor);
3886 data.writeStrongBinder(target != null ? target.asBinder() : null);
3887 data.writeInt(resultCode);
3888 data.writeBundle(results);
3889 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3890 reply.readException();
3891 data.recycle();
3892 reply.recycle();
3893 }
3894 public Configuration getConfiguration() throws RemoteException
3895 {
3896 Parcel data = Parcel.obtain();
3897 Parcel reply = Parcel.obtain();
3898 data.writeInterfaceToken(IActivityManager.descriptor);
3899 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
3900 reply.readException();
3901 Configuration res = Configuration.CREATOR.createFromParcel(reply);
3902 reply.recycle();
3903 data.recycle();
3904 return res;
3905 }
3906 public void updateConfiguration(Configuration values) throws RemoteException
3907 {
3908 Parcel data = Parcel.obtain();
3909 Parcel reply = Parcel.obtain();
3910 data.writeInterfaceToken(IActivityManager.descriptor);
3911 values.writeToParcel(data, 0);
3912 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
3913 reply.readException();
3914 data.recycle();
3915 reply.recycle();
3916 }
3917 public void setRequestedOrientation(IBinder token, int requestedOrientation)
3918 throws RemoteException {
3919 Parcel data = Parcel.obtain();
3920 Parcel reply = Parcel.obtain();
3921 data.writeInterfaceToken(IActivityManager.descriptor);
3922 data.writeStrongBinder(token);
3923 data.writeInt(requestedOrientation);
3924 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3925 reply.readException();
3926 data.recycle();
3927 reply.recycle();
3928 }
3929 public int getRequestedOrientation(IBinder token) throws RemoteException {
3930 Parcel data = Parcel.obtain();
3931 Parcel reply = Parcel.obtain();
3932 data.writeInterfaceToken(IActivityManager.descriptor);
3933 data.writeStrongBinder(token);
3934 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3935 reply.readException();
3936 int res = reply.readInt();
3937 data.recycle();
3938 reply.recycle();
3939 return res;
3940 }
3941 public ComponentName getActivityClassForToken(IBinder token)
3942 throws RemoteException {
3943 Parcel data = Parcel.obtain();
3944 Parcel reply = Parcel.obtain();
3945 data.writeInterfaceToken(IActivityManager.descriptor);
3946 data.writeStrongBinder(token);
3947 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
3948 reply.readException();
3949 ComponentName res = ComponentName.readFromParcel(reply);
3950 data.recycle();
3951 reply.recycle();
3952 return res;
3953 }
3954 public String getPackageForToken(IBinder token) throws RemoteException
3955 {
3956 Parcel data = Parcel.obtain();
3957 Parcel reply = Parcel.obtain();
3958 data.writeInterfaceToken(IActivityManager.descriptor);
3959 data.writeStrongBinder(token);
3960 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
3961 reply.readException();
3962 String res = reply.readString();
3963 data.recycle();
3964 reply.recycle();
3965 return res;
3966 }
3967 public IIntentSender getIntentSender(int type,
3968 String packageName, IBinder token, String resultWho,
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003969 int requestCode, Intent[] intents, String[] resolvedTypes, int flags,
Dianne Hackborn41203752012-08-31 14:05:51 -07003970 Bundle options, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003971 Parcel data = Parcel.obtain();
3972 Parcel reply = Parcel.obtain();
3973 data.writeInterfaceToken(IActivityManager.descriptor);
3974 data.writeInt(type);
3975 data.writeString(packageName);
3976 data.writeStrongBinder(token);
3977 data.writeString(resultWho);
3978 data.writeInt(requestCode);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003979 if (intents != null) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003980 data.writeInt(1);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003981 data.writeTypedArray(intents, 0);
3982 data.writeStringArray(resolvedTypes);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003983 } else {
3984 data.writeInt(0);
3985 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003986 data.writeInt(flags);
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003987 if (options != null) {
3988 data.writeInt(1);
3989 options.writeToParcel(data, 0);
3990 } else {
3991 data.writeInt(0);
3992 }
Dianne Hackborn41203752012-08-31 14:05:51 -07003993 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003994 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
3995 reply.readException();
3996 IIntentSender res = IIntentSender.Stub.asInterface(
Dianne Hackbornff170242014-11-19 10:59:01 -08003997 reply.readStrongBinder());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003998 data.recycle();
3999 reply.recycle();
4000 return res;
4001 }
4002 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
4003 Parcel data = Parcel.obtain();
4004 Parcel reply = Parcel.obtain();
4005 data.writeInterfaceToken(IActivityManager.descriptor);
4006 data.writeStrongBinder(sender.asBinder());
4007 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
4008 reply.readException();
4009 data.recycle();
4010 reply.recycle();
4011 }
4012 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
4013 Parcel data = Parcel.obtain();
4014 Parcel reply = Parcel.obtain();
4015 data.writeInterfaceToken(IActivityManager.descriptor);
4016 data.writeStrongBinder(sender.asBinder());
4017 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4018 reply.readException();
4019 String res = reply.readString();
4020 data.recycle();
4021 reply.recycle();
4022 return res;
4023 }
Christopher Tatec4a07d12012-04-06 14:19:13 -07004024 public int getUidForIntentSender(IIntentSender sender) throws RemoteException {
4025 Parcel data = Parcel.obtain();
4026 Parcel reply = Parcel.obtain();
4027 data.writeInterfaceToken(IActivityManager.descriptor);
4028 data.writeStrongBinder(sender.asBinder());
4029 mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4030 reply.readException();
4031 int res = reply.readInt();
4032 data.recycle();
4033 reply.recycle();
4034 return res;
4035 }
Dianne Hackborn41203752012-08-31 14:05:51 -07004036 public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
4037 boolean requireFull, String name, String callerPackage) throws RemoteException {
4038 Parcel data = Parcel.obtain();
4039 Parcel reply = Parcel.obtain();
4040 data.writeInterfaceToken(IActivityManager.descriptor);
4041 data.writeInt(callingPid);
4042 data.writeInt(callingUid);
4043 data.writeInt(userId);
4044 data.writeInt(allowAll ? 1 : 0);
4045 data.writeInt(requireFull ? 1 : 0);
4046 data.writeString(name);
4047 data.writeString(callerPackage);
4048 mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0);
4049 reply.readException();
4050 int res = reply.readInt();
4051 data.recycle();
4052 reply.recycle();
4053 return res;
4054 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004055 public void setProcessLimit(int max) throws RemoteException
4056 {
4057 Parcel data = Parcel.obtain();
4058 Parcel reply = Parcel.obtain();
4059 data.writeInterfaceToken(IActivityManager.descriptor);
4060 data.writeInt(max);
4061 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4062 reply.readException();
4063 data.recycle();
4064 reply.recycle();
4065 }
4066 public int getProcessLimit() throws RemoteException
4067 {
4068 Parcel data = Parcel.obtain();
4069 Parcel reply = Parcel.obtain();
4070 data.writeInterfaceToken(IActivityManager.descriptor);
4071 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4072 reply.readException();
4073 int res = reply.readInt();
4074 data.recycle();
4075 reply.recycle();
4076 return res;
4077 }
4078 public void setProcessForeground(IBinder token, int pid,
4079 boolean isForeground) throws RemoteException {
4080 Parcel data = Parcel.obtain();
4081 Parcel reply = Parcel.obtain();
4082 data.writeInterfaceToken(IActivityManager.descriptor);
4083 data.writeStrongBinder(token);
4084 data.writeInt(pid);
4085 data.writeInt(isForeground ? 1 : 0);
4086 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
4087 reply.readException();
4088 data.recycle();
4089 reply.recycle();
4090 }
4091 public int checkPermission(String permission, int pid, int uid)
4092 throws RemoteException {
4093 Parcel data = Parcel.obtain();
4094 Parcel reply = Parcel.obtain();
4095 data.writeInterfaceToken(IActivityManager.descriptor);
4096 data.writeString(permission);
4097 data.writeInt(pid);
4098 data.writeInt(uid);
4099 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
4100 reply.readException();
4101 int res = reply.readInt();
4102 data.recycle();
4103 reply.recycle();
4104 return res;
4105 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004106 public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken)
4107 throws RemoteException {
4108 Parcel data = Parcel.obtain();
4109 Parcel reply = Parcel.obtain();
4110 data.writeInterfaceToken(IActivityManager.descriptor);
4111 data.writeString(permission);
4112 data.writeInt(pid);
4113 data.writeInt(uid);
4114 data.writeStrongBinder(callerToken);
4115 mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0);
4116 reply.readException();
4117 int res = reply.readInt();
4118 data.recycle();
4119 reply.recycle();
4120 return res;
4121 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004122 public boolean clearApplicationUserData(final String packageName,
Amith Yamasani742a6712011-05-04 14:49:28 -07004123 final IPackageDataObserver observer, final int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004124 Parcel data = Parcel.obtain();
4125 Parcel reply = Parcel.obtain();
4126 data.writeInterfaceToken(IActivityManager.descriptor);
4127 data.writeString(packageName);
Christopher Tate31b65f92013-09-09 14:17:27 -07004128 data.writeStrongBinder((observer != null) ? observer.asBinder() : null);
Amith Yamasani742a6712011-05-04 14:49:28 -07004129 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004130 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
4131 reply.readException();
4132 boolean res = reply.readInt() != 0;
4133 data.recycle();
4134 reply.recycle();
4135 return res;
4136 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004137 public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId,
4138 IBinder callerToken) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004139 Parcel data = Parcel.obtain();
4140 Parcel reply = Parcel.obtain();
4141 data.writeInterfaceToken(IActivityManager.descriptor);
4142 uri.writeToParcel(data, 0);
4143 data.writeInt(pid);
4144 data.writeInt(uid);
4145 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004146 data.writeInt(userId);
Dianne Hackbornff170242014-11-19 10:59:01 -08004147 data.writeStrongBinder(callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004148 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
4149 reply.readException();
4150 int res = reply.readInt();
4151 data.recycle();
4152 reply.recycle();
4153 return res;
4154 }
4155 public void grantUriPermission(IApplicationThread caller, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004156 Uri uri, int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004157 Parcel data = Parcel.obtain();
4158 Parcel reply = Parcel.obtain();
4159 data.writeInterfaceToken(IActivityManager.descriptor);
4160 data.writeStrongBinder(caller.asBinder());
4161 data.writeString(targetPkg);
4162 uri.writeToParcel(data, 0);
4163 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004164 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004165 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4166 reply.readException();
4167 data.recycle();
4168 reply.recycle();
4169 }
4170 public void revokeUriPermission(IApplicationThread caller, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004171 int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004172 Parcel data = Parcel.obtain();
4173 Parcel reply = Parcel.obtain();
4174 data.writeInterfaceToken(IActivityManager.descriptor);
4175 data.writeStrongBinder(caller.asBinder());
4176 uri.writeToParcel(data, 0);
4177 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004178 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004179 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4180 reply.readException();
4181 data.recycle();
4182 reply.recycle();
4183 }
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004184
4185 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004186 public void takePersistableUriPermission(Uri uri, int mode, int userId)
4187 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004188 Parcel data = Parcel.obtain();
4189 Parcel reply = Parcel.obtain();
4190 data.writeInterfaceToken(IActivityManager.descriptor);
4191 uri.writeToParcel(data, 0);
4192 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004193 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004194 mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4195 reply.readException();
4196 data.recycle();
4197 reply.recycle();
4198 }
4199
4200 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004201 public void releasePersistableUriPermission(Uri uri, int mode, int userId)
4202 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004203 Parcel data = Parcel.obtain();
4204 Parcel reply = Parcel.obtain();
4205 data.writeInterfaceToken(IActivityManager.descriptor);
4206 uri.writeToParcel(data, 0);
4207 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004208 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004209 mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4210 reply.readException();
4211 data.recycle();
4212 reply.recycle();
4213 }
4214
4215 @Override
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004216 public ParceledListSlice<UriPermission> getPersistedUriPermissions(
4217 String packageName, boolean incoming) throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004218 Parcel data = Parcel.obtain();
4219 Parcel reply = Parcel.obtain();
4220 data.writeInterfaceToken(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004221 data.writeString(packageName);
4222 data.writeInt(incoming ? 1 : 0);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004223 mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
4224 reply.readException();
4225 final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel(
4226 reply);
4227 data.recycle();
4228 reply.recycle();
4229 return perms;
4230 }
4231
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004232 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
4233 throws RemoteException {
4234 Parcel data = Parcel.obtain();
4235 Parcel reply = Parcel.obtain();
4236 data.writeInterfaceToken(IActivityManager.descriptor);
4237 data.writeStrongBinder(who.asBinder());
4238 data.writeInt(waiting ? 1 : 0);
4239 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
4240 reply.readException();
4241 data.recycle();
4242 reply.recycle();
4243 }
4244 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
4245 Parcel data = Parcel.obtain();
4246 Parcel reply = Parcel.obtain();
4247 data.writeInterfaceToken(IActivityManager.descriptor);
4248 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
4249 reply.readException();
4250 outInfo.readFromParcel(reply);
4251 data.recycle();
4252 reply.recycle();
4253 }
4254 public void unhandledBack() throws RemoteException
4255 {
4256 Parcel data = Parcel.obtain();
4257 Parcel reply = Parcel.obtain();
4258 data.writeInterfaceToken(IActivityManager.descriptor);
4259 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
4260 reply.readException();
4261 data.recycle();
4262 reply.recycle();
4263 }
4264 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
4265 {
4266 Parcel data = Parcel.obtain();
4267 Parcel reply = Parcel.obtain();
4268 data.writeInterfaceToken(IActivityManager.descriptor);
4269 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
4270 reply.readException();
4271 ParcelFileDescriptor pfd = null;
4272 if (reply.readInt() != 0) {
4273 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
4274 }
4275 data.recycle();
4276 reply.recycle();
4277 return pfd;
4278 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07004279 public void setLockScreenShown(boolean shown) throws RemoteException
4280 {
4281 Parcel data = Parcel.obtain();
4282 Parcel reply = Parcel.obtain();
4283 data.writeInterfaceToken(IActivityManager.descriptor);
4284 data.writeInt(shown ? 1 : 0);
4285 mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0);
4286 reply.readException();
4287 data.recycle();
4288 reply.recycle();
4289 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004290 public void setDebugApp(
4291 String packageName, boolean waitForDebugger, boolean persistent)
4292 throws RemoteException
4293 {
4294 Parcel data = Parcel.obtain();
4295 Parcel reply = Parcel.obtain();
4296 data.writeInterfaceToken(IActivityManager.descriptor);
4297 data.writeString(packageName);
4298 data.writeInt(waitForDebugger ? 1 : 0);
4299 data.writeInt(persistent ? 1 : 0);
4300 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
4301 reply.readException();
4302 data.recycle();
4303 reply.recycle();
4304 }
4305 public void setAlwaysFinish(boolean enabled) throws RemoteException
4306 {
4307 Parcel data = Parcel.obtain();
4308 Parcel reply = Parcel.obtain();
4309 data.writeInterfaceToken(IActivityManager.descriptor);
4310 data.writeInt(enabled ? 1 : 0);
4311 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
4312 reply.readException();
4313 data.recycle();
4314 reply.recycle();
4315 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004316 public void setActivityController(IActivityController watcher) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004317 {
4318 Parcel data = Parcel.obtain();
4319 Parcel reply = Parcel.obtain();
4320 data.writeInterfaceToken(IActivityManager.descriptor);
4321 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004322 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004323 reply.readException();
4324 data.recycle();
4325 reply.recycle();
4326 }
4327 public void enterSafeMode() throws RemoteException {
4328 Parcel data = Parcel.obtain();
4329 data.writeInterfaceToken(IActivityManager.descriptor);
4330 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
4331 data.recycle();
4332 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07004333 public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag)
Dianne Hackborn099bc622014-01-22 13:39:16 -08004334 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004335 Parcel data = Parcel.obtain();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004336 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn099bc622014-01-22 13:39:16 -08004337 data.writeStrongBinder(sender.asBinder());
4338 data.writeInt(sourceUid);
4339 data.writeString(sourcePkg);
Dianne Hackborn1e383822015-04-10 14:02:33 -07004340 data.writeString(tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004341 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
4342 data.recycle();
4343 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07004344 public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag)
4345 throws RemoteException {
4346 Parcel data = Parcel.obtain();
4347 data.writeInterfaceToken(IActivityManager.descriptor);
4348 data.writeStrongBinder(sender.asBinder());
4349 data.writeInt(sourceUid);
4350 data.writeString(tag);
4351 mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0);
4352 data.recycle();
4353 }
4354 public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag)
4355 throws RemoteException {
4356 Parcel data = Parcel.obtain();
4357 data.writeInterfaceToken(IActivityManager.descriptor);
4358 data.writeStrongBinder(sender.asBinder());
4359 data.writeInt(sourceUid);
4360 data.writeString(tag);
4361 mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0);
4362 data.recycle();
4363 }
Dianne Hackborn64825172011-03-02 21:32:58 -08004364 public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004365 Parcel data = Parcel.obtain();
4366 Parcel reply = Parcel.obtain();
4367 data.writeInterfaceToken(IActivityManager.descriptor);
4368 data.writeIntArray(pids);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004369 data.writeString(reason);
Dianne Hackborn64825172011-03-02 21:32:58 -08004370 data.writeInt(secure ? 1 : 0);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004371 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07004372 reply.readException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004373 boolean res = reply.readInt() != 0;
4374 data.recycle();
4375 reply.recycle();
4376 return res;
4377 }
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07004378 @Override
4379 public boolean killProcessesBelowForeground(String reason) throws RemoteException {
4380 Parcel data = Parcel.obtain();
4381 Parcel reply = Parcel.obtain();
4382 data.writeInterfaceToken(IActivityManager.descriptor);
4383 data.writeString(reason);
4384 mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0);
4385 boolean res = reply.readInt() != 0;
4386 data.recycle();
4387 reply.recycle();
4388 return res;
4389 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004390 public boolean testIsSystemReady()
4391 {
4392 /* this base class version is never called */
4393 return true;
4394 }
Dan Egnor60d87622009-12-16 16:32:58 -08004395 public void handleApplicationCrash(IBinder app,
4396 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
4397 {
4398 Parcel data = Parcel.obtain();
4399 Parcel reply = Parcel.obtain();
4400 data.writeInterfaceToken(IActivityManager.descriptor);
4401 data.writeStrongBinder(app);
4402 crashInfo.writeToParcel(data, 0);
4403 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
4404 reply.readException();
4405 reply.recycle();
4406 data.recycle();
4407 }
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004408
Dianne Hackborn52322712014-08-26 22:47:26 -07004409 public boolean handleApplicationWtf(IBinder app, String tag, boolean system,
Dan Egnorb7f03672009-12-09 16:22:32 -08004410 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004411 {
4412 Parcel data = Parcel.obtain();
4413 Parcel reply = Parcel.obtain();
4414 data.writeInterfaceToken(IActivityManager.descriptor);
4415 data.writeStrongBinder(app);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004416 data.writeString(tag);
Dianne Hackborn52322712014-08-26 22:47:26 -07004417 data.writeInt(system ? 1 : 0);
Dan Egnorb7f03672009-12-09 16:22:32 -08004418 crashInfo.writeToParcel(data, 0);
Dan Egnor60d87622009-12-16 16:32:58 -08004419 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004420 reply.readException();
Dan Egnor60d87622009-12-16 16:32:58 -08004421 boolean res = reply.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004422 reply.recycle();
4423 data.recycle();
Dan Egnor60d87622009-12-16 16:32:58 -08004424 return res;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004425 }
Dan Egnorb7f03672009-12-09 16:22:32 -08004426
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004427 public void handleApplicationStrictModeViolation(IBinder app,
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004428 int violationMask,
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004429 StrictMode.ViolationInfo info) throws RemoteException
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004430 {
4431 Parcel data = Parcel.obtain();
4432 Parcel reply = Parcel.obtain();
4433 data.writeInterfaceToken(IActivityManager.descriptor);
4434 data.writeStrongBinder(app);
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004435 data.writeInt(violationMask);
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004436 info.writeToParcel(data, 0);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004437 mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0);
4438 reply.readException();
4439 reply.recycle();
4440 data.recycle();
4441 }
4442
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004443 public void signalPersistentProcesses(int sig) throws RemoteException {
4444 Parcel data = Parcel.obtain();
4445 Parcel reply = Parcel.obtain();
4446 data.writeInterfaceToken(IActivityManager.descriptor);
4447 data.writeInt(sig);
4448 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
4449 reply.readException();
4450 data.recycle();
4451 reply.recycle();
4452 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004453
Dianne Hackborn1676c852012-09-10 14:52:30 -07004454 public void killBackgroundProcesses(String packageName, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004455 Parcel data = Parcel.obtain();
4456 Parcel reply = Parcel.obtain();
4457 data.writeInterfaceToken(IActivityManager.descriptor);
4458 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004459 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004460 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4461 reply.readException();
4462 data.recycle();
4463 reply.recycle();
4464 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004465
4466 public void killAllBackgroundProcesses() throws RemoteException {
4467 Parcel data = Parcel.obtain();
4468 Parcel reply = Parcel.obtain();
4469 data.writeInterfaceToken(IActivityManager.descriptor);
4470 mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4471 reply.readException();
4472 data.recycle();
4473 reply.recycle();
4474 }
4475
Dianne Hackborn1676c852012-09-10 14:52:30 -07004476 public void forceStopPackage(String packageName, int userId) throws RemoteException {
Dianne Hackborn03abb812010-01-04 18:43:19 -08004477 Parcel data = Parcel.obtain();
4478 Parcel reply = Parcel.obtain();
4479 data.writeInterfaceToken(IActivityManager.descriptor);
4480 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004481 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004482 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004483 reply.readException();
4484 data.recycle();
4485 reply.recycle();
4486 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004487
Dianne Hackborn27ff9132012-03-06 14:57:58 -08004488 public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
4489 throws RemoteException
4490 {
4491 Parcel data = Parcel.obtain();
4492 Parcel reply = Parcel.obtain();
4493 data.writeInterfaceToken(IActivityManager.descriptor);
4494 mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0);
4495 reply.readException();
4496 outInfo.readFromParcel(reply);
4497 reply.recycle();
4498 data.recycle();
4499 }
4500
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004501 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
4502 {
4503 Parcel data = Parcel.obtain();
4504 Parcel reply = Parcel.obtain();
4505 data.writeInterfaceToken(IActivityManager.descriptor);
4506 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
4507 reply.readException();
4508 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
4509 reply.recycle();
4510 data.recycle();
4511 return res;
4512 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004513
Dianne Hackborn1676c852012-09-10 14:52:30 -07004514 public boolean profileControl(String process, int userId, boolean start,
Jeff Hao1b012d32014-08-20 10:35:34 -07004515 ProfilerInfo profilerInfo, int profileType) throws RemoteException
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004516 {
4517 Parcel data = Parcel.obtain();
4518 Parcel reply = Parcel.obtain();
4519 data.writeInterfaceToken(IActivityManager.descriptor);
4520 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004521 data.writeInt(userId);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004522 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07004523 data.writeInt(profileType);
Jeff Hao1b012d32014-08-20 10:35:34 -07004524 if (profilerInfo != null) {
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004525 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07004526 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004527 } else {
4528 data.writeInt(0);
4529 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004530 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
4531 reply.readException();
4532 boolean res = reply.readInt() != 0;
4533 reply.recycle();
4534 data.recycle();
4535 return res;
4536 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004537
Dianne Hackborn55280a92009-05-07 15:53:46 -07004538 public boolean shutdown(int timeout) throws RemoteException
4539 {
4540 Parcel data = Parcel.obtain();
4541 Parcel reply = Parcel.obtain();
4542 data.writeInterfaceToken(IActivityManager.descriptor);
4543 data.writeInt(timeout);
4544 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
4545 reply.readException();
4546 boolean res = reply.readInt() != 0;
4547 reply.recycle();
4548 data.recycle();
4549 return res;
4550 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004551
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07004552 public void stopAppSwitches() throws RemoteException {
4553 Parcel data = Parcel.obtain();
4554 Parcel reply = Parcel.obtain();
4555 data.writeInterfaceToken(IActivityManager.descriptor);
4556 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
4557 reply.readException();
4558 reply.recycle();
4559 data.recycle();
4560 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004561
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07004562 public void resumeAppSwitches() throws RemoteException {
4563 Parcel data = Parcel.obtain();
4564 Parcel reply = Parcel.obtain();
4565 data.writeInterfaceToken(IActivityManager.descriptor);
4566 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
4567 reply.readException();
4568 reply.recycle();
4569 data.recycle();
4570 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07004571
4572 public void addPackageDependency(String packageName) throws RemoteException {
4573 Parcel data = Parcel.obtain();
4574 Parcel reply = Parcel.obtain();
4575 data.writeInterfaceToken(IActivityManager.descriptor);
4576 data.writeString(packageName);
4577 mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0);
4578 reply.readException();
4579 data.recycle();
4580 reply.recycle();
4581 }
4582
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004583 public void killApplicationWithAppId(String pkg, int appid, String reason)
4584 throws RemoteException {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004585 Parcel data = Parcel.obtain();
4586 Parcel reply = Parcel.obtain();
4587 data.writeInterfaceToken(IActivityManager.descriptor);
4588 data.writeString(pkg);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004589 data.writeInt(appid);
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004590 data.writeString(reason);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004591 mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004592 reply.readException();
4593 data.recycle();
4594 reply.recycle();
4595 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004596
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07004597 public void closeSystemDialogs(String reason) throws RemoteException {
4598 Parcel data = Parcel.obtain();
4599 Parcel reply = Parcel.obtain();
4600 data.writeInterfaceToken(IActivityManager.descriptor);
4601 data.writeString(reason);
4602 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
4603 reply.readException();
4604 data.recycle();
4605 reply.recycle();
4606 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004607
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004608 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004609 throws RemoteException {
4610 Parcel data = Parcel.obtain();
4611 Parcel reply = Parcel.obtain();
4612 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004613 data.writeIntArray(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004614 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
4615 reply.readException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004616 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004617 data.recycle();
4618 reply.recycle();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004619 return res;
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004620 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07004621
4622 public void killApplicationProcess(String processName, int uid) throws RemoteException {
4623 Parcel data = Parcel.obtain();
4624 Parcel reply = Parcel.obtain();
4625 data.writeInterfaceToken(IActivityManager.descriptor);
4626 data.writeString(processName);
4627 data.writeInt(uid);
4628 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
4629 reply.readException();
4630 data.recycle();
4631 reply.recycle();
4632 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004633
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07004634 public void overridePendingTransition(IBinder token, String packageName,
4635 int enterAnim, int exitAnim) throws RemoteException {
4636 Parcel data = Parcel.obtain();
4637 Parcel reply = Parcel.obtain();
4638 data.writeInterfaceToken(IActivityManager.descriptor);
4639 data.writeStrongBinder(token);
4640 data.writeString(packageName);
4641 data.writeInt(enterAnim);
4642 data.writeInt(exitAnim);
4643 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
4644 reply.readException();
4645 data.recycle();
4646 reply.recycle();
4647 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004648
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08004649 public boolean isUserAMonkey() throws RemoteException {
4650 Parcel data = Parcel.obtain();
4651 Parcel reply = Parcel.obtain();
4652 data.writeInterfaceToken(IActivityManager.descriptor);
4653 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
4654 reply.readException();
4655 boolean res = reply.readInt() != 0;
4656 data.recycle();
4657 reply.recycle();
4658 return res;
4659 }
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07004660
4661 public void setUserIsMonkey(boolean monkey) throws RemoteException {
4662 Parcel data = Parcel.obtain();
4663 Parcel reply = Parcel.obtain();
4664 data.writeInterfaceToken(IActivityManager.descriptor);
4665 data.writeInt(monkey ? 1 : 0);
4666 mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0);
4667 reply.readException();
4668 data.recycle();
4669 reply.recycle();
4670 }
4671
Dianne Hackborn860755f2010-06-03 18:47:52 -07004672 public void finishHeavyWeightApp() throws RemoteException {
4673 Parcel data = Parcel.obtain();
4674 Parcel reply = Parcel.obtain();
4675 data.writeInterfaceToken(IActivityManager.descriptor);
4676 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
4677 reply.readException();
4678 data.recycle();
4679 reply.recycle();
4680 }
Craig Mautner4addfc52013-06-25 08:05:45 -07004681
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004682 public boolean convertFromTranslucent(IBinder token)
Craig Mautner4addfc52013-06-25 08:05:45 -07004683 throws RemoteException {
4684 Parcel data = Parcel.obtain();
4685 Parcel reply = Parcel.obtain();
4686 data.writeInterfaceToken(IActivityManager.descriptor);
4687 data.writeStrongBinder(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07004688 mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0);
4689 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004690 boolean res = reply.readInt() != 0;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004691 data.recycle();
4692 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004693 return res;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004694 }
4695
Craig Mautner233ceee2014-05-09 17:05:11 -07004696 public boolean convertToTranslucent(IBinder token, ActivityOptions options)
Craig Mautner5eda9b32013-07-02 11:58:16 -07004697 throws RemoteException {
4698 Parcel data = Parcel.obtain();
4699 Parcel reply = Parcel.obtain();
4700 data.writeInterfaceToken(IActivityManager.descriptor);
4701 data.writeStrongBinder(token);
Craig Mautner233ceee2014-05-09 17:05:11 -07004702 if (options == null) {
4703 data.writeInt(0);
4704 } else {
4705 data.writeInt(1);
4706 data.writeBundle(options.toBundle());
4707 }
Craig Mautner5eda9b32013-07-02 11:58:16 -07004708 mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07004709 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004710 boolean res = reply.readInt() != 0;
Craig Mautner4addfc52013-06-25 08:05:45 -07004711 data.recycle();
4712 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004713 return res;
Craig Mautner4addfc52013-06-25 08:05:45 -07004714 }
4715
Craig Mautner233ceee2014-05-09 17:05:11 -07004716 public ActivityOptions getActivityOptions(IBinder token) throws RemoteException {
4717 Parcel data = Parcel.obtain();
4718 Parcel reply = Parcel.obtain();
4719 data.writeInterfaceToken(IActivityManager.descriptor);
4720 data.writeStrongBinder(token);
4721 mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0);
4722 reply.readException();
4723 Bundle bundle = reply.readBundle();
4724 ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
4725 data.recycle();
4726 reply.recycle();
4727 return options;
4728 }
4729
Daniel Sandler69a48172010-06-23 16:29:36 -04004730 public void setImmersive(IBinder token, boolean immersive)
4731 throws RemoteException {
4732 Parcel data = Parcel.obtain();
4733 Parcel reply = Parcel.obtain();
4734 data.writeInterfaceToken(IActivityManager.descriptor);
4735 data.writeStrongBinder(token);
4736 data.writeInt(immersive ? 1 : 0);
4737 mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
4738 reply.readException();
4739 data.recycle();
4740 reply.recycle();
4741 }
4742
4743 public boolean isImmersive(IBinder token)
4744 throws RemoteException {
4745 Parcel data = Parcel.obtain();
4746 Parcel reply = Parcel.obtain();
4747 data.writeInterfaceToken(IActivityManager.descriptor);
4748 data.writeStrongBinder(token);
4749 mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004750 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004751 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004752 data.recycle();
4753 reply.recycle();
4754 return res;
4755 }
4756
Craig Mautnerd61dc202014-07-07 11:09:11 -07004757 public boolean isTopOfTask(IBinder token) throws RemoteException {
4758 Parcel data = Parcel.obtain();
4759 Parcel reply = Parcel.obtain();
4760 data.writeInterfaceToken(IActivityManager.descriptor);
4761 data.writeStrongBinder(token);
4762 mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0);
4763 reply.readException();
4764 boolean res = reply.readInt() == 1;
4765 data.recycle();
4766 reply.recycle();
4767 return res;
4768 }
4769
Daniel Sandler69a48172010-06-23 16:29:36 -04004770 public boolean isTopActivityImmersive()
4771 throws RemoteException {
4772 Parcel data = Parcel.obtain();
4773 Parcel reply = Parcel.obtain();
4774 data.writeInterfaceToken(IActivityManager.descriptor);
4775 mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004776 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004777 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004778 data.recycle();
4779 reply.recycle();
4780 return res;
4781 }
4782
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004783 public void crashApplication(int uid, int initialPid, String packageName,
4784 String message) throws RemoteException {
4785 Parcel data = Parcel.obtain();
4786 Parcel reply = Parcel.obtain();
4787 data.writeInterfaceToken(IActivityManager.descriptor);
4788 data.writeInt(uid);
4789 data.writeInt(initialPid);
4790 data.writeString(packageName);
4791 data.writeString(message);
4792 mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0);
4793 reply.readException();
4794 data.recycle();
4795 reply.recycle();
4796 }
Andy McFadden824c5102010-07-09 16:26:57 -07004797
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004798 public String getProviderMimeType(Uri uri, int userId) throws RemoteException {
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004799 Parcel data = Parcel.obtain();
4800 Parcel reply = Parcel.obtain();
4801 data.writeInterfaceToken(IActivityManager.descriptor);
4802 uri.writeToParcel(data, 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004803 data.writeInt(userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004804 mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0);
4805 reply.readException();
4806 String res = reply.readString();
4807 data.recycle();
4808 reply.recycle();
4809 return res;
4810 }
4811
Dianne Hackborn7e269642010-08-25 19:50:20 -07004812 public IBinder newUriPermissionOwner(String name)
4813 throws RemoteException {
4814 Parcel data = Parcel.obtain();
4815 Parcel reply = Parcel.obtain();
4816 data.writeInterfaceToken(IActivityManager.descriptor);
4817 data.writeString(name);
4818 mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
4819 reply.readException();
4820 IBinder res = reply.readStrongBinder();
4821 data.recycle();
4822 reply.recycle();
4823 return res;
4824 }
4825
4826 public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
Nicolas Prevotf1939902014-06-25 09:29:02 +01004827 Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07004828 Parcel data = Parcel.obtain();
4829 Parcel reply = Parcel.obtain();
4830 data.writeInterfaceToken(IActivityManager.descriptor);
4831 data.writeStrongBinder(owner);
4832 data.writeInt(fromUid);
4833 data.writeString(targetPkg);
4834 uri.writeToParcel(data, 0);
4835 data.writeInt(mode);
Nicolas Prevotf1939902014-06-25 09:29:02 +01004836 data.writeInt(sourceUserId);
4837 data.writeInt(targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07004838 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4839 reply.readException();
4840 data.recycle();
4841 reply.recycle();
4842 }
4843
4844 public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004845 int mode, int userId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07004846 Parcel data = Parcel.obtain();
4847 Parcel reply = Parcel.obtain();
4848 data.writeInterfaceToken(IActivityManager.descriptor);
4849 data.writeStrongBinder(owner);
4850 if (uri != null) {
4851 data.writeInt(1);
4852 uri.writeToParcel(data, 0);
4853 } else {
4854 data.writeInt(0);
4855 }
4856 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004857 data.writeInt(userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07004858 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4859 reply.readException();
4860 data.recycle();
4861 reply.recycle();
4862 }
Dianne Hackbornc8f84972010-08-25 23:14:44 -07004863
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004864 public int checkGrantUriPermission(int callingUid, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004865 Uri uri, int modeFlags, int userId) throws RemoteException {
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004866 Parcel data = Parcel.obtain();
4867 Parcel reply = Parcel.obtain();
4868 data.writeInterfaceToken(IActivityManager.descriptor);
4869 data.writeInt(callingUid);
4870 data.writeString(targetPkg);
4871 uri.writeToParcel(data, 0);
4872 data.writeInt(modeFlags);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004873 data.writeInt(userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004874 mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4875 reply.readException();
4876 int res = reply.readInt();
4877 data.recycle();
4878 reply.recycle();
4879 return res;
4880 }
4881
Dianne Hackborn1676c852012-09-10 14:52:30 -07004882 public boolean dumpHeap(String process, int userId, boolean managed,
Andy McFadden824c5102010-07-09 16:26:57 -07004883 String path, ParcelFileDescriptor fd) throws RemoteException {
4884 Parcel data = Parcel.obtain();
4885 Parcel reply = Parcel.obtain();
4886 data.writeInterfaceToken(IActivityManager.descriptor);
4887 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004888 data.writeInt(userId);
Andy McFadden824c5102010-07-09 16:26:57 -07004889 data.writeInt(managed ? 1 : 0);
4890 data.writeString(path);
4891 if (fd != null) {
4892 data.writeInt(1);
4893 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
4894 } else {
4895 data.writeInt(0);
4896 }
4897 mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
4898 reply.readException();
4899 boolean res = reply.readInt() != 0;
4900 reply.recycle();
4901 data.recycle();
4902 return res;
4903 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004904
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004905 public int startActivities(IApplicationThread caller, String callingPackage,
Dianne Hackborna4972e92012-03-14 10:38:05 -07004906 Intent[] intents, String[] resolvedTypes, IBinder resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004907 Bundle options, int userId) throws RemoteException {
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004908 Parcel data = Parcel.obtain();
4909 Parcel reply = Parcel.obtain();
4910 data.writeInterfaceToken(IActivityManager.descriptor);
4911 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004912 data.writeString(callingPackage);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004913 data.writeTypedArray(intents, 0);
4914 data.writeStringArray(resolvedTypes);
4915 data.writeStrongBinder(resultTo);
Dianne Hackborna4972e92012-03-14 10:38:05 -07004916 if (options != null) {
4917 data.writeInt(1);
4918 options.writeToParcel(data, 0);
4919 } else {
4920 data.writeInt(0);
4921 }
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004922 data.writeInt(userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004923 mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0);
4924 reply.readException();
4925 int result = reply.readInt();
4926 reply.recycle();
4927 data.recycle();
4928 return result;
4929 }
4930
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004931 public int getFrontActivityScreenCompatMode() throws RemoteException {
4932 Parcel data = Parcel.obtain();
4933 Parcel reply = Parcel.obtain();
4934 data.writeInterfaceToken(IActivityManager.descriptor);
4935 mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4936 reply.readException();
4937 int mode = reply.readInt();
4938 reply.recycle();
4939 data.recycle();
4940 return mode;
4941 }
4942
4943 public void setFrontActivityScreenCompatMode(int mode) throws RemoteException {
4944 Parcel data = Parcel.obtain();
4945 Parcel reply = Parcel.obtain();
4946 data.writeInterfaceToken(IActivityManager.descriptor);
4947 data.writeInt(mode);
4948 mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4949 reply.readException();
4950 reply.recycle();
4951 data.recycle();
4952 }
4953
4954 public int getPackageScreenCompatMode(String packageName) throws RemoteException {
4955 Parcel data = Parcel.obtain();
4956 Parcel reply = Parcel.obtain();
4957 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004958 data.writeString(packageName);
4959 mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004960 reply.readException();
4961 int mode = reply.readInt();
4962 reply.recycle();
4963 data.recycle();
4964 return mode;
4965 }
4966
4967 public void setPackageScreenCompatMode(String packageName, int mode)
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004968 throws RemoteException {
4969 Parcel data = Parcel.obtain();
4970 Parcel reply = Parcel.obtain();
4971 data.writeInterfaceToken(IActivityManager.descriptor);
4972 data.writeString(packageName);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004973 data.writeInt(mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004974 mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4975 reply.readException();
4976 reply.recycle();
4977 data.recycle();
4978 }
4979
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004980 public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
4981 Parcel data = Parcel.obtain();
4982 Parcel reply = Parcel.obtain();
4983 data.writeInterfaceToken(IActivityManager.descriptor);
4984 data.writeString(packageName);
4985 mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4986 reply.readException();
4987 boolean ask = reply.readInt() != 0;
4988 reply.recycle();
4989 data.recycle();
4990 return ask;
4991 }
4992
4993 public void setPackageAskScreenCompat(String packageName, boolean ask)
4994 throws RemoteException {
4995 Parcel data = Parcel.obtain();
4996 Parcel reply = Parcel.obtain();
4997 data.writeInterfaceToken(IActivityManager.descriptor);
4998 data.writeString(packageName);
4999 data.writeInt(ask ? 1 : 0);
5000 mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
5001 reply.readException();
5002 reply.recycle();
5003 data.recycle();
5004 }
5005
Amith Yamasani4b2e9342011-03-31 12:38:53 -07005006 public boolean switchUser(int userid) throws RemoteException {
5007 Parcel data = Parcel.obtain();
5008 Parcel reply = Parcel.obtain();
5009 data.writeInterfaceToken(IActivityManager.descriptor);
5010 data.writeInt(userid);
5011 mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0);
5012 reply.readException();
5013 boolean result = reply.readInt() != 0;
5014 reply.recycle();
5015 data.recycle();
5016 return result;
5017 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07005018
Kenny Guy08488bf2014-02-21 17:40:37 +00005019 public boolean startUserInBackground(int userid) throws RemoteException {
5020 Parcel data = Parcel.obtain();
5021 Parcel reply = Parcel.obtain();
5022 data.writeInterfaceToken(IActivityManager.descriptor);
5023 data.writeInt(userid);
5024 mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0);
5025 reply.readException();
5026 boolean result = reply.readInt() != 0;
5027 reply.recycle();
5028 data.recycle();
5029 return result;
5030 }
5031
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005032 public int stopUser(int userid, IStopUserCallback callback) throws RemoteException {
5033 Parcel data = Parcel.obtain();
5034 Parcel reply = Parcel.obtain();
5035 data.writeInterfaceToken(IActivityManager.descriptor);
5036 data.writeInt(userid);
5037 data.writeStrongInterface(callback);
5038 mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0);
5039 reply.readException();
5040 int result = reply.readInt();
5041 reply.recycle();
5042 data.recycle();
5043 return result;
5044 }
5045
Amith Yamasani52f1d752012-03-28 18:19:29 -07005046 public UserInfo getCurrentUser() throws RemoteException {
5047 Parcel data = Parcel.obtain();
5048 Parcel reply = Parcel.obtain();
5049 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005050 mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0);
Amith Yamasani52f1d752012-03-28 18:19:29 -07005051 reply.readException();
5052 UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply);
5053 reply.recycle();
5054 data.recycle();
5055 return userInfo;
5056 }
5057
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07005058 public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException {
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005059 Parcel data = Parcel.obtain();
5060 Parcel reply = Parcel.obtain();
5061 data.writeInterfaceToken(IActivityManager.descriptor);
5062 data.writeInt(userid);
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07005063 data.writeInt(orStopping ? 1 : 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005064 mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0);
5065 reply.readException();
5066 boolean result = reply.readInt() != 0;
5067 reply.recycle();
5068 data.recycle();
5069 return result;
5070 }
5071
Dianne Hackbornc72fc672012-09-20 13:12:03 -07005072 public int[] getRunningUserIds() throws RemoteException {
5073 Parcel data = Parcel.obtain();
5074 Parcel reply = Parcel.obtain();
5075 data.writeInterfaceToken(IActivityManager.descriptor);
5076 mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0);
5077 reply.readException();
5078 int[] result = reply.createIntArray();
5079 reply.recycle();
5080 data.recycle();
5081 return result;
5082 }
5083
Wale Ogunwaled54b5782014-10-23 15:55:23 -07005084 public boolean removeTask(int taskId) throws RemoteException {
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005085 Parcel data = Parcel.obtain();
5086 Parcel reply = Parcel.obtain();
5087 data.writeInterfaceToken(IActivityManager.descriptor);
5088 data.writeInt(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005089 mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
5090 reply.readException();
5091 boolean result = reply.readInt() != 0;
5092 reply.recycle();
5093 data.recycle();
5094 return result;
5095 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07005096
Jeff Sharkeya4620792011-05-20 15:29:23 -07005097 public void registerProcessObserver(IProcessObserver observer) throws RemoteException {
5098 Parcel data = Parcel.obtain();
5099 Parcel reply = Parcel.obtain();
5100 data.writeInterfaceToken(IActivityManager.descriptor);
5101 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5102 mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5103 reply.readException();
5104 data.recycle();
5105 reply.recycle();
5106 }
5107
5108 public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException {
5109 Parcel data = Parcel.obtain();
5110 Parcel reply = Parcel.obtain();
5111 data.writeInterfaceToken(IActivityManager.descriptor);
5112 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5113 mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5114 reply.readException();
5115 data.recycle();
5116 reply.recycle();
5117 }
5118
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07005119 public void registerUidObserver(IUidObserver observer) throws RemoteException {
5120 Parcel data = Parcel.obtain();
5121 Parcel reply = Parcel.obtain();
5122 data.writeInterfaceToken(IActivityManager.descriptor);
5123 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5124 mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0);
5125 reply.readException();
5126 data.recycle();
5127 reply.recycle();
5128 }
5129
5130 public void unregisterUidObserver(IUidObserver observer) throws RemoteException {
5131 Parcel data = Parcel.obtain();
5132 Parcel reply = Parcel.obtain();
5133 data.writeInterfaceToken(IActivityManager.descriptor);
5134 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5135 mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0);
5136 reply.readException();
5137 data.recycle();
5138 reply.recycle();
5139 }
5140
Dianne Hackborn6c418d52011-06-29 14:05:33 -07005141 public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException {
5142 Parcel data = Parcel.obtain();
5143 Parcel reply = Parcel.obtain();
5144 data.writeInterfaceToken(IActivityManager.descriptor);
5145 data.writeStrongBinder(sender.asBinder());
5146 mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0);
5147 reply.readException();
5148 boolean res = reply.readInt() != 0;
5149 data.recycle();
5150 reply.recycle();
5151 return res;
5152 }
5153
Dianne Hackborn1927ae82012-06-22 15:21:36 -07005154 public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException {
5155 Parcel data = Parcel.obtain();
5156 Parcel reply = Parcel.obtain();
5157 data.writeInterfaceToken(IActivityManager.descriptor);
5158 data.writeStrongBinder(sender.asBinder());
5159 mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0);
5160 reply.readException();
5161 boolean res = reply.readInt() != 0;
5162 data.recycle();
5163 reply.recycle();
5164 return res;
5165 }
5166
Dianne Hackborn81038902012-11-26 17:04:09 -08005167 public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException {
5168 Parcel data = Parcel.obtain();
5169 Parcel reply = Parcel.obtain();
5170 data.writeInterfaceToken(IActivityManager.descriptor);
5171 data.writeStrongBinder(sender.asBinder());
5172 mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5173 reply.readException();
5174 Intent res = reply.readInt() != 0
5175 ? Intent.CREATOR.createFromParcel(reply) : null;
5176 data.recycle();
5177 reply.recycle();
5178 return res;
5179 }
5180
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08005181 public String getTagForIntentSender(IIntentSender sender, String prefix)
5182 throws RemoteException {
5183 Parcel data = Parcel.obtain();
5184 Parcel reply = Parcel.obtain();
5185 data.writeInterfaceToken(IActivityManager.descriptor);
5186 data.writeStrongBinder(sender.asBinder());
5187 data.writeString(prefix);
5188 mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5189 reply.readException();
5190 String res = reply.readString();
5191 data.recycle();
5192 reply.recycle();
5193 return res;
5194 }
5195
Dianne Hackborn31ca8542011-07-19 14:58:28 -07005196 public void updatePersistentConfiguration(Configuration values) throws RemoteException
5197 {
5198 Parcel data = Parcel.obtain();
5199 Parcel reply = Parcel.obtain();
5200 data.writeInterfaceToken(IActivityManager.descriptor);
5201 values.writeToParcel(data, 0);
5202 mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0);
5203 reply.readException();
5204 data.recycle();
5205 reply.recycle();
5206 }
5207
Dianne Hackbornb437e092011-08-05 17:50:29 -07005208 public long[] getProcessPss(int[] pids) throws RemoteException {
5209 Parcel data = Parcel.obtain();
5210 Parcel reply = Parcel.obtain();
5211 data.writeInterfaceToken(IActivityManager.descriptor);
5212 data.writeIntArray(pids);
5213 mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0);
5214 reply.readException();
5215 long[] res = reply.createLongArray();
5216 data.recycle();
5217 reply.recycle();
5218 return res;
5219 }
5220
Dianne Hackborn661cd522011-08-22 00:26:20 -07005221 public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
5222 Parcel data = Parcel.obtain();
5223 Parcel reply = Parcel.obtain();
5224 data.writeInterfaceToken(IActivityManager.descriptor);
5225 TextUtils.writeToParcel(msg, data, 0);
5226 data.writeInt(always ? 1 : 0);
5227 mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
5228 reply.readException();
5229 data.recycle();
5230 reply.recycle();
5231 }
5232
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02005233 public void keyguardWaitingForActivityDrawn() throws RemoteException {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07005234 Parcel data = Parcel.obtain();
5235 Parcel reply = Parcel.obtain();
5236 data.writeInterfaceToken(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02005237 mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
Dianne Hackborn90c52de2011-09-23 12:57:44 -07005238 reply.readException();
5239 data.recycle();
5240 reply.recycle();
5241 }
5242
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07005243 public void keyguardGoingAway(boolean disableWindowAnimations,
5244 boolean keyguardGoingToNotificationShade) throws RemoteException {
5245 Parcel data = Parcel.obtain();
5246 Parcel reply = Parcel.obtain();
5247 data.writeInterfaceToken(IActivityManager.descriptor);
5248 data.writeInt(disableWindowAnimations ? 1 : 0);
5249 data.writeInt(keyguardGoingToNotificationShade ? 1 : 0);
5250 mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0);
5251 reply.readException();
5252 data.recycle();
5253 reply.recycle();
5254 }
5255
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07005256 public boolean shouldUpRecreateTask(IBinder token, String destAffinity)
Adam Powelldd8fab22012-03-22 17:47:27 -07005257 throws RemoteException {
5258 Parcel data = Parcel.obtain();
5259 Parcel reply = Parcel.obtain();
5260 data.writeInterfaceToken(IActivityManager.descriptor);
5261 data.writeStrongBinder(token);
5262 data.writeString(destAffinity);
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07005263 mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0);
Adam Powelldd8fab22012-03-22 17:47:27 -07005264 reply.readException();
5265 boolean result = reply.readInt() != 0;
5266 data.recycle();
5267 reply.recycle();
5268 return result;
5269 }
5270
5271 public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData)
5272 throws RemoteException {
5273 Parcel data = Parcel.obtain();
5274 Parcel reply = Parcel.obtain();
5275 data.writeInterfaceToken(IActivityManager.descriptor);
5276 data.writeStrongBinder(token);
5277 target.writeToParcel(data, 0);
5278 data.writeInt(resultCode);
5279 if (resultData != null) {
5280 data.writeInt(1);
5281 resultData.writeToParcel(data, 0);
5282 } else {
5283 data.writeInt(0);
5284 }
5285 mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0);
5286 reply.readException();
5287 boolean result = reply.readInt() != 0;
5288 data.recycle();
5289 reply.recycle();
5290 return result;
5291 }
5292
Dianne Hackborn5320eb82012-05-18 12:05:04 -07005293 public int getLaunchedFromUid(IBinder activityToken) throws RemoteException {
5294 Parcel data = Parcel.obtain();
5295 Parcel reply = Parcel.obtain();
5296 data.writeInterfaceToken(IActivityManager.descriptor);
5297 data.writeStrongBinder(activityToken);
5298 mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0);
5299 reply.readException();
5300 int result = reply.readInt();
5301 data.recycle();
5302 reply.recycle();
5303 return result;
5304 }
5305
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005306 public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException {
5307 Parcel data = Parcel.obtain();
5308 Parcel reply = Parcel.obtain();
5309 data.writeInterfaceToken(IActivityManager.descriptor);
5310 data.writeStrongBinder(activityToken);
5311 mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0);
5312 reply.readException();
5313 String result = reply.readString();
5314 data.recycle();
5315 reply.recycle();
5316 return result;
5317 }
5318
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07005319 public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5320 Parcel data = Parcel.obtain();
5321 Parcel reply = Parcel.obtain();
5322 data.writeInterfaceToken(IActivityManager.descriptor);
5323 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5324 mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5325 reply.readException();
5326 data.recycle();
5327 reply.recycle();
5328 }
5329
5330 public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5331 Parcel data = Parcel.obtain();
5332 Parcel reply = Parcel.obtain();
5333 data.writeInterfaceToken(IActivityManager.descriptor);
5334 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5335 mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5336 reply.readException();
5337 data.recycle();
5338 reply.recycle();
5339 }
5340
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07005341 public void requestBugReport() throws RemoteException {
5342 Parcel data = Parcel.obtain();
5343 Parcel reply = Parcel.obtain();
5344 data.writeInterfaceToken(IActivityManager.descriptor);
5345 mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0);
5346 reply.readException();
5347 data.recycle();
5348 reply.recycle();
5349 }
5350
Jeff Brownbd181bb2013-09-10 16:44:24 -07005351 public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason)
5352 throws RemoteException {
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005353 Parcel data = Parcel.obtain();
5354 Parcel reply = Parcel.obtain();
5355 data.writeInterfaceToken(IActivityManager.descriptor);
5356 data.writeInt(pid);
5357 data.writeInt(aboveSystem ? 1 : 0);
Jeff Brownbd181bb2013-09-10 16:44:24 -07005358 data.writeString(reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005359 mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0);
5360 reply.readException();
5361 long res = reply.readInt();
5362 data.recycle();
5363 reply.recycle();
5364 return res;
5365 }
5366
Adam Skorydfc7fd72013-08-05 19:23:41 -07005367 public Bundle getAssistContextExtras(int requestType) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005368 Parcel data = Parcel.obtain();
5369 Parcel reply = Parcel.obtain();
5370 data.writeInterfaceToken(IActivityManager.descriptor);
5371 data.writeInt(requestType);
Adam Skorydfc7fd72013-08-05 19:23:41 -07005372 mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005373 reply.readException();
5374 Bundle res = reply.readBundle();
5375 data.recycle();
5376 reply.recycle();
5377 return res;
5378 }
5379
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005380 public void requestAssistContextExtras(int requestType, IResultReceiver receiver)
5381 throws RemoteException {
5382 Parcel data = Parcel.obtain();
5383 Parcel reply = Parcel.obtain();
5384 data.writeInterfaceToken(IActivityManager.descriptor);
5385 data.writeInt(requestType);
5386 data.writeStrongBinder(receiver.asBinder());
5387 mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
5388 reply.readException();
5389 data.recycle();
5390 reply.recycle();
5391 }
5392
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07005393 public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure,
Dianne Hackborna3acdb32015-06-08 17:07:40 -07005394 AssistContent content, Uri referrer) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005395 Parcel data = Parcel.obtain();
5396 Parcel reply = Parcel.obtain();
5397 data.writeInterfaceToken(IActivityManager.descriptor);
5398 data.writeStrongBinder(token);
5399 data.writeBundle(extras);
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07005400 structure.writeToParcel(data, 0);
5401 content.writeToParcel(data, 0);
Dianne Hackborna3acdb32015-06-08 17:07:40 -07005402 if (referrer != null) {
5403 data.writeInt(1);
5404 referrer.writeToParcel(data, 0);
5405 } else {
5406 data.writeInt(0);
5407 }
Adam Skorydfc7fd72013-08-05 19:23:41 -07005408 mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005409 reply.readException();
5410 data.recycle();
5411 reply.recycle();
5412 }
5413
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07005414 public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle,
5415 Bundle args) throws RemoteException {
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07005416 Parcel data = Parcel.obtain();
5417 Parcel reply = Parcel.obtain();
5418 data.writeInterfaceToken(IActivityManager.descriptor);
5419 intent.writeToParcel(data, 0);
5420 data.writeInt(requestType);
5421 data.writeString(hint);
5422 data.writeInt(userHandle);
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07005423 data.writeBundle(args);
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07005424 mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0);
5425 reply.readException();
5426 boolean res = reply.readInt() != 0;
5427 data.recycle();
5428 reply.recycle();
5429 return res;
5430 }
5431
Benjamin Franzc200f442015-06-25 18:20:04 +01005432 public boolean isScreenCaptureAllowedOnCurrentActivity() throws RemoteException {
5433 Parcel data = Parcel.obtain();
5434 Parcel reply = Parcel.obtain();
5435 data.writeInterfaceToken(IActivityManager.descriptor);
5436 mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0);
5437 reply.readException();
5438 boolean res = reply.readInt() != 0;
5439 data.recycle();
5440 reply.recycle();
5441 return res;
5442 }
5443
Dianne Hackbornf1b78242013-04-08 22:28:59 -07005444 public void killUid(int uid, String reason) throws RemoteException {
5445 Parcel data = Parcel.obtain();
5446 Parcel reply = Parcel.obtain();
5447 data.writeInterfaceToken(IActivityManager.descriptor);
5448 data.writeInt(uid);
5449 data.writeString(reason);
5450 mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0);
5451 reply.readException();
5452 data.recycle();
5453 reply.recycle();
5454 }
5455
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07005456 public void hang(IBinder who, boolean allowRestart) throws RemoteException {
5457 Parcel data = Parcel.obtain();
5458 Parcel reply = Parcel.obtain();
5459 data.writeInterfaceToken(IActivityManager.descriptor);
5460 data.writeStrongBinder(who);
5461 data.writeInt(allowRestart ? 1 : 0);
5462 mRemote.transact(HANG_TRANSACTION, data, reply, 0);
5463 reply.readException();
5464 data.recycle();
5465 reply.recycle();
5466 }
5467
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07005468 public void reportActivityFullyDrawn(IBinder token) throws RemoteException {
5469 Parcel data = Parcel.obtain();
5470 Parcel reply = Parcel.obtain();
5471 data.writeInterfaceToken(IActivityManager.descriptor);
5472 data.writeStrongBinder(token);
5473 mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0);
5474 reply.readException();
5475 data.recycle();
5476 reply.recycle();
5477 }
5478
Craig Mautner5eda9b32013-07-02 11:58:16 -07005479 public void notifyActivityDrawn(IBinder token) throws RemoteException {
5480 Parcel data = Parcel.obtain();
5481 Parcel reply = Parcel.obtain();
5482 data.writeInterfaceToken(IActivityManager.descriptor);
5483 data.writeStrongBinder(token);
5484 mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
5485 reply.readException();
5486 data.recycle();
5487 reply.recycle();
5488 }
5489
Dianne Hackborn57a7f592013-07-22 18:21:32 -07005490 public void restart() throws RemoteException {
5491 Parcel data = Parcel.obtain();
5492 Parcel reply = Parcel.obtain();
5493 data.writeInterfaceToken(IActivityManager.descriptor);
5494 mRemote.transact(RESTART_TRANSACTION, data, reply, 0);
5495 reply.readException();
5496 data.recycle();
5497 reply.recycle();
5498 }
5499
Dianne Hackborn35f72be2013-09-16 10:57:39 -07005500 public void performIdleMaintenance() throws RemoteException {
5501 Parcel data = Parcel.obtain();
5502 Parcel reply = Parcel.obtain();
5503 data.writeInterfaceToken(IActivityManager.descriptor);
5504 mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0);
5505 reply.readException();
5506 data.recycle();
5507 reply.recycle();
5508 }
5509
Todd Kennedyca4d8422015-01-15 15:19:22 -08005510 public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken,
Craig Mautner4a1cb222013-12-04 16:14:06 -08005511 IActivityContainerCallback callback) throws RemoteException {
5512 Parcel data = Parcel.obtain();
5513 Parcel reply = Parcel.obtain();
5514 data.writeInterfaceToken(IActivityManager.descriptor);
5515 data.writeStrongBinder(parentActivityToken);
Craig Mautnere3a00d72014-04-16 08:31:19 -07005516 data.writeStrongBinder(callback == null ? null : callback.asBinder());
Todd Kennedyca4d8422015-01-15 15:19:22 -08005517 mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
Craig Mautner4a1cb222013-12-04 16:14:06 -08005518 reply.readException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08005519 final int result = reply.readInt();
5520 final IActivityContainer res;
5521 if (result == 1) {
5522 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5523 } else {
5524 res = null;
5525 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08005526 data.recycle();
5527 reply.recycle();
5528 return res;
5529 }
5530
Craig Mautner95da1082014-02-24 17:54:35 -08005531 public void deleteActivityContainer(IActivityContainer activityContainer)
5532 throws RemoteException {
5533 Parcel data = Parcel.obtain();
5534 Parcel reply = Parcel.obtain();
5535 data.writeInterfaceToken(IActivityManager.descriptor);
5536 data.writeStrongBinder(activityContainer.asBinder());
5537 mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
5538 reply.readException();
5539 data.recycle();
5540 reply.recycle();
5541 }
5542
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005543 @Override
Todd Kennedy4900bf92015-01-16 16:05:14 -08005544 public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException {
5545 Parcel data = Parcel.obtain();
5546 Parcel reply = Parcel.obtain();
5547 data.writeInterfaceToken(IActivityManager.descriptor);
5548 data.writeInt(displayId);
5549 mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0);
5550 reply.readException();
5551 final int result = reply.readInt();
5552 final IActivityContainer res;
5553 if (result == 1) {
5554 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5555 } else {
5556 res = null;
5557 }
5558 data.recycle();
5559 reply.recycle();
5560 return res;
5561 }
5562
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005563 @Override
5564 public int getActivityDisplayId(IBinder activityToken)
Craig Mautnere0a38842013-12-16 16:14:02 -08005565 throws RemoteException {
5566 Parcel data = Parcel.obtain();
5567 Parcel reply = Parcel.obtain();
5568 data.writeInterfaceToken(IActivityManager.descriptor);
5569 data.writeStrongBinder(activityToken);
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005570 mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0);
Craig Mautnere0a38842013-12-16 16:14:02 -08005571 reply.readException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005572 final int displayId = reply.readInt();
Craig Mautnere0a38842013-12-16 16:14:02 -08005573 data.recycle();
5574 reply.recycle();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005575 return displayId;
Craig Mautnere0a38842013-12-16 16:14:02 -08005576 }
5577
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005578 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005579 public void startLockTaskMode(int taskId) throws RemoteException {
5580 Parcel data = Parcel.obtain();
5581 Parcel reply = Parcel.obtain();
5582 data.writeInterfaceToken(IActivityManager.descriptor);
5583 data.writeInt(taskId);
5584 mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0);
5585 reply.readException();
5586 data.recycle();
5587 reply.recycle();
5588 }
5589
5590 @Override
5591 public void startLockTaskMode(IBinder token) throws RemoteException {
5592 Parcel data = Parcel.obtain();
5593 Parcel reply = Parcel.obtain();
5594 data.writeInterfaceToken(IActivityManager.descriptor);
5595 data.writeStrongBinder(token);
5596 mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0);
5597 reply.readException();
5598 data.recycle();
5599 reply.recycle();
5600 }
5601
5602 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005603 public void startLockTaskModeOnCurrent() throws RemoteException {
5604 Parcel data = Parcel.obtain();
5605 Parcel reply = Parcel.obtain();
5606 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005607 mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005608 reply.readException();
5609 data.recycle();
5610 reply.recycle();
5611 }
5612
5613 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005614 public void stopLockTaskMode() throws RemoteException {
5615 Parcel data = Parcel.obtain();
5616 Parcel reply = Parcel.obtain();
5617 data.writeInterfaceToken(IActivityManager.descriptor);
5618 mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5619 reply.readException();
5620 data.recycle();
5621 reply.recycle();
5622 }
5623
5624 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005625 public void stopLockTaskModeOnCurrent() throws RemoteException {
5626 Parcel data = Parcel.obtain();
5627 Parcel reply = Parcel.obtain();
5628 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005629 mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005630 reply.readException();
5631 data.recycle();
5632 reply.recycle();
5633 }
5634
5635 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005636 public boolean isInLockTaskMode() throws RemoteException {
5637 Parcel data = Parcel.obtain();
5638 Parcel reply = Parcel.obtain();
5639 data.writeInterfaceToken(IActivityManager.descriptor);
5640 mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5641 reply.readException();
5642 boolean isInLockTaskMode = reply.readInt() == 1;
5643 data.recycle();
5644 reply.recycle();
5645 return isInLockTaskMode;
5646 }
5647
Craig Mautner688b5102014-03-27 16:55:03 -07005648 @Override
Benjamin Franz43261142015-02-11 15:59:44 +00005649 public int getLockTaskModeState() throws RemoteException {
5650 Parcel data = Parcel.obtain();
5651 Parcel reply = Parcel.obtain();
5652 data.writeInterfaceToken(IActivityManager.descriptor);
5653 mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0);
5654 reply.readException();
5655 int lockTaskModeState = reply.readInt();
5656 data.recycle();
5657 reply.recycle();
5658 return lockTaskModeState;
5659 }
5660
5661 @Override
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07005662 public void showLockTaskEscapeMessage(IBinder token) throws RemoteException {
5663 Parcel data = Parcel.obtain();
5664 Parcel reply = Parcel.obtain();
5665 data.writeInterfaceToken(IActivityManager.descriptor);
5666 data.writeStrongBinder(token);
5667 mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply,
5668 IBinder.FLAG_ONEWAY);
5669 reply.readException();
5670 data.recycle();
5671 reply.recycle();
5672 }
5673
5674 @Override
Winson Chunga449dc02014-05-16 11:15:04 -07005675 public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values)
Winson Chung03a9bae2014-05-02 09:56:12 -07005676 throws RemoteException {
Craig Mautner2fbd7542014-03-21 09:34:07 -07005677 Parcel data = Parcel.obtain();
5678 Parcel reply = Parcel.obtain();
5679 data.writeInterfaceToken(IActivityManager.descriptor);
5680 data.writeStrongBinder(token);
Winson Chung03a9bae2014-05-02 09:56:12 -07005681 values.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005682 mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0);
Craig Mautner2fbd7542014-03-21 09:34:07 -07005683 reply.readException();
5684 data.recycle();
5685 reply.recycle();
5686 }
5687
Craig Mautneree2e45a2014-06-27 12:10:03 -07005688 @Override
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08005689 public void setTaskResizeable(int taskId, boolean resizeable) throws RemoteException {
5690 Parcel data = Parcel.obtain();
5691 Parcel reply = Parcel.obtain();
5692 data.writeInterfaceToken(IActivityManager.descriptor);
5693 data.writeInt(taskId);
5694 data.writeInt(resizeable ? 1 : 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005695 mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0);
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08005696 reply.readException();
5697 data.recycle();
5698 reply.recycle();
5699 }
5700
5701 @Override
Wale Ogunwale53a29a92015-02-23 15:42:52 -08005702 public void resizeTask(int taskId, Rect r) throws RemoteException
5703 {
5704 Parcel data = Parcel.obtain();
5705 Parcel reply = Parcel.obtain();
5706 data.writeInterfaceToken(IActivityManager.descriptor);
5707 data.writeInt(taskId);
5708 r.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005709 mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08005710 reply.readException();
5711 data.recycle();
5712 reply.recycle();
5713 }
5714
5715 @Override
Craig Mautner648f69b2014-09-18 14:16:26 -07005716 public Bitmap getTaskDescriptionIcon(String filename) throws RemoteException {
5717 Parcel data = Parcel.obtain();
5718 Parcel reply = Parcel.obtain();
5719 data.writeInterfaceToken(IActivityManager.descriptor);
5720 data.writeString(filename);
5721 mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0);
5722 reply.readException();
5723 final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply);
5724 data.recycle();
5725 reply.recycle();
5726 return icon;
5727 }
5728
5729 @Override
Winson Chung044d5292014-11-06 11:05:19 -08005730 public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options)
5731 throws RemoteException {
5732 Parcel data = Parcel.obtain();
5733 Parcel reply = Parcel.obtain();
5734 data.writeInterfaceToken(IActivityManager.descriptor);
5735 if (options == null) {
5736 data.writeInt(0);
5737 } else {
5738 data.writeInt(1);
5739 data.writeBundle(options.toBundle());
5740 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07005741 mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0);
Winson Chung044d5292014-11-06 11:05:19 -08005742 reply.readException();
5743 data.recycle();
5744 reply.recycle();
5745 }
5746
5747 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005748 public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005749 Parcel data = Parcel.obtain();
5750 Parcel reply = Parcel.obtain();
5751 data.writeInterfaceToken(IActivityManager.descriptor);
5752 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07005753 data.writeInt(visible ? 1 : 0);
5754 mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005755 reply.readException();
5756 boolean success = reply.readInt() > 0;
5757 data.recycle();
5758 reply.recycle();
5759 return success;
5760 }
5761
5762 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005763 public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005764 Parcel data = Parcel.obtain();
5765 Parcel reply = Parcel.obtain();
5766 data.writeInterfaceToken(IActivityManager.descriptor);
5767 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07005768 mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005769 reply.readException();
Jose Lima4b6c6692014-08-12 17:41:12 -07005770 final boolean visible = reply.readInt() > 0;
Craig Mautneree2e45a2014-06-27 12:10:03 -07005771 data.recycle();
5772 reply.recycle();
Jose Lima4b6c6692014-08-12 17:41:12 -07005773 return visible;
Craig Mautneree2e45a2014-06-27 12:10:03 -07005774 }
5775
5776 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005777 public void backgroundResourcesReleased(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005778 Parcel data = Parcel.obtain();
5779 Parcel reply = Parcel.obtain();
5780 data.writeInterfaceToken(IActivityManager.descriptor);
5781 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005782 mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0);
Craig Mautnerbb742462014-07-07 15:28:55 -07005783 reply.readException();
5784 data.recycle();
5785 reply.recycle();
5786 }
5787
5788 @Override
5789 public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException {
5790 Parcel data = Parcel.obtain();
5791 Parcel reply = Parcel.obtain();
5792 data.writeInterfaceToken(IActivityManager.descriptor);
5793 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005794 mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005795 reply.readException();
5796 data.recycle();
5797 reply.recycle();
5798 }
5799
Craig Mautner8746a472014-07-24 15:12:54 -07005800 @Override
5801 public void notifyEnterAnimationComplete(IBinder token) throws RemoteException {
5802 Parcel data = Parcel.obtain();
5803 Parcel reply = Parcel.obtain();
5804 data.writeInterfaceToken(IActivityManager.descriptor);
5805 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005806 mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautner8746a472014-07-24 15:12:54 -07005807 reply.readException();
5808 data.recycle();
5809 reply.recycle();
5810 }
5811
Craig Mautner6e2f3952014-09-09 14:26:41 -07005812 @Override
5813 public void bootAnimationComplete() throws RemoteException {
5814 Parcel data = Parcel.obtain();
5815 Parcel reply = Parcel.obtain();
5816 data.writeInterfaceToken(IActivityManager.descriptor);
5817 mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
5818 reply.readException();
5819 data.recycle();
5820 reply.recycle();
5821 }
5822
Wale Ogunwale18795a22014-12-03 11:38:33 -08005823 @Override
Jeff Sharkey605eb792014-11-04 13:34:06 -08005824 public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException {
5825 Parcel data = Parcel.obtain();
5826 Parcel reply = Parcel.obtain();
5827 data.writeInterfaceToken(IActivityManager.descriptor);
5828 data.writeInt(uid);
5829 data.writeByteArray(firstPacket);
5830 mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0);
5831 reply.readException();
5832 data.recycle();
5833 reply.recycle();
5834 }
5835
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005836 @Override
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07005837 public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize,
5838 String reportPackage) throws RemoteException {
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005839 Parcel data = Parcel.obtain();
5840 Parcel reply = Parcel.obtain();
5841 data.writeInterfaceToken(IActivityManager.descriptor);
5842 data.writeString(processName);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07005843 data.writeInt(uid);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005844 data.writeLong(maxMemSize);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07005845 data.writeString(reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005846 mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0);
5847 reply.readException();
5848 data.recycle();
5849 reply.recycle();
5850 }
5851
5852 @Override
5853 public void dumpHeapFinished(String path) throws RemoteException {
5854 Parcel data = Parcel.obtain();
5855 Parcel reply = Parcel.obtain();
5856 data.writeInterfaceToken(IActivityManager.descriptor);
5857 data.writeString(path);
5858 mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0);
5859 reply.readException();
5860 data.recycle();
5861 reply.recycle();
5862 }
5863
Dianne Hackborn3d07c942015-03-13 18:02:54 -07005864 @Override
5865 public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake)
5866 throws RemoteException {
5867 Parcel data = Parcel.obtain();
5868 Parcel reply = Parcel.obtain();
5869 data.writeInterfaceToken(IActivityManager.descriptor);
5870 data.writeStrongBinder(session.asBinder());
5871 data.writeInt(keepAwake ? 1 : 0);
5872 mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0);
5873 reply.readException();
5874 data.recycle();
5875 reply.recycle();
5876 }
5877
Craig Mautnere5600772015-04-03 21:36:37 -07005878 @Override
5879 public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException {
5880 Parcel data = Parcel.obtain();
5881 Parcel reply = Parcel.obtain();
5882 data.writeInterfaceToken(IActivityManager.descriptor);
5883 data.writeInt(userId);
5884 data.writeStringArray(packages);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005885 mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0);
Craig Mautnere5600772015-04-03 21:36:37 -07005886 reply.readException();
5887 data.recycle();
5888 reply.recycle();
5889 }
5890
Dianne Hackborn1e383822015-04-10 14:02:33 -07005891 @Override
Craig Mautner015c5e52015-04-23 10:39:39 -07005892 public void updateDeviceOwner(String packageName) throws RemoteException {
5893 Parcel data = Parcel.obtain();
5894 Parcel reply = Parcel.obtain();
5895 data.writeInterfaceToken(IActivityManager.descriptor);
5896 data.writeString(packageName);
5897 mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0);
5898 reply.readException();
5899 data.recycle();
5900 reply.recycle();
5901 }
5902
5903 @Override
Adam Lesinskic30454c2015-06-24 13:24:35 -07005904 public int getPackageProcessState(String packageName, String callingPackage)
5905 throws RemoteException {
Dianne Hackborn1e383822015-04-10 14:02:33 -07005906 Parcel data = Parcel.obtain();
5907 Parcel reply = Parcel.obtain();
5908 data.writeInterfaceToken(IActivityManager.descriptor);
5909 data.writeString(packageName);
Adam Lesinskic30454c2015-06-24 13:24:35 -07005910 data.writeString(callingPackage);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005911 mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0);
5912 reply.readException();
5913 int res = reply.readInt();
5914 data.recycle();
5915 reply.recycle();
5916 return res;
5917 }
5918
Stefan Kuhne16045c22015-06-05 07:18:06 -07005919 @Override
5920 public boolean setProcessMemoryTrimLevel(String process, int userId, int level)
5921 throws RemoteException {
5922 Parcel data = Parcel.obtain();
5923 Parcel reply = Parcel.obtain();
5924 data.writeInterfaceToken(IActivityManager.descriptor);
5925 data.writeString(process);
5926 data.writeInt(userId);
5927 data.writeInt(level);
5928 mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0);
5929 reply.readException();
5930 int res = reply.readInt();
5931 data.recycle();
5932 reply.recycle();
5933 return res != 0;
5934 }
5935
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005936 private IBinder mRemote;
5937}