blob: 70f1bcce0e424b2392ec5369834997f0effa67c7 [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(
Filip Gruszczynski23493322015-07-29 17:02:59 -0700110 null, intent, null, null, Activity.RESULT_OK, null, null,
111 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);
Wale Ogunwale7e8184b2015-10-05 14:37:03 -0700333 final int taskId = data.readInt();
334 final int launchStackId = data.readInt();
335 final Bundle options =
336 data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data);
337 final int result = startActivityFromRecents(taskId, launchStackId, options);
Craig Mautnerdc00cbe2014-07-20 17:48:47 -0700338 reply.writeNoException();
339 reply.writeInt(result);
340 return true;
341 }
342
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800343 case FINISH_ACTIVITY_TRANSACTION: {
344 data.enforceInterface(IActivityManager.descriptor);
345 IBinder token = data.readStrongBinder();
346 Intent resultData = null;
347 int resultCode = data.readInt();
348 if (data.readInt() != 0) {
349 resultData = Intent.CREATOR.createFromParcel(data);
350 }
Wale Ogunwaleba7881c2015-08-01 19:28:29 -0700351 int finishTask = data.readInt();
Winson Chung3b3f4642014-04-22 10:08:18 -0700352 boolean res = finishActivity(token, resultCode, resultData, finishTask);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800353 reply.writeNoException();
354 reply.writeInt(res ? 1 : 0);
355 return true;
356 }
357
358 case FINISH_SUB_ACTIVITY_TRANSACTION: {
359 data.enforceInterface(IActivityManager.descriptor);
360 IBinder token = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700361 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800362 int requestCode = data.readInt();
363 finishSubActivity(token, resultWho, requestCode);
364 reply.writeNoException();
365 return true;
366 }
367
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700368 case FINISH_ACTIVITY_AFFINITY_TRANSACTION: {
369 data.enforceInterface(IActivityManager.descriptor);
370 IBinder token = data.readStrongBinder();
371 boolean res = finishActivityAffinity(token);
372 reply.writeNoException();
373 reply.writeInt(res ? 1 : 0);
374 return true;
375 }
376
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -0700377 case FINISH_VOICE_TASK_TRANSACTION: {
378 data.enforceInterface(IActivityManager.descriptor);
379 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
380 data.readStrongBinder());
381 finishVoiceTask(session);
382 reply.writeNoException();
383 return true;
384 }
385
Dianne Hackborn89ad4562014-08-24 16:45:38 -0700386 case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: {
387 data.enforceInterface(IActivityManager.descriptor);
388 IBinder token = data.readStrongBinder();
389 boolean res = releaseActivityInstance(token);
390 reply.writeNoException();
391 reply.writeInt(res ? 1 : 0);
392 return true;
393 }
394
395 case RELEASE_SOME_ACTIVITIES_TRANSACTION: {
396 data.enforceInterface(IActivityManager.descriptor);
397 IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder());
398 releaseSomeActivities(app);
399 reply.writeNoException();
400 return true;
401 }
402
Dianne Hackborn061d58a2010-03-12 15:07:06 -0800403 case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: {
404 data.enforceInterface(IActivityManager.descriptor);
405 IBinder token = data.readStrongBinder();
406 boolean res = willActivityBeVisible(token);
407 reply.writeNoException();
408 reply.writeInt(res ? 1 : 0);
409 return true;
410 }
411
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800412 case REGISTER_RECEIVER_TRANSACTION:
413 {
414 data.enforceInterface(IActivityManager.descriptor);
415 IBinder b = data.readStrongBinder();
416 IApplicationThread app =
417 b != null ? ApplicationThreadNative.asInterface(b) : null;
Dianne Hackborn6c418d52011-06-29 14:05:33 -0700418 String packageName = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800419 b = data.readStrongBinder();
420 IIntentReceiver rec
421 = b != null ? IIntentReceiver.Stub.asInterface(b) : null;
422 IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data);
423 String perm = data.readString();
Dianne Hackborn20e80982012-08-31 19:00:44 -0700424 int userId = data.readInt();
425 Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800426 reply.writeNoException();
427 if (intent != null) {
428 reply.writeInt(1);
429 intent.writeToParcel(reply, 0);
430 } else {
431 reply.writeInt(0);
432 }
433 return true;
434 }
435
436 case UNREGISTER_RECEIVER_TRANSACTION:
437 {
438 data.enforceInterface(IActivityManager.descriptor);
439 IBinder b = data.readStrongBinder();
440 if (b == null) {
441 return true;
442 }
443 IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b);
444 unregisterReceiver(rec);
445 reply.writeNoException();
446 return true;
447 }
448
449 case BROADCAST_INTENT_TRANSACTION:
450 {
451 data.enforceInterface(IActivityManager.descriptor);
452 IBinder b = data.readStrongBinder();
453 IApplicationThread app =
454 b != null ? ApplicationThreadNative.asInterface(b) : null;
455 Intent intent = Intent.CREATOR.createFromParcel(data);
456 String resolvedType = data.readString();
457 b = data.readStrongBinder();
458 IIntentReceiver resultTo =
459 b != null ? IIntentReceiver.Stub.asInterface(b) : null;
460 int resultCode = data.readInt();
461 String resultData = data.readString();
462 Bundle resultExtras = data.readBundle();
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -0700463 String[] perms = data.readStringArray();
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800464 int appOp = data.readInt();
Dianne Hackborna750a632015-06-16 17:18:23 -0700465 Bundle options = data.readBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800466 boolean serialized = data.readInt() != 0;
467 boolean sticky = data.readInt() != 0;
Amith Yamasani742a6712011-05-04 14:49:28 -0700468 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800469 int res = broadcastIntent(app, intent, resolvedType, resultTo,
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -0700470 resultCode, resultData, resultExtras, perms, appOp,
Dianne Hackborna750a632015-06-16 17:18:23 -0700471 options, serialized, sticky, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800472 reply.writeNoException();
473 reply.writeInt(res);
474 return true;
475 }
476
477 case UNBROADCAST_INTENT_TRANSACTION:
478 {
479 data.enforceInterface(IActivityManager.descriptor);
480 IBinder b = data.readStrongBinder();
481 IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null;
482 Intent intent = Intent.CREATOR.createFromParcel(data);
Amith Yamasani742a6712011-05-04 14:49:28 -0700483 int userId = data.readInt();
484 unbroadcastIntent(app, intent, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800485 reply.writeNoException();
486 return true;
487 }
488
489 case FINISH_RECEIVER_TRANSACTION: {
490 data.enforceInterface(IActivityManager.descriptor);
491 IBinder who = data.readStrongBinder();
492 int resultCode = data.readInt();
493 String resultData = data.readString();
494 Bundle resultExtras = data.readBundle();
495 boolean resultAbort = data.readInt() != 0;
riddle_hsu1f5ac4d2015-01-03 15:38:21 +0800496 int intentFlags = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800497 if (who != null) {
riddle_hsu1f5ac4d2015-01-03 15:38:21 +0800498 finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800499 }
500 reply.writeNoException();
501 return true;
502 }
503
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800504 case ATTACH_APPLICATION_TRANSACTION: {
505 data.enforceInterface(IActivityManager.descriptor);
506 IApplicationThread app = ApplicationThreadNative.asInterface(
507 data.readStrongBinder());
508 if (app != null) {
509 attachApplication(app);
510 }
511 reply.writeNoException();
512 return true;
513 }
514
515 case ACTIVITY_IDLE_TRANSACTION: {
516 data.enforceInterface(IActivityManager.descriptor);
517 IBinder token = data.readStrongBinder();
Dianne Hackborne88846e2009-09-30 21:34:25 -0700518 Configuration config = null;
519 if (data.readInt() != 0) {
520 config = Configuration.CREATOR.createFromParcel(data);
521 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700522 boolean stopProfiling = data.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800523 if (token != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700524 activityIdle(token, config, stopProfiling);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800525 }
526 reply.writeNoException();
527 return true;
528 }
529
Dianne Hackbornad9b32112012-09-17 15:35:01 -0700530 case ACTIVITY_RESUMED_TRANSACTION: {
531 data.enforceInterface(IActivityManager.descriptor);
532 IBinder token = data.readStrongBinder();
533 activityResumed(token);
534 reply.writeNoException();
535 return true;
536 }
537
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800538 case ACTIVITY_PAUSED_TRANSACTION: {
539 data.enforceInterface(IActivityManager.descriptor);
540 IBinder token = data.readStrongBinder();
Dianne Hackborna4e102e2014-09-04 22:52:27 -0700541 activityPaused(token);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800542 reply.writeNoException();
543 return true;
544 }
545
546 case ACTIVITY_STOPPED_TRANSACTION: {
547 data.enforceInterface(IActivityManager.descriptor);
548 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800549 Bundle map = data.readBundle();
Craig Mautnera0026042014-04-23 11:45:37 -0700550 PersistableBundle persistentState = data.readPersistableBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800551 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
Craig Mautnera0026042014-04-23 11:45:37 -0700552 activityStopped(token, map, persistentState, description);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800553 reply.writeNoException();
554 return true;
555 }
556
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800557 case ACTIVITY_SLEPT_TRANSACTION: {
558 data.enforceInterface(IActivityManager.descriptor);
559 IBinder token = data.readStrongBinder();
560 activitySlept(token);
561 reply.writeNoException();
562 return true;
563 }
564
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800565 case ACTIVITY_DESTROYED_TRANSACTION: {
566 data.enforceInterface(IActivityManager.descriptor);
567 IBinder token = data.readStrongBinder();
568 activityDestroyed(token);
569 reply.writeNoException();
570 return true;
571 }
572
573 case GET_CALLING_PACKAGE_TRANSACTION: {
574 data.enforceInterface(IActivityManager.descriptor);
575 IBinder token = data.readStrongBinder();
576 String res = token != null ? getCallingPackage(token) : null;
577 reply.writeNoException();
578 reply.writeString(res);
579 return true;
580 }
581
582 case GET_CALLING_ACTIVITY_TRANSACTION: {
583 data.enforceInterface(IActivityManager.descriptor);
584 IBinder token = data.readStrongBinder();
585 ComponentName cn = getCallingActivity(token);
586 reply.writeNoException();
587 ComponentName.writeToParcel(cn, reply);
588 return true;
589 }
590
Winson Chung1147c402014-05-14 11:05:00 -0700591 case GET_APP_TASKS_TRANSACTION: {
592 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -0700593 String callingPackage = data.readString();
594 List<IAppTask> list = getAppTasks(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -0700595 reply.writeNoException();
596 int N = list != null ? list.size() : -1;
597 reply.writeInt(N);
598 int i;
599 for (i=0; i<N; i++) {
600 IAppTask task = list.get(i);
601 reply.writeStrongBinder(task.asBinder());
602 }
603 return true;
604 }
605
Dianne Hackbornaec68bb2014-08-20 15:25:13 -0700606 case ADD_APP_TASK_TRANSACTION: {
607 data.enforceInterface(IActivityManager.descriptor);
608 IBinder activityToken = data.readStrongBinder();
609 Intent intent = Intent.CREATOR.createFromParcel(data);
610 ActivityManager.TaskDescription descr
611 = ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
612 Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data);
613 int res = addAppTask(activityToken, intent, descr, thumbnail);
614 reply.writeNoException();
615 reply.writeInt(res);
616 return true;
617 }
618
619 case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: {
620 data.enforceInterface(IActivityManager.descriptor);
621 Point size = getAppTaskThumbnailSize();
622 reply.writeNoException();
623 size.writeToParcel(reply, 0);
624 return true;
625 }
626
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800627 case GET_TASKS_TRANSACTION: {
628 data.enforceInterface(IActivityManager.descriptor);
629 int maxNum = data.readInt();
630 int fl = data.readInt();
Dianne Hackborn09233282014-04-30 11:33:59 -0700631 List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800632 reply.writeNoException();
633 int N = list != null ? list.size() : -1;
634 reply.writeInt(N);
635 int i;
636 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700637 ActivityManager.RunningTaskInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800638 info.writeToParcel(reply, 0);
639 }
640 return true;
641 }
642
643 case GET_RECENT_TASKS_TRANSACTION: {
644 data.enforceInterface(IActivityManager.descriptor);
645 int maxNum = data.readInt();
646 int fl = data.readInt();
Amith Yamasani82644082012-08-03 13:09:11 -0700647 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800648 List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -0700649 fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800650 reply.writeNoException();
651 reply.writeTypedList(list);
652 return true;
653 }
Dianne Hackborn15491c62012-09-19 10:59:14 -0700654
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700655 case GET_TASK_THUMBNAIL_TRANSACTION: {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800656 data.enforceInterface(IActivityManager.descriptor);
657 int id = data.readInt();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700658 ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id);
Dianne Hackbornd94df452011-02-16 18:53:31 -0800659 reply.writeNoException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700660 if (taskThumbnail != null) {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800661 reply.writeInt(1);
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700662 taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn15491c62012-09-19 10:59:14 -0700663 } else {
664 reply.writeInt(0);
665 }
666 return true;
667 }
668
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800669 case GET_SERVICES_TRANSACTION: {
670 data.enforceInterface(IActivityManager.descriptor);
671 int maxNum = data.readInt();
672 int fl = data.readInt();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700673 List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800674 reply.writeNoException();
675 int N = list != null ? list.size() : -1;
676 reply.writeInt(N);
677 int i;
678 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700679 ActivityManager.RunningServiceInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800680 info.writeToParcel(reply, 0);
681 }
682 return true;
683 }
684
685 case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: {
686 data.enforceInterface(IActivityManager.descriptor);
687 List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState();
688 reply.writeNoException();
689 reply.writeTypedList(list);
690 return true;
691 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700692
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800693 case GET_RUNNING_APP_PROCESSES_TRANSACTION: {
694 data.enforceInterface(IActivityManager.descriptor);
695 List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses();
696 reply.writeNoException();
697 reply.writeTypedList(list);
698 return true;
699 }
700
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -0700701 case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: {
702 data.enforceInterface(IActivityManager.descriptor);
703 List<ApplicationInfo> list = getRunningExternalApplications();
704 reply.writeNoException();
705 reply.writeTypedList(list);
706 return true;
707 }
708
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800709 case MOVE_TASK_TO_FRONT_TRANSACTION: {
710 data.enforceInterface(IActivityManager.descriptor);
711 int task = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800712 int fl = data.readInt();
Dianne Hackborn8078d8c2012-03-20 11:11:26 -0700713 Bundle options = data.readInt() != 0
714 ? Bundle.CREATOR.createFromParcel(data) : null;
715 moveTaskToFront(task, fl, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800716 reply.writeNoException();
717 return true;
718 }
719
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800720 case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: {
721 data.enforceInterface(IActivityManager.descriptor);
722 IBinder token = data.readStrongBinder();
723 boolean nonRoot = data.readInt() != 0;
724 boolean res = moveActivityTaskToBack(token, nonRoot);
725 reply.writeNoException();
726 reply.writeInt(res ? 1 : 0);
727 return true;
728 }
729
730 case MOVE_TASK_BACKWARDS_TRANSACTION: {
731 data.enforceInterface(IActivityManager.descriptor);
732 int task = data.readInt();
733 moveTaskBackwards(task);
734 reply.writeNoException();
735 return true;
736 }
737
Craig Mautnerc00204b2013-03-05 15:02:14 -0800738 case MOVE_TASK_TO_STACK_TRANSACTION: {
739 data.enforceInterface(IActivityManager.descriptor);
740 int taskId = data.readInt();
741 int stackId = data.readInt();
742 boolean toTop = data.readInt() != 0;
743 moveTaskToStack(taskId, stackId, toTop);
744 reply.writeNoException();
745 return true;
746 }
747
Wale Ogunwale59a73ca2015-09-14 12:54:50 -0700748 case MOVE_TASK_TO_DOCKED_STACK_TRANSACTION: {
749 data.enforceInterface(IActivityManager.descriptor);
750 int taskId = data.readInt();
751 int createMode = data.readInt();
752 boolean toTop = data.readInt() != 0;
753 moveTaskToDockedStack(taskId, createMode, toTop);
754 reply.writeNoException();
755 return true;
756 }
757
Wale Ogunwale079a0042015-10-24 11:44:07 -0700758 case MOVE_TOP_ACTIVITY_TO_PINNED_STACK: {
759 data.enforceInterface(IActivityManager.descriptor);
760 final int stackId = data.readInt();
761 final Rect r = Rect.CREATOR.createFromParcel(data);
762 final boolean res = moveTopActivityToPinnedStack(stackId, r);
763 reply.writeNoException();
764 reply.writeInt(res ? 1 : 0);
765 return true;
766 }
767
Craig Mautnerc00204b2013-03-05 15:02:14 -0800768 case RESIZE_STACK_TRANSACTION: {
769 data.enforceInterface(IActivityManager.descriptor);
Wale Ogunwaleffc11bb2015-10-10 13:05:45 -0700770 final int stackId = data.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800771 Rect r = Rect.CREATOR.createFromParcel(data);
Wale Ogunwaleffc11bb2015-10-10 13:05:45 -0700772 final boolean allowResizeInDockedMode = data.readInt() == 1;
773 resizeStack(stackId, r, allowResizeInDockedMode);
Craig Mautnerc00204b2013-03-05 15:02:14 -0800774 reply.writeNoException();
775 return true;
776 }
777
Wale Ogunwaleddc1cb22015-07-25 19:23:04 -0700778 case POSITION_TASK_IN_STACK_TRANSACTION: {
779 data.enforceInterface(IActivityManager.descriptor);
780 int taskId = data.readInt();
781 int stackId = data.readInt();
782 int position = data.readInt();
783 positionTaskInStack(taskId, stackId, position);
784 reply.writeNoException();
785 return true;
786 }
787
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800788 case GET_ALL_STACK_INFOS_TRANSACTION: {
Craig Mautner5ff12102013-05-24 12:50:15 -0700789 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800790 List<StackInfo> list = getAllStackInfos();
Craig Mautner5ff12102013-05-24 12:50:15 -0700791 reply.writeNoException();
792 reply.writeTypedList(list);
793 return true;
794 }
795
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800796 case GET_STACK_INFO_TRANSACTION: {
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700797 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800798 int stackId = data.readInt();
799 StackInfo info = getStackInfo(stackId);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700800 reply.writeNoException();
801 if (info != null) {
802 reply.writeInt(1);
803 info.writeToParcel(reply, 0);
804 } else {
805 reply.writeInt(0);
806 }
807 return true;
808 }
809
Winson Chung303e1ff2014-03-07 15:06:19 -0800810 case IS_IN_HOME_STACK_TRANSACTION: {
811 data.enforceInterface(IActivityManager.descriptor);
812 int taskId = data.readInt();
813 boolean isInHomeStack = isInHomeStack(taskId);
814 reply.writeNoException();
815 reply.writeInt(isInHomeStack ? 1 : 0);
816 return true;
817 }
818
Craig Mautnercf910b02013-04-23 11:23:27 -0700819 case SET_FOCUSED_STACK_TRANSACTION: {
820 data.enforceInterface(IActivityManager.descriptor);
821 int stackId = data.readInt();
822 setFocusedStack(stackId);
823 reply.writeNoException();
824 return true;
825 }
826
Winson Chungd16c5652015-01-26 16:11:07 -0800827 case GET_FOCUSED_STACK_ID_TRANSACTION: {
828 data.enforceInterface(IActivityManager.descriptor);
829 int focusedStackId = getFocusedStackId();
830 reply.writeNoException();
831 reply.writeInt(focusedStackId);
832 return true;
833 }
834
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700835 case SET_FOCUSED_TASK_TRANSACTION: {
836 data.enforceInterface(IActivityManager.descriptor);
837 int taskId = data.readInt();
Skuhnef36bb0c2015-08-26 14:26:17 -0700838 setFocusedTask(taskId);
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700839 reply.writeNoException();
840 return true;
841 }
842
Winson Chung740c3ac2014-11-12 16:14:38 -0800843 case REGISTER_TASK_STACK_LISTENER_TRANSACTION: {
844 data.enforceInterface(IActivityManager.descriptor);
845 IBinder token = data.readStrongBinder();
846 registerTaskStackListener(ITaskStackListener.Stub.asInterface(token));
847 reply.writeNoException();
848 return true;
849 }
850
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800851 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
852 data.enforceInterface(IActivityManager.descriptor);
853 IBinder token = data.readStrongBinder();
854 boolean onlyRoot = data.readInt() != 0;
855 int res = token != null
856 ? getTaskForActivity(token, onlyRoot) : -1;
857 reply.writeNoException();
858 reply.writeInt(res);
859 return true;
860 }
861
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800862 case GET_CONTENT_PROVIDER_TRANSACTION: {
863 data.enforceInterface(IActivityManager.descriptor);
864 IBinder b = data.readStrongBinder();
865 IApplicationThread app = ApplicationThreadNative.asInterface(b);
866 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700867 int userId = data.readInt();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700868 boolean stable = data.readInt() != 0;
Jeff Sharkey6d515712012-09-20 16:06:08 -0700869 ContentProviderHolder cph = getContentProvider(app, name, userId, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800870 reply.writeNoException();
871 if (cph != null) {
872 reply.writeInt(1);
873 cph.writeToParcel(reply, 0);
874 } else {
875 reply.writeInt(0);
876 }
877 return true;
878 }
879
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800880 case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
881 data.enforceInterface(IActivityManager.descriptor);
882 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700883 int userId = data.readInt();
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800884 IBinder token = data.readStrongBinder();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700885 ContentProviderHolder cph = getContentProviderExternal(name, userId, token);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800886 reply.writeNoException();
887 if (cph != null) {
888 reply.writeInt(1);
889 cph.writeToParcel(reply, 0);
890 } else {
891 reply.writeInt(0);
892 }
893 return true;
894 }
895
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800896 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
897 data.enforceInterface(IActivityManager.descriptor);
898 IBinder b = data.readStrongBinder();
899 IApplicationThread app = ApplicationThreadNative.asInterface(b);
900 ArrayList<ContentProviderHolder> providers =
901 data.createTypedArrayList(ContentProviderHolder.CREATOR);
902 publishContentProviders(app, providers);
903 reply.writeNoException();
904 return true;
905 }
906
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700907 case REF_CONTENT_PROVIDER_TRANSACTION: {
908 data.enforceInterface(IActivityManager.descriptor);
909 IBinder b = data.readStrongBinder();
910 int stable = data.readInt();
911 int unstable = data.readInt();
912 boolean res = refContentProvider(b, stable, unstable);
913 reply.writeNoException();
914 reply.writeInt(res ? 1 : 0);
915 return true;
916 }
917
918 case UNSTABLE_PROVIDER_DIED_TRANSACTION: {
919 data.enforceInterface(IActivityManager.descriptor);
920 IBinder b = data.readStrongBinder();
921 unstableProviderDied(b);
922 reply.writeNoException();
923 return true;
924 }
925
Jeff Sharkey7aa76012013-09-30 14:26:27 -0700926 case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: {
927 data.enforceInterface(IActivityManager.descriptor);
928 IBinder b = data.readStrongBinder();
929 appNotRespondingViaProvider(b);
930 reply.writeNoException();
931 return true;
932 }
933
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800934 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
935 data.enforceInterface(IActivityManager.descriptor);
936 IBinder b = data.readStrongBinder();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700937 boolean stable = data.readInt() != 0;
938 removeContentProvider(b, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800939 reply.writeNoException();
940 return true;
941 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800942
943 case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
944 data.enforceInterface(IActivityManager.descriptor);
945 String name = data.readString();
946 IBinder token = data.readStrongBinder();
947 removeContentProviderExternal(name, token);
948 reply.writeNoException();
949 return true;
950 }
951
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700952 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
953 data.enforceInterface(IActivityManager.descriptor);
954 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
955 PendingIntent pi = getRunningServiceControlPanel(comp);
956 reply.writeNoException();
957 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
958 return true;
959 }
960
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800961 case START_SERVICE_TRANSACTION: {
962 data.enforceInterface(IActivityManager.descriptor);
963 IBinder b = data.readStrongBinder();
964 IApplicationThread app = ApplicationThreadNative.asInterface(b);
965 Intent service = Intent.CREATOR.createFromParcel(data);
966 String resolvedType = data.readString();
Svet Ganov99b60432015-06-27 13:15:22 -0700967 String callingPackage = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700968 int userId = data.readInt();
Svet Ganov99b60432015-06-27 13:15:22 -0700969 ComponentName cn = startService(app, service, resolvedType, callingPackage, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800970 reply.writeNoException();
971 ComponentName.writeToParcel(cn, reply);
972 return true;
973 }
974
975 case STOP_SERVICE_TRANSACTION: {
976 data.enforceInterface(IActivityManager.descriptor);
977 IBinder b = data.readStrongBinder();
978 IApplicationThread app = ApplicationThreadNative.asInterface(b);
979 Intent service = Intent.CREATOR.createFromParcel(data);
980 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700981 int userId = data.readInt();
982 int res = stopService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800983 reply.writeNoException();
984 reply.writeInt(res);
985 return true;
986 }
987
988 case STOP_SERVICE_TOKEN_TRANSACTION: {
989 data.enforceInterface(IActivityManager.descriptor);
990 ComponentName className = ComponentName.readFromParcel(data);
991 IBinder token = data.readStrongBinder();
992 int startId = data.readInt();
993 boolean res = stopServiceToken(className, token, startId);
994 reply.writeNoException();
995 reply.writeInt(res ? 1 : 0);
996 return true;
997 }
998
999 case SET_SERVICE_FOREGROUND_TRANSACTION: {
1000 data.enforceInterface(IActivityManager.descriptor);
1001 ComponentName className = ComponentName.readFromParcel(data);
1002 IBinder token = data.readStrongBinder();
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07001003 int id = data.readInt();
1004 Notification notification = null;
1005 if (data.readInt() != 0) {
1006 notification = Notification.CREATOR.createFromParcel(data);
1007 }
1008 boolean removeNotification = data.readInt() != 0;
1009 setServiceForeground(className, token, id, notification, removeNotification);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001010 reply.writeNoException();
1011 return true;
1012 }
1013
1014 case BIND_SERVICE_TRANSACTION: {
1015 data.enforceInterface(IActivityManager.descriptor);
1016 IBinder b = data.readStrongBinder();
1017 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1018 IBinder token = data.readStrongBinder();
1019 Intent service = Intent.CREATOR.createFromParcel(data);
1020 String resolvedType = data.readString();
1021 b = data.readStrongBinder();
1022 int fl = data.readInt();
Svet Ganov99b60432015-06-27 13:15:22 -07001023 String callingPackage = data.readString();
Amith Yamasani37ce3a82012-02-06 12:04:42 -08001024 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001025 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
Svet Ganov99b60432015-06-27 13:15:22 -07001026 int res = bindService(app, token, service, resolvedType, conn, fl,
1027 callingPackage, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001028 reply.writeNoException();
1029 reply.writeInt(res);
1030 return true;
1031 }
1032
1033 case UNBIND_SERVICE_TRANSACTION: {
1034 data.enforceInterface(IActivityManager.descriptor);
1035 IBinder b = data.readStrongBinder();
1036 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
1037 boolean res = unbindService(conn);
1038 reply.writeNoException();
1039 reply.writeInt(res ? 1 : 0);
1040 return true;
1041 }
1042
1043 case PUBLISH_SERVICE_TRANSACTION: {
1044 data.enforceInterface(IActivityManager.descriptor);
1045 IBinder token = data.readStrongBinder();
1046 Intent intent = Intent.CREATOR.createFromParcel(data);
1047 IBinder service = data.readStrongBinder();
1048 publishService(token, intent, service);
1049 reply.writeNoException();
1050 return true;
1051 }
1052
1053 case UNBIND_FINISHED_TRANSACTION: {
1054 data.enforceInterface(IActivityManager.descriptor);
1055 IBinder token = data.readStrongBinder();
1056 Intent intent = Intent.CREATOR.createFromParcel(data);
1057 boolean doRebind = data.readInt() != 0;
1058 unbindFinished(token, intent, doRebind);
1059 reply.writeNoException();
1060 return true;
1061 }
1062
1063 case SERVICE_DONE_EXECUTING_TRANSACTION: {
1064 data.enforceInterface(IActivityManager.descriptor);
1065 IBinder token = data.readStrongBinder();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07001066 int type = data.readInt();
1067 int startId = data.readInt();
1068 int res = data.readInt();
1069 serviceDoneExecuting(token, type, startId, res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001070 reply.writeNoException();
1071 return true;
1072 }
1073
1074 case START_INSTRUMENTATION_TRANSACTION: {
1075 data.enforceInterface(IActivityManager.descriptor);
1076 ComponentName className = ComponentName.readFromParcel(data);
1077 String profileFile = data.readString();
1078 int fl = data.readInt();
1079 Bundle arguments = data.readBundle();
1080 IBinder b = data.readStrongBinder();
1081 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08001082 b = data.readStrongBinder();
1083 IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001084 int userId = data.readInt();
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01001085 String abiOverride = data.readString();
1086 boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId,
1087 abiOverride);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001088 reply.writeNoException();
1089 reply.writeInt(res ? 1 : 0);
1090 return true;
1091 }
1092
1093
1094 case FINISH_INSTRUMENTATION_TRANSACTION: {
1095 data.enforceInterface(IActivityManager.descriptor);
1096 IBinder b = data.readStrongBinder();
1097 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1098 int resultCode = data.readInt();
1099 Bundle results = data.readBundle();
1100 finishInstrumentation(app, resultCode, results);
1101 reply.writeNoException();
1102 return true;
1103 }
1104
1105 case GET_CONFIGURATION_TRANSACTION: {
1106 data.enforceInterface(IActivityManager.descriptor);
1107 Configuration config = getConfiguration();
1108 reply.writeNoException();
1109 config.writeToParcel(reply, 0);
1110 return true;
1111 }
1112
1113 case UPDATE_CONFIGURATION_TRANSACTION: {
1114 data.enforceInterface(IActivityManager.descriptor);
1115 Configuration config = Configuration.CREATOR.createFromParcel(data);
1116 updateConfiguration(config);
1117 reply.writeNoException();
1118 return true;
1119 }
1120
1121 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
1122 data.enforceInterface(IActivityManager.descriptor);
1123 IBinder token = data.readStrongBinder();
1124 int requestedOrientation = data.readInt();
1125 setRequestedOrientation(token, requestedOrientation);
1126 reply.writeNoException();
1127 return true;
1128 }
1129
1130 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
1131 data.enforceInterface(IActivityManager.descriptor);
1132 IBinder token = data.readStrongBinder();
1133 int req = getRequestedOrientation(token);
1134 reply.writeNoException();
1135 reply.writeInt(req);
1136 return true;
1137 }
1138
1139 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
1140 data.enforceInterface(IActivityManager.descriptor);
1141 IBinder token = data.readStrongBinder();
1142 ComponentName cn = getActivityClassForToken(token);
1143 reply.writeNoException();
1144 ComponentName.writeToParcel(cn, reply);
1145 return true;
1146 }
1147
1148 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
1149 data.enforceInterface(IActivityManager.descriptor);
1150 IBinder token = data.readStrongBinder();
1151 reply.writeNoException();
1152 reply.writeString(getPackageForToken(token));
1153 return true;
1154 }
1155
1156 case GET_INTENT_SENDER_TRANSACTION: {
1157 data.enforceInterface(IActivityManager.descriptor);
1158 int type = data.readInt();
1159 String packageName = data.readString();
1160 IBinder token = data.readStrongBinder();
1161 String resultWho = data.readString();
1162 int requestCode = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001163 Intent[] requestIntents;
1164 String[] requestResolvedTypes;
1165 if (data.readInt() != 0) {
1166 requestIntents = data.createTypedArray(Intent.CREATOR);
1167 requestResolvedTypes = data.createStringArray();
1168 } else {
1169 requestIntents = null;
1170 requestResolvedTypes = null;
1171 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001172 int fl = data.readInt();
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07001173 Bundle options = data.readInt() != 0
1174 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -07001175 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001176 IIntentSender res = getIntentSender(type, packageName, token,
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001177 resultWho, requestCode, requestIntents,
Dianne Hackborn41203752012-08-31 14:05:51 -07001178 requestResolvedTypes, fl, options, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001179 reply.writeNoException();
1180 reply.writeStrongBinder(res != null ? res.asBinder() : null);
1181 return true;
1182 }
1183
1184 case CANCEL_INTENT_SENDER_TRANSACTION: {
1185 data.enforceInterface(IActivityManager.descriptor);
1186 IIntentSender r = IIntentSender.Stub.asInterface(
1187 data.readStrongBinder());
1188 cancelIntentSender(r);
1189 reply.writeNoException();
1190 return true;
1191 }
1192
1193 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
1194 data.enforceInterface(IActivityManager.descriptor);
1195 IIntentSender r = IIntentSender.Stub.asInterface(
1196 data.readStrongBinder());
1197 String res = getPackageForIntentSender(r);
1198 reply.writeNoException();
1199 reply.writeString(res);
1200 return true;
1201 }
1202
Christopher Tatec4a07d12012-04-06 14:19:13 -07001203 case GET_UID_FOR_INTENT_SENDER_TRANSACTION: {
1204 data.enforceInterface(IActivityManager.descriptor);
1205 IIntentSender r = IIntentSender.Stub.asInterface(
1206 data.readStrongBinder());
1207 int res = getUidForIntentSender(r);
1208 reply.writeNoException();
1209 reply.writeInt(res);
1210 return true;
1211 }
1212
Dianne Hackborn41203752012-08-31 14:05:51 -07001213 case HANDLE_INCOMING_USER_TRANSACTION: {
1214 data.enforceInterface(IActivityManager.descriptor);
1215 int callingPid = data.readInt();
1216 int callingUid = data.readInt();
1217 int userId = data.readInt();
1218 boolean allowAll = data.readInt() != 0 ;
1219 boolean requireFull = data.readInt() != 0;
1220 String name = data.readString();
1221 String callerPackage = data.readString();
1222 int res = handleIncomingUser(callingPid, callingUid, userId, allowAll,
1223 requireFull, name, callerPackage);
1224 reply.writeNoException();
1225 reply.writeInt(res);
1226 return true;
1227 }
1228
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001229 case SET_PROCESS_LIMIT_TRANSACTION: {
1230 data.enforceInterface(IActivityManager.descriptor);
1231 int max = data.readInt();
1232 setProcessLimit(max);
1233 reply.writeNoException();
1234 return true;
1235 }
1236
1237 case GET_PROCESS_LIMIT_TRANSACTION: {
1238 data.enforceInterface(IActivityManager.descriptor);
1239 int limit = getProcessLimit();
1240 reply.writeNoException();
1241 reply.writeInt(limit);
1242 return true;
1243 }
1244
1245 case SET_PROCESS_FOREGROUND_TRANSACTION: {
1246 data.enforceInterface(IActivityManager.descriptor);
1247 IBinder token = data.readStrongBinder();
1248 int pid = data.readInt();
1249 boolean isForeground = data.readInt() != 0;
1250 setProcessForeground(token, pid, isForeground);
1251 reply.writeNoException();
1252 return true;
1253 }
1254
1255 case CHECK_PERMISSION_TRANSACTION: {
1256 data.enforceInterface(IActivityManager.descriptor);
1257 String perm = data.readString();
1258 int pid = data.readInt();
1259 int uid = data.readInt();
1260 int res = checkPermission(perm, pid, uid);
1261 reply.writeNoException();
1262 reply.writeInt(res);
1263 return true;
1264 }
1265
Dianne Hackbornff170242014-11-19 10:59:01 -08001266 case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: {
1267 data.enforceInterface(IActivityManager.descriptor);
1268 String perm = data.readString();
1269 int pid = data.readInt();
1270 int uid = data.readInt();
1271 IBinder token = data.readStrongBinder();
1272 int res = checkPermissionWithToken(perm, pid, uid, token);
1273 reply.writeNoException();
1274 reply.writeInt(res);
1275 return true;
1276 }
1277
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001278 case CHECK_URI_PERMISSION_TRANSACTION: {
1279 data.enforceInterface(IActivityManager.descriptor);
1280 Uri uri = Uri.CREATOR.createFromParcel(data);
1281 int pid = data.readInt();
1282 int uid = data.readInt();
1283 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001284 int userId = data.readInt();
Dianne Hackbornff170242014-11-19 10:59:01 -08001285 IBinder callerToken = data.readStrongBinder();
1286 int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001287 reply.writeNoException();
1288 reply.writeInt(res);
1289 return true;
1290 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001291
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001292 case CLEAR_APP_DATA_TRANSACTION: {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001293 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001294 String packageName = data.readString();
1295 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
1296 data.readStrongBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -07001297 int userId = data.readInt();
1298 boolean res = clearApplicationUserData(packageName, observer, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001299 reply.writeNoException();
1300 reply.writeInt(res ? 1 : 0);
1301 return true;
1302 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001303
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001304 case GRANT_URI_PERMISSION_TRANSACTION: {
1305 data.enforceInterface(IActivityManager.descriptor);
1306 IBinder b = data.readStrongBinder();
1307 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1308 String targetPkg = data.readString();
1309 Uri uri = Uri.CREATOR.createFromParcel(data);
1310 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001311 int userId = data.readInt();
1312 grantUriPermission(app, targetPkg, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001313 reply.writeNoException();
1314 return true;
1315 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001316
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001317 case REVOKE_URI_PERMISSION_TRANSACTION: {
1318 data.enforceInterface(IActivityManager.descriptor);
1319 IBinder b = data.readStrongBinder();
1320 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1321 Uri uri = Uri.CREATOR.createFromParcel(data);
1322 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001323 int userId = data.readInt();
1324 revokeUriPermission(app, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001325 reply.writeNoException();
1326 return true;
1327 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001328
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001329 case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1330 data.enforceInterface(IActivityManager.descriptor);
1331 Uri uri = Uri.CREATOR.createFromParcel(data);
1332 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001333 int userId = data.readInt();
1334 takePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001335 reply.writeNoException();
1336 return true;
1337 }
1338
1339 case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1340 data.enforceInterface(IActivityManager.descriptor);
1341 Uri uri = Uri.CREATOR.createFromParcel(data);
1342 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001343 int userId = data.readInt();
1344 releasePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001345 reply.writeNoException();
1346 return true;
1347 }
1348
1349 case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: {
1350 data.enforceInterface(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07001351 final String packageName = data.readString();
1352 final boolean incoming = data.readInt() != 0;
1353 final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions(
1354 packageName, incoming);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001355 reply.writeNoException();
1356 perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1357 return true;
1358 }
1359
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001360 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
1361 data.enforceInterface(IActivityManager.descriptor);
1362 IBinder b = data.readStrongBinder();
1363 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1364 boolean waiting = data.readInt() != 0;
1365 showWaitingForDebugger(app, waiting);
1366 reply.writeNoException();
1367 return true;
1368 }
1369
1370 case GET_MEMORY_INFO_TRANSACTION: {
1371 data.enforceInterface(IActivityManager.descriptor);
1372 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
1373 getMemoryInfo(mi);
1374 reply.writeNoException();
1375 mi.writeToParcel(reply, 0);
1376 return true;
1377 }
1378
1379 case UNHANDLED_BACK_TRANSACTION: {
1380 data.enforceInterface(IActivityManager.descriptor);
1381 unhandledBack();
1382 reply.writeNoException();
1383 return true;
1384 }
1385
1386 case OPEN_CONTENT_URI_TRANSACTION: {
1387 data.enforceInterface(IActivityManager.descriptor);
1388 Uri uri = Uri.parse(data.readString());
1389 ParcelFileDescriptor pfd = openContentUri(uri);
1390 reply.writeNoException();
1391 if (pfd != null) {
1392 reply.writeInt(1);
1393 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1394 } else {
1395 reply.writeInt(0);
1396 }
1397 return true;
1398 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001399
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001400 case SET_LOCK_SCREEN_SHOWN_TRANSACTION: {
1401 data.enforceInterface(IActivityManager.descriptor);
1402 setLockScreenShown(data.readInt() != 0);
1403 reply.writeNoException();
1404 return true;
1405 }
1406
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001407 case SET_DEBUG_APP_TRANSACTION: {
1408 data.enforceInterface(IActivityManager.descriptor);
1409 String pn = data.readString();
1410 boolean wfd = data.readInt() != 0;
1411 boolean per = data.readInt() != 0;
1412 setDebugApp(pn, wfd, per);
1413 reply.writeNoException();
1414 return true;
1415 }
1416
1417 case SET_ALWAYS_FINISH_TRANSACTION: {
1418 data.enforceInterface(IActivityManager.descriptor);
1419 boolean enabled = data.readInt() != 0;
1420 setAlwaysFinish(enabled);
1421 reply.writeNoException();
1422 return true;
1423 }
1424
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001425 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001426 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001427 IActivityController watcher = IActivityController.Stub.asInterface(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001428 data.readStrongBinder());
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001429 setActivityController(watcher);
Sungmin Choicdb86bb2012-12-20 14:08:59 +09001430 reply.writeNoException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001431 return true;
1432 }
1433
1434 case ENTER_SAFE_MODE_TRANSACTION: {
1435 data.enforceInterface(IActivityManager.descriptor);
1436 enterSafeMode();
1437 reply.writeNoException();
1438 return true;
1439 }
1440
1441 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1442 data.enforceInterface(IActivityManager.descriptor);
1443 IIntentSender is = IIntentSender.Stub.asInterface(
1444 data.readStrongBinder());
Dianne Hackborn099bc622014-01-22 13:39:16 -08001445 int sourceUid = data.readInt();
1446 String sourcePkg = data.readString();
Dianne Hackborn1e383822015-04-10 14:02:33 -07001447 String tag = data.readString();
1448 noteWakeupAlarm(is, sourceUid, sourcePkg, tag);
1449 reply.writeNoException();
1450 return true;
1451 }
1452
1453 case NOTE_ALARM_START_TRANSACTION: {
1454 data.enforceInterface(IActivityManager.descriptor);
1455 IIntentSender is = IIntentSender.Stub.asInterface(
1456 data.readStrongBinder());
1457 int sourceUid = data.readInt();
1458 String tag = data.readString();
1459 noteAlarmStart(is, sourceUid, tag);
1460 reply.writeNoException();
1461 return true;
1462 }
1463
1464 case NOTE_ALARM_FINISH_TRANSACTION: {
1465 data.enforceInterface(IActivityManager.descriptor);
1466 IIntentSender is = IIntentSender.Stub.asInterface(
1467 data.readStrongBinder());
1468 int sourceUid = data.readInt();
1469 String tag = data.readString();
1470 noteAlarmFinish(is, sourceUid, tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001471 reply.writeNoException();
1472 return true;
1473 }
1474
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001475 case KILL_PIDS_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001476 data.enforceInterface(IActivityManager.descriptor);
1477 int[] pids = data.createIntArray();
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001478 String reason = data.readString();
Dianne Hackborn64825172011-03-02 21:32:58 -08001479 boolean secure = data.readInt() != 0;
1480 boolean res = killPids(pids, reason, secure);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001481 reply.writeNoException();
1482 reply.writeInt(res ? 1 : 0);
1483 return true;
1484 }
1485
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07001486 case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: {
1487 data.enforceInterface(IActivityManager.descriptor);
1488 String reason = data.readString();
1489 boolean res = killProcessesBelowForeground(reason);
1490 reply.writeNoException();
1491 reply.writeInt(res ? 1 : 0);
1492 return true;
1493 }
1494
Dan Egnor60d87622009-12-16 16:32:58 -08001495 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1496 data.enforceInterface(IActivityManager.descriptor);
1497 IBinder app = data.readStrongBinder();
1498 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1499 handleApplicationCrash(app, ci);
1500 reply.writeNoException();
1501 return true;
1502 }
1503
1504 case HANDLE_APPLICATION_WTF_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001505 data.enforceInterface(IActivityManager.descriptor);
1506 IBinder app = data.readStrongBinder();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001507 String tag = data.readString();
Dianne Hackborn52322712014-08-26 22:47:26 -07001508 boolean system = data.readInt() != 0;
Dan Egnorb7f03672009-12-09 16:22:32 -08001509 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
Dianne Hackborn52322712014-08-26 22:47:26 -07001510 boolean res = handleApplicationWtf(app, tag, system, ci);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001511 reply.writeNoException();
Dan Egnor60d87622009-12-16 16:32:58 -08001512 reply.writeInt(res ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001513 return true;
1514 }
Dan Egnorb7f03672009-12-09 16:22:32 -08001515
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001516 case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: {
1517 data.enforceInterface(IActivityManager.descriptor);
1518 IBinder app = data.readStrongBinder();
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07001519 int violationMask = data.readInt();
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07001520 StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data);
1521 handleApplicationStrictModeViolation(app, violationMask, info);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001522 reply.writeNoException();
1523 return true;
1524 }
1525
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001526 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1527 data.enforceInterface(IActivityManager.descriptor);
1528 int sig = data.readInt();
1529 signalPersistentProcesses(sig);
1530 reply.writeNoException();
1531 return true;
1532 }
1533
Dianne Hackborn03abb812010-01-04 18:43:19 -08001534 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1535 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001536 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001537 int userId = data.readInt();
1538 killBackgroundProcesses(packageName, userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08001539 reply.writeNoException();
1540 return true;
1541 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08001542
1543 case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
1544 data.enforceInterface(IActivityManager.descriptor);
1545 killAllBackgroundProcesses();
1546 reply.writeNoException();
1547 return true;
1548 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001549
Dianne Hackborn03abb812010-01-04 18:43:19 -08001550 case FORCE_STOP_PACKAGE_TRANSACTION: {
1551 data.enforceInterface(IActivityManager.descriptor);
1552 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001553 int userId = data.readInt();
1554 forceStopPackage(packageName, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001555 reply.writeNoException();
1556 return true;
1557 }
Dianne Hackborn27ff9132012-03-06 14:57:58 -08001558
1559 case GET_MY_MEMORY_STATE_TRANSACTION: {
1560 data.enforceInterface(IActivityManager.descriptor);
1561 ActivityManager.RunningAppProcessInfo info =
1562 new ActivityManager.RunningAppProcessInfo();
1563 getMyMemoryState(info);
1564 reply.writeNoException();
1565 info.writeToParcel(reply, 0);
1566 return true;
1567 }
1568
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001569 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1570 data.enforceInterface(IActivityManager.descriptor);
1571 ConfigurationInfo config = getDeviceConfigurationInfo();
1572 reply.writeNoException();
1573 config.writeToParcel(reply, 0);
1574 return true;
1575 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001576
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001577 case PROFILE_CONTROL_TRANSACTION: {
1578 data.enforceInterface(IActivityManager.descriptor);
1579 String process = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001580 int userId = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001581 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001582 int profileType = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -07001583 ProfilerInfo profilerInfo = data.readInt() != 0
1584 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
1585 boolean res = profileControl(process, userId, start, profilerInfo, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001586 reply.writeNoException();
1587 reply.writeInt(res ? 1 : 0);
1588 return true;
1589 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001590
Dianne Hackborn55280a92009-05-07 15:53:46 -07001591 case SHUTDOWN_TRANSACTION: {
1592 data.enforceInterface(IActivityManager.descriptor);
1593 boolean res = shutdown(data.readInt());
1594 reply.writeNoException();
1595 reply.writeInt(res ? 1 : 0);
1596 return true;
1597 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001598
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001599 case STOP_APP_SWITCHES_TRANSACTION: {
1600 data.enforceInterface(IActivityManager.descriptor);
1601 stopAppSwitches();
1602 reply.writeNoException();
1603 return true;
1604 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001605
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001606 case RESUME_APP_SWITCHES_TRANSACTION: {
1607 data.enforceInterface(IActivityManager.descriptor);
1608 resumeAppSwitches();
1609 reply.writeNoException();
1610 return true;
1611 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001612
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001613 case PEEK_SERVICE_TRANSACTION: {
1614 data.enforceInterface(IActivityManager.descriptor);
1615 Intent service = Intent.CREATOR.createFromParcel(data);
1616 String resolvedType = data.readString();
Svet Ganov99b60432015-06-27 13:15:22 -07001617 String callingPackage = data.readString();
1618 IBinder binder = peekService(service, resolvedType, callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001619 reply.writeNoException();
1620 reply.writeStrongBinder(binder);
1621 return true;
1622 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001623
Christopher Tate181fafa2009-05-14 11:12:14 -07001624 case START_BACKUP_AGENT_TRANSACTION: {
1625 data.enforceInterface(IActivityManager.descriptor);
1626 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1627 int backupRestoreMode = data.readInt();
1628 boolean success = bindBackupAgent(info, backupRestoreMode);
1629 reply.writeNoException();
1630 reply.writeInt(success ? 1 : 0);
1631 return true;
1632 }
1633
1634 case BACKUP_AGENT_CREATED_TRANSACTION: {
1635 data.enforceInterface(IActivityManager.descriptor);
1636 String packageName = data.readString();
1637 IBinder agent = data.readStrongBinder();
1638 backupAgentCreated(packageName, agent);
1639 reply.writeNoException();
1640 return true;
1641 }
1642
1643 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1644 data.enforceInterface(IActivityManager.descriptor);
1645 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1646 unbindBackupAgent(info);
1647 reply.writeNoException();
1648 return true;
1649 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001650
1651 case ADD_PACKAGE_DEPENDENCY_TRANSACTION: {
1652 data.enforceInterface(IActivityManager.descriptor);
1653 String packageName = data.readString();
1654 addPackageDependency(packageName);
1655 reply.writeNoException();
1656 return true;
1657 }
1658
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001659 case KILL_APPLICATION_WITH_APPID_TRANSACTION: {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001660 data.enforceInterface(IActivityManager.descriptor);
1661 String pkg = data.readString();
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001662 int appid = data.readInt();
Dianne Hackborn21d9b562013-05-28 17:46:59 -07001663 String reason = data.readString();
1664 killApplicationWithAppId(pkg, appid, reason);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001665 reply.writeNoException();
1666 return true;
1667 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001668
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001669 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1670 data.enforceInterface(IActivityManager.descriptor);
1671 String reason = data.readString();
1672 closeSystemDialogs(reason);
1673 reply.writeNoException();
1674 return true;
1675 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001676
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001677 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1678 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001679 int[] pids = data.createIntArray();
1680 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001681 reply.writeNoException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001682 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001683 return true;
1684 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001685
1686 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1687 data.enforceInterface(IActivityManager.descriptor);
1688 String processName = data.readString();
1689 int uid = data.readInt();
1690 killApplicationProcess(processName, uid);
1691 reply.writeNoException();
1692 return true;
1693 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001694
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001695 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1696 data.enforceInterface(IActivityManager.descriptor);
1697 IBinder token = data.readStrongBinder();
1698 String packageName = data.readString();
1699 int enterAnim = data.readInt();
1700 int exitAnim = data.readInt();
1701 overridePendingTransition(token, packageName, enterAnim, exitAnim);
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001702 reply.writeNoException();
1703 return true;
1704 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001705
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001706 case IS_USER_A_MONKEY_TRANSACTION: {
1707 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001708 boolean areThey = isUserAMonkey();
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001709 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001710 reply.writeInt(areThey ? 1 : 0);
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001711 return true;
1712 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001713
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07001714 case SET_USER_IS_MONKEY_TRANSACTION: {
1715 data.enforceInterface(IActivityManager.descriptor);
1716 final boolean monkey = (data.readInt() == 1);
1717 setUserIsMonkey(monkey);
1718 reply.writeNoException();
1719 return true;
1720 }
1721
Dianne Hackborn860755f2010-06-03 18:47:52 -07001722 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1723 data.enforceInterface(IActivityManager.descriptor);
1724 finishHeavyWeightApp();
1725 reply.writeNoException();
1726 return true;
1727 }
Daniel Sandler69a48172010-06-23 16:29:36 -04001728
1729 case IS_IMMERSIVE_TRANSACTION: {
1730 data.enforceInterface(IActivityManager.descriptor);
1731 IBinder token = data.readStrongBinder();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001732 boolean isit = isImmersive(token);
Daniel Sandler69a48172010-06-23 16:29:36 -04001733 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001734 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001735 return true;
1736 }
1737
Craig Mautnerd61dc202014-07-07 11:09:11 -07001738 case IS_TOP_OF_TASK_TRANSACTION: {
1739 data.enforceInterface(IActivityManager.descriptor);
1740 IBinder token = data.readStrongBinder();
1741 final boolean isTopOfTask = isTopOfTask(token);
1742 reply.writeNoException();
1743 reply.writeInt(isTopOfTask ? 1 : 0);
1744 return true;
1745 }
1746
Craig Mautner5eda9b32013-07-02 11:58:16 -07001747 case CONVERT_FROM_TRANSLUCENT_TRANSACTION: {
Craig Mautner4addfc52013-06-25 08:05:45 -07001748 data.enforceInterface(IActivityManager.descriptor);
1749 IBinder token = data.readStrongBinder();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001750 boolean converted = convertFromTranslucent(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001751 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001752 reply.writeInt(converted ? 1 : 0);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001753 return true;
1754 }
1755
1756 case CONVERT_TO_TRANSLUCENT_TRANSACTION: {
1757 data.enforceInterface(IActivityManager.descriptor);
1758 IBinder token = data.readStrongBinder();
Craig Mautner233ceee2014-05-09 17:05:11 -07001759 final Bundle bundle;
1760 if (data.readInt() == 0) {
1761 bundle = null;
1762 } else {
1763 bundle = data.readBundle();
1764 }
1765 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
1766 boolean converted = convertToTranslucent(token, options);
Craig Mautner4addfc52013-06-25 08:05:45 -07001767 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001768 reply.writeInt(converted ? 1 : 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07001769 return true;
1770 }
1771
Craig Mautner233ceee2014-05-09 17:05:11 -07001772 case GET_ACTIVITY_OPTIONS_TRANSACTION: {
1773 data.enforceInterface(IActivityManager.descriptor);
1774 IBinder token = data.readStrongBinder();
1775 final ActivityOptions options = getActivityOptions(token);
1776 reply.writeNoException();
1777 reply.writeBundle(options == null ? null : options.toBundle());
1778 return true;
1779 }
1780
Daniel Sandler69a48172010-06-23 16:29:36 -04001781 case SET_IMMERSIVE_TRANSACTION: {
1782 data.enforceInterface(IActivityManager.descriptor);
1783 IBinder token = data.readStrongBinder();
1784 boolean imm = data.readInt() == 1;
1785 setImmersive(token, imm);
1786 reply.writeNoException();
1787 return true;
1788 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001789
Daniel Sandler69a48172010-06-23 16:29:36 -04001790 case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
1791 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001792 boolean isit = isTopActivityImmersive();
Daniel Sandler69a48172010-06-23 16:29:36 -04001793 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001794 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001795 return true;
1796 }
1797
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001798 case CRASH_APPLICATION_TRANSACTION: {
1799 data.enforceInterface(IActivityManager.descriptor);
1800 int uid = data.readInt();
1801 int initialPid = data.readInt();
1802 String packageName = data.readString();
1803 String message = data.readString();
1804 crashApplication(uid, initialPid, packageName, message);
1805 reply.writeNoException();
1806 return true;
1807 }
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001808
1809 case GET_PROVIDER_MIME_TYPE_TRANSACTION: {
1810 data.enforceInterface(IActivityManager.descriptor);
1811 Uri uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001812 int userId = data.readInt();
1813 String type = getProviderMimeType(uri, userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001814 reply.writeNoException();
1815 reply.writeString(type);
1816 return true;
1817 }
1818
Dianne Hackborn7e269642010-08-25 19:50:20 -07001819 case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
1820 data.enforceInterface(IActivityManager.descriptor);
1821 String name = data.readString();
1822 IBinder perm = newUriPermissionOwner(name);
1823 reply.writeNoException();
1824 reply.writeStrongBinder(perm);
1825 return true;
1826 }
1827
1828 case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1829 data.enforceInterface(IActivityManager.descriptor);
1830 IBinder owner = data.readStrongBinder();
1831 int fromUid = data.readInt();
1832 String targetPkg = data.readString();
1833 Uri uri = Uri.CREATOR.createFromParcel(data);
1834 int mode = data.readInt();
Nicolas Prevotf1939902014-06-25 09:29:02 +01001835 int sourceUserId = data.readInt();
1836 int targetUserId = data.readInt();
1837 grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId,
1838 targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001839 reply.writeNoException();
1840 return true;
1841 }
1842
1843 case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1844 data.enforceInterface(IActivityManager.descriptor);
1845 IBinder owner = data.readStrongBinder();
1846 Uri uri = null;
1847 if (data.readInt() != 0) {
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001848 uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001849 }
1850 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001851 int userId = data.readInt();
1852 revokeUriPermissionFromOwner(owner, uri, mode, userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001853 reply.writeNoException();
1854 return true;
1855 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001856
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001857 case CHECK_GRANT_URI_PERMISSION_TRANSACTION: {
1858 data.enforceInterface(IActivityManager.descriptor);
1859 int callingUid = data.readInt();
1860 String targetPkg = data.readString();
1861 Uri uri = Uri.CREATOR.createFromParcel(data);
1862 int modeFlags = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001863 int userId = data.readInt();
1864 int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001865 reply.writeNoException();
1866 reply.writeInt(res);
1867 return true;
1868 }
1869
Andy McFadden824c5102010-07-09 16:26:57 -07001870 case DUMP_HEAP_TRANSACTION: {
1871 data.enforceInterface(IActivityManager.descriptor);
1872 String process = data.readString();
Dianne Hackbornb12e1352012-09-26 11:39:20 -07001873 int userId = data.readInt();
Andy McFadden824c5102010-07-09 16:26:57 -07001874 boolean managed = data.readInt() != 0;
1875 String path = data.readString();
1876 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -07001877 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborn1676c852012-09-10 14:52:30 -07001878 boolean res = dumpHeap(process, userId, managed, path, fd);
Andy McFadden824c5102010-07-09 16:26:57 -07001879 reply.writeNoException();
1880 reply.writeInt(res ? 1 : 0);
1881 return true;
1882 }
1883
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001884 case START_ACTIVITIES_TRANSACTION:
1885 {
1886 data.enforceInterface(IActivityManager.descriptor);
1887 IBinder b = data.readStrongBinder();
1888 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001889 String callingPackage = data.readString();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001890 Intent[] intents = data.createTypedArray(Intent.CREATOR);
1891 String[] resolvedTypes = data.createStringArray();
1892 IBinder resultTo = data.readStrongBinder();
Dianne Hackborna4972e92012-03-14 10:38:05 -07001893 Bundle options = data.readInt() != 0
1894 ? Bundle.CREATOR.createFromParcel(data) : null;
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001895 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001896 int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001897 options, userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001898 reply.writeNoException();
1899 reply.writeInt(result);
1900 return true;
1901 }
1902
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001903 case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1904 {
1905 data.enforceInterface(IActivityManager.descriptor);
1906 int mode = getFrontActivityScreenCompatMode();
1907 reply.writeNoException();
1908 reply.writeInt(mode);
1909 return true;
1910 }
1911
1912 case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1913 {
1914 data.enforceInterface(IActivityManager.descriptor);
1915 int mode = data.readInt();
1916 setFrontActivityScreenCompatMode(mode);
1917 reply.writeNoException();
1918 reply.writeInt(mode);
1919 return true;
1920 }
1921
1922 case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1923 {
1924 data.enforceInterface(IActivityManager.descriptor);
1925 String pkg = data.readString();
1926 int mode = getPackageScreenCompatMode(pkg);
1927 reply.writeNoException();
1928 reply.writeInt(mode);
1929 return true;
1930 }
1931
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001932 case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1933 {
1934 data.enforceInterface(IActivityManager.descriptor);
1935 String pkg = data.readString();
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001936 int mode = data.readInt();
1937 setPackageScreenCompatMode(pkg, mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001938 reply.writeNoException();
1939 return true;
1940 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001941
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001942 case SWITCH_USER_TRANSACTION: {
1943 data.enforceInterface(IActivityManager.descriptor);
1944 int userid = data.readInt();
1945 boolean result = switchUser(userid);
1946 reply.writeNoException();
1947 reply.writeInt(result ? 1 : 0);
1948 return true;
1949 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07001950
Kenny Guy08488bf2014-02-21 17:40:37 +00001951 case START_USER_IN_BACKGROUND_TRANSACTION: {
1952 data.enforceInterface(IActivityManager.descriptor);
1953 int userid = data.readInt();
1954 boolean result = startUserInBackground(userid);
1955 reply.writeNoException();
1956 reply.writeInt(result ? 1 : 0);
1957 return true;
1958 }
1959
Dianne Hackborn80a4af22012-08-27 19:18:31 -07001960 case STOP_USER_TRANSACTION: {
1961 data.enforceInterface(IActivityManager.descriptor);
1962 int userid = data.readInt();
1963 IStopUserCallback callback = IStopUserCallback.Stub.asInterface(
1964 data.readStrongBinder());
1965 int result = stopUser(userid, callback);
1966 reply.writeNoException();
1967 reply.writeInt(result);
1968 return true;
1969 }
1970
Amith Yamasani52f1d752012-03-28 18:19:29 -07001971 case GET_CURRENT_USER_TRANSACTION: {
1972 data.enforceInterface(IActivityManager.descriptor);
1973 UserInfo userInfo = getCurrentUser();
1974 reply.writeNoException();
1975 userInfo.writeToParcel(reply, 0);
1976 return true;
1977 }
1978
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001979 case IS_USER_RUNNING_TRANSACTION: {
1980 data.enforceInterface(IActivityManager.descriptor);
1981 int userid = data.readInt();
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07001982 boolean orStopping = data.readInt() != 0;
1983 boolean result = isUserRunning(userid, orStopping);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001984 reply.writeNoException();
1985 reply.writeInt(result ? 1 : 0);
1986 return true;
1987 }
1988
Dianne Hackbornc72fc672012-09-20 13:12:03 -07001989 case GET_RUNNING_USER_IDS_TRANSACTION: {
1990 data.enforceInterface(IActivityManager.descriptor);
1991 int[] result = getRunningUserIds();
1992 reply.writeNoException();
1993 reply.writeIntArray(result);
1994 return true;
1995 }
1996
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001997 case REMOVE_TASK_TRANSACTION:
1998 {
1999 data.enforceInterface(IActivityManager.descriptor);
2000 int taskId = data.readInt();
Wale Ogunwaled54b5782014-10-23 15:55:23 -07002001 boolean result = removeTask(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07002002 reply.writeNoException();
2003 reply.writeInt(result ? 1 : 0);
2004 return true;
2005 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002006
Jeff Sharkeya4620792011-05-20 15:29:23 -07002007 case REGISTER_PROCESS_OBSERVER_TRANSACTION: {
2008 data.enforceInterface(IActivityManager.descriptor);
2009 IProcessObserver observer = IProcessObserver.Stub.asInterface(
2010 data.readStrongBinder());
2011 registerProcessObserver(observer);
2012 return true;
2013 }
2014
2015 case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: {
2016 data.enforceInterface(IActivityManager.descriptor);
2017 IProcessObserver observer = IProcessObserver.Stub.asInterface(
2018 data.readStrongBinder());
2019 unregisterProcessObserver(observer);
2020 return true;
2021 }
2022
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07002023 case REGISTER_UID_OBSERVER_TRANSACTION: {
2024 data.enforceInterface(IActivityManager.descriptor);
2025 IUidObserver observer = IUidObserver.Stub.asInterface(
2026 data.readStrongBinder());
2027 registerUidObserver(observer);
2028 return true;
2029 }
2030
2031 case UNREGISTER_UID_OBSERVER_TRANSACTION: {
2032 data.enforceInterface(IActivityManager.descriptor);
2033 IUidObserver observer = IUidObserver.Stub.asInterface(
2034 data.readStrongBinder());
2035 unregisterUidObserver(observer);
2036 return true;
2037 }
2038
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07002039 case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
2040 {
2041 data.enforceInterface(IActivityManager.descriptor);
2042 String pkg = data.readString();
2043 boolean ask = getPackageAskScreenCompat(pkg);
2044 reply.writeNoException();
2045 reply.writeInt(ask ? 1 : 0);
2046 return true;
2047 }
2048
2049 case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
2050 {
2051 data.enforceInterface(IActivityManager.descriptor);
2052 String pkg = data.readString();
2053 boolean ask = data.readInt() != 0;
2054 setPackageAskScreenCompat(pkg, ask);
2055 reply.writeNoException();
2056 return true;
2057 }
2058
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002059 case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: {
2060 data.enforceInterface(IActivityManager.descriptor);
2061 IIntentSender r = IIntentSender.Stub.asInterface(
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002062 data.readStrongBinder());
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002063 boolean res = isIntentSenderTargetedToPackage(r);
2064 reply.writeNoException();
2065 reply.writeInt(res ? 1 : 0);
2066 return true;
2067 }
2068
Dianne Hackborn1927ae82012-06-22 15:21:36 -07002069 case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: {
2070 data.enforceInterface(IActivityManager.descriptor);
2071 IIntentSender r = IIntentSender.Stub.asInterface(
2072 data.readStrongBinder());
2073 boolean res = isIntentSenderAnActivity(r);
2074 reply.writeNoException();
2075 reply.writeInt(res ? 1 : 0);
2076 return true;
2077 }
2078
Dianne Hackborn81038902012-11-26 17:04:09 -08002079 case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: {
2080 data.enforceInterface(IActivityManager.descriptor);
2081 IIntentSender r = IIntentSender.Stub.asInterface(
2082 data.readStrongBinder());
2083 Intent intent = getIntentForIntentSender(r);
2084 reply.writeNoException();
2085 if (intent != null) {
2086 reply.writeInt(1);
2087 intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2088 } else {
2089 reply.writeInt(0);
2090 }
2091 return true;
2092 }
2093
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08002094 case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: {
2095 data.enforceInterface(IActivityManager.descriptor);
2096 IIntentSender r = IIntentSender.Stub.asInterface(
2097 data.readStrongBinder());
2098 String prefix = data.readString();
2099 String tag = getTagForIntentSender(r, prefix);
2100 reply.writeNoException();
2101 reply.writeString(tag);
2102 return true;
2103 }
2104
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002105 case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
2106 data.enforceInterface(IActivityManager.descriptor);
2107 Configuration config = Configuration.CREATOR.createFromParcel(data);
2108 updatePersistentConfiguration(config);
2109 reply.writeNoException();
2110 return true;
2111 }
2112
Dianne Hackbornb437e092011-08-05 17:50:29 -07002113 case GET_PROCESS_PSS_TRANSACTION: {
2114 data.enforceInterface(IActivityManager.descriptor);
2115 int[] pids = data.createIntArray();
2116 long[] pss = getProcessPss(pids);
2117 reply.writeNoException();
2118 reply.writeLongArray(pss);
2119 return true;
2120 }
2121
Dianne Hackborn661cd522011-08-22 00:26:20 -07002122 case SHOW_BOOT_MESSAGE_TRANSACTION: {
2123 data.enforceInterface(IActivityManager.descriptor);
2124 CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
2125 boolean always = data.readInt() != 0;
2126 showBootMessage(msg, always);
2127 reply.writeNoException();
2128 return true;
2129 }
2130
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002131 case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002132 data.enforceInterface(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002133 keyguardWaitingForActivityDrawn();
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002134 reply.writeNoException();
2135 return true;
2136 }
2137
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07002138 case KEYGUARD_GOING_AWAY_TRANSACTION: {
2139 data.enforceInterface(IActivityManager.descriptor);
2140 keyguardGoingAway(data.readInt() != 0, data.readInt() != 0);
2141 reply.writeNoException();
2142 return true;
2143 }
2144
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002145 case SHOULD_UP_RECREATE_TASK_TRANSACTION: {
Adam Powelldd8fab22012-03-22 17:47:27 -07002146 data.enforceInterface(IActivityManager.descriptor);
2147 IBinder token = data.readStrongBinder();
2148 String destAffinity = data.readString();
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002149 boolean res = shouldUpRecreateTask(token, destAffinity);
Adam Powelldd8fab22012-03-22 17:47:27 -07002150 reply.writeNoException();
2151 reply.writeInt(res ? 1 : 0);
2152 return true;
2153 }
2154
2155 case NAVIGATE_UP_TO_TRANSACTION: {
2156 data.enforceInterface(IActivityManager.descriptor);
2157 IBinder token = data.readStrongBinder();
2158 Intent target = Intent.CREATOR.createFromParcel(data);
2159 int resultCode = data.readInt();
2160 Intent resultData = null;
2161 if (data.readInt() != 0) {
2162 resultData = Intent.CREATOR.createFromParcel(data);
2163 }
2164 boolean res = navigateUpTo(token, target, resultCode, resultData);
2165 reply.writeNoException();
2166 reply.writeInt(res ? 1 : 0);
2167 return true;
2168 }
2169
Dianne Hackborn5320eb82012-05-18 12:05:04 -07002170 case GET_LAUNCHED_FROM_UID_TRANSACTION: {
2171 data.enforceInterface(IActivityManager.descriptor);
2172 IBinder token = data.readStrongBinder();
2173 int res = getLaunchedFromUid(token);
2174 reply.writeNoException();
2175 reply.writeInt(res);
2176 return true;
2177 }
2178
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002179 case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: {
2180 data.enforceInterface(IActivityManager.descriptor);
2181 IBinder token = data.readStrongBinder();
2182 String res = getLaunchedFromPackage(token);
2183 reply.writeNoException();
2184 reply.writeString(res);
2185 return true;
2186 }
2187
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002188 case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2189 data.enforceInterface(IActivityManager.descriptor);
2190 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2191 data.readStrongBinder());
2192 registerUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002193 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002194 return true;
2195 }
2196
2197 case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2198 data.enforceInterface(IActivityManager.descriptor);
2199 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2200 data.readStrongBinder());
2201 unregisterUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002202 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002203 return true;
2204 }
2205
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002206 case REQUEST_BUG_REPORT_TRANSACTION: {
2207 data.enforceInterface(IActivityManager.descriptor);
2208 requestBugReport();
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002209 reply.writeNoException();
2210 return true;
2211 }
2212
2213 case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: {
2214 data.enforceInterface(IActivityManager.descriptor);
2215 int pid = data.readInt();
2216 boolean aboveSystem = data.readInt() != 0;
Jeff Brownbd181bb2013-09-10 16:44:24 -07002217 String reason = data.readString();
2218 long res = inputDispatchingTimedOut(pid, aboveSystem, reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002219 reply.writeNoException();
2220 reply.writeLong(res);
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002221 return true;
2222 }
2223
Adam Skorydfc7fd72013-08-05 19:23:41 -07002224 case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002225 data.enforceInterface(IActivityManager.descriptor);
2226 int requestType = data.readInt();
Adam Skorydfc7fd72013-08-05 19:23:41 -07002227 Bundle res = getAssistContextExtras(requestType);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002228 reply.writeNoException();
2229 reply.writeBundle(res);
2230 return true;
2231 }
2232
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002233 case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
2234 data.enforceInterface(IActivityManager.descriptor);
2235 int requestType = data.readInt();
2236 IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder());
Dianne Hackborn17f69352015-07-17 18:04:14 -07002237 IBinder activityToken = data.readStrongBinder();
2238 boolean res = requestAssistContextExtras(requestType, receiver, activityToken);
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002239 reply.writeNoException();
Dianne Hackborn17f69352015-07-17 18:04:14 -07002240 reply.writeInt(res ? 1 : 0);
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002241 return true;
2242 }
2243
Adam Skorydfc7fd72013-08-05 19:23:41 -07002244 case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002245 data.enforceInterface(IActivityManager.descriptor);
2246 IBinder token = data.readStrongBinder();
2247 Bundle extras = data.readBundle();
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07002248 AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data);
2249 AssistContent content = AssistContent.CREATOR.createFromParcel(data);
Dianne Hackborna3acdb32015-06-08 17:07:40 -07002250 Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null;
2251 reportAssistContextExtras(token, extras, structure, content, referrer);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002252 reply.writeNoException();
2253 return true;
2254 }
2255
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002256 case LAUNCH_ASSIST_INTENT_TRANSACTION: {
2257 data.enforceInterface(IActivityManager.descriptor);
2258 Intent intent = Intent.CREATOR.createFromParcel(data);
2259 int requestType = data.readInt();
2260 String hint = data.readString();
2261 int userHandle = data.readInt();
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07002262 Bundle args = data.readBundle();
2263 boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args);
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002264 reply.writeNoException();
2265 reply.writeInt(res ? 1 : 0);
2266 return true;
2267 }
2268
Benjamin Franzc200f442015-06-25 18:20:04 +01002269 case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: {
2270 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn17f69352015-07-17 18:04:14 -07002271 boolean res = isAssistDataAllowedOnCurrentActivity();
2272 reply.writeNoException();
2273 reply.writeInt(res ? 1 : 0);
2274 return true;
2275 }
2276
2277 case SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION: {
2278 data.enforceInterface(IActivityManager.descriptor);
2279 IBinder token = data.readStrongBinder();
2280 Bundle args = data.readBundle();
2281 boolean res = showAssistFromActivity(token, args);
Benjamin Franzc200f442015-06-25 18:20:04 +01002282 reply.writeNoException();
2283 reply.writeInt(res ? 1 : 0);
2284 return true;
2285 }
2286
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002287 case KILL_UID_TRANSACTION: {
2288 data.enforceInterface(IActivityManager.descriptor);
Svetoslavaa41add2015-08-06 15:03:55 -07002289 int appId = data.readInt();
2290 int userId = data.readInt();
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002291 String reason = data.readString();
Svetoslavaa41add2015-08-06 15:03:55 -07002292 killUid(appId, userId, reason);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002293 reply.writeNoException();
2294 return true;
2295 }
2296
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07002297 case HANG_TRANSACTION: {
2298 data.enforceInterface(IActivityManager.descriptor);
2299 IBinder who = data.readStrongBinder();
2300 boolean allowRestart = data.readInt() != 0;
2301 hang(who, allowRestart);
2302 reply.writeNoException();
2303 return true;
2304 }
2305
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07002306 case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: {
2307 data.enforceInterface(IActivityManager.descriptor);
2308 IBinder token = data.readStrongBinder();
2309 reportActivityFullyDrawn(token);
2310 reply.writeNoException();
2311 return true;
2312 }
2313
Craig Mautner5eda9b32013-07-02 11:58:16 -07002314 case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: {
2315 data.enforceInterface(IActivityManager.descriptor);
2316 IBinder token = data.readStrongBinder();
2317 notifyActivityDrawn(token);
2318 reply.writeNoException();
2319 return true;
2320 }
Dianne Hackborn57a7f592013-07-22 18:21:32 -07002321
2322 case RESTART_TRANSACTION: {
2323 data.enforceInterface(IActivityManager.descriptor);
2324 restart();
2325 reply.writeNoException();
2326 return true;
2327 }
Jeff Sharkey08da7a12013-08-11 20:53:18 -07002328
Dianne Hackborn35f72be2013-09-16 10:57:39 -07002329 case PERFORM_IDLE_MAINTENANCE_TRANSACTION: {
2330 data.enforceInterface(IActivityManager.descriptor);
2331 performIdleMaintenance();
2332 reply.writeNoException();
2333 return true;
2334 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002335
Todd Kennedyca4d8422015-01-15 15:19:22 -08002336 case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: {
Craig Mautner4a1cb222013-12-04 16:14:06 -08002337 data.enforceInterface(IActivityManager.descriptor);
2338 IBinder parentActivityToken = data.readStrongBinder();
2339 IActivityContainerCallback callback =
Craig Mautnere3a00d72014-04-16 08:31:19 -07002340 IActivityContainerCallback.Stub.asInterface(data.readStrongBinder());
Craig Mautner4a1cb222013-12-04 16:14:06 -08002341 IActivityContainer activityContainer =
Todd Kennedyca4d8422015-01-15 15:19:22 -08002342 createVirtualActivityContainer(parentActivityToken, callback);
Craig Mautner4a1cb222013-12-04 16:14:06 -08002343 reply.writeNoException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08002344 if (activityContainer != null) {
2345 reply.writeInt(1);
2346 reply.writeStrongBinder(activityContainer.asBinder());
2347 } else {
2348 reply.writeInt(0);
2349 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002350 return true;
2351 }
2352
Craig Mautner95da1082014-02-24 17:54:35 -08002353 case DELETE_ACTIVITY_CONTAINER_TRANSACTION: {
2354 data.enforceInterface(IActivityManager.descriptor);
2355 IActivityContainer activityContainer =
2356 IActivityContainer.Stub.asInterface(data.readStrongBinder());
2357 deleteActivityContainer(activityContainer);
2358 reply.writeNoException();
2359 return true;
2360 }
2361
Todd Kennedy4900bf92015-01-16 16:05:14 -08002362 case CREATE_STACK_ON_DISPLAY: {
2363 data.enforceInterface(IActivityManager.descriptor);
2364 int displayId = data.readInt();
2365 IActivityContainer activityContainer = createStackOnDisplay(displayId);
2366 reply.writeNoException();
2367 if (activityContainer != null) {
2368 reply.writeInt(1);
2369 reply.writeStrongBinder(activityContainer.asBinder());
2370 } else {
2371 reply.writeInt(0);
2372 }
2373 return true;
2374 }
2375
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002376 case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: {
Craig Mautnere0a38842013-12-16 16:14:02 -08002377 data.enforceInterface(IActivityManager.descriptor);
2378 IBinder activityToken = data.readStrongBinder();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002379 int displayId = getActivityDisplayId(activityToken);
Craig Mautnere0a38842013-12-16 16:14:02 -08002380 reply.writeNoException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002381 reply.writeInt(displayId);
Craig Mautnere0a38842013-12-16 16:14:02 -08002382 return true;
2383 }
2384
Craig Mautneraea74a52014-03-08 14:23:10 -08002385 case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: {
2386 data.enforceInterface(IActivityManager.descriptor);
2387 final int taskId = data.readInt();
2388 startLockTaskMode(taskId);
2389 reply.writeNoException();
2390 return true;
2391 }
2392
2393 case START_LOCK_TASK_BY_TOKEN_TRANSACTION: {
2394 data.enforceInterface(IActivityManager.descriptor);
2395 IBinder token = data.readStrongBinder();
2396 startLockTaskMode(token);
2397 reply.writeNoException();
2398 return true;
2399 }
2400
Craig Mautnerd61dc202014-07-07 11:09:11 -07002401 case START_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002402 data.enforceInterface(IActivityManager.descriptor);
2403 startLockTaskModeOnCurrent();
2404 reply.writeNoException();
2405 return true;
2406 }
2407
Craig Mautneraea74a52014-03-08 14:23:10 -08002408 case STOP_LOCK_TASK_MODE_TRANSACTION: {
2409 data.enforceInterface(IActivityManager.descriptor);
2410 stopLockTaskMode();
2411 reply.writeNoException();
2412 return true;
2413 }
2414
Craig Mautnerd61dc202014-07-07 11:09:11 -07002415 case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002416 data.enforceInterface(IActivityManager.descriptor);
2417 stopLockTaskModeOnCurrent();
2418 reply.writeNoException();
2419 return true;
2420 }
2421
Craig Mautneraea74a52014-03-08 14:23:10 -08002422 case IS_IN_LOCK_TASK_MODE_TRANSACTION: {
2423 data.enforceInterface(IActivityManager.descriptor);
2424 final boolean isInLockTaskMode = isInLockTaskMode();
2425 reply.writeNoException();
2426 reply.writeInt(isInLockTaskMode ? 1 : 0);
2427 return true;
2428 }
Craig Mautner2fbd7542014-03-21 09:34:07 -07002429
Benjamin Franz43261142015-02-11 15:59:44 +00002430 case GET_LOCK_TASK_MODE_STATE_TRANSACTION: {
2431 data.enforceInterface(IActivityManager.descriptor);
2432 final int lockTaskModeState = getLockTaskModeState();
2433 reply.writeNoException();
2434 reply.writeInt(lockTaskModeState);
2435 return true;
2436 }
2437
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07002438 case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: {
2439 data.enforceInterface(IActivityManager.descriptor);
2440 final IBinder token = data.readStrongBinder();
2441 showLockTaskEscapeMessage(token);
2442 reply.writeNoException();
2443 return true;
2444 }
2445
Winson Chunga449dc02014-05-16 11:15:04 -07002446 case SET_TASK_DESCRIPTION_TRANSACTION: {
Craig Mautner2fbd7542014-03-21 09:34:07 -07002447 data.enforceInterface(IActivityManager.descriptor);
2448 IBinder token = data.readStrongBinder();
Winson Chunga449dc02014-05-16 11:15:04 -07002449 ActivityManager.TaskDescription values =
2450 ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
2451 setTaskDescription(token, values);
Craig Mautner2fbd7542014-03-21 09:34:07 -07002452 reply.writeNoException();
2453 return true;
2454 }
Craig Mautneree2e45a2014-06-27 12:10:03 -07002455
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08002456 case SET_TASK_RESIZEABLE_TRANSACTION: {
2457 data.enforceInterface(IActivityManager.descriptor);
2458 int taskId = data.readInt();
2459 boolean resizeable = (data.readInt() == 1) ? true : false;
2460 setTaskResizeable(taskId, resizeable);
2461 reply.writeNoException();
2462 return true;
2463 }
2464
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002465 case RESIZE_TASK_TRANSACTION: {
2466 data.enforceInterface(IActivityManager.descriptor);
2467 int taskId = data.readInt();
Chong Zhang87b21722015-09-21 15:39:51 -07002468 int resizeMode = data.readInt();
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002469 Rect r = Rect.CREATOR.createFromParcel(data);
Chong Zhang87b21722015-09-21 15:39:51 -07002470 resizeTask(taskId, r, resizeMode);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002471 reply.writeNoException();
2472 return true;
2473 }
2474
Wale Ogunwalee4a0c572015-06-30 08:40:31 -07002475 case GET_TASK_BOUNDS_TRANSACTION: {
2476 data.enforceInterface(IActivityManager.descriptor);
2477 int taskId = data.readInt();
2478 Rect r = getTaskBounds(taskId);
2479 reply.writeNoException();
2480 r.writeToParcel(reply, 0);
2481 return true;
2482 }
2483
Craig Mautner648f69b2014-09-18 14:16:26 -07002484 case GET_TASK_DESCRIPTION_ICON_TRANSACTION: {
2485 data.enforceInterface(IActivityManager.descriptor);
2486 String filename = data.readString();
2487 Bitmap icon = getTaskDescriptionIcon(filename);
2488 reply.writeNoException();
2489 if (icon == null) {
2490 reply.writeInt(0);
2491 } else {
2492 reply.writeInt(1);
2493 icon.writeToParcel(reply, 0);
2494 }
2495 return true;
2496 }
2497
Winson Chung044d5292014-11-06 11:05:19 -08002498 case START_IN_PLACE_ANIMATION_TRANSACTION: {
2499 data.enforceInterface(IActivityManager.descriptor);
2500 final Bundle bundle;
2501 if (data.readInt() == 0) {
2502 bundle = null;
2503 } else {
2504 bundle = data.readBundle();
2505 }
2506 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
2507 startInPlaceAnimationOnFrontMostApplication(options);
2508 reply.writeNoException();
2509 return true;
2510 }
2511
Jose Lima4b6c6692014-08-12 17:41:12 -07002512 case REQUEST_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002513 data.enforceInterface(IActivityManager.descriptor);
2514 IBinder token = data.readStrongBinder();
2515 boolean enable = data.readInt() > 0;
Jose Lima4b6c6692014-08-12 17:41:12 -07002516 boolean success = requestVisibleBehind(token, enable);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002517 reply.writeNoException();
2518 reply.writeInt(success ? 1 : 0);
2519 return true;
2520 }
2521
Jose Lima4b6c6692014-08-12 17:41:12 -07002522 case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002523 data.enforceInterface(IActivityManager.descriptor);
2524 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002525 final boolean enabled = isBackgroundVisibleBehind(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002526 reply.writeNoException();
2527 reply.writeInt(enabled ? 1 : 0);
2528 return true;
2529 }
2530
Jose Lima4b6c6692014-08-12 17:41:12 -07002531 case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002532 data.enforceInterface(IActivityManager.descriptor);
2533 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002534 backgroundResourcesReleased(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002535 reply.writeNoException();
2536 return true;
2537 }
Craig Mautnerbb742462014-07-07 15:28:55 -07002538
2539 case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: {
2540 data.enforceInterface(IActivityManager.descriptor);
2541 IBinder token = data.readStrongBinder();
2542 notifyLaunchTaskBehindComplete(token);
2543 reply.writeNoException();
2544 return true;
2545 }
Craig Mautner8746a472014-07-24 15:12:54 -07002546
2547 case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: {
2548 data.enforceInterface(IActivityManager.descriptor);
2549 IBinder token = data.readStrongBinder();
2550 notifyEnterAnimationComplete(token);
2551 reply.writeNoException();
2552 return true;
2553 }
Craig Mautner6e2f3952014-09-09 14:26:41 -07002554
2555 case BOOT_ANIMATION_COMPLETE_TRANSACTION: {
2556 data.enforceInterface(IActivityManager.descriptor);
2557 bootAnimationComplete();
2558 reply.writeNoException();
2559 return true;
2560 }
Wale Ogunwale18795a22014-12-03 11:38:33 -08002561
Jeff Sharkey605eb792014-11-04 13:34:06 -08002562 case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: {
2563 data.enforceInterface(IActivityManager.descriptor);
2564 final int uid = data.readInt();
2565 final byte[] firstPacket = data.createByteArray();
2566 notifyCleartextNetwork(uid, firstPacket);
2567 reply.writeNoException();
2568 return true;
2569 }
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002570
2571 case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: {
2572 data.enforceInterface(IActivityManager.descriptor);
2573 String procName = data.readString();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002574 int uid = data.readInt();
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002575 long maxMemSize = data.readLong();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002576 String reportPackage = data.readString();
2577 setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002578 reply.writeNoException();
2579 return true;
2580 }
2581
2582 case DUMP_HEAP_FINISHED_TRANSACTION: {
2583 data.enforceInterface(IActivityManager.descriptor);
2584 String path = data.readString();
2585 dumpHeapFinished(path);
2586 reply.writeNoException();
2587 return true;
2588 }
Dianne Hackborn3d07c942015-03-13 18:02:54 -07002589
2590 case SET_VOICE_KEEP_AWAKE_TRANSACTION: {
2591 data.enforceInterface(IActivityManager.descriptor);
2592 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
2593 data.readStrongBinder());
2594 boolean keepAwake = data.readInt() != 0;
2595 setVoiceKeepAwake(session, keepAwake);
2596 reply.writeNoException();
2597 return true;
2598 }
Craig Mautnere5600772015-04-03 21:36:37 -07002599
2600 case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: {
2601 data.enforceInterface(IActivityManager.descriptor);
2602 int userId = data.readInt();
2603 String[] packages = data.readStringArray();
2604 updateLockTaskPackages(userId, packages);
2605 reply.writeNoException();
2606 return true;
2607 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07002608
Craig Mautner015c5e52015-04-23 10:39:39 -07002609 case UPDATE_DEVICE_OWNER_TRANSACTION: {
2610 data.enforceInterface(IActivityManager.descriptor);
2611 String packageName = data.readString();
2612 updateDeviceOwner(packageName);
2613 reply.writeNoException();
2614 return true;
2615 }
2616
Dianne Hackborn1e383822015-04-10 14:02:33 -07002617 case GET_PACKAGE_PROCESS_STATE_TRANSACTION: {
2618 data.enforceInterface(IActivityManager.descriptor);
2619 String pkg = data.readString();
Adam Lesinskic30454c2015-06-24 13:24:35 -07002620 String callingPackage = data.readString();
2621 int res = getPackageProcessState(pkg, callingPackage);
Dianne Hackborn1e383822015-04-10 14:02:33 -07002622 reply.writeNoException();
2623 reply.writeInt(res);
2624 return true;
2625 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07002626
2627 case SET_PROCESS_MEMORY_TRIM_TRANSACTION: {
2628 data.enforceInterface(IActivityManager.descriptor);
2629 String process = data.readString();
2630 int userId = data.readInt();
2631 int level = data.readInt();
2632 boolean res = setProcessMemoryTrimLevel(process, userId, level);
2633 reply.writeNoException();
2634 reply.writeInt(res ? 1 : 0);
2635 return true;
2636 }
Rahul Chaturvedi52613f92015-06-17 23:54:08 -04002637
Dianne Hackbornfb81d092015-08-03 17:14:46 -07002638 case IS_ROOT_VOICE_INTERACTION_TRANSACTION: {
2639 data.enforceInterface(IActivityManager.descriptor);
2640 IBinder token = data.readStrongBinder();
2641 boolean res = isRootVoiceInteraction(token);
2642 reply.writeNoException();
2643 reply.writeInt(res ? 1 : 0);
2644 return true;
2645 }
Ian Pedowitza3710842015-08-03 23:36:15 -07002646
Rahul Chaturvedi52613f92015-06-17 23:54:08 -04002647 case START_BINDER_TRACKING_TRANSACTION: {
2648 data.enforceInterface(IActivityManager.descriptor);
2649 boolean res = startBinderTracking();
2650 reply.writeNoException();
2651 reply.writeInt(res ? 1 : 0);
2652 return true;
2653 }
2654
2655 case STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION: {
2656 data.enforceInterface(IActivityManager.descriptor);
2657 ParcelFileDescriptor fd = data.readInt() != 0
2658 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
2659 boolean res = stopBinderTrackingAndDump(fd);
2660 reply.writeNoException();
2661 reply.writeInt(res ? 1 : 0);
2662 return true;
2663 }
Wale Ogunwale868a5e12015-08-02 16:19:20 -07002664 case GET_ACTIVITY_STACK_ID_TRANSACTION: {
2665 data.enforceInterface(IActivityManager.descriptor);
2666 IBinder token = data.readStrongBinder();
2667 int stackId = getActivityStackId(token);
2668 reply.writeNoException();
2669 reply.writeInt(stackId);
2670 return true;
2671 }
2672 case MOVE_ACTIVITY_TO_STACK_TRANSACTION: {
2673 data.enforceInterface(IActivityManager.descriptor);
2674 IBinder token = data.readStrongBinder();
2675 int stackId = data.readInt();
2676 moveActivityToStack(token, stackId);
2677 reply.writeNoException();
2678 return true;
2679 }
Filip Gruszczynski23493322015-07-29 17:02:59 -07002680 case REPORT_SIZE_CONFIGURATIONS: {
2681 data.enforceInterface(IActivityManager.descriptor);
2682 IBinder token = data.readStrongBinder();
2683 int horizontalSize = data.readInt();
2684 int[] horizontal = null;
2685 if (horizontalSize > 0) {
2686 horizontal = new int[horizontalSize];
2687 data.readIntArray(horizontal);
2688 }
2689 int[] vertical = null;
2690 int verticalSize = data.readInt();
2691 if (verticalSize > 0) {
2692 vertical = new int[verticalSize];
2693 data.readIntArray(vertical);
2694 }
2695 reportSizeConfigurations(token, horizontal, vertical);
2696 return true;
2697 }
Wale Ogunwale83301a92015-09-24 15:54:08 -07002698 case SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION: {
2699 data.enforceInterface(IActivityManager.descriptor);
2700 final boolean suppress = data.readInt() == 1;
2701 suppressResizeConfigChanges(suppress);
2702 reply.writeNoException();
2703 return true;
2704 }
Filip Gruszczynski57b6cce2015-10-06 09:50:51 -07002705 case REMOVE_STACK: {
2706 data.enforceInterface(IActivityManager.descriptor);
2707 final int stackId = data.readInt();
2708 removeStack(stackId);
2709 reply.writeNoException();
2710 return true;
2711 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002712 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002713
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002714 return super.onTransact(code, data, reply, flags);
2715 }
2716
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002717 public IBinder asBinder() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002718 return this;
2719 }
2720
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002721 private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
2722 protected IActivityManager create() {
2723 IBinder b = ServiceManager.getService("activity");
Joe Onorato43a17652011-04-06 19:22:23 -07002724 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002725 Log.v("ActivityManager", "default service binder = " + b);
2726 }
2727 IActivityManager am = asInterface(b);
Joe Onorato43a17652011-04-06 19:22:23 -07002728 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002729 Log.v("ActivityManager", "default service = " + am);
2730 }
2731 return am;
2732 }
2733 };
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002734}
2735
2736class ActivityManagerProxy implements IActivityManager
2737{
2738 public ActivityManagerProxy(IBinder remote)
2739 {
2740 mRemote = remote;
2741 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002742
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002743 public IBinder asBinder()
2744 {
2745 return mRemote;
2746 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002747
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002748 public int startActivity(IApplicationThread caller, String callingPackage, Intent intent,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002749 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002750 int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002751 Parcel data = Parcel.obtain();
2752 Parcel reply = Parcel.obtain();
2753 data.writeInterfaceToken(IActivityManager.descriptor);
2754 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002755 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002756 intent.writeToParcel(data, 0);
2757 data.writeString(resolvedType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002758 data.writeStrongBinder(resultTo);
2759 data.writeString(resultWho);
2760 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002761 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002762 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002763 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002764 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002765 } else {
2766 data.writeInt(0);
2767 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002768 if (options != null) {
2769 data.writeInt(1);
2770 options.writeToParcel(data, 0);
2771 } else {
2772 data.writeInt(0);
2773 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002774 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2775 reply.readException();
2776 int result = reply.readInt();
2777 reply.recycle();
2778 data.recycle();
2779 return result;
2780 }
Amith Yamasani82644082012-08-03 13:09:11 -07002781
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002782 public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent,
Amith Yamasani82644082012-08-03 13:09:11 -07002783 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002784 int startFlags, ProfilerInfo profilerInfo, Bundle options,
2785 int userId) throws RemoteException {
Amith Yamasani82644082012-08-03 13:09:11 -07002786 Parcel data = Parcel.obtain();
2787 Parcel reply = Parcel.obtain();
2788 data.writeInterfaceToken(IActivityManager.descriptor);
2789 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002790 data.writeString(callingPackage);
Amith Yamasani82644082012-08-03 13:09:11 -07002791 intent.writeToParcel(data, 0);
2792 data.writeString(resolvedType);
2793 data.writeStrongBinder(resultTo);
2794 data.writeString(resultWho);
2795 data.writeInt(requestCode);
2796 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002797 if (profilerInfo != null) {
Amith Yamasani82644082012-08-03 13:09:11 -07002798 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002799 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Amith Yamasani82644082012-08-03 13:09:11 -07002800 } else {
2801 data.writeInt(0);
2802 }
2803 if (options != null) {
2804 data.writeInt(1);
2805 options.writeToParcel(data, 0);
2806 } else {
2807 data.writeInt(0);
2808 }
2809 data.writeInt(userId);
2810 mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0);
2811 reply.readException();
2812 int result = reply.readInt();
2813 reply.recycle();
2814 data.recycle();
2815 return result;
2816 }
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002817 public int startActivityAsCaller(IApplicationThread caller, String callingPackage,
2818 Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna7cfbe02015-07-16 10:52:52 -07002819 int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity,
2820 int userId) throws RemoteException {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002821 Parcel data = Parcel.obtain();
2822 Parcel reply = Parcel.obtain();
2823 data.writeInterfaceToken(IActivityManager.descriptor);
2824 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2825 data.writeString(callingPackage);
2826 intent.writeToParcel(data, 0);
2827 data.writeString(resolvedType);
2828 data.writeStrongBinder(resultTo);
2829 data.writeString(resultWho);
2830 data.writeInt(requestCode);
2831 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002832 if (profilerInfo != null) {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002833 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002834 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002835 } else {
2836 data.writeInt(0);
2837 }
2838 if (options != null) {
2839 data.writeInt(1);
2840 options.writeToParcel(data, 0);
2841 } else {
2842 data.writeInt(0);
2843 }
Dianne Hackborna7cfbe02015-07-16 10:52:52 -07002844 data.writeInt(ignoreTargetSecurity ? 1 : 0);
Jeff Sharkey97978802014-10-14 10:48:18 -07002845 data.writeInt(userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002846 mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0);
2847 reply.readException();
2848 int result = reply.readInt();
2849 reply.recycle();
2850 data.recycle();
2851 return result;
2852 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002853 public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage,
2854 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Jeff Hao1b012d32014-08-20 10:35:34 -07002855 int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options,
2856 int userId) throws RemoteException {
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002857 Parcel data = Parcel.obtain();
2858 Parcel reply = Parcel.obtain();
2859 data.writeInterfaceToken(IActivityManager.descriptor);
2860 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002861 data.writeString(callingPackage);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002862 intent.writeToParcel(data, 0);
2863 data.writeString(resolvedType);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002864 data.writeStrongBinder(resultTo);
2865 data.writeString(resultWho);
2866 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002867 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002868 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002869 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002870 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002871 } else {
2872 data.writeInt(0);
2873 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002874 if (options != null) {
2875 data.writeInt(1);
2876 options.writeToParcel(data, 0);
2877 } else {
2878 data.writeInt(0);
2879 }
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002880 data.writeInt(userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002881 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
2882 reply.readException();
2883 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
2884 reply.recycle();
2885 data.recycle();
2886 return result;
2887 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002888 public int startActivityWithConfig(IApplicationThread caller, String callingPackage,
2889 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002890 int requestCode, int startFlags, Configuration config,
Dianne Hackborn41203752012-08-31 14:05:51 -07002891 Bundle options, int userId) throws RemoteException {
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002892 Parcel data = Parcel.obtain();
2893 Parcel reply = Parcel.obtain();
2894 data.writeInterfaceToken(IActivityManager.descriptor);
2895 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002896 data.writeString(callingPackage);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002897 intent.writeToParcel(data, 0);
2898 data.writeString(resolvedType);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002899 data.writeStrongBinder(resultTo);
2900 data.writeString(resultWho);
2901 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002902 data.writeInt(startFlags);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002903 config.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002904 if (options != null) {
2905 data.writeInt(1);
2906 options.writeToParcel(data, 0);
2907 } else {
2908 data.writeInt(0);
2909 }
Dianne Hackborn41203752012-08-31 14:05:51 -07002910 data.writeInt(userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002911 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2912 reply.readException();
2913 int result = reply.readInt();
2914 reply.recycle();
2915 data.recycle();
2916 return result;
2917 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002918 public int startActivityIntentSender(IApplicationThread caller,
2919 IntentSender intent, Intent fillInIntent, String resolvedType,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002920 IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002921 int flagsMask, int flagsValues, Bundle options) throws RemoteException {
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002922 Parcel data = Parcel.obtain();
2923 Parcel reply = Parcel.obtain();
2924 data.writeInterfaceToken(IActivityManager.descriptor);
2925 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2926 intent.writeToParcel(data, 0);
2927 if (fillInIntent != null) {
2928 data.writeInt(1);
2929 fillInIntent.writeToParcel(data, 0);
2930 } else {
2931 data.writeInt(0);
2932 }
2933 data.writeString(resolvedType);
2934 data.writeStrongBinder(resultTo);
2935 data.writeString(resultWho);
2936 data.writeInt(requestCode);
2937 data.writeInt(flagsMask);
2938 data.writeInt(flagsValues);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002939 if (options != null) {
2940 data.writeInt(1);
2941 options.writeToParcel(data, 0);
2942 } else {
2943 data.writeInt(0);
2944 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002945 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002946 reply.readException();
2947 int result = reply.readInt();
2948 reply.recycle();
2949 data.recycle();
2950 return result;
2951 }
Dianne Hackborn91097de2014-04-04 18:02:06 -07002952 public int startVoiceActivity(String callingPackage, int callingPid, int callingUid,
2953 Intent intent, String resolvedType, IVoiceInteractionSession session,
Jeff Hao1b012d32014-08-20 10:35:34 -07002954 IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo,
2955 Bundle options, int userId) throws RemoteException {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002956 Parcel data = Parcel.obtain();
2957 Parcel reply = Parcel.obtain();
2958 data.writeInterfaceToken(IActivityManager.descriptor);
2959 data.writeString(callingPackage);
2960 data.writeInt(callingPid);
2961 data.writeInt(callingUid);
2962 intent.writeToParcel(data, 0);
2963 data.writeString(resolvedType);
2964 data.writeStrongBinder(session.asBinder());
2965 data.writeStrongBinder(interactor.asBinder());
2966 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002967 if (profilerInfo != null) {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002968 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002969 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn91097de2014-04-04 18:02:06 -07002970 } else {
2971 data.writeInt(0);
2972 }
2973 if (options != null) {
2974 data.writeInt(1);
2975 options.writeToParcel(data, 0);
2976 } else {
2977 data.writeInt(0);
2978 }
2979 data.writeInt(userId);
2980 mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0);
2981 reply.readException();
2982 int result = reply.readInt();
2983 reply.recycle();
2984 data.recycle();
2985 return result;
2986 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002987 public boolean startNextMatchingActivity(IBinder callingActivity,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002988 Intent intent, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002989 Parcel data = Parcel.obtain();
2990 Parcel reply = Parcel.obtain();
2991 data.writeInterfaceToken(IActivityManager.descriptor);
2992 data.writeStrongBinder(callingActivity);
2993 intent.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002994 if (options != null) {
2995 data.writeInt(1);
2996 options.writeToParcel(data, 0);
2997 } else {
2998 data.writeInt(0);
2999 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003000 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
3001 reply.readException();
3002 int result = reply.readInt();
3003 reply.recycle();
3004 data.recycle();
3005 return result != 0;
3006 }
Wale Ogunwale7e8184b2015-10-05 14:37:03 -07003007 public int startActivityFromRecents(int taskId, int launchStackId, Bundle options)
3008 throws RemoteException {
Craig Mautnerdc00cbe2014-07-20 17:48:47 -07003009 Parcel data = Parcel.obtain();
3010 Parcel reply = Parcel.obtain();
3011 data.writeInterfaceToken(IActivityManager.descriptor);
3012 data.writeInt(taskId);
Wale Ogunwale7e8184b2015-10-05 14:37:03 -07003013 data.writeInt(launchStackId);
Craig Mautnerdc00cbe2014-07-20 17:48:47 -07003014 if (options == null) {
3015 data.writeInt(0);
3016 } else {
3017 data.writeInt(1);
3018 options.writeToParcel(data, 0);
3019 }
3020 mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0);
3021 reply.readException();
3022 int result = reply.readInt();
3023 reply.recycle();
3024 data.recycle();
3025 return result;
3026 }
Wale Ogunwaleba7881c2015-08-01 19:28:29 -07003027 public boolean finishActivity(IBinder token, int resultCode, Intent resultData, int finishTask)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003028 throws RemoteException {
3029 Parcel data = Parcel.obtain();
3030 Parcel reply = Parcel.obtain();
3031 data.writeInterfaceToken(IActivityManager.descriptor);
3032 data.writeStrongBinder(token);
3033 data.writeInt(resultCode);
3034 if (resultData != null) {
3035 data.writeInt(1);
3036 resultData.writeToParcel(data, 0);
3037 } else {
3038 data.writeInt(0);
3039 }
Wale Ogunwaleba7881c2015-08-01 19:28:29 -07003040 data.writeInt(finishTask);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003041 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
3042 reply.readException();
3043 boolean res = reply.readInt() != 0;
3044 data.recycle();
3045 reply.recycle();
3046 return res;
3047 }
3048 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
3049 {
3050 Parcel data = Parcel.obtain();
3051 Parcel reply = Parcel.obtain();
3052 data.writeInterfaceToken(IActivityManager.descriptor);
3053 data.writeStrongBinder(token);
3054 data.writeString(resultWho);
3055 data.writeInt(requestCode);
3056 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
3057 reply.readException();
3058 data.recycle();
3059 reply.recycle();
3060 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -07003061 public boolean finishActivityAffinity(IBinder token) throws RemoteException {
3062 Parcel data = Parcel.obtain();
3063 Parcel reply = Parcel.obtain();
3064 data.writeInterfaceToken(IActivityManager.descriptor);
3065 data.writeStrongBinder(token);
3066 mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0);
3067 reply.readException();
3068 boolean res = reply.readInt() != 0;
3069 data.recycle();
3070 reply.recycle();
3071 return res;
3072 }
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -07003073 public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException {
3074 Parcel data = Parcel.obtain();
3075 Parcel reply = Parcel.obtain();
3076 data.writeInterfaceToken(IActivityManager.descriptor);
3077 data.writeStrongBinder(session.asBinder());
3078 mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0);
3079 reply.readException();
3080 data.recycle();
3081 reply.recycle();
3082 }
Dianne Hackborn89ad4562014-08-24 16:45:38 -07003083 public boolean releaseActivityInstance(IBinder token) throws RemoteException {
3084 Parcel data = Parcel.obtain();
3085 Parcel reply = Parcel.obtain();
3086 data.writeInterfaceToken(IActivityManager.descriptor);
3087 data.writeStrongBinder(token);
3088 mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0);
3089 reply.readException();
3090 boolean res = reply.readInt() != 0;
3091 data.recycle();
3092 reply.recycle();
3093 return res;
3094 }
3095 public void releaseSomeActivities(IApplicationThread app) throws RemoteException {
3096 Parcel data = Parcel.obtain();
3097 Parcel reply = Parcel.obtain();
3098 data.writeInterfaceToken(IActivityManager.descriptor);
3099 data.writeStrongBinder(app.asBinder());
3100 mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0);
3101 reply.readException();
3102 data.recycle();
3103 reply.recycle();
3104 }
Dianne Hackborn061d58a2010-03-12 15:07:06 -08003105 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
3106 Parcel data = Parcel.obtain();
3107 Parcel reply = Parcel.obtain();
3108 data.writeInterfaceToken(IActivityManager.descriptor);
3109 data.writeStrongBinder(token);
3110 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
3111 reply.readException();
3112 boolean res = reply.readInt() != 0;
3113 data.recycle();
3114 reply.recycle();
3115 return res;
3116 }
Dianne Hackborn6c418d52011-06-29 14:05:33 -07003117 public Intent registerReceiver(IApplicationThread caller, String packageName,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003118 IIntentReceiver receiver,
Dianne Hackborn20e80982012-08-31 19:00:44 -07003119 IntentFilter filter, String perm, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003120 {
3121 Parcel data = Parcel.obtain();
3122 Parcel reply = Parcel.obtain();
3123 data.writeInterfaceToken(IActivityManager.descriptor);
3124 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackborn6c418d52011-06-29 14:05:33 -07003125 data.writeString(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003126 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
3127 filter.writeToParcel(data, 0);
3128 data.writeString(perm);
Dianne Hackborn20e80982012-08-31 19:00:44 -07003129 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003130 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
3131 reply.readException();
3132 Intent intent = null;
3133 int haveIntent = reply.readInt();
3134 if (haveIntent != 0) {
3135 intent = Intent.CREATOR.createFromParcel(reply);
3136 }
3137 reply.recycle();
3138 data.recycle();
3139 return intent;
3140 }
3141 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
3142 {
3143 Parcel data = Parcel.obtain();
3144 Parcel reply = Parcel.obtain();
3145 data.writeInterfaceToken(IActivityManager.descriptor);
3146 data.writeStrongBinder(receiver.asBinder());
3147 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
3148 reply.readException();
3149 data.recycle();
3150 reply.recycle();
3151 }
3152 public int broadcastIntent(IApplicationThread caller,
Dianne Hackborna750a632015-06-16 17:18:23 -07003153 Intent intent, String resolvedType, IIntentReceiver resultTo,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003154 int resultCode, String resultData, Bundle map,
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -07003155 String[] requiredPermissions, int appOp, Bundle options, boolean serialized,
Amith Yamasani742a6712011-05-04 14:49:28 -07003156 boolean sticky, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003157 {
3158 Parcel data = Parcel.obtain();
3159 Parcel reply = Parcel.obtain();
3160 data.writeInterfaceToken(IActivityManager.descriptor);
3161 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3162 intent.writeToParcel(data, 0);
3163 data.writeString(resolvedType);
3164 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
3165 data.writeInt(resultCode);
3166 data.writeString(resultData);
3167 data.writeBundle(map);
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -07003168 data.writeStringArray(requiredPermissions);
Dianne Hackbornf51f6122013-02-04 18:23:34 -08003169 data.writeInt(appOp);
Dianne Hackborna750a632015-06-16 17:18:23 -07003170 data.writeBundle(options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003171 data.writeInt(serialized ? 1 : 0);
3172 data.writeInt(sticky ? 1 : 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003173 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003174 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
3175 reply.readException();
3176 int res = reply.readInt();
3177 reply.recycle();
3178 data.recycle();
3179 return res;
3180 }
Amith Yamasani742a6712011-05-04 14:49:28 -07003181 public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
3182 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003183 {
3184 Parcel data = Parcel.obtain();
3185 Parcel reply = Parcel.obtain();
3186 data.writeInterfaceToken(IActivityManager.descriptor);
3187 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3188 intent.writeToParcel(data, 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003189 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003190 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
3191 reply.readException();
3192 data.recycle();
3193 reply.recycle();
3194 }
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003195 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map,
3196 boolean abortBroadcast, int flags) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003197 {
3198 Parcel data = Parcel.obtain();
3199 Parcel reply = Parcel.obtain();
3200 data.writeInterfaceToken(IActivityManager.descriptor);
3201 data.writeStrongBinder(who);
3202 data.writeInt(resultCode);
3203 data.writeString(resultData);
3204 data.writeBundle(map);
3205 data.writeInt(abortBroadcast ? 1 : 0);
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003206 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003207 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3208 reply.readException();
3209 data.recycle();
3210 reply.recycle();
3211 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003212 public void attachApplication(IApplicationThread app) throws RemoteException
3213 {
3214 Parcel data = Parcel.obtain();
3215 Parcel reply = Parcel.obtain();
3216 data.writeInterfaceToken(IActivityManager.descriptor);
3217 data.writeStrongBinder(app.asBinder());
3218 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
3219 reply.readException();
3220 data.recycle();
3221 reply.recycle();
3222 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003223 public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
3224 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003225 {
3226 Parcel data = Parcel.obtain();
3227 Parcel reply = Parcel.obtain();
3228 data.writeInterfaceToken(IActivityManager.descriptor);
3229 data.writeStrongBinder(token);
Dianne Hackborne88846e2009-09-30 21:34:25 -07003230 if (config != null) {
3231 data.writeInt(1);
3232 config.writeToParcel(data, 0);
3233 } else {
3234 data.writeInt(0);
3235 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003236 data.writeInt(stopProfiling ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003237 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3238 reply.readException();
3239 data.recycle();
3240 reply.recycle();
3241 }
Dianne Hackbornad9b32112012-09-17 15:35:01 -07003242 public void activityResumed(IBinder token) throws RemoteException
3243 {
3244 Parcel data = Parcel.obtain();
3245 Parcel reply = Parcel.obtain();
3246 data.writeInterfaceToken(IActivityManager.descriptor);
3247 data.writeStrongBinder(token);
3248 mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0);
3249 reply.readException();
3250 data.recycle();
3251 reply.recycle();
3252 }
Dianne Hackborna4e102e2014-09-04 22:52:27 -07003253 public void activityPaused(IBinder token) throws RemoteException
Dianne Hackborn0aae2d42010-12-07 23:51:29 -08003254 {
3255 Parcel data = Parcel.obtain();
3256 Parcel reply = Parcel.obtain();
3257 data.writeInterfaceToken(IActivityManager.descriptor);
3258 data.writeStrongBinder(token);
3259 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
3260 reply.readException();
3261 data.recycle();
3262 reply.recycle();
3263 }
3264 public void activityStopped(IBinder token, Bundle state,
Craig Mautnera0026042014-04-23 11:45:37 -07003265 PersistableBundle persistentState, CharSequence description) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003266 {
3267 Parcel data = Parcel.obtain();
3268 Parcel reply = Parcel.obtain();
3269 data.writeInterfaceToken(IActivityManager.descriptor);
3270 data.writeStrongBinder(token);
3271 data.writeBundle(state);
Craig Mautnera0026042014-04-23 11:45:37 -07003272 data.writePersistableBundle(persistentState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003273 TextUtils.writeToParcel(description, data, 0);
3274 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3275 reply.readException();
3276 data.recycle();
3277 reply.recycle();
3278 }
Dianne Hackborn4eba96b2011-01-21 13:34:36 -08003279 public void activitySlept(IBinder token) throws RemoteException
3280 {
3281 Parcel data = Parcel.obtain();
3282 Parcel reply = Parcel.obtain();
3283 data.writeInterfaceToken(IActivityManager.descriptor);
3284 data.writeStrongBinder(token);
3285 mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3286 reply.readException();
3287 data.recycle();
3288 reply.recycle();
3289 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003290 public void activityDestroyed(IBinder token) throws RemoteException
3291 {
3292 Parcel data = Parcel.obtain();
3293 Parcel reply = Parcel.obtain();
3294 data.writeInterfaceToken(IActivityManager.descriptor);
3295 data.writeStrongBinder(token);
3296 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3297 reply.readException();
3298 data.recycle();
3299 reply.recycle();
3300 }
3301 public String getCallingPackage(IBinder token) throws RemoteException
3302 {
3303 Parcel data = Parcel.obtain();
3304 Parcel reply = Parcel.obtain();
3305 data.writeInterfaceToken(IActivityManager.descriptor);
3306 data.writeStrongBinder(token);
3307 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
3308 reply.readException();
3309 String res = reply.readString();
3310 data.recycle();
3311 reply.recycle();
3312 return res;
3313 }
3314 public ComponentName getCallingActivity(IBinder token)
3315 throws RemoteException {
3316 Parcel data = Parcel.obtain();
3317 Parcel reply = Parcel.obtain();
3318 data.writeInterfaceToken(IActivityManager.descriptor);
3319 data.writeStrongBinder(token);
3320 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
3321 reply.readException();
3322 ComponentName res = ComponentName.readFromParcel(reply);
3323 data.recycle();
3324 reply.recycle();
3325 return res;
3326 }
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003327 public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException {
Winson Chung1147c402014-05-14 11:05:00 -07003328 Parcel data = Parcel.obtain();
3329 Parcel reply = Parcel.obtain();
3330 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003331 data.writeString(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -07003332 mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0);
3333 reply.readException();
3334 ArrayList<IAppTask> list = null;
3335 int N = reply.readInt();
3336 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003337 list = new ArrayList<>();
Winson Chung1147c402014-05-14 11:05:00 -07003338 while (N > 0) {
3339 IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder());
3340 list.add(task);
3341 N--;
3342 }
3343 }
3344 data.recycle();
3345 reply.recycle();
3346 return list;
3347 }
Dianne Hackbornaec68bb2014-08-20 15:25:13 -07003348 public int addAppTask(IBinder activityToken, Intent intent,
3349 ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException {
3350 Parcel data = Parcel.obtain();
3351 Parcel reply = Parcel.obtain();
3352 data.writeInterfaceToken(IActivityManager.descriptor);
3353 data.writeStrongBinder(activityToken);
3354 intent.writeToParcel(data, 0);
3355 description.writeToParcel(data, 0);
3356 thumbnail.writeToParcel(data, 0);
3357 mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0);
3358 reply.readException();
3359 int res = reply.readInt();
3360 data.recycle();
3361 reply.recycle();
3362 return res;
3363 }
3364 public Point getAppTaskThumbnailSize() throws RemoteException {
3365 Parcel data = Parcel.obtain();
3366 Parcel reply = Parcel.obtain();
3367 data.writeInterfaceToken(IActivityManager.descriptor);
3368 mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0);
3369 reply.readException();
3370 Point size = Point.CREATOR.createFromParcel(reply);
3371 data.recycle();
3372 reply.recycle();
3373 return size;
3374 }
Todd Kennedye635f662015-01-20 10:36:49 -08003375 public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags)
3376 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003377 Parcel data = Parcel.obtain();
3378 Parcel reply = Parcel.obtain();
3379 data.writeInterfaceToken(IActivityManager.descriptor);
3380 data.writeInt(maxNum);
3381 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003382 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
3383 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003384 ArrayList<ActivityManager.RunningTaskInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003385 int N = reply.readInt();
3386 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003387 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003388 while (N > 0) {
3389 ActivityManager.RunningTaskInfo info =
3390 ActivityManager.RunningTaskInfo.CREATOR
Winson Chung1147c402014-05-14 11:05:00 -07003391 .createFromParcel(reply);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003392 list.add(info);
3393 N--;
3394 }
3395 }
3396 data.recycle();
3397 reply.recycle();
3398 return list;
3399 }
3400 public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -07003401 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003402 Parcel data = Parcel.obtain();
3403 Parcel reply = Parcel.obtain();
3404 data.writeInterfaceToken(IActivityManager.descriptor);
3405 data.writeInt(maxNum);
3406 data.writeInt(flags);
Amith Yamasani82644082012-08-03 13:09:11 -07003407 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003408 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
3409 reply.readException();
3410 ArrayList<ActivityManager.RecentTaskInfo> list
3411 = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR);
3412 data.recycle();
3413 reply.recycle();
3414 return list;
3415 }
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003416 public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException {
Dianne Hackbornd94df452011-02-16 18:53:31 -08003417 Parcel data = Parcel.obtain();
3418 Parcel reply = Parcel.obtain();
3419 data.writeInterfaceToken(IActivityManager.descriptor);
3420 data.writeInt(id);
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003421 mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003422 reply.readException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003423 ActivityManager.TaskThumbnail taskThumbnail = null;
Dianne Hackbornd94df452011-02-16 18:53:31 -08003424 if (reply.readInt() != 0) {
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003425 taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003426 }
3427 data.recycle();
3428 reply.recycle();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003429 return taskThumbnail;
Dianne Hackborn15491c62012-09-19 10:59:14 -07003430 }
Todd Kennedye635f662015-01-20 10:36:49 -08003431 public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags)
3432 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003433 Parcel data = Parcel.obtain();
3434 Parcel reply = Parcel.obtain();
3435 data.writeInterfaceToken(IActivityManager.descriptor);
3436 data.writeInt(maxNum);
3437 data.writeInt(flags);
3438 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
3439 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003440 ArrayList<ActivityManager.RunningServiceInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003441 int N = reply.readInt();
3442 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003443 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003444 while (N > 0) {
3445 ActivityManager.RunningServiceInfo info =
3446 ActivityManager.RunningServiceInfo.CREATOR
3447 .createFromParcel(reply);
3448 list.add(info);
3449 N--;
3450 }
3451 }
3452 data.recycle();
3453 reply.recycle();
3454 return list;
3455 }
3456 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
3457 throws RemoteException {
3458 Parcel data = Parcel.obtain();
3459 Parcel reply = Parcel.obtain();
3460 data.writeInterfaceToken(IActivityManager.descriptor);
3461 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
3462 reply.readException();
3463 ArrayList<ActivityManager.ProcessErrorStateInfo> list
3464 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
3465 data.recycle();
3466 reply.recycle();
3467 return list;
3468 }
3469 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
3470 throws RemoteException {
3471 Parcel data = Parcel.obtain();
3472 Parcel reply = Parcel.obtain();
3473 data.writeInterfaceToken(IActivityManager.descriptor);
3474 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
3475 reply.readException();
3476 ArrayList<ActivityManager.RunningAppProcessInfo> list
3477 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
3478 data.recycle();
3479 reply.recycle();
3480 return list;
3481 }
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -07003482 public List<ApplicationInfo> getRunningExternalApplications()
3483 throws RemoteException {
3484 Parcel data = Parcel.obtain();
3485 Parcel reply = Parcel.obtain();
3486 data.writeInterfaceToken(IActivityManager.descriptor);
3487 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
3488 reply.readException();
3489 ArrayList<ApplicationInfo> list
3490 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
3491 data.recycle();
3492 reply.recycle();
3493 return list;
3494 }
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003495 public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003496 {
3497 Parcel data = Parcel.obtain();
3498 Parcel reply = Parcel.obtain();
3499 data.writeInterfaceToken(IActivityManager.descriptor);
3500 data.writeInt(task);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003501 data.writeInt(flags);
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003502 if (options != null) {
3503 data.writeInt(1);
3504 options.writeToParcel(data, 0);
3505 } else {
3506 data.writeInt(0);
3507 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003508 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
3509 reply.readException();
3510 data.recycle();
3511 reply.recycle();
3512 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003513 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
3514 throws RemoteException {
3515 Parcel data = Parcel.obtain();
3516 Parcel reply = Parcel.obtain();
3517 data.writeInterfaceToken(IActivityManager.descriptor);
3518 data.writeStrongBinder(token);
3519 data.writeInt(nonRoot ? 1 : 0);
3520 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
3521 reply.readException();
3522 boolean res = reply.readInt() != 0;
3523 data.recycle();
3524 reply.recycle();
3525 return res;
3526 }
3527 public void moveTaskBackwards(int task) throws RemoteException
3528 {
3529 Parcel data = Parcel.obtain();
3530 Parcel reply = Parcel.obtain();
3531 data.writeInterfaceToken(IActivityManager.descriptor);
3532 data.writeInt(task);
3533 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
3534 reply.readException();
3535 data.recycle();
3536 reply.recycle();
3537 }
Craig Mautnerc00204b2013-03-05 15:02:14 -08003538 @Override
Craig Mautnerc00204b2013-03-05 15:02:14 -08003539 public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException
3540 {
3541 Parcel data = Parcel.obtain();
3542 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003543 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003544 data.writeInt(taskId);
3545 data.writeInt(stackId);
3546 data.writeInt(toTop ? 1 : 0);
3547 mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0);
3548 reply.readException();
3549 data.recycle();
3550 reply.recycle();
3551 }
3552 @Override
Wale Ogunwale59a73ca2015-09-14 12:54:50 -07003553 public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop)
3554 throws RemoteException
3555 {
3556 Parcel data = Parcel.obtain();
3557 Parcel reply = Parcel.obtain();
3558 data.writeInterfaceToken(IActivityManager.descriptor);
3559 data.writeInt(taskId);
3560 data.writeInt(createMode);
3561 data.writeInt(toTop ? 1 : 0);
3562 mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0);
3563 reply.readException();
3564 data.recycle();
3565 reply.recycle();
3566 }
3567 @Override
Wale Ogunwale079a0042015-10-24 11:44:07 -07003568 public boolean moveTopActivityToPinnedStack(int stackId, Rect r)
3569 throws RemoteException
3570 {
3571 Parcel data = Parcel.obtain();
3572 Parcel reply = Parcel.obtain();
3573 data.writeInterfaceToken(IActivityManager.descriptor);
3574 data.writeInt(stackId);
3575 r.writeToParcel(data, 0);
3576 mRemote.transact(MOVE_TOP_ACTIVITY_TO_PINNED_STACK, data, reply, 0);
3577 reply.readException();
3578 final boolean res = reply.readInt() != 0;
3579 data.recycle();
3580 reply.recycle();
3581 return res;
3582 }
3583 @Override
Wale Ogunwaleffc11bb2015-10-10 13:05:45 -07003584 public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode)
3585 throws RemoteException
Craig Mautnerc00204b2013-03-05 15:02:14 -08003586 {
3587 Parcel data = Parcel.obtain();
3588 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003589 data.writeInterfaceToken(IActivityManager.descriptor);
Wale Ogunwaleb34a7ad2015-08-14 11:05:30 -07003590 data.writeInt(stackId);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003591 r.writeToParcel(data, 0);
Wale Ogunwaleffc11bb2015-10-10 13:05:45 -07003592 data.writeInt(allowResizeInDockedMode ? 1 : 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07003593 mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003594 reply.readException();
3595 data.recycle();
3596 reply.recycle();
3597 }
Craig Mautner967212c2013-04-13 21:10:58 -07003598 @Override
Wale Ogunwaleddc1cb22015-07-25 19:23:04 -07003599 public void positionTaskInStack(int taskId, int stackId, int position) throws RemoteException
3600 {
3601 Parcel data = Parcel.obtain();
3602 Parcel reply = Parcel.obtain();
3603 data.writeInterfaceToken(IActivityManager.descriptor);
3604 data.writeInt(taskId);
3605 data.writeInt(stackId);
3606 data.writeInt(position);
3607 mRemote.transact(POSITION_TASK_IN_STACK_TRANSACTION, data, reply, 0);
3608 reply.readException();
3609 data.recycle();
3610 reply.recycle();
3611 }
3612 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003613 public List<StackInfo> getAllStackInfos() throws RemoteException
Craig Mautner5ff12102013-05-24 12:50:15 -07003614 {
3615 Parcel data = Parcel.obtain();
3616 Parcel reply = Parcel.obtain();
3617 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003618 mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0);
Craig Mautner5ff12102013-05-24 12:50:15 -07003619 reply.readException();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003620 ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR);
Craig Mautner967212c2013-04-13 21:10:58 -07003621 data.recycle();
3622 reply.recycle();
3623 return list;
3624 }
Craig Mautnercf910b02013-04-23 11:23:27 -07003625 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003626 public StackInfo getStackInfo(int stackId) throws RemoteException
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003627 {
3628 Parcel data = Parcel.obtain();
3629 Parcel reply = Parcel.obtain();
3630 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003631 data.writeInt(stackId);
3632 mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003633 reply.readException();
3634 int res = reply.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003635 StackInfo info = null;
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003636 if (res != 0) {
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003637 info = StackInfo.CREATOR.createFromParcel(reply);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003638 }
3639 data.recycle();
3640 reply.recycle();
3641 return info;
3642 }
3643 @Override
Winson Chung303e1ff2014-03-07 15:06:19 -08003644 public boolean isInHomeStack(int taskId) throws RemoteException {
3645 Parcel data = Parcel.obtain();
3646 Parcel reply = Parcel.obtain();
3647 data.writeInterfaceToken(IActivityManager.descriptor);
3648 data.writeInt(taskId);
3649 mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0);
3650 reply.readException();
3651 boolean isInHomeStack = reply.readInt() > 0;
3652 data.recycle();
3653 reply.recycle();
3654 return isInHomeStack;
3655 }
3656 @Override
Craig Mautnercf910b02013-04-23 11:23:27 -07003657 public void setFocusedStack(int stackId) throws RemoteException
3658 {
3659 Parcel data = Parcel.obtain();
3660 Parcel reply = Parcel.obtain();
3661 data.writeInterfaceToken(IActivityManager.descriptor);
3662 data.writeInt(stackId);
Dianne Hackborn1e383822015-04-10 14:02:33 -07003663 mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0);
Craig Mautnercf910b02013-04-23 11:23:27 -07003664 reply.readException();
3665 data.recycle();
3666 reply.recycle();
3667 }
Winson Chung740c3ac2014-11-12 16:14:38 -08003668 @Override
Winson Chungd16c5652015-01-26 16:11:07 -08003669 public int getFocusedStackId() throws RemoteException {
3670 Parcel data = Parcel.obtain();
3671 Parcel reply = Parcel.obtain();
3672 data.writeInterfaceToken(IActivityManager.descriptor);
3673 mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0);
3674 reply.readException();
3675 int focusedStackId = reply.readInt();
3676 data.recycle();
3677 reply.recycle();
3678 return focusedStackId;
3679 }
3680 @Override
Wale Ogunwalee4a0c572015-06-30 08:40:31 -07003681 public void setFocusedTask(int taskId) throws RemoteException
3682 {
3683 Parcel data = Parcel.obtain();
3684 Parcel reply = Parcel.obtain();
3685 data.writeInterfaceToken(IActivityManager.descriptor);
3686 data.writeInt(taskId);
3687 mRemote.transact(SET_FOCUSED_TASK_TRANSACTION, data, reply, 0);
3688 reply.readException();
3689 data.recycle();
3690 reply.recycle();
3691 }
3692 @Override
Winson Chung740c3ac2014-11-12 16:14:38 -08003693 public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException
3694 {
3695 Parcel data = Parcel.obtain();
3696 Parcel reply = Parcel.obtain();
3697 data.writeInterfaceToken(IActivityManager.descriptor);
3698 data.writeStrongBinder(listener.asBinder());
Dianne Hackborn1e383822015-04-10 14:02:33 -07003699 mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0);
Winson Chung740c3ac2014-11-12 16:14:38 -08003700 reply.readException();
3701 data.recycle();
3702 reply.recycle();
3703 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003704 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
3705 {
3706 Parcel data = Parcel.obtain();
3707 Parcel reply = Parcel.obtain();
3708 data.writeInterfaceToken(IActivityManager.descriptor);
3709 data.writeStrongBinder(token);
3710 data.writeInt(onlyRoot ? 1 : 0);
3711 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
3712 reply.readException();
3713 int res = reply.readInt();
3714 data.recycle();
3715 reply.recycle();
3716 return res;
3717 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003718 public ContentProviderHolder getContentProvider(IApplicationThread caller,
Jeff Sharkey6d515712012-09-20 16:06:08 -07003719 String name, int userId, boolean stable) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003720 Parcel data = Parcel.obtain();
3721 Parcel reply = Parcel.obtain();
3722 data.writeInterfaceToken(IActivityManager.descriptor);
3723 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3724 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003725 data.writeInt(userId);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003726 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003727 mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3728 reply.readException();
3729 int res = reply.readInt();
3730 ContentProviderHolder cph = null;
3731 if (res != 0) {
3732 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3733 }
3734 data.recycle();
3735 reply.recycle();
3736 return cph;
3737 }
Jeff Sharkey6d515712012-09-20 16:06:08 -07003738 public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token)
3739 throws RemoteException {
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003740 Parcel data = Parcel.obtain();
3741 Parcel reply = Parcel.obtain();
3742 data.writeInterfaceToken(IActivityManager.descriptor);
3743 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003744 data.writeInt(userId);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003745 data.writeStrongBinder(token);
3746 mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3747 reply.readException();
3748 int res = reply.readInt();
3749 ContentProviderHolder cph = null;
3750 if (res != 0) {
3751 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3752 }
3753 data.recycle();
3754 reply.recycle();
3755 return cph;
3756 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003757 public void publishContentProviders(IApplicationThread caller,
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003758 List<ContentProviderHolder> providers) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003759 {
3760 Parcel data = Parcel.obtain();
3761 Parcel reply = Parcel.obtain();
3762 data.writeInterfaceToken(IActivityManager.descriptor);
3763 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3764 data.writeTypedList(providers);
3765 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
3766 reply.readException();
3767 data.recycle();
3768 reply.recycle();
3769 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003770 public boolean refContentProvider(IBinder connection, int stable, int unstable)
3771 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003772 Parcel data = Parcel.obtain();
3773 Parcel reply = Parcel.obtain();
3774 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003775 data.writeStrongBinder(connection);
3776 data.writeInt(stable);
3777 data.writeInt(unstable);
3778 mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3779 reply.readException();
3780 boolean res = reply.readInt() != 0;
3781 data.recycle();
3782 reply.recycle();
3783 return res;
3784 }
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003785
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003786 public void unstableProviderDied(IBinder connection) throws RemoteException {
3787 Parcel data = Parcel.obtain();
3788 Parcel reply = Parcel.obtain();
3789 data.writeInterfaceToken(IActivityManager.descriptor);
3790 data.writeStrongBinder(connection);
3791 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0);
3792 reply.readException();
3793 data.recycle();
3794 reply.recycle();
3795 }
3796
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003797 @Override
3798 public void appNotRespondingViaProvider(IBinder connection) throws RemoteException {
3799 Parcel data = Parcel.obtain();
3800 Parcel reply = Parcel.obtain();
3801 data.writeInterfaceToken(IActivityManager.descriptor);
3802 data.writeStrongBinder(connection);
3803 mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0);
3804 reply.readException();
3805 data.recycle();
3806 reply.recycle();
3807 }
3808
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003809 public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException {
3810 Parcel data = Parcel.obtain();
3811 Parcel reply = Parcel.obtain();
3812 data.writeInterfaceToken(IActivityManager.descriptor);
3813 data.writeStrongBinder(connection);
3814 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003815 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3816 reply.readException();
3817 data.recycle();
3818 reply.recycle();
3819 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003820
3821 public void removeContentProviderExternal(String name, IBinder token) throws RemoteException {
3822 Parcel data = Parcel.obtain();
3823 Parcel reply = Parcel.obtain();
3824 data.writeInterfaceToken(IActivityManager.descriptor);
3825 data.writeString(name);
3826 data.writeStrongBinder(token);
3827 mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3828 reply.readException();
3829 data.recycle();
3830 reply.recycle();
3831 }
3832
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07003833 public PendingIntent getRunningServiceControlPanel(ComponentName service)
3834 throws RemoteException
3835 {
3836 Parcel data = Parcel.obtain();
3837 Parcel reply = Parcel.obtain();
3838 data.writeInterfaceToken(IActivityManager.descriptor);
3839 service.writeToParcel(data, 0);
3840 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
3841 reply.readException();
3842 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
3843 data.recycle();
3844 reply.recycle();
3845 return res;
3846 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003847
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003848 public ComponentName startService(IApplicationThread caller, Intent service,
Svet Ganov99b60432015-06-27 13:15:22 -07003849 String resolvedType, String callingPackage, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003850 {
3851 Parcel data = Parcel.obtain();
3852 Parcel reply = Parcel.obtain();
3853 data.writeInterfaceToken(IActivityManager.descriptor);
3854 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3855 service.writeToParcel(data, 0);
3856 data.writeString(resolvedType);
Svet Ganov99b60432015-06-27 13:15:22 -07003857 data.writeString(callingPackage);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003858 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003859 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
3860 reply.readException();
3861 ComponentName res = ComponentName.readFromParcel(reply);
3862 data.recycle();
3863 reply.recycle();
3864 return res;
3865 }
3866 public int stopService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003867 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003868 {
3869 Parcel data = Parcel.obtain();
3870 Parcel reply = Parcel.obtain();
3871 data.writeInterfaceToken(IActivityManager.descriptor);
3872 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3873 service.writeToParcel(data, 0);
3874 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003875 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003876 mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0);
3877 reply.readException();
3878 int res = reply.readInt();
3879 reply.recycle();
3880 data.recycle();
3881 return res;
3882 }
3883 public boolean stopServiceToken(ComponentName className, IBinder token,
3884 int startId) throws RemoteException {
3885 Parcel data = Parcel.obtain();
3886 Parcel reply = Parcel.obtain();
3887 data.writeInterfaceToken(IActivityManager.descriptor);
3888 ComponentName.writeToParcel(className, data);
3889 data.writeStrongBinder(token);
3890 data.writeInt(startId);
3891 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
3892 reply.readException();
3893 boolean res = reply.readInt() != 0;
3894 data.recycle();
3895 reply.recycle();
3896 return res;
3897 }
3898 public void setServiceForeground(ComponentName className, IBinder token,
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003899 int id, Notification notification, boolean removeNotification) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003900 Parcel data = Parcel.obtain();
3901 Parcel reply = Parcel.obtain();
3902 data.writeInterfaceToken(IActivityManager.descriptor);
3903 ComponentName.writeToParcel(className, data);
3904 data.writeStrongBinder(token);
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003905 data.writeInt(id);
3906 if (notification != null) {
3907 data.writeInt(1);
3908 notification.writeToParcel(data, 0);
3909 } else {
3910 data.writeInt(0);
3911 }
3912 data.writeInt(removeNotification ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003913 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
3914 reply.readException();
3915 data.recycle();
3916 reply.recycle();
3917 }
3918 public int bindService(IApplicationThread caller, IBinder token,
3919 Intent service, String resolvedType, IServiceConnection connection,
Svet Ganov99b60432015-06-27 13:15:22 -07003920 int flags, String callingPackage, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003921 Parcel data = Parcel.obtain();
3922 Parcel reply = Parcel.obtain();
3923 data.writeInterfaceToken(IActivityManager.descriptor);
3924 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3925 data.writeStrongBinder(token);
3926 service.writeToParcel(data, 0);
3927 data.writeString(resolvedType);
3928 data.writeStrongBinder(connection.asBinder());
3929 data.writeInt(flags);
Svet Ganov99b60432015-06-27 13:15:22 -07003930 data.writeString(callingPackage);
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003931 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003932 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
3933 reply.readException();
3934 int res = reply.readInt();
3935 data.recycle();
3936 reply.recycle();
3937 return res;
3938 }
3939 public boolean unbindService(IServiceConnection connection) throws RemoteException
3940 {
3941 Parcel data = Parcel.obtain();
3942 Parcel reply = Parcel.obtain();
3943 data.writeInterfaceToken(IActivityManager.descriptor);
3944 data.writeStrongBinder(connection.asBinder());
3945 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
3946 reply.readException();
3947 boolean res = reply.readInt() != 0;
3948 data.recycle();
3949 reply.recycle();
3950 return res;
3951 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003952
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003953 public void publishService(IBinder token,
3954 Intent intent, IBinder service) throws RemoteException {
3955 Parcel data = Parcel.obtain();
3956 Parcel reply = Parcel.obtain();
3957 data.writeInterfaceToken(IActivityManager.descriptor);
3958 data.writeStrongBinder(token);
3959 intent.writeToParcel(data, 0);
3960 data.writeStrongBinder(service);
3961 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
3962 reply.readException();
3963 data.recycle();
3964 reply.recycle();
3965 }
3966
3967 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
3968 throws RemoteException {
3969 Parcel data = Parcel.obtain();
3970 Parcel reply = Parcel.obtain();
3971 data.writeInterfaceToken(IActivityManager.descriptor);
3972 data.writeStrongBinder(token);
3973 intent.writeToParcel(data, 0);
3974 data.writeInt(doRebind ? 1 : 0);
3975 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
3976 reply.readException();
3977 data.recycle();
3978 reply.recycle();
3979 }
3980
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003981 public void serviceDoneExecuting(IBinder token, int type, int startId,
3982 int res) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003983 Parcel data = Parcel.obtain();
3984 Parcel reply = Parcel.obtain();
3985 data.writeInterfaceToken(IActivityManager.descriptor);
3986 data.writeStrongBinder(token);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003987 data.writeInt(type);
3988 data.writeInt(startId);
3989 data.writeInt(res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003990 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3991 reply.readException();
3992 data.recycle();
3993 reply.recycle();
3994 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003995
Svet Ganov99b60432015-06-27 13:15:22 -07003996 public IBinder peekService(Intent service, String resolvedType, String callingPackage)
3997 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003998 Parcel data = Parcel.obtain();
3999 Parcel reply = Parcel.obtain();
4000 data.writeInterfaceToken(IActivityManager.descriptor);
4001 service.writeToParcel(data, 0);
4002 data.writeString(resolvedType);
Svet Ganov99b60432015-06-27 13:15:22 -07004003 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004004 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
4005 reply.readException();
4006 IBinder binder = reply.readStrongBinder();
4007 reply.recycle();
4008 data.recycle();
4009 return binder;
4010 }
4011
Christopher Tate181fafa2009-05-14 11:12:14 -07004012 public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
4013 throws RemoteException {
4014 Parcel data = Parcel.obtain();
4015 Parcel reply = Parcel.obtain();
4016 data.writeInterfaceToken(IActivityManager.descriptor);
4017 app.writeToParcel(data, 0);
4018 data.writeInt(backupRestoreMode);
4019 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
4020 reply.readException();
4021 boolean success = reply.readInt() != 0;
4022 reply.recycle();
4023 data.recycle();
4024 return success;
4025 }
4026
Christopher Tate346acb12012-10-15 19:20:25 -07004027 public void clearPendingBackup() throws RemoteException {
4028 Parcel data = Parcel.obtain();
4029 Parcel reply = Parcel.obtain();
4030 data.writeInterfaceToken(IActivityManager.descriptor);
4031 mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0);
4032 reply.recycle();
4033 data.recycle();
4034 }
4035
Christopher Tate181fafa2009-05-14 11:12:14 -07004036 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
4037 Parcel data = Parcel.obtain();
4038 Parcel reply = Parcel.obtain();
4039 data.writeInterfaceToken(IActivityManager.descriptor);
4040 data.writeString(packageName);
4041 data.writeStrongBinder(agent);
4042 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
4043 reply.recycle();
4044 data.recycle();
4045 }
4046
4047 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
4048 Parcel data = Parcel.obtain();
4049 Parcel reply = Parcel.obtain();
4050 data.writeInterfaceToken(IActivityManager.descriptor);
4051 app.writeToParcel(data, 0);
4052 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
4053 reply.readException();
4054 reply.recycle();
4055 data.recycle();
4056 }
4057
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004058 public boolean startInstrumentation(ComponentName className, String profileFile,
Svetoslav Ganov80943d82013-01-02 10:25:37 -08004059 int flags, Bundle arguments, IInstrumentationWatcher watcher,
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01004060 IUiAutomationConnection connection, int userId, String instructionSet)
4061 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004062 Parcel data = Parcel.obtain();
4063 Parcel reply = Parcel.obtain();
4064 data.writeInterfaceToken(IActivityManager.descriptor);
4065 ComponentName.writeToParcel(className, data);
4066 data.writeString(profileFile);
4067 data.writeInt(flags);
4068 data.writeBundle(arguments);
4069 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08004070 data.writeStrongBinder(connection != null ? connection.asBinder() : null);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004071 data.writeInt(userId);
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01004072 data.writeString(instructionSet);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004073 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
4074 reply.readException();
4075 boolean res = reply.readInt() != 0;
4076 reply.recycle();
4077 data.recycle();
4078 return res;
4079 }
4080
4081 public void finishInstrumentation(IApplicationThread target,
4082 int resultCode, Bundle results) throws RemoteException {
4083 Parcel data = Parcel.obtain();
4084 Parcel reply = Parcel.obtain();
4085 data.writeInterfaceToken(IActivityManager.descriptor);
4086 data.writeStrongBinder(target != null ? target.asBinder() : null);
4087 data.writeInt(resultCode);
4088 data.writeBundle(results);
4089 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
4090 reply.readException();
4091 data.recycle();
4092 reply.recycle();
4093 }
4094 public Configuration getConfiguration() throws RemoteException
4095 {
4096 Parcel data = Parcel.obtain();
4097 Parcel reply = Parcel.obtain();
4098 data.writeInterfaceToken(IActivityManager.descriptor);
4099 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
4100 reply.readException();
4101 Configuration res = Configuration.CREATOR.createFromParcel(reply);
4102 reply.recycle();
4103 data.recycle();
4104 return res;
4105 }
4106 public void updateConfiguration(Configuration values) throws RemoteException
4107 {
4108 Parcel data = Parcel.obtain();
4109 Parcel reply = Parcel.obtain();
4110 data.writeInterfaceToken(IActivityManager.descriptor);
4111 values.writeToParcel(data, 0);
4112 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
4113 reply.readException();
4114 data.recycle();
4115 reply.recycle();
4116 }
4117 public void setRequestedOrientation(IBinder token, int requestedOrientation)
4118 throws RemoteException {
4119 Parcel data = Parcel.obtain();
4120 Parcel reply = Parcel.obtain();
4121 data.writeInterfaceToken(IActivityManager.descriptor);
4122 data.writeStrongBinder(token);
4123 data.writeInt(requestedOrientation);
4124 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
4125 reply.readException();
4126 data.recycle();
4127 reply.recycle();
4128 }
4129 public int getRequestedOrientation(IBinder token) throws RemoteException {
4130 Parcel data = Parcel.obtain();
4131 Parcel reply = Parcel.obtain();
4132 data.writeInterfaceToken(IActivityManager.descriptor);
4133 data.writeStrongBinder(token);
4134 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
4135 reply.readException();
4136 int res = reply.readInt();
4137 data.recycle();
4138 reply.recycle();
4139 return res;
4140 }
4141 public ComponentName getActivityClassForToken(IBinder token)
4142 throws RemoteException {
4143 Parcel data = Parcel.obtain();
4144 Parcel reply = Parcel.obtain();
4145 data.writeInterfaceToken(IActivityManager.descriptor);
4146 data.writeStrongBinder(token);
4147 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
4148 reply.readException();
4149 ComponentName res = ComponentName.readFromParcel(reply);
4150 data.recycle();
4151 reply.recycle();
4152 return res;
4153 }
4154 public String getPackageForToken(IBinder token) throws RemoteException
4155 {
4156 Parcel data = Parcel.obtain();
4157 Parcel reply = Parcel.obtain();
4158 data.writeInterfaceToken(IActivityManager.descriptor);
4159 data.writeStrongBinder(token);
4160 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
4161 reply.readException();
4162 String res = reply.readString();
4163 data.recycle();
4164 reply.recycle();
4165 return res;
4166 }
4167 public IIntentSender getIntentSender(int type,
4168 String packageName, IBinder token, String resultWho,
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07004169 int requestCode, Intent[] intents, String[] resolvedTypes, int flags,
Dianne Hackborn41203752012-08-31 14:05:51 -07004170 Bundle options, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004171 Parcel data = Parcel.obtain();
4172 Parcel reply = Parcel.obtain();
4173 data.writeInterfaceToken(IActivityManager.descriptor);
4174 data.writeInt(type);
4175 data.writeString(packageName);
4176 data.writeStrongBinder(token);
4177 data.writeString(resultWho);
4178 data.writeInt(requestCode);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004179 if (intents != null) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004180 data.writeInt(1);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004181 data.writeTypedArray(intents, 0);
4182 data.writeStringArray(resolvedTypes);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004183 } else {
4184 data.writeInt(0);
4185 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004186 data.writeInt(flags);
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07004187 if (options != null) {
4188 data.writeInt(1);
4189 options.writeToParcel(data, 0);
4190 } else {
4191 data.writeInt(0);
4192 }
Dianne Hackborn41203752012-08-31 14:05:51 -07004193 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004194 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
4195 reply.readException();
4196 IIntentSender res = IIntentSender.Stub.asInterface(
Dianne Hackbornff170242014-11-19 10:59:01 -08004197 reply.readStrongBinder());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004198 data.recycle();
4199 reply.recycle();
4200 return res;
4201 }
4202 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
4203 Parcel data = Parcel.obtain();
4204 Parcel reply = Parcel.obtain();
4205 data.writeInterfaceToken(IActivityManager.descriptor);
4206 data.writeStrongBinder(sender.asBinder());
4207 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
4208 reply.readException();
4209 data.recycle();
4210 reply.recycle();
4211 }
4212 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
4213 Parcel data = Parcel.obtain();
4214 Parcel reply = Parcel.obtain();
4215 data.writeInterfaceToken(IActivityManager.descriptor);
4216 data.writeStrongBinder(sender.asBinder());
4217 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4218 reply.readException();
4219 String res = reply.readString();
4220 data.recycle();
4221 reply.recycle();
4222 return res;
4223 }
Christopher Tatec4a07d12012-04-06 14:19:13 -07004224 public int getUidForIntentSender(IIntentSender sender) throws RemoteException {
4225 Parcel data = Parcel.obtain();
4226 Parcel reply = Parcel.obtain();
4227 data.writeInterfaceToken(IActivityManager.descriptor);
4228 data.writeStrongBinder(sender.asBinder());
4229 mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4230 reply.readException();
4231 int res = reply.readInt();
4232 data.recycle();
4233 reply.recycle();
4234 return res;
4235 }
Dianne Hackborn41203752012-08-31 14:05:51 -07004236 public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
4237 boolean requireFull, String name, String callerPackage) throws RemoteException {
4238 Parcel data = Parcel.obtain();
4239 Parcel reply = Parcel.obtain();
4240 data.writeInterfaceToken(IActivityManager.descriptor);
4241 data.writeInt(callingPid);
4242 data.writeInt(callingUid);
4243 data.writeInt(userId);
4244 data.writeInt(allowAll ? 1 : 0);
4245 data.writeInt(requireFull ? 1 : 0);
4246 data.writeString(name);
4247 data.writeString(callerPackage);
4248 mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0);
4249 reply.readException();
4250 int res = reply.readInt();
4251 data.recycle();
4252 reply.recycle();
4253 return res;
4254 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004255 public void setProcessLimit(int max) throws RemoteException
4256 {
4257 Parcel data = Parcel.obtain();
4258 Parcel reply = Parcel.obtain();
4259 data.writeInterfaceToken(IActivityManager.descriptor);
4260 data.writeInt(max);
4261 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4262 reply.readException();
4263 data.recycle();
4264 reply.recycle();
4265 }
4266 public int getProcessLimit() throws RemoteException
4267 {
4268 Parcel data = Parcel.obtain();
4269 Parcel reply = Parcel.obtain();
4270 data.writeInterfaceToken(IActivityManager.descriptor);
4271 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4272 reply.readException();
4273 int res = reply.readInt();
4274 data.recycle();
4275 reply.recycle();
4276 return res;
4277 }
4278 public void setProcessForeground(IBinder token, int pid,
4279 boolean isForeground) throws RemoteException {
4280 Parcel data = Parcel.obtain();
4281 Parcel reply = Parcel.obtain();
4282 data.writeInterfaceToken(IActivityManager.descriptor);
4283 data.writeStrongBinder(token);
4284 data.writeInt(pid);
4285 data.writeInt(isForeground ? 1 : 0);
4286 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
4287 reply.readException();
4288 data.recycle();
4289 reply.recycle();
4290 }
4291 public int checkPermission(String permission, int pid, int uid)
4292 throws RemoteException {
4293 Parcel data = Parcel.obtain();
4294 Parcel reply = Parcel.obtain();
4295 data.writeInterfaceToken(IActivityManager.descriptor);
4296 data.writeString(permission);
4297 data.writeInt(pid);
4298 data.writeInt(uid);
4299 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
4300 reply.readException();
4301 int res = reply.readInt();
4302 data.recycle();
4303 reply.recycle();
4304 return res;
4305 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004306 public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken)
4307 throws RemoteException {
4308 Parcel data = Parcel.obtain();
4309 Parcel reply = Parcel.obtain();
4310 data.writeInterfaceToken(IActivityManager.descriptor);
4311 data.writeString(permission);
4312 data.writeInt(pid);
4313 data.writeInt(uid);
4314 data.writeStrongBinder(callerToken);
4315 mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0);
4316 reply.readException();
4317 int res = reply.readInt();
4318 data.recycle();
4319 reply.recycle();
4320 return res;
4321 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004322 public boolean clearApplicationUserData(final String packageName,
Amith Yamasani742a6712011-05-04 14:49:28 -07004323 final IPackageDataObserver observer, final int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004324 Parcel data = Parcel.obtain();
4325 Parcel reply = Parcel.obtain();
4326 data.writeInterfaceToken(IActivityManager.descriptor);
4327 data.writeString(packageName);
Christopher Tate31b65f92013-09-09 14:17:27 -07004328 data.writeStrongBinder((observer != null) ? observer.asBinder() : null);
Amith Yamasani742a6712011-05-04 14:49:28 -07004329 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004330 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
4331 reply.readException();
4332 boolean res = reply.readInt() != 0;
4333 data.recycle();
4334 reply.recycle();
4335 return res;
4336 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004337 public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId,
4338 IBinder callerToken) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004339 Parcel data = Parcel.obtain();
4340 Parcel reply = Parcel.obtain();
4341 data.writeInterfaceToken(IActivityManager.descriptor);
4342 uri.writeToParcel(data, 0);
4343 data.writeInt(pid);
4344 data.writeInt(uid);
4345 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004346 data.writeInt(userId);
Dianne Hackbornff170242014-11-19 10:59:01 -08004347 data.writeStrongBinder(callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004348 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
4349 reply.readException();
4350 int res = reply.readInt();
4351 data.recycle();
4352 reply.recycle();
4353 return res;
4354 }
4355 public void grantUriPermission(IApplicationThread caller, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004356 Uri uri, int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004357 Parcel data = Parcel.obtain();
4358 Parcel reply = Parcel.obtain();
4359 data.writeInterfaceToken(IActivityManager.descriptor);
4360 data.writeStrongBinder(caller.asBinder());
4361 data.writeString(targetPkg);
4362 uri.writeToParcel(data, 0);
4363 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004364 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004365 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4366 reply.readException();
4367 data.recycle();
4368 reply.recycle();
4369 }
4370 public void revokeUriPermission(IApplicationThread caller, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004371 int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004372 Parcel data = Parcel.obtain();
4373 Parcel reply = Parcel.obtain();
4374 data.writeInterfaceToken(IActivityManager.descriptor);
4375 data.writeStrongBinder(caller.asBinder());
4376 uri.writeToParcel(data, 0);
4377 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004378 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004379 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4380 reply.readException();
4381 data.recycle();
4382 reply.recycle();
4383 }
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004384
4385 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004386 public void takePersistableUriPermission(Uri uri, int mode, int userId)
4387 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004388 Parcel data = Parcel.obtain();
4389 Parcel reply = Parcel.obtain();
4390 data.writeInterfaceToken(IActivityManager.descriptor);
4391 uri.writeToParcel(data, 0);
4392 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004393 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004394 mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4395 reply.readException();
4396 data.recycle();
4397 reply.recycle();
4398 }
4399
4400 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004401 public void releasePersistableUriPermission(Uri uri, int mode, int userId)
4402 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004403 Parcel data = Parcel.obtain();
4404 Parcel reply = Parcel.obtain();
4405 data.writeInterfaceToken(IActivityManager.descriptor);
4406 uri.writeToParcel(data, 0);
4407 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004408 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004409 mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4410 reply.readException();
4411 data.recycle();
4412 reply.recycle();
4413 }
4414
4415 @Override
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004416 public ParceledListSlice<UriPermission> getPersistedUriPermissions(
4417 String packageName, boolean incoming) throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004418 Parcel data = Parcel.obtain();
4419 Parcel reply = Parcel.obtain();
4420 data.writeInterfaceToken(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004421 data.writeString(packageName);
4422 data.writeInt(incoming ? 1 : 0);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004423 mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
4424 reply.readException();
4425 final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel(
4426 reply);
4427 data.recycle();
4428 reply.recycle();
4429 return perms;
4430 }
4431
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004432 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
4433 throws RemoteException {
4434 Parcel data = Parcel.obtain();
4435 Parcel reply = Parcel.obtain();
4436 data.writeInterfaceToken(IActivityManager.descriptor);
4437 data.writeStrongBinder(who.asBinder());
4438 data.writeInt(waiting ? 1 : 0);
4439 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
4440 reply.readException();
4441 data.recycle();
4442 reply.recycle();
4443 }
4444 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
4445 Parcel data = Parcel.obtain();
4446 Parcel reply = Parcel.obtain();
4447 data.writeInterfaceToken(IActivityManager.descriptor);
4448 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
4449 reply.readException();
4450 outInfo.readFromParcel(reply);
4451 data.recycle();
4452 reply.recycle();
4453 }
4454 public void unhandledBack() throws RemoteException
4455 {
4456 Parcel data = Parcel.obtain();
4457 Parcel reply = Parcel.obtain();
4458 data.writeInterfaceToken(IActivityManager.descriptor);
4459 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
4460 reply.readException();
4461 data.recycle();
4462 reply.recycle();
4463 }
4464 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
4465 {
4466 Parcel data = Parcel.obtain();
4467 Parcel reply = Parcel.obtain();
4468 data.writeInterfaceToken(IActivityManager.descriptor);
4469 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
4470 reply.readException();
4471 ParcelFileDescriptor pfd = null;
4472 if (reply.readInt() != 0) {
4473 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
4474 }
4475 data.recycle();
4476 reply.recycle();
4477 return pfd;
4478 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07004479 public void setLockScreenShown(boolean shown) throws RemoteException
4480 {
4481 Parcel data = Parcel.obtain();
4482 Parcel reply = Parcel.obtain();
4483 data.writeInterfaceToken(IActivityManager.descriptor);
4484 data.writeInt(shown ? 1 : 0);
4485 mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0);
4486 reply.readException();
4487 data.recycle();
4488 reply.recycle();
4489 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004490 public void setDebugApp(
4491 String packageName, boolean waitForDebugger, boolean persistent)
4492 throws RemoteException
4493 {
4494 Parcel data = Parcel.obtain();
4495 Parcel reply = Parcel.obtain();
4496 data.writeInterfaceToken(IActivityManager.descriptor);
4497 data.writeString(packageName);
4498 data.writeInt(waitForDebugger ? 1 : 0);
4499 data.writeInt(persistent ? 1 : 0);
4500 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
4501 reply.readException();
4502 data.recycle();
4503 reply.recycle();
4504 }
4505 public void setAlwaysFinish(boolean enabled) throws RemoteException
4506 {
4507 Parcel data = Parcel.obtain();
4508 Parcel reply = Parcel.obtain();
4509 data.writeInterfaceToken(IActivityManager.descriptor);
4510 data.writeInt(enabled ? 1 : 0);
4511 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
4512 reply.readException();
4513 data.recycle();
4514 reply.recycle();
4515 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004516 public void setActivityController(IActivityController watcher) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004517 {
4518 Parcel data = Parcel.obtain();
4519 Parcel reply = Parcel.obtain();
4520 data.writeInterfaceToken(IActivityManager.descriptor);
4521 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004522 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004523 reply.readException();
4524 data.recycle();
4525 reply.recycle();
4526 }
4527 public void enterSafeMode() throws RemoteException {
4528 Parcel data = Parcel.obtain();
4529 data.writeInterfaceToken(IActivityManager.descriptor);
4530 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
4531 data.recycle();
4532 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07004533 public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag)
Dianne Hackborn099bc622014-01-22 13:39:16 -08004534 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004535 Parcel data = Parcel.obtain();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004536 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn099bc622014-01-22 13:39:16 -08004537 data.writeStrongBinder(sender.asBinder());
4538 data.writeInt(sourceUid);
4539 data.writeString(sourcePkg);
Dianne Hackborn1e383822015-04-10 14:02:33 -07004540 data.writeString(tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004541 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
4542 data.recycle();
4543 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07004544 public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag)
4545 throws RemoteException {
4546 Parcel data = Parcel.obtain();
4547 data.writeInterfaceToken(IActivityManager.descriptor);
4548 data.writeStrongBinder(sender.asBinder());
4549 data.writeInt(sourceUid);
4550 data.writeString(tag);
4551 mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0);
4552 data.recycle();
4553 }
4554 public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag)
4555 throws RemoteException {
4556 Parcel data = Parcel.obtain();
4557 data.writeInterfaceToken(IActivityManager.descriptor);
4558 data.writeStrongBinder(sender.asBinder());
4559 data.writeInt(sourceUid);
4560 data.writeString(tag);
4561 mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0);
4562 data.recycle();
4563 }
Dianne Hackborn64825172011-03-02 21:32:58 -08004564 public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004565 Parcel data = Parcel.obtain();
4566 Parcel reply = Parcel.obtain();
4567 data.writeInterfaceToken(IActivityManager.descriptor);
4568 data.writeIntArray(pids);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004569 data.writeString(reason);
Dianne Hackborn64825172011-03-02 21:32:58 -08004570 data.writeInt(secure ? 1 : 0);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004571 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07004572 reply.readException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004573 boolean res = reply.readInt() != 0;
4574 data.recycle();
4575 reply.recycle();
4576 return res;
4577 }
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07004578 @Override
4579 public boolean killProcessesBelowForeground(String reason) throws RemoteException {
4580 Parcel data = Parcel.obtain();
4581 Parcel reply = Parcel.obtain();
4582 data.writeInterfaceToken(IActivityManager.descriptor);
4583 data.writeString(reason);
4584 mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0);
4585 boolean res = reply.readInt() != 0;
4586 data.recycle();
4587 reply.recycle();
4588 return res;
4589 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004590 public boolean testIsSystemReady()
4591 {
4592 /* this base class version is never called */
4593 return true;
4594 }
Dan Egnor60d87622009-12-16 16:32:58 -08004595 public void handleApplicationCrash(IBinder app,
4596 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
4597 {
4598 Parcel data = Parcel.obtain();
4599 Parcel reply = Parcel.obtain();
4600 data.writeInterfaceToken(IActivityManager.descriptor);
4601 data.writeStrongBinder(app);
4602 crashInfo.writeToParcel(data, 0);
4603 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
4604 reply.readException();
4605 reply.recycle();
4606 data.recycle();
4607 }
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004608
Dianne Hackborn52322712014-08-26 22:47:26 -07004609 public boolean handleApplicationWtf(IBinder app, String tag, boolean system,
Dan Egnorb7f03672009-12-09 16:22:32 -08004610 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004611 {
4612 Parcel data = Parcel.obtain();
4613 Parcel reply = Parcel.obtain();
4614 data.writeInterfaceToken(IActivityManager.descriptor);
4615 data.writeStrongBinder(app);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004616 data.writeString(tag);
Dianne Hackborn52322712014-08-26 22:47:26 -07004617 data.writeInt(system ? 1 : 0);
Dan Egnorb7f03672009-12-09 16:22:32 -08004618 crashInfo.writeToParcel(data, 0);
Dan Egnor60d87622009-12-16 16:32:58 -08004619 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004620 reply.readException();
Dan Egnor60d87622009-12-16 16:32:58 -08004621 boolean res = reply.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004622 reply.recycle();
4623 data.recycle();
Dan Egnor60d87622009-12-16 16:32:58 -08004624 return res;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004625 }
Dan Egnorb7f03672009-12-09 16:22:32 -08004626
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004627 public void handleApplicationStrictModeViolation(IBinder app,
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004628 int violationMask,
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004629 StrictMode.ViolationInfo info) throws RemoteException
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004630 {
4631 Parcel data = Parcel.obtain();
4632 Parcel reply = Parcel.obtain();
4633 data.writeInterfaceToken(IActivityManager.descriptor);
4634 data.writeStrongBinder(app);
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004635 data.writeInt(violationMask);
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004636 info.writeToParcel(data, 0);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004637 mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0);
4638 reply.readException();
4639 reply.recycle();
4640 data.recycle();
4641 }
4642
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004643 public void signalPersistentProcesses(int sig) throws RemoteException {
4644 Parcel data = Parcel.obtain();
4645 Parcel reply = Parcel.obtain();
4646 data.writeInterfaceToken(IActivityManager.descriptor);
4647 data.writeInt(sig);
4648 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
4649 reply.readException();
4650 data.recycle();
4651 reply.recycle();
4652 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004653
Dianne Hackborn1676c852012-09-10 14:52:30 -07004654 public void killBackgroundProcesses(String packageName, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004655 Parcel data = Parcel.obtain();
4656 Parcel reply = Parcel.obtain();
4657 data.writeInterfaceToken(IActivityManager.descriptor);
4658 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004659 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004660 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4661 reply.readException();
4662 data.recycle();
4663 reply.recycle();
4664 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004665
4666 public void killAllBackgroundProcesses() throws RemoteException {
4667 Parcel data = Parcel.obtain();
4668 Parcel reply = Parcel.obtain();
4669 data.writeInterfaceToken(IActivityManager.descriptor);
4670 mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4671 reply.readException();
4672 data.recycle();
4673 reply.recycle();
4674 }
4675
Dianne Hackborn1676c852012-09-10 14:52:30 -07004676 public void forceStopPackage(String packageName, int userId) throws RemoteException {
Dianne Hackborn03abb812010-01-04 18:43:19 -08004677 Parcel data = Parcel.obtain();
4678 Parcel reply = Parcel.obtain();
4679 data.writeInterfaceToken(IActivityManager.descriptor);
4680 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004681 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004682 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004683 reply.readException();
4684 data.recycle();
4685 reply.recycle();
4686 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004687
Dianne Hackborn27ff9132012-03-06 14:57:58 -08004688 public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
4689 throws RemoteException
4690 {
4691 Parcel data = Parcel.obtain();
4692 Parcel reply = Parcel.obtain();
4693 data.writeInterfaceToken(IActivityManager.descriptor);
4694 mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0);
4695 reply.readException();
4696 outInfo.readFromParcel(reply);
4697 reply.recycle();
4698 data.recycle();
4699 }
4700
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004701 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
4702 {
4703 Parcel data = Parcel.obtain();
4704 Parcel reply = Parcel.obtain();
4705 data.writeInterfaceToken(IActivityManager.descriptor);
4706 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
4707 reply.readException();
4708 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
4709 reply.recycle();
4710 data.recycle();
4711 return res;
4712 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004713
Dianne Hackborn1676c852012-09-10 14:52:30 -07004714 public boolean profileControl(String process, int userId, boolean start,
Jeff Hao1b012d32014-08-20 10:35:34 -07004715 ProfilerInfo profilerInfo, int profileType) throws RemoteException
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004716 {
4717 Parcel data = Parcel.obtain();
4718 Parcel reply = Parcel.obtain();
4719 data.writeInterfaceToken(IActivityManager.descriptor);
4720 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004721 data.writeInt(userId);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004722 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07004723 data.writeInt(profileType);
Jeff Hao1b012d32014-08-20 10:35:34 -07004724 if (profilerInfo != null) {
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004725 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07004726 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004727 } else {
4728 data.writeInt(0);
4729 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004730 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
4731 reply.readException();
4732 boolean res = reply.readInt() != 0;
4733 reply.recycle();
4734 data.recycle();
4735 return res;
4736 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004737
Dianne Hackborn55280a92009-05-07 15:53:46 -07004738 public boolean shutdown(int timeout) throws RemoteException
4739 {
4740 Parcel data = Parcel.obtain();
4741 Parcel reply = Parcel.obtain();
4742 data.writeInterfaceToken(IActivityManager.descriptor);
4743 data.writeInt(timeout);
4744 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
4745 reply.readException();
4746 boolean res = reply.readInt() != 0;
4747 reply.recycle();
4748 data.recycle();
4749 return res;
4750 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004751
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07004752 public void stopAppSwitches() throws RemoteException {
4753 Parcel data = Parcel.obtain();
4754 Parcel reply = Parcel.obtain();
4755 data.writeInterfaceToken(IActivityManager.descriptor);
4756 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
4757 reply.readException();
4758 reply.recycle();
4759 data.recycle();
4760 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004761
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07004762 public void resumeAppSwitches() throws RemoteException {
4763 Parcel data = Parcel.obtain();
4764 Parcel reply = Parcel.obtain();
4765 data.writeInterfaceToken(IActivityManager.descriptor);
4766 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
4767 reply.readException();
4768 reply.recycle();
4769 data.recycle();
4770 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07004771
4772 public void addPackageDependency(String packageName) throws RemoteException {
4773 Parcel data = Parcel.obtain();
4774 Parcel reply = Parcel.obtain();
4775 data.writeInterfaceToken(IActivityManager.descriptor);
4776 data.writeString(packageName);
4777 mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0);
4778 reply.readException();
4779 data.recycle();
4780 reply.recycle();
4781 }
4782
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004783 public void killApplicationWithAppId(String pkg, int appid, String reason)
4784 throws RemoteException {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004785 Parcel data = Parcel.obtain();
4786 Parcel reply = Parcel.obtain();
4787 data.writeInterfaceToken(IActivityManager.descriptor);
4788 data.writeString(pkg);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004789 data.writeInt(appid);
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004790 data.writeString(reason);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004791 mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004792 reply.readException();
4793 data.recycle();
4794 reply.recycle();
4795 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004796
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07004797 public void closeSystemDialogs(String reason) throws RemoteException {
4798 Parcel data = Parcel.obtain();
4799 Parcel reply = Parcel.obtain();
4800 data.writeInterfaceToken(IActivityManager.descriptor);
4801 data.writeString(reason);
4802 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
4803 reply.readException();
4804 data.recycle();
4805 reply.recycle();
4806 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004807
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004808 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004809 throws RemoteException {
4810 Parcel data = Parcel.obtain();
4811 Parcel reply = Parcel.obtain();
4812 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004813 data.writeIntArray(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004814 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
4815 reply.readException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004816 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004817 data.recycle();
4818 reply.recycle();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004819 return res;
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004820 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07004821
4822 public void killApplicationProcess(String processName, int uid) throws RemoteException {
4823 Parcel data = Parcel.obtain();
4824 Parcel reply = Parcel.obtain();
4825 data.writeInterfaceToken(IActivityManager.descriptor);
4826 data.writeString(processName);
4827 data.writeInt(uid);
4828 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
4829 reply.readException();
4830 data.recycle();
4831 reply.recycle();
4832 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004833
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07004834 public void overridePendingTransition(IBinder token, String packageName,
4835 int enterAnim, int exitAnim) throws RemoteException {
4836 Parcel data = Parcel.obtain();
4837 Parcel reply = Parcel.obtain();
4838 data.writeInterfaceToken(IActivityManager.descriptor);
4839 data.writeStrongBinder(token);
4840 data.writeString(packageName);
4841 data.writeInt(enterAnim);
4842 data.writeInt(exitAnim);
4843 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
4844 reply.readException();
4845 data.recycle();
4846 reply.recycle();
4847 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004848
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08004849 public boolean isUserAMonkey() throws RemoteException {
4850 Parcel data = Parcel.obtain();
4851 Parcel reply = Parcel.obtain();
4852 data.writeInterfaceToken(IActivityManager.descriptor);
4853 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
4854 reply.readException();
4855 boolean res = reply.readInt() != 0;
4856 data.recycle();
4857 reply.recycle();
4858 return res;
4859 }
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07004860
4861 public void setUserIsMonkey(boolean monkey) throws RemoteException {
4862 Parcel data = Parcel.obtain();
4863 Parcel reply = Parcel.obtain();
4864 data.writeInterfaceToken(IActivityManager.descriptor);
4865 data.writeInt(monkey ? 1 : 0);
4866 mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0);
4867 reply.readException();
4868 data.recycle();
4869 reply.recycle();
4870 }
4871
Dianne Hackborn860755f2010-06-03 18:47:52 -07004872 public void finishHeavyWeightApp() throws RemoteException {
4873 Parcel data = Parcel.obtain();
4874 Parcel reply = Parcel.obtain();
4875 data.writeInterfaceToken(IActivityManager.descriptor);
4876 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
4877 reply.readException();
4878 data.recycle();
4879 reply.recycle();
4880 }
Craig Mautner4addfc52013-06-25 08:05:45 -07004881
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004882 public boolean convertFromTranslucent(IBinder token)
Craig Mautner4addfc52013-06-25 08:05:45 -07004883 throws RemoteException {
4884 Parcel data = Parcel.obtain();
4885 Parcel reply = Parcel.obtain();
4886 data.writeInterfaceToken(IActivityManager.descriptor);
4887 data.writeStrongBinder(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07004888 mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0);
4889 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004890 boolean res = reply.readInt() != 0;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004891 data.recycle();
4892 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004893 return res;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004894 }
4895
Craig Mautner233ceee2014-05-09 17:05:11 -07004896 public boolean convertToTranslucent(IBinder token, ActivityOptions options)
Craig Mautner5eda9b32013-07-02 11:58:16 -07004897 throws RemoteException {
4898 Parcel data = Parcel.obtain();
4899 Parcel reply = Parcel.obtain();
4900 data.writeInterfaceToken(IActivityManager.descriptor);
4901 data.writeStrongBinder(token);
Craig Mautner233ceee2014-05-09 17:05:11 -07004902 if (options == null) {
4903 data.writeInt(0);
4904 } else {
4905 data.writeInt(1);
4906 data.writeBundle(options.toBundle());
4907 }
Craig Mautner5eda9b32013-07-02 11:58:16 -07004908 mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07004909 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004910 boolean res = reply.readInt() != 0;
Craig Mautner4addfc52013-06-25 08:05:45 -07004911 data.recycle();
4912 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004913 return res;
Craig Mautner4addfc52013-06-25 08:05:45 -07004914 }
4915
Craig Mautner233ceee2014-05-09 17:05:11 -07004916 public ActivityOptions getActivityOptions(IBinder token) throws RemoteException {
4917 Parcel data = Parcel.obtain();
4918 Parcel reply = Parcel.obtain();
4919 data.writeInterfaceToken(IActivityManager.descriptor);
4920 data.writeStrongBinder(token);
4921 mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0);
4922 reply.readException();
4923 Bundle bundle = reply.readBundle();
4924 ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
4925 data.recycle();
4926 reply.recycle();
4927 return options;
4928 }
4929
Daniel Sandler69a48172010-06-23 16:29:36 -04004930 public void setImmersive(IBinder token, boolean immersive)
4931 throws RemoteException {
4932 Parcel data = Parcel.obtain();
4933 Parcel reply = Parcel.obtain();
4934 data.writeInterfaceToken(IActivityManager.descriptor);
4935 data.writeStrongBinder(token);
4936 data.writeInt(immersive ? 1 : 0);
4937 mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
4938 reply.readException();
4939 data.recycle();
4940 reply.recycle();
4941 }
4942
4943 public boolean isImmersive(IBinder token)
4944 throws RemoteException {
4945 Parcel data = Parcel.obtain();
4946 Parcel reply = Parcel.obtain();
4947 data.writeInterfaceToken(IActivityManager.descriptor);
4948 data.writeStrongBinder(token);
4949 mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004950 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004951 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004952 data.recycle();
4953 reply.recycle();
4954 return res;
4955 }
4956
Craig Mautnerd61dc202014-07-07 11:09:11 -07004957 public boolean isTopOfTask(IBinder token) throws RemoteException {
4958 Parcel data = Parcel.obtain();
4959 Parcel reply = Parcel.obtain();
4960 data.writeInterfaceToken(IActivityManager.descriptor);
4961 data.writeStrongBinder(token);
4962 mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0);
4963 reply.readException();
4964 boolean res = reply.readInt() == 1;
4965 data.recycle();
4966 reply.recycle();
4967 return res;
4968 }
4969
Daniel Sandler69a48172010-06-23 16:29:36 -04004970 public boolean isTopActivityImmersive()
4971 throws RemoteException {
4972 Parcel data = Parcel.obtain();
4973 Parcel reply = Parcel.obtain();
4974 data.writeInterfaceToken(IActivityManager.descriptor);
4975 mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004976 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004977 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004978 data.recycle();
4979 reply.recycle();
4980 return res;
4981 }
4982
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004983 public void crashApplication(int uid, int initialPid, String packageName,
4984 String message) throws RemoteException {
4985 Parcel data = Parcel.obtain();
4986 Parcel reply = Parcel.obtain();
4987 data.writeInterfaceToken(IActivityManager.descriptor);
4988 data.writeInt(uid);
4989 data.writeInt(initialPid);
4990 data.writeString(packageName);
4991 data.writeString(message);
4992 mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0);
4993 reply.readException();
4994 data.recycle();
4995 reply.recycle();
4996 }
Andy McFadden824c5102010-07-09 16:26:57 -07004997
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004998 public String getProviderMimeType(Uri uri, int userId) throws RemoteException {
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004999 Parcel data = Parcel.obtain();
5000 Parcel reply = Parcel.obtain();
5001 data.writeInterfaceToken(IActivityManager.descriptor);
5002 uri.writeToParcel(data, 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005003 data.writeInt(userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07005004 mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0);
5005 reply.readException();
5006 String res = reply.readString();
5007 data.recycle();
5008 reply.recycle();
5009 return res;
5010 }
5011
Dianne Hackborn7e269642010-08-25 19:50:20 -07005012 public IBinder newUriPermissionOwner(String name)
5013 throws RemoteException {
5014 Parcel data = Parcel.obtain();
5015 Parcel reply = Parcel.obtain();
5016 data.writeInterfaceToken(IActivityManager.descriptor);
5017 data.writeString(name);
5018 mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
5019 reply.readException();
5020 IBinder res = reply.readStrongBinder();
5021 data.recycle();
5022 reply.recycle();
5023 return res;
5024 }
5025
5026 public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
Nicolas Prevotf1939902014-06-25 09:29:02 +01005027 Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07005028 Parcel data = Parcel.obtain();
5029 Parcel reply = Parcel.obtain();
5030 data.writeInterfaceToken(IActivityManager.descriptor);
5031 data.writeStrongBinder(owner);
5032 data.writeInt(fromUid);
5033 data.writeString(targetPkg);
5034 uri.writeToParcel(data, 0);
5035 data.writeInt(mode);
Nicolas Prevotf1939902014-06-25 09:29:02 +01005036 data.writeInt(sourceUserId);
5037 data.writeInt(targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07005038 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
5039 reply.readException();
5040 data.recycle();
5041 reply.recycle();
5042 }
5043
5044 public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01005045 int mode, int userId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07005046 Parcel data = Parcel.obtain();
5047 Parcel reply = Parcel.obtain();
5048 data.writeInterfaceToken(IActivityManager.descriptor);
5049 data.writeStrongBinder(owner);
5050 if (uri != null) {
5051 data.writeInt(1);
5052 uri.writeToParcel(data, 0);
5053 } else {
5054 data.writeInt(0);
5055 }
5056 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01005057 data.writeInt(userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07005058 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
5059 reply.readException();
5060 data.recycle();
5061 reply.recycle();
5062 }
Dianne Hackbornc8f84972010-08-25 23:14:44 -07005063
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07005064 public int checkGrantUriPermission(int callingUid, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01005065 Uri uri, int modeFlags, int userId) throws RemoteException {
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07005066 Parcel data = Parcel.obtain();
5067 Parcel reply = Parcel.obtain();
5068 data.writeInterfaceToken(IActivityManager.descriptor);
5069 data.writeInt(callingUid);
5070 data.writeString(targetPkg);
5071 uri.writeToParcel(data, 0);
5072 data.writeInt(modeFlags);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01005073 data.writeInt(userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07005074 mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
5075 reply.readException();
5076 int res = reply.readInt();
5077 data.recycle();
5078 reply.recycle();
5079 return res;
5080 }
5081
Dianne Hackborn1676c852012-09-10 14:52:30 -07005082 public boolean dumpHeap(String process, int userId, boolean managed,
Andy McFadden824c5102010-07-09 16:26:57 -07005083 String path, ParcelFileDescriptor fd) throws RemoteException {
5084 Parcel data = Parcel.obtain();
5085 Parcel reply = Parcel.obtain();
5086 data.writeInterfaceToken(IActivityManager.descriptor);
5087 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07005088 data.writeInt(userId);
Andy McFadden824c5102010-07-09 16:26:57 -07005089 data.writeInt(managed ? 1 : 0);
5090 data.writeString(path);
5091 if (fd != null) {
5092 data.writeInt(1);
5093 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
5094 } else {
5095 data.writeInt(0);
5096 }
5097 mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
5098 reply.readException();
5099 boolean res = reply.readInt() != 0;
5100 reply.recycle();
5101 data.recycle();
5102 return res;
5103 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07005104
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005105 public int startActivities(IApplicationThread caller, String callingPackage,
Dianne Hackborna4972e92012-03-14 10:38:05 -07005106 Intent[] intents, String[] resolvedTypes, IBinder resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07005107 Bundle options, int userId) throws RemoteException {
Dianne Hackborn621e17d2010-11-22 15:59:56 -08005108 Parcel data = Parcel.obtain();
5109 Parcel reply = Parcel.obtain();
5110 data.writeInterfaceToken(IActivityManager.descriptor);
5111 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005112 data.writeString(callingPackage);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08005113 data.writeTypedArray(intents, 0);
5114 data.writeStringArray(resolvedTypes);
5115 data.writeStrongBinder(resultTo);
Dianne Hackborna4972e92012-03-14 10:38:05 -07005116 if (options != null) {
5117 data.writeInt(1);
5118 options.writeToParcel(data, 0);
5119 } else {
5120 data.writeInt(0);
5121 }
Amith Yamasaniea7e9152012-09-24 16:11:18 -07005122 data.writeInt(userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08005123 mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0);
5124 reply.readException();
5125 int result = reply.readInt();
5126 reply.recycle();
5127 data.recycle();
5128 return result;
5129 }
5130
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07005131 public int getFrontActivityScreenCompatMode() throws RemoteException {
5132 Parcel data = Parcel.obtain();
5133 Parcel reply = Parcel.obtain();
5134 data.writeInterfaceToken(IActivityManager.descriptor);
5135 mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
5136 reply.readException();
5137 int mode = reply.readInt();
5138 reply.recycle();
5139 data.recycle();
5140 return mode;
5141 }
5142
5143 public void setFrontActivityScreenCompatMode(int mode) throws RemoteException {
5144 Parcel data = Parcel.obtain();
5145 Parcel reply = Parcel.obtain();
5146 data.writeInterfaceToken(IActivityManager.descriptor);
5147 data.writeInt(mode);
5148 mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
5149 reply.readException();
5150 reply.recycle();
5151 data.recycle();
5152 }
5153
5154 public int getPackageScreenCompatMode(String packageName) throws RemoteException {
5155 Parcel data = Parcel.obtain();
5156 Parcel reply = Parcel.obtain();
5157 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07005158 data.writeString(packageName);
5159 mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07005160 reply.readException();
5161 int mode = reply.readInt();
5162 reply.recycle();
5163 data.recycle();
5164 return mode;
5165 }
5166
5167 public void setPackageScreenCompatMode(String packageName, int mode)
Dianne Hackborne2515ee2011-04-27 18:52:56 -04005168 throws RemoteException {
5169 Parcel data = Parcel.obtain();
5170 Parcel reply = Parcel.obtain();
5171 data.writeInterfaceToken(IActivityManager.descriptor);
5172 data.writeString(packageName);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07005173 data.writeInt(mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04005174 mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
5175 reply.readException();
5176 reply.recycle();
5177 data.recycle();
5178 }
5179
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07005180 public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
5181 Parcel data = Parcel.obtain();
5182 Parcel reply = Parcel.obtain();
5183 data.writeInterfaceToken(IActivityManager.descriptor);
5184 data.writeString(packageName);
5185 mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
5186 reply.readException();
5187 boolean ask = reply.readInt() != 0;
5188 reply.recycle();
5189 data.recycle();
5190 return ask;
5191 }
5192
5193 public void setPackageAskScreenCompat(String packageName, boolean ask)
5194 throws RemoteException {
5195 Parcel data = Parcel.obtain();
5196 Parcel reply = Parcel.obtain();
5197 data.writeInterfaceToken(IActivityManager.descriptor);
5198 data.writeString(packageName);
5199 data.writeInt(ask ? 1 : 0);
5200 mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
5201 reply.readException();
5202 reply.recycle();
5203 data.recycle();
5204 }
5205
Amith Yamasani4b2e9342011-03-31 12:38:53 -07005206 public boolean switchUser(int userid) throws RemoteException {
5207 Parcel data = Parcel.obtain();
5208 Parcel reply = Parcel.obtain();
5209 data.writeInterfaceToken(IActivityManager.descriptor);
5210 data.writeInt(userid);
5211 mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0);
5212 reply.readException();
5213 boolean result = reply.readInt() != 0;
5214 reply.recycle();
5215 data.recycle();
5216 return result;
5217 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07005218
Kenny Guy08488bf2014-02-21 17:40:37 +00005219 public boolean startUserInBackground(int userid) throws RemoteException {
5220 Parcel data = Parcel.obtain();
5221 Parcel reply = Parcel.obtain();
5222 data.writeInterfaceToken(IActivityManager.descriptor);
5223 data.writeInt(userid);
5224 mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0);
5225 reply.readException();
5226 boolean result = reply.readInt() != 0;
5227 reply.recycle();
5228 data.recycle();
5229 return result;
5230 }
5231
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005232 public int stopUser(int userid, IStopUserCallback callback) throws RemoteException {
5233 Parcel data = Parcel.obtain();
5234 Parcel reply = Parcel.obtain();
5235 data.writeInterfaceToken(IActivityManager.descriptor);
5236 data.writeInt(userid);
5237 data.writeStrongInterface(callback);
5238 mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0);
5239 reply.readException();
5240 int result = reply.readInt();
5241 reply.recycle();
5242 data.recycle();
5243 return result;
5244 }
5245
Amith Yamasani52f1d752012-03-28 18:19:29 -07005246 public UserInfo getCurrentUser() throws RemoteException {
5247 Parcel data = Parcel.obtain();
5248 Parcel reply = Parcel.obtain();
5249 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005250 mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0);
Amith Yamasani52f1d752012-03-28 18:19:29 -07005251 reply.readException();
5252 UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply);
5253 reply.recycle();
5254 data.recycle();
5255 return userInfo;
5256 }
5257
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07005258 public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException {
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005259 Parcel data = Parcel.obtain();
5260 Parcel reply = Parcel.obtain();
5261 data.writeInterfaceToken(IActivityManager.descriptor);
5262 data.writeInt(userid);
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07005263 data.writeInt(orStopping ? 1 : 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005264 mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0);
5265 reply.readException();
5266 boolean result = reply.readInt() != 0;
5267 reply.recycle();
5268 data.recycle();
5269 return result;
5270 }
5271
Dianne Hackbornc72fc672012-09-20 13:12:03 -07005272 public int[] getRunningUserIds() throws RemoteException {
5273 Parcel data = Parcel.obtain();
5274 Parcel reply = Parcel.obtain();
5275 data.writeInterfaceToken(IActivityManager.descriptor);
5276 mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0);
5277 reply.readException();
5278 int[] result = reply.createIntArray();
5279 reply.recycle();
5280 data.recycle();
5281 return result;
5282 }
5283
Wale Ogunwaled54b5782014-10-23 15:55:23 -07005284 public boolean removeTask(int taskId) throws RemoteException {
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005285 Parcel data = Parcel.obtain();
5286 Parcel reply = Parcel.obtain();
5287 data.writeInterfaceToken(IActivityManager.descriptor);
5288 data.writeInt(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005289 mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
5290 reply.readException();
5291 boolean result = reply.readInt() != 0;
5292 reply.recycle();
5293 data.recycle();
5294 return result;
5295 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07005296
Jeff Sharkeya4620792011-05-20 15:29:23 -07005297 public void registerProcessObserver(IProcessObserver observer) throws RemoteException {
5298 Parcel data = Parcel.obtain();
5299 Parcel reply = Parcel.obtain();
5300 data.writeInterfaceToken(IActivityManager.descriptor);
5301 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5302 mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5303 reply.readException();
5304 data.recycle();
5305 reply.recycle();
5306 }
5307
5308 public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException {
5309 Parcel data = Parcel.obtain();
5310 Parcel reply = Parcel.obtain();
5311 data.writeInterfaceToken(IActivityManager.descriptor);
5312 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5313 mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5314 reply.readException();
5315 data.recycle();
5316 reply.recycle();
5317 }
5318
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07005319 public void registerUidObserver(IUidObserver 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_UID_OBSERVER_TRANSACTION, data, reply, 0);
5325 reply.readException();
5326 data.recycle();
5327 reply.recycle();
5328 }
5329
5330 public void unregisterUidObserver(IUidObserver 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_UID_OBSERVER_TRANSACTION, data, reply, 0);
5336 reply.readException();
5337 data.recycle();
5338 reply.recycle();
5339 }
5340
Dianne Hackborn6c418d52011-06-29 14:05:33 -07005341 public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException {
5342 Parcel data = Parcel.obtain();
5343 Parcel reply = Parcel.obtain();
5344 data.writeInterfaceToken(IActivityManager.descriptor);
5345 data.writeStrongBinder(sender.asBinder());
5346 mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0);
5347 reply.readException();
5348 boolean res = reply.readInt() != 0;
5349 data.recycle();
5350 reply.recycle();
5351 return res;
5352 }
5353
Dianne Hackborn1927ae82012-06-22 15:21:36 -07005354 public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException {
5355 Parcel data = Parcel.obtain();
5356 Parcel reply = Parcel.obtain();
5357 data.writeInterfaceToken(IActivityManager.descriptor);
5358 data.writeStrongBinder(sender.asBinder());
5359 mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0);
5360 reply.readException();
5361 boolean res = reply.readInt() != 0;
5362 data.recycle();
5363 reply.recycle();
5364 return res;
5365 }
5366
Dianne Hackborn81038902012-11-26 17:04:09 -08005367 public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException {
5368 Parcel data = Parcel.obtain();
5369 Parcel reply = Parcel.obtain();
5370 data.writeInterfaceToken(IActivityManager.descriptor);
5371 data.writeStrongBinder(sender.asBinder());
5372 mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5373 reply.readException();
5374 Intent res = reply.readInt() != 0
5375 ? Intent.CREATOR.createFromParcel(reply) : null;
5376 data.recycle();
5377 reply.recycle();
5378 return res;
5379 }
5380
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08005381 public String getTagForIntentSender(IIntentSender sender, String prefix)
5382 throws RemoteException {
5383 Parcel data = Parcel.obtain();
5384 Parcel reply = Parcel.obtain();
5385 data.writeInterfaceToken(IActivityManager.descriptor);
5386 data.writeStrongBinder(sender.asBinder());
5387 data.writeString(prefix);
5388 mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5389 reply.readException();
5390 String res = reply.readString();
5391 data.recycle();
5392 reply.recycle();
5393 return res;
5394 }
5395
Dianne Hackborn31ca8542011-07-19 14:58:28 -07005396 public void updatePersistentConfiguration(Configuration values) throws RemoteException
5397 {
5398 Parcel data = Parcel.obtain();
5399 Parcel reply = Parcel.obtain();
5400 data.writeInterfaceToken(IActivityManager.descriptor);
5401 values.writeToParcel(data, 0);
5402 mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0);
5403 reply.readException();
5404 data.recycle();
5405 reply.recycle();
5406 }
5407
Dianne Hackbornb437e092011-08-05 17:50:29 -07005408 public long[] getProcessPss(int[] pids) throws RemoteException {
5409 Parcel data = Parcel.obtain();
5410 Parcel reply = Parcel.obtain();
5411 data.writeInterfaceToken(IActivityManager.descriptor);
5412 data.writeIntArray(pids);
5413 mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0);
5414 reply.readException();
5415 long[] res = reply.createLongArray();
5416 data.recycle();
5417 reply.recycle();
5418 return res;
5419 }
5420
Dianne Hackborn661cd522011-08-22 00:26:20 -07005421 public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
5422 Parcel data = Parcel.obtain();
5423 Parcel reply = Parcel.obtain();
5424 data.writeInterfaceToken(IActivityManager.descriptor);
5425 TextUtils.writeToParcel(msg, data, 0);
5426 data.writeInt(always ? 1 : 0);
5427 mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
5428 reply.readException();
5429 data.recycle();
5430 reply.recycle();
5431 }
5432
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02005433 public void keyguardWaitingForActivityDrawn() throws RemoteException {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07005434 Parcel data = Parcel.obtain();
5435 Parcel reply = Parcel.obtain();
5436 data.writeInterfaceToken(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02005437 mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
Dianne Hackborn90c52de2011-09-23 12:57:44 -07005438 reply.readException();
5439 data.recycle();
5440 reply.recycle();
5441 }
5442
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07005443 public void keyguardGoingAway(boolean disableWindowAnimations,
5444 boolean keyguardGoingToNotificationShade) throws RemoteException {
5445 Parcel data = Parcel.obtain();
5446 Parcel reply = Parcel.obtain();
5447 data.writeInterfaceToken(IActivityManager.descriptor);
5448 data.writeInt(disableWindowAnimations ? 1 : 0);
5449 data.writeInt(keyguardGoingToNotificationShade ? 1 : 0);
5450 mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0);
5451 reply.readException();
5452 data.recycle();
5453 reply.recycle();
5454 }
5455
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07005456 public boolean shouldUpRecreateTask(IBinder token, String destAffinity)
Adam Powelldd8fab22012-03-22 17:47:27 -07005457 throws RemoteException {
5458 Parcel data = Parcel.obtain();
5459 Parcel reply = Parcel.obtain();
5460 data.writeInterfaceToken(IActivityManager.descriptor);
5461 data.writeStrongBinder(token);
5462 data.writeString(destAffinity);
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07005463 mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0);
Adam Powelldd8fab22012-03-22 17:47:27 -07005464 reply.readException();
5465 boolean result = reply.readInt() != 0;
5466 data.recycle();
5467 reply.recycle();
5468 return result;
5469 }
5470
5471 public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData)
5472 throws RemoteException {
5473 Parcel data = Parcel.obtain();
5474 Parcel reply = Parcel.obtain();
5475 data.writeInterfaceToken(IActivityManager.descriptor);
5476 data.writeStrongBinder(token);
5477 target.writeToParcel(data, 0);
5478 data.writeInt(resultCode);
5479 if (resultData != null) {
5480 data.writeInt(1);
5481 resultData.writeToParcel(data, 0);
5482 } else {
5483 data.writeInt(0);
5484 }
5485 mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0);
5486 reply.readException();
5487 boolean result = reply.readInt() != 0;
5488 data.recycle();
5489 reply.recycle();
5490 return result;
5491 }
5492
Dianne Hackborn5320eb82012-05-18 12:05:04 -07005493 public int getLaunchedFromUid(IBinder activityToken) throws RemoteException {
5494 Parcel data = Parcel.obtain();
5495 Parcel reply = Parcel.obtain();
5496 data.writeInterfaceToken(IActivityManager.descriptor);
5497 data.writeStrongBinder(activityToken);
5498 mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0);
5499 reply.readException();
5500 int result = reply.readInt();
5501 data.recycle();
5502 reply.recycle();
5503 return result;
5504 }
5505
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005506 public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException {
5507 Parcel data = Parcel.obtain();
5508 Parcel reply = Parcel.obtain();
5509 data.writeInterfaceToken(IActivityManager.descriptor);
5510 data.writeStrongBinder(activityToken);
5511 mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0);
5512 reply.readException();
5513 String result = reply.readString();
5514 data.recycle();
5515 reply.recycle();
5516 return result;
5517 }
5518
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07005519 public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5520 Parcel data = Parcel.obtain();
5521 Parcel reply = Parcel.obtain();
5522 data.writeInterfaceToken(IActivityManager.descriptor);
5523 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5524 mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5525 reply.readException();
5526 data.recycle();
5527 reply.recycle();
5528 }
5529
5530 public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5531 Parcel data = Parcel.obtain();
5532 Parcel reply = Parcel.obtain();
5533 data.writeInterfaceToken(IActivityManager.descriptor);
5534 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5535 mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5536 reply.readException();
5537 data.recycle();
5538 reply.recycle();
5539 }
5540
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07005541 public void requestBugReport() throws RemoteException {
5542 Parcel data = Parcel.obtain();
5543 Parcel reply = Parcel.obtain();
5544 data.writeInterfaceToken(IActivityManager.descriptor);
5545 mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0);
5546 reply.readException();
5547 data.recycle();
5548 reply.recycle();
5549 }
5550
Jeff Brownbd181bb2013-09-10 16:44:24 -07005551 public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason)
5552 throws RemoteException {
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005553 Parcel data = Parcel.obtain();
5554 Parcel reply = Parcel.obtain();
5555 data.writeInterfaceToken(IActivityManager.descriptor);
5556 data.writeInt(pid);
5557 data.writeInt(aboveSystem ? 1 : 0);
Jeff Brownbd181bb2013-09-10 16:44:24 -07005558 data.writeString(reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005559 mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0);
5560 reply.readException();
5561 long res = reply.readInt();
5562 data.recycle();
5563 reply.recycle();
5564 return res;
5565 }
5566
Adam Skorydfc7fd72013-08-05 19:23:41 -07005567 public Bundle getAssistContextExtras(int requestType) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005568 Parcel data = Parcel.obtain();
5569 Parcel reply = Parcel.obtain();
5570 data.writeInterfaceToken(IActivityManager.descriptor);
5571 data.writeInt(requestType);
Adam Skorydfc7fd72013-08-05 19:23:41 -07005572 mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005573 reply.readException();
5574 Bundle res = reply.readBundle();
5575 data.recycle();
5576 reply.recycle();
5577 return res;
5578 }
5579
Dianne Hackborn17f69352015-07-17 18:04:14 -07005580 public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver,
5581 IBinder activityToken) throws RemoteException {
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005582 Parcel data = Parcel.obtain();
5583 Parcel reply = Parcel.obtain();
5584 data.writeInterfaceToken(IActivityManager.descriptor);
5585 data.writeInt(requestType);
5586 data.writeStrongBinder(receiver.asBinder());
Dianne Hackborn17f69352015-07-17 18:04:14 -07005587 data.writeStrongBinder(activityToken);
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005588 mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
5589 reply.readException();
Dianne Hackborn17f69352015-07-17 18:04:14 -07005590 boolean res = reply.readInt() != 0;
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005591 data.recycle();
5592 reply.recycle();
Dianne Hackborn17f69352015-07-17 18:04:14 -07005593 return res;
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005594 }
5595
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07005596 public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure,
Dianne Hackborna3acdb32015-06-08 17:07:40 -07005597 AssistContent content, Uri referrer) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005598 Parcel data = Parcel.obtain();
5599 Parcel reply = Parcel.obtain();
5600 data.writeInterfaceToken(IActivityManager.descriptor);
5601 data.writeStrongBinder(token);
5602 data.writeBundle(extras);
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07005603 structure.writeToParcel(data, 0);
5604 content.writeToParcel(data, 0);
Dianne Hackborna3acdb32015-06-08 17:07:40 -07005605 if (referrer != null) {
5606 data.writeInt(1);
5607 referrer.writeToParcel(data, 0);
5608 } else {
5609 data.writeInt(0);
5610 }
Adam Skorydfc7fd72013-08-05 19:23:41 -07005611 mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005612 reply.readException();
5613 data.recycle();
5614 reply.recycle();
5615 }
5616
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07005617 public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle,
5618 Bundle args) throws RemoteException {
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07005619 Parcel data = Parcel.obtain();
5620 Parcel reply = Parcel.obtain();
5621 data.writeInterfaceToken(IActivityManager.descriptor);
5622 intent.writeToParcel(data, 0);
5623 data.writeInt(requestType);
5624 data.writeString(hint);
5625 data.writeInt(userHandle);
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07005626 data.writeBundle(args);
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07005627 mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0);
5628 reply.readException();
5629 boolean res = reply.readInt() != 0;
5630 data.recycle();
5631 reply.recycle();
5632 return res;
5633 }
5634
Dianne Hackborn17f69352015-07-17 18:04:14 -07005635 public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException {
Benjamin Franzc200f442015-06-25 18:20:04 +01005636 Parcel data = Parcel.obtain();
5637 Parcel reply = Parcel.obtain();
5638 data.writeInterfaceToken(IActivityManager.descriptor);
5639 mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0);
5640 reply.readException();
5641 boolean res = reply.readInt() != 0;
5642 data.recycle();
5643 reply.recycle();
5644 return res;
5645 }
5646
Dianne Hackborn17f69352015-07-17 18:04:14 -07005647 public boolean showAssistFromActivity(IBinder token, Bundle args) throws RemoteException {
5648 Parcel data = Parcel.obtain();
5649 Parcel reply = Parcel.obtain();
5650 data.writeInterfaceToken(IActivityManager.descriptor);
5651 data.writeStrongBinder(token);
5652 data.writeBundle(args);
5653 mRemote.transact(SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION, data, reply, 0);
5654 reply.readException();
5655 boolean res = reply.readInt() != 0;
5656 data.recycle();
5657 reply.recycle();
5658 return res;
5659 }
5660
Svetoslavaa41add2015-08-06 15:03:55 -07005661 public void killUid(int appId, int userId, String reason) throws RemoteException {
Dianne Hackbornf1b78242013-04-08 22:28:59 -07005662 Parcel data = Parcel.obtain();
5663 Parcel reply = Parcel.obtain();
5664 data.writeInterfaceToken(IActivityManager.descriptor);
Svetoslavaa41add2015-08-06 15:03:55 -07005665 data.writeInt(appId);
5666 data.writeInt(userId);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07005667 data.writeString(reason);
5668 mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0);
5669 reply.readException();
5670 data.recycle();
5671 reply.recycle();
5672 }
5673
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07005674 public void hang(IBinder who, boolean allowRestart) throws RemoteException {
5675 Parcel data = Parcel.obtain();
5676 Parcel reply = Parcel.obtain();
5677 data.writeInterfaceToken(IActivityManager.descriptor);
5678 data.writeStrongBinder(who);
5679 data.writeInt(allowRestart ? 1 : 0);
5680 mRemote.transact(HANG_TRANSACTION, data, reply, 0);
5681 reply.readException();
5682 data.recycle();
5683 reply.recycle();
5684 }
5685
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07005686 public void reportActivityFullyDrawn(IBinder token) throws RemoteException {
5687 Parcel data = Parcel.obtain();
5688 Parcel reply = Parcel.obtain();
5689 data.writeInterfaceToken(IActivityManager.descriptor);
5690 data.writeStrongBinder(token);
5691 mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0);
5692 reply.readException();
5693 data.recycle();
5694 reply.recycle();
5695 }
5696
Craig Mautner5eda9b32013-07-02 11:58:16 -07005697 public void notifyActivityDrawn(IBinder token) throws RemoteException {
5698 Parcel data = Parcel.obtain();
5699 Parcel reply = Parcel.obtain();
5700 data.writeInterfaceToken(IActivityManager.descriptor);
5701 data.writeStrongBinder(token);
5702 mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
5703 reply.readException();
5704 data.recycle();
5705 reply.recycle();
5706 }
5707
Dianne Hackborn57a7f592013-07-22 18:21:32 -07005708 public void restart() throws RemoteException {
5709 Parcel data = Parcel.obtain();
5710 Parcel reply = Parcel.obtain();
5711 data.writeInterfaceToken(IActivityManager.descriptor);
5712 mRemote.transact(RESTART_TRANSACTION, data, reply, 0);
5713 reply.readException();
5714 data.recycle();
5715 reply.recycle();
5716 }
5717
Dianne Hackborn35f72be2013-09-16 10:57:39 -07005718 public void performIdleMaintenance() throws RemoteException {
5719 Parcel data = Parcel.obtain();
5720 Parcel reply = Parcel.obtain();
5721 data.writeInterfaceToken(IActivityManager.descriptor);
5722 mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0);
5723 reply.readException();
5724 data.recycle();
5725 reply.recycle();
5726 }
5727
Todd Kennedyca4d8422015-01-15 15:19:22 -08005728 public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken,
Craig Mautner4a1cb222013-12-04 16:14:06 -08005729 IActivityContainerCallback callback) throws RemoteException {
5730 Parcel data = Parcel.obtain();
5731 Parcel reply = Parcel.obtain();
5732 data.writeInterfaceToken(IActivityManager.descriptor);
5733 data.writeStrongBinder(parentActivityToken);
Craig Mautnere3a00d72014-04-16 08:31:19 -07005734 data.writeStrongBinder(callback == null ? null : callback.asBinder());
Todd Kennedyca4d8422015-01-15 15:19:22 -08005735 mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
Craig Mautner4a1cb222013-12-04 16:14:06 -08005736 reply.readException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08005737 final int result = reply.readInt();
5738 final IActivityContainer res;
5739 if (result == 1) {
5740 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5741 } else {
5742 res = null;
5743 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08005744 data.recycle();
5745 reply.recycle();
5746 return res;
5747 }
5748
Craig Mautner95da1082014-02-24 17:54:35 -08005749 public void deleteActivityContainer(IActivityContainer activityContainer)
5750 throws RemoteException {
5751 Parcel data = Parcel.obtain();
5752 Parcel reply = Parcel.obtain();
5753 data.writeInterfaceToken(IActivityManager.descriptor);
5754 data.writeStrongBinder(activityContainer.asBinder());
5755 mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
5756 reply.readException();
5757 data.recycle();
5758 reply.recycle();
5759 }
5760
Rahul Chaturvedi52613f92015-06-17 23:54:08 -04005761 public boolean startBinderTracking() throws RemoteException {
5762 Parcel data = Parcel.obtain();
5763 Parcel reply = Parcel.obtain();
5764 data.writeInterfaceToken(IActivityManager.descriptor);
5765 mRemote.transact(START_BINDER_TRACKING_TRANSACTION, data, reply, 0);
5766 reply.readException();
5767 boolean res = reply.readInt() != 0;
5768 reply.recycle();
5769 data.recycle();
5770 return res;
5771 }
5772
5773 public boolean stopBinderTrackingAndDump(ParcelFileDescriptor fd) throws RemoteException {
5774 Parcel data = Parcel.obtain();
5775 Parcel reply = Parcel.obtain();
5776 data.writeInterfaceToken(IActivityManager.descriptor);
5777 if (fd != null) {
5778 data.writeInt(1);
5779 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
5780 } else {
5781 data.writeInt(0);
5782 }
5783 mRemote.transact(STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION, data, reply, 0);
5784 reply.readException();
5785 boolean res = reply.readInt() != 0;
5786 reply.recycle();
5787 data.recycle();
5788 return res;
5789 }
5790
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005791 @Override
Todd Kennedy4900bf92015-01-16 16:05:14 -08005792 public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException {
5793 Parcel data = Parcel.obtain();
5794 Parcel reply = Parcel.obtain();
5795 data.writeInterfaceToken(IActivityManager.descriptor);
5796 data.writeInt(displayId);
5797 mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0);
5798 reply.readException();
5799 final int result = reply.readInt();
5800 final IActivityContainer res;
5801 if (result == 1) {
5802 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5803 } else {
5804 res = null;
5805 }
5806 data.recycle();
5807 reply.recycle();
5808 return res;
5809 }
5810
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005811 @Override
5812 public int getActivityDisplayId(IBinder activityToken)
Craig Mautnere0a38842013-12-16 16:14:02 -08005813 throws RemoteException {
5814 Parcel data = Parcel.obtain();
5815 Parcel reply = Parcel.obtain();
5816 data.writeInterfaceToken(IActivityManager.descriptor);
5817 data.writeStrongBinder(activityToken);
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005818 mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0);
Craig Mautnere0a38842013-12-16 16:14:02 -08005819 reply.readException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005820 final int displayId = reply.readInt();
Craig Mautnere0a38842013-12-16 16:14:02 -08005821 data.recycle();
5822 reply.recycle();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005823 return displayId;
Craig Mautnere0a38842013-12-16 16:14:02 -08005824 }
5825
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005826 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005827 public void startLockTaskMode(int taskId) throws RemoteException {
5828 Parcel data = Parcel.obtain();
5829 Parcel reply = Parcel.obtain();
5830 data.writeInterfaceToken(IActivityManager.descriptor);
5831 data.writeInt(taskId);
5832 mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0);
5833 reply.readException();
5834 data.recycle();
5835 reply.recycle();
5836 }
5837
5838 @Override
5839 public void startLockTaskMode(IBinder token) throws RemoteException {
5840 Parcel data = Parcel.obtain();
5841 Parcel reply = Parcel.obtain();
5842 data.writeInterfaceToken(IActivityManager.descriptor);
5843 data.writeStrongBinder(token);
5844 mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0);
5845 reply.readException();
5846 data.recycle();
5847 reply.recycle();
5848 }
5849
5850 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005851 public void startLockTaskModeOnCurrent() throws RemoteException {
5852 Parcel data = Parcel.obtain();
5853 Parcel reply = Parcel.obtain();
5854 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005855 mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005856 reply.readException();
5857 data.recycle();
5858 reply.recycle();
5859 }
5860
5861 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005862 public void stopLockTaskMode() throws RemoteException {
5863 Parcel data = Parcel.obtain();
5864 Parcel reply = Parcel.obtain();
5865 data.writeInterfaceToken(IActivityManager.descriptor);
5866 mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5867 reply.readException();
5868 data.recycle();
5869 reply.recycle();
5870 }
5871
5872 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005873 public void stopLockTaskModeOnCurrent() throws RemoteException {
5874 Parcel data = Parcel.obtain();
5875 Parcel reply = Parcel.obtain();
5876 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005877 mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005878 reply.readException();
5879 data.recycle();
5880 reply.recycle();
5881 }
5882
5883 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005884 public boolean isInLockTaskMode() throws RemoteException {
5885 Parcel data = Parcel.obtain();
5886 Parcel reply = Parcel.obtain();
5887 data.writeInterfaceToken(IActivityManager.descriptor);
5888 mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5889 reply.readException();
5890 boolean isInLockTaskMode = reply.readInt() == 1;
5891 data.recycle();
5892 reply.recycle();
5893 return isInLockTaskMode;
5894 }
5895
Craig Mautner688b5102014-03-27 16:55:03 -07005896 @Override
Benjamin Franz43261142015-02-11 15:59:44 +00005897 public int getLockTaskModeState() throws RemoteException {
5898 Parcel data = Parcel.obtain();
5899 Parcel reply = Parcel.obtain();
5900 data.writeInterfaceToken(IActivityManager.descriptor);
5901 mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0);
5902 reply.readException();
5903 int lockTaskModeState = reply.readInt();
5904 data.recycle();
5905 reply.recycle();
5906 return lockTaskModeState;
5907 }
5908
5909 @Override
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07005910 public void showLockTaskEscapeMessage(IBinder token) throws RemoteException {
5911 Parcel data = Parcel.obtain();
5912 Parcel reply = Parcel.obtain();
5913 data.writeInterfaceToken(IActivityManager.descriptor);
5914 data.writeStrongBinder(token);
5915 mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply,
5916 IBinder.FLAG_ONEWAY);
5917 reply.readException();
5918 data.recycle();
5919 reply.recycle();
5920 }
5921
5922 @Override
Winson Chunga449dc02014-05-16 11:15:04 -07005923 public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values)
Winson Chung03a9bae2014-05-02 09:56:12 -07005924 throws RemoteException {
Craig Mautner2fbd7542014-03-21 09:34:07 -07005925 Parcel data = Parcel.obtain();
5926 Parcel reply = Parcel.obtain();
5927 data.writeInterfaceToken(IActivityManager.descriptor);
5928 data.writeStrongBinder(token);
Winson Chung03a9bae2014-05-02 09:56:12 -07005929 values.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005930 mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0);
Craig Mautner2fbd7542014-03-21 09:34:07 -07005931 reply.readException();
5932 data.recycle();
5933 reply.recycle();
5934 }
5935
Craig Mautneree2e45a2014-06-27 12:10:03 -07005936 @Override
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08005937 public void setTaskResizeable(int taskId, boolean resizeable) throws RemoteException {
5938 Parcel data = Parcel.obtain();
5939 Parcel reply = Parcel.obtain();
5940 data.writeInterfaceToken(IActivityManager.descriptor);
5941 data.writeInt(taskId);
5942 data.writeInt(resizeable ? 1 : 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005943 mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0);
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08005944 reply.readException();
5945 data.recycle();
5946 reply.recycle();
5947 }
5948
5949 @Override
Chong Zhang87b21722015-09-21 15:39:51 -07005950 public void resizeTask(int taskId, Rect r, int resizeMode) throws RemoteException
Wale Ogunwale53a29a92015-02-23 15:42:52 -08005951 {
5952 Parcel data = Parcel.obtain();
5953 Parcel reply = Parcel.obtain();
5954 data.writeInterfaceToken(IActivityManager.descriptor);
5955 data.writeInt(taskId);
Chong Zhang87b21722015-09-21 15:39:51 -07005956 data.writeInt(resizeMode);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08005957 r.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005958 mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08005959 reply.readException();
5960 data.recycle();
5961 reply.recycle();
5962 }
5963
5964 @Override
Wale Ogunwalee4a0c572015-06-30 08:40:31 -07005965 public Rect getTaskBounds(int taskId) throws RemoteException
5966 {
5967 Parcel data = Parcel.obtain();
5968 Parcel reply = Parcel.obtain();
5969 data.writeInterfaceToken(IActivityManager.descriptor);
5970 data.writeInt(taskId);
5971 mRemote.transact(GET_TASK_BOUNDS_TRANSACTION, data, reply, 0);
5972 reply.readException();
5973 Rect rect = Rect.CREATOR.createFromParcel(reply);
5974 data.recycle();
5975 reply.recycle();
5976 return rect;
5977 }
5978
5979 @Override
Craig Mautner648f69b2014-09-18 14:16:26 -07005980 public Bitmap getTaskDescriptionIcon(String filename) throws RemoteException {
5981 Parcel data = Parcel.obtain();
5982 Parcel reply = Parcel.obtain();
5983 data.writeInterfaceToken(IActivityManager.descriptor);
5984 data.writeString(filename);
5985 mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0);
5986 reply.readException();
5987 final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply);
5988 data.recycle();
5989 reply.recycle();
5990 return icon;
5991 }
5992
5993 @Override
Winson Chung044d5292014-11-06 11:05:19 -08005994 public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options)
5995 throws RemoteException {
5996 Parcel data = Parcel.obtain();
5997 Parcel reply = Parcel.obtain();
5998 data.writeInterfaceToken(IActivityManager.descriptor);
5999 if (options == null) {
6000 data.writeInt(0);
6001 } else {
6002 data.writeInt(1);
6003 data.writeBundle(options.toBundle());
6004 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07006005 mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0);
Winson Chung044d5292014-11-06 11:05:19 -08006006 reply.readException();
6007 data.recycle();
6008 reply.recycle();
6009 }
6010
6011 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07006012 public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07006013 Parcel data = Parcel.obtain();
6014 Parcel reply = Parcel.obtain();
6015 data.writeInterfaceToken(IActivityManager.descriptor);
6016 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07006017 data.writeInt(visible ? 1 : 0);
6018 mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07006019 reply.readException();
6020 boolean success = reply.readInt() > 0;
6021 data.recycle();
6022 reply.recycle();
6023 return success;
6024 }
6025
6026 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07006027 public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07006028 Parcel data = Parcel.obtain();
6029 Parcel reply = Parcel.obtain();
6030 data.writeInterfaceToken(IActivityManager.descriptor);
6031 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07006032 mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07006033 reply.readException();
Jose Lima4b6c6692014-08-12 17:41:12 -07006034 final boolean visible = reply.readInt() > 0;
Craig Mautneree2e45a2014-06-27 12:10:03 -07006035 data.recycle();
6036 reply.recycle();
Jose Lima4b6c6692014-08-12 17:41:12 -07006037 return visible;
Craig Mautneree2e45a2014-06-27 12:10:03 -07006038 }
6039
6040 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07006041 public void backgroundResourcesReleased(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07006042 Parcel data = Parcel.obtain();
6043 Parcel reply = Parcel.obtain();
6044 data.writeInterfaceToken(IActivityManager.descriptor);
6045 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006046 mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0);
Craig Mautnerbb742462014-07-07 15:28:55 -07006047 reply.readException();
6048 data.recycle();
6049 reply.recycle();
6050 }
6051
6052 @Override
6053 public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException {
6054 Parcel data = Parcel.obtain();
6055 Parcel reply = Parcel.obtain();
6056 data.writeInterfaceToken(IActivityManager.descriptor);
6057 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006058 mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07006059 reply.readException();
6060 data.recycle();
6061 reply.recycle();
6062 }
6063
Craig Mautner8746a472014-07-24 15:12:54 -07006064 @Override
6065 public void notifyEnterAnimationComplete(IBinder token) throws RemoteException {
6066 Parcel data = Parcel.obtain();
6067 Parcel reply = Parcel.obtain();
6068 data.writeInterfaceToken(IActivityManager.descriptor);
6069 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006070 mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautner8746a472014-07-24 15:12:54 -07006071 reply.readException();
6072 data.recycle();
6073 reply.recycle();
6074 }
6075
Craig Mautner6e2f3952014-09-09 14:26:41 -07006076 @Override
6077 public void bootAnimationComplete() throws RemoteException {
6078 Parcel data = Parcel.obtain();
6079 Parcel reply = Parcel.obtain();
6080 data.writeInterfaceToken(IActivityManager.descriptor);
6081 mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
6082 reply.readException();
6083 data.recycle();
6084 reply.recycle();
6085 }
6086
Wale Ogunwale18795a22014-12-03 11:38:33 -08006087 @Override
Jeff Sharkey605eb792014-11-04 13:34:06 -08006088 public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException {
6089 Parcel data = Parcel.obtain();
6090 Parcel reply = Parcel.obtain();
6091 data.writeInterfaceToken(IActivityManager.descriptor);
6092 data.writeInt(uid);
6093 data.writeByteArray(firstPacket);
6094 mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0);
6095 reply.readException();
6096 data.recycle();
6097 reply.recycle();
6098 }
6099
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08006100 @Override
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07006101 public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize,
6102 String reportPackage) throws RemoteException {
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08006103 Parcel data = Parcel.obtain();
6104 Parcel reply = Parcel.obtain();
6105 data.writeInterfaceToken(IActivityManager.descriptor);
6106 data.writeString(processName);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07006107 data.writeInt(uid);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08006108 data.writeLong(maxMemSize);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07006109 data.writeString(reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08006110 mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0);
6111 reply.readException();
6112 data.recycle();
6113 reply.recycle();
6114 }
6115
6116 @Override
6117 public void dumpHeapFinished(String path) throws RemoteException {
6118 Parcel data = Parcel.obtain();
6119 Parcel reply = Parcel.obtain();
6120 data.writeInterfaceToken(IActivityManager.descriptor);
6121 data.writeString(path);
6122 mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0);
6123 reply.readException();
6124 data.recycle();
6125 reply.recycle();
6126 }
6127
Dianne Hackborn3d07c942015-03-13 18:02:54 -07006128 @Override
6129 public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake)
6130 throws RemoteException {
6131 Parcel data = Parcel.obtain();
6132 Parcel reply = Parcel.obtain();
6133 data.writeInterfaceToken(IActivityManager.descriptor);
6134 data.writeStrongBinder(session.asBinder());
6135 data.writeInt(keepAwake ? 1 : 0);
6136 mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0);
6137 reply.readException();
6138 data.recycle();
6139 reply.recycle();
6140 }
6141
Craig Mautnere5600772015-04-03 21:36:37 -07006142 @Override
6143 public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException {
6144 Parcel data = Parcel.obtain();
6145 Parcel reply = Parcel.obtain();
6146 data.writeInterfaceToken(IActivityManager.descriptor);
6147 data.writeInt(userId);
6148 data.writeStringArray(packages);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006149 mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0);
Craig Mautnere5600772015-04-03 21:36:37 -07006150 reply.readException();
6151 data.recycle();
6152 reply.recycle();
6153 }
6154
Dianne Hackborn1e383822015-04-10 14:02:33 -07006155 @Override
Craig Mautner015c5e52015-04-23 10:39:39 -07006156 public void updateDeviceOwner(String packageName) throws RemoteException {
6157 Parcel data = Parcel.obtain();
6158 Parcel reply = Parcel.obtain();
6159 data.writeInterfaceToken(IActivityManager.descriptor);
6160 data.writeString(packageName);
6161 mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0);
6162 reply.readException();
6163 data.recycle();
6164 reply.recycle();
6165 }
6166
6167 @Override
Adam Lesinskic30454c2015-06-24 13:24:35 -07006168 public int getPackageProcessState(String packageName, String callingPackage)
6169 throws RemoteException {
Dianne Hackborn1e383822015-04-10 14:02:33 -07006170 Parcel data = Parcel.obtain();
6171 Parcel reply = Parcel.obtain();
6172 data.writeInterfaceToken(IActivityManager.descriptor);
6173 data.writeString(packageName);
Adam Lesinskic30454c2015-06-24 13:24:35 -07006174 data.writeString(callingPackage);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006175 mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0);
6176 reply.readException();
6177 int res = reply.readInt();
6178 data.recycle();
6179 reply.recycle();
6180 return res;
6181 }
6182
Stefan Kuhne16045c22015-06-05 07:18:06 -07006183 @Override
6184 public boolean setProcessMemoryTrimLevel(String process, int userId, int level)
6185 throws RemoteException {
6186 Parcel data = Parcel.obtain();
6187 Parcel reply = Parcel.obtain();
6188 data.writeInterfaceToken(IActivityManager.descriptor);
6189 data.writeString(process);
6190 data.writeInt(userId);
6191 data.writeInt(level);
6192 mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0);
6193 reply.readException();
6194 int res = reply.readInt();
6195 data.recycle();
6196 reply.recycle();
6197 return res != 0;
6198 }
6199
Dianne Hackbornfb81d092015-08-03 17:14:46 -07006200 @Override
6201 public boolean isRootVoiceInteraction(IBinder token) throws RemoteException {
6202 Parcel data = Parcel.obtain();
6203 Parcel reply = Parcel.obtain();
6204 data.writeInterfaceToken(IActivityManager.descriptor);
6205 data.writeStrongBinder(token);
6206 mRemote.transact(IS_ROOT_VOICE_INTERACTION_TRANSACTION, data, reply, 0);
6207 reply.readException();
6208 int res = reply.readInt();
6209 data.recycle();
6210 reply.recycle();
6211 return res != 0;
6212 }
6213
Wale Ogunwale868a5e12015-08-02 16:19:20 -07006214 @Override
6215 public void moveActivityToStack(IBinder token, int stackId) throws RemoteException {
6216 Parcel data = Parcel.obtain();
6217 Parcel reply = Parcel.obtain();
6218 data.writeInterfaceToken(IActivityManager.descriptor);
6219 data.writeStrongBinder(token);
6220 data.writeInt(stackId);
6221 mRemote.transact(MOVE_ACTIVITY_TO_STACK_TRANSACTION, data, reply, 0);
6222 reply.readException();
6223 data.recycle();
6224 reply.recycle();
6225 }
6226
6227 @Override
6228 public int getActivityStackId(IBinder token) throws RemoteException {
6229 Parcel data = Parcel.obtain();
6230 Parcel reply = Parcel.obtain();
6231 data.writeInterfaceToken(IActivityManager.descriptor);
6232 data.writeStrongBinder(token);
6233 mRemote.transact(GET_ACTIVITY_STACK_ID_TRANSACTION, data, reply, 0);
6234 reply.readException();
6235 int stackId = reply.readInt();
6236 data.recycle();
6237 reply.recycle();
6238 return stackId;
6239 }
6240
Filip Gruszczynski23493322015-07-29 17:02:59 -07006241 @Override
6242 public void reportSizeConfigurations(IBinder token, int[] horizontalSizeConfiguration,
6243 int[] verticalSizeConfigurations) throws RemoteException {
6244 Parcel data = Parcel.obtain();
6245 Parcel reply = Parcel.obtain();
6246 data.writeInterfaceToken(IActivityManager.descriptor);
6247 data.writeStrongBinder(token);
6248 if (horizontalSizeConfiguration == null) {
6249 data.writeInt(0);
6250 } else {
6251 data.writeInt(horizontalSizeConfiguration.length);
6252 data.writeIntArray(horizontalSizeConfiguration);
6253 }
6254 if (verticalSizeConfigurations == null) {
6255 data.writeInt(0);
6256 } else {
6257 data.writeInt(verticalSizeConfigurations.length);
6258 data.writeIntArray(verticalSizeConfigurations);
6259 }
6260 mRemote.transact(REPORT_SIZE_CONFIGURATIONS, data, reply, 0);
6261 reply.readException();
6262 data.recycle();
6263 reply.recycle();
6264 }
6265
Wale Ogunwale83301a92015-09-24 15:54:08 -07006266 @Override
6267 public void suppressResizeConfigChanges(boolean suppress) throws RemoteException {
6268 Parcel data = Parcel.obtain();
6269 Parcel reply = Parcel.obtain();
6270 data.writeInterfaceToken(IActivityManager.descriptor);
6271 data.writeInt(suppress ? 1 : 0);
6272 mRemote.transact(SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION, data, reply, 0);
6273 reply.readException();
6274 data.recycle();
6275 reply.recycle();
6276 }
6277
Filip Gruszczynski57b6cce2015-10-06 09:50:51 -07006278 @Override
6279 public void removeStack(int stackId) throws RemoteException {
6280 Parcel data = Parcel.obtain();
6281 Parcel reply = Parcel.obtain();
6282 data.writeInterfaceToken(IActivityManager.descriptor);
6283 data.writeInt(stackId);
6284 mRemote.transact(REMOVE_STACK, data, reply, 0);
6285 reply.readException();
6286 data.recycle();
6287 reply.recycle();
6288 }
6289
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006290 private IBinder mRemote;
6291}