blob: 2bb4e760f7d42eadda21ad7eaf8b3c6962348134 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.app;
18
Craig Mautnerbdc748af2013-12-02 14:08:25 -080019import android.app.ActivityManager.StackInfo;
Dianne Hackborn69c6adc2015-06-02 10:52:59 -070020import android.app.assist.AssistContent;
21import android.app.assist.AssistStructure;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080022import android.content.ComponentName;
Adam Powelldd8fab22012-03-22 17:47:27 -070023import android.content.IIntentReceiver;
24import android.content.IIntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080025import android.content.Intent;
26import android.content.IntentFilter;
Dianne Hackbornfa82f222009-09-17 15:14:12 -070027import android.content.IntentSender;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070028import android.content.UriPermission;
Christopher Tate181fafa2009-05-14 11:12:14 -070029import android.content.pm.ApplicationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080030import android.content.pm.ConfigurationInfo;
31import android.content.pm.IPackageDataObserver;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070032import android.content.pm.ParceledListSlice;
Amith Yamasani52f1d752012-03-28 18:19:29 -070033import android.content.pm.UserInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080034import android.content.res.Configuration;
Dianne Hackbornaec68bb2014-08-20 15:25:13 -070035import android.graphics.Bitmap;
36import android.graphics.Point;
Craig Mautnerbdc748af2013-12-02 14:08:25 -080037import android.graphics.Rect;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080038import android.net.Uri;
39import android.os.Binder;
40import android.os.Bundle;
Dianne Hackborn3025ef32009-08-31 21:31:47 -070041import android.os.Debug;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080042import android.os.IBinder;
43import android.os.Parcel;
Adam Powelldd8fab22012-03-22 17:47:27 -070044import android.os.ParcelFileDescriptor;
45import android.os.Parcelable;
Craig Mautnera0026042014-04-23 11:45:37 -070046import android.os.PersistableBundle;
Adam Powelldd8fab22012-03-22 17:47:27 -070047import android.os.RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080048import android.os.ServiceManager;
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -070049import android.os.StrictMode;
Dianne Hackborn91097de2014-04-04 18:02:06 -070050import android.service.voice.IVoiceInteractionSession;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080051import android.text.TextUtils;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080052import android.util.Log;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080053import android.util.Singleton;
Dianne Hackborn91097de2014-04-04 18:02:06 -070054import com.android.internal.app.IVoiceInteractor;
Dianne Hackbornae6688b2015-02-11 17:02:41 -080055import com.android.internal.os.IResultReceiver;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080057import java.util.ArrayList;
58import java.util.List;
59
60/** {@hide} */
61public abstract class ActivityManagerNative extends Binder implements IActivityManager
62{
63 /**
64 * Cast a Binder object into an activity manager interface, generating
65 * a proxy if needed.
66 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080067 static public IActivityManager asInterface(IBinder obj) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080068 if (obj == null) {
69 return null;
70 }
71 IActivityManager in =
72 (IActivityManager)obj.queryLocalInterface(descriptor);
73 if (in != null) {
74 return in;
75 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080076
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080077 return new ActivityManagerProxy(obj);
78 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080079
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080080 /**
81 * Retrieve the system's default/global activity manager.
82 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080083 static public IActivityManager getDefault() {
84 return gDefault.get();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080085 }
86
87 /**
88 * Convenience for checking whether the system is ready. For internal use only.
89 */
90 static public boolean isSystemReady() {
91 if (!sSystemReady) {
92 sSystemReady = getDefault().testIsSystemReady();
93 }
94 return sSystemReady;
95 }
96 static boolean sSystemReady = false;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080097
Svet Ganov16a16892015-04-16 10:32:04 -070098 static public void broadcastStickyIntent(Intent intent, String permission, int userId) {
99 broadcastStickyIntent(intent, permission, AppOpsManager.OP_NONE, userId);
100 }
101
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800102 /**
103 * Convenience for sending a sticky broadcast. For internal use only.
104 * If you don't care about permission, use null.
105 */
Svet Ganov16a16892015-04-16 10:32:04 -0700106 static public void broadcastStickyIntent(Intent intent, String permission, int appOp,
107 int userId) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800108 try {
109 getDefault().broadcastIntent(
110 null, intent, null, null, Activity.RESULT_OK, null, null,
Dianne Hackborna750a632015-06-16 17:18:23 -0700111 null /*permission*/, appOp, null, false, true, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800112 } catch (RemoteException ex) {
113 }
114 }
115
Dianne Hackborn1e383822015-04-10 14:02:33 -0700116 static public void noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg,
117 String tag) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800118 try {
Dianne Hackborn1e383822015-04-10 14:02:33 -0700119 getDefault().noteWakeupAlarm(ps.getTarget(), sourceUid, sourcePkg, tag);
120 } catch (RemoteException ex) {
121 }
122 }
123
124 static public void noteAlarmStart(PendingIntent ps, int sourceUid, String tag) {
125 try {
126 getDefault().noteAlarmStart(ps.getTarget(), sourceUid, tag);
127 } catch (RemoteException ex) {
128 }
129 }
130
131 static public void noteAlarmFinish(PendingIntent ps, int sourceUid, String tag) {
132 try {
133 getDefault().noteAlarmFinish(ps.getTarget(), sourceUid, tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800134 } catch (RemoteException ex) {
135 }
136 }
137
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -0800138 public ActivityManagerNative() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800139 attachInterface(this, descriptor);
140 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700141
142 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800143 public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
144 throws RemoteException {
145 switch (code) {
146 case START_ACTIVITY_TRANSACTION:
147 {
148 data.enforceInterface(IActivityManager.descriptor);
149 IBinder b = data.readStrongBinder();
150 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800151 String callingPackage = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800152 Intent intent = Intent.CREATOR.createFromParcel(data);
153 String resolvedType = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800154 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800155 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800156 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700157 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700158 ProfilerInfo profilerInfo = data.readInt() != 0
159 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700160 Bundle options = data.readInt() != 0
161 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800162 int result = startActivity(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700163 resultTo, resultWho, requestCode, startFlags, profilerInfo, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800164 reply.writeNoException();
165 reply.writeInt(result);
166 return true;
167 }
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700168
Amith Yamasani82644082012-08-03 13:09:11 -0700169 case START_ACTIVITY_AS_USER_TRANSACTION:
170 {
171 data.enforceInterface(IActivityManager.descriptor);
172 IBinder b = data.readStrongBinder();
173 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800174 String callingPackage = data.readString();
Amith Yamasani82644082012-08-03 13:09:11 -0700175 Intent intent = Intent.CREATOR.createFromParcel(data);
176 String resolvedType = data.readString();
177 IBinder resultTo = data.readStrongBinder();
178 String resultWho = data.readString();
179 int requestCode = data.readInt();
180 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700181 ProfilerInfo profilerInfo = data.readInt() != 0
182 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Amith Yamasani82644082012-08-03 13:09:11 -0700183 Bundle options = data.readInt() != 0
184 ? Bundle.CREATOR.createFromParcel(data) : null;
185 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800186 int result = startActivityAsUser(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700187 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Amith Yamasani82644082012-08-03 13:09:11 -0700188 reply.writeNoException();
189 reply.writeInt(result);
190 return true;
191 }
192
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700193 case START_ACTIVITY_AS_CALLER_TRANSACTION:
194 {
195 data.enforceInterface(IActivityManager.descriptor);
196 IBinder b = data.readStrongBinder();
197 IApplicationThread app = ApplicationThreadNative.asInterface(b);
198 String callingPackage = data.readString();
199 Intent intent = Intent.CREATOR.createFromParcel(data);
200 String resolvedType = data.readString();
201 IBinder resultTo = data.readStrongBinder();
202 String resultWho = data.readString();
203 int requestCode = data.readInt();
204 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700205 ProfilerInfo profilerInfo = data.readInt() != 0
206 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700207 Bundle options = data.readInt() != 0
208 ? Bundle.CREATOR.createFromParcel(data) : null;
Jeff Sharkey97978802014-10-14 10:48:18 -0700209 int userId = data.readInt();
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700210 int result = startActivityAsCaller(app, callingPackage, intent, resolvedType,
Jeff Sharkey97978802014-10-14 10:48:18 -0700211 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700212 reply.writeNoException();
213 reply.writeInt(result);
214 return true;
215 }
216
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800217 case START_ACTIVITY_AND_WAIT_TRANSACTION:
218 {
219 data.enforceInterface(IActivityManager.descriptor);
220 IBinder b = data.readStrongBinder();
221 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800222 String callingPackage = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800223 Intent intent = Intent.CREATOR.createFromParcel(data);
224 String resolvedType = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800225 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800226 String resultWho = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800227 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700228 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700229 ProfilerInfo profilerInfo = data.readInt() != 0
230 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700231 Bundle options = data.readInt() != 0
232 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -0700233 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800234 WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700235 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800236 reply.writeNoException();
237 result.writeToParcel(reply, 0);
238 return true;
239 }
240
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700241 case START_ACTIVITY_WITH_CONFIG_TRANSACTION:
242 {
243 data.enforceInterface(IActivityManager.descriptor);
244 IBinder b = data.readStrongBinder();
245 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800246 String callingPackage = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700247 Intent intent = Intent.CREATOR.createFromParcel(data);
248 String resolvedType = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700249 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700250 String resultWho = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700251 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700252 int startFlags = data.readInt();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700253 Configuration config = Configuration.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700254 Bundle options = data.readInt() != 0
255 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -0700256 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800257 int result = startActivityWithConfig(app, callingPackage, intent, resolvedType,
Dianne Hackborn41203752012-08-31 14:05:51 -0700258 resultTo, resultWho, requestCode, startFlags, config, options, userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700259 reply.writeNoException();
260 reply.writeInt(result);
261 return true;
262 }
263
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700264 case START_ACTIVITY_INTENT_SENDER_TRANSACTION:
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700265 {
266 data.enforceInterface(IActivityManager.descriptor);
267 IBinder b = data.readStrongBinder();
268 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700269 IntentSender intent = IntentSender.CREATOR.createFromParcel(data);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700270 Intent fillInIntent = null;
271 if (data.readInt() != 0) {
272 fillInIntent = Intent.CREATOR.createFromParcel(data);
273 }
274 String resolvedType = data.readString();
275 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700276 String resultWho = data.readString();
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700277 int requestCode = data.readInt();
278 int flagsMask = data.readInt();
279 int flagsValues = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700280 Bundle options = data.readInt() != 0
281 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700282 int result = startActivityIntentSender(app, intent,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700283 fillInIntent, resolvedType, resultTo, resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700284 requestCode, flagsMask, flagsValues, options);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700285 reply.writeNoException();
286 reply.writeInt(result);
287 return true;
288 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700289
Dianne Hackborn91097de2014-04-04 18:02:06 -0700290 case START_VOICE_ACTIVITY_TRANSACTION:
291 {
292 data.enforceInterface(IActivityManager.descriptor);
293 String callingPackage = data.readString();
294 int callingPid = data.readInt();
295 int callingUid = data.readInt();
296 Intent intent = Intent.CREATOR.createFromParcel(data);
297 String resolvedType = data.readString();
298 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
299 data.readStrongBinder());
300 IVoiceInteractor interactor = IVoiceInteractor.Stub.asInterface(
301 data.readStrongBinder());
302 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700303 ProfilerInfo profilerInfo = data.readInt() != 0
304 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborn91097de2014-04-04 18:02:06 -0700305 Bundle options = data.readInt() != 0
306 ? Bundle.CREATOR.createFromParcel(data) : null;
307 int userId = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700308 int result = startVoiceActivity(callingPackage, callingPid, callingUid, intent,
309 resolvedType, session, interactor, startFlags, profilerInfo, options, userId);
Dianne Hackborn91097de2014-04-04 18:02:06 -0700310 reply.writeNoException();
311 reply.writeInt(result);
312 return true;
313 }
314
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800315 case START_NEXT_MATCHING_ACTIVITY_TRANSACTION:
316 {
317 data.enforceInterface(IActivityManager.descriptor);
318 IBinder callingActivity = data.readStrongBinder();
319 Intent intent = Intent.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700320 Bundle options = data.readInt() != 0
321 ? Bundle.CREATOR.createFromParcel(data) : null;
322 boolean result = startNextMatchingActivity(callingActivity, intent, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800323 reply.writeNoException();
324 reply.writeInt(result ? 1 : 0);
325 return true;
326 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700327
Craig Mautnerdc00cbe2014-07-20 17:48:47 -0700328 case START_ACTIVITY_FROM_RECENTS_TRANSACTION:
329 {
330 data.enforceInterface(IActivityManager.descriptor);
331 int taskId = data.readInt();
332 Bundle options = data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data);
333 int result = startActivityFromRecents(taskId, options);
334 reply.writeNoException();
335 reply.writeInt(result);
336 return true;
337 }
338
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800339 case FINISH_ACTIVITY_TRANSACTION: {
340 data.enforceInterface(IActivityManager.descriptor);
341 IBinder token = data.readStrongBinder();
342 Intent resultData = null;
343 int resultCode = data.readInt();
344 if (data.readInt() != 0) {
345 resultData = Intent.CREATOR.createFromParcel(data);
346 }
Winson Chung3b3f4642014-04-22 10:08:18 -0700347 boolean finishTask = (data.readInt() != 0);
348 boolean res = finishActivity(token, resultCode, resultData, finishTask);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800349 reply.writeNoException();
350 reply.writeInt(res ? 1 : 0);
351 return true;
352 }
353
354 case FINISH_SUB_ACTIVITY_TRANSACTION: {
355 data.enforceInterface(IActivityManager.descriptor);
356 IBinder token = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700357 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800358 int requestCode = data.readInt();
359 finishSubActivity(token, resultWho, requestCode);
360 reply.writeNoException();
361 return true;
362 }
363
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700364 case FINISH_ACTIVITY_AFFINITY_TRANSACTION: {
365 data.enforceInterface(IActivityManager.descriptor);
366 IBinder token = data.readStrongBinder();
367 boolean res = finishActivityAffinity(token);
368 reply.writeNoException();
369 reply.writeInt(res ? 1 : 0);
370 return true;
371 }
372
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -0700373 case FINISH_VOICE_TASK_TRANSACTION: {
374 data.enforceInterface(IActivityManager.descriptor);
375 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
376 data.readStrongBinder());
377 finishVoiceTask(session);
378 reply.writeNoException();
379 return true;
380 }
381
Dianne Hackborn89ad4562014-08-24 16:45:38 -0700382 case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: {
383 data.enforceInterface(IActivityManager.descriptor);
384 IBinder token = data.readStrongBinder();
385 boolean res = releaseActivityInstance(token);
386 reply.writeNoException();
387 reply.writeInt(res ? 1 : 0);
388 return true;
389 }
390
391 case RELEASE_SOME_ACTIVITIES_TRANSACTION: {
392 data.enforceInterface(IActivityManager.descriptor);
393 IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder());
394 releaseSomeActivities(app);
395 reply.writeNoException();
396 return true;
397 }
398
Dianne Hackborn061d58a2010-03-12 15:07:06 -0800399 case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: {
400 data.enforceInterface(IActivityManager.descriptor);
401 IBinder token = data.readStrongBinder();
402 boolean res = willActivityBeVisible(token);
403 reply.writeNoException();
404 reply.writeInt(res ? 1 : 0);
405 return true;
406 }
407
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800408 case REGISTER_RECEIVER_TRANSACTION:
409 {
410 data.enforceInterface(IActivityManager.descriptor);
411 IBinder b = data.readStrongBinder();
412 IApplicationThread app =
413 b != null ? ApplicationThreadNative.asInterface(b) : null;
Dianne Hackborn6c418d52011-06-29 14:05:33 -0700414 String packageName = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800415 b = data.readStrongBinder();
416 IIntentReceiver rec
417 = b != null ? IIntentReceiver.Stub.asInterface(b) : null;
418 IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data);
419 String perm = data.readString();
Dianne Hackborn20e80982012-08-31 19:00:44 -0700420 int userId = data.readInt();
421 Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800422 reply.writeNoException();
423 if (intent != null) {
424 reply.writeInt(1);
425 intent.writeToParcel(reply, 0);
426 } else {
427 reply.writeInt(0);
428 }
429 return true;
430 }
431
432 case UNREGISTER_RECEIVER_TRANSACTION:
433 {
434 data.enforceInterface(IActivityManager.descriptor);
435 IBinder b = data.readStrongBinder();
436 if (b == null) {
437 return true;
438 }
439 IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b);
440 unregisterReceiver(rec);
441 reply.writeNoException();
442 return true;
443 }
444
445 case BROADCAST_INTENT_TRANSACTION:
446 {
447 data.enforceInterface(IActivityManager.descriptor);
448 IBinder b = data.readStrongBinder();
449 IApplicationThread app =
450 b != null ? ApplicationThreadNative.asInterface(b) : null;
451 Intent intent = Intent.CREATOR.createFromParcel(data);
452 String resolvedType = data.readString();
453 b = data.readStrongBinder();
454 IIntentReceiver resultTo =
455 b != null ? IIntentReceiver.Stub.asInterface(b) : null;
456 int resultCode = data.readInt();
457 String resultData = data.readString();
458 Bundle resultExtras = data.readBundle();
459 String perm = data.readString();
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800460 int appOp = data.readInt();
Dianne Hackborna750a632015-06-16 17:18:23 -0700461 Bundle options = data.readBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800462 boolean serialized = data.readInt() != 0;
463 boolean sticky = data.readInt() != 0;
Amith Yamasani742a6712011-05-04 14:49:28 -0700464 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800465 int res = broadcastIntent(app, intent, resolvedType, resultTo,
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800466 resultCode, resultData, resultExtras, perm, appOp,
Dianne Hackborna750a632015-06-16 17:18:23 -0700467 options, serialized, sticky, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800468 reply.writeNoException();
469 reply.writeInt(res);
470 return true;
471 }
472
473 case UNBROADCAST_INTENT_TRANSACTION:
474 {
475 data.enforceInterface(IActivityManager.descriptor);
476 IBinder b = data.readStrongBinder();
477 IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null;
478 Intent intent = Intent.CREATOR.createFromParcel(data);
Amith Yamasani742a6712011-05-04 14:49:28 -0700479 int userId = data.readInt();
480 unbroadcastIntent(app, intent, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800481 reply.writeNoException();
482 return true;
483 }
484
485 case FINISH_RECEIVER_TRANSACTION: {
486 data.enforceInterface(IActivityManager.descriptor);
487 IBinder who = data.readStrongBinder();
488 int resultCode = data.readInt();
489 String resultData = data.readString();
490 Bundle resultExtras = data.readBundle();
491 boolean resultAbort = data.readInt() != 0;
riddle_hsu1f5ac4d2015-01-03 15:38:21 +0800492 int intentFlags = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800493 if (who != null) {
riddle_hsu1f5ac4d2015-01-03 15:38:21 +0800494 finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800495 }
496 reply.writeNoException();
497 return true;
498 }
499
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800500 case ATTACH_APPLICATION_TRANSACTION: {
501 data.enforceInterface(IActivityManager.descriptor);
502 IApplicationThread app = ApplicationThreadNative.asInterface(
503 data.readStrongBinder());
504 if (app != null) {
505 attachApplication(app);
506 }
507 reply.writeNoException();
508 return true;
509 }
510
511 case ACTIVITY_IDLE_TRANSACTION: {
512 data.enforceInterface(IActivityManager.descriptor);
513 IBinder token = data.readStrongBinder();
Dianne Hackborne88846e2009-09-30 21:34:25 -0700514 Configuration config = null;
515 if (data.readInt() != 0) {
516 config = Configuration.CREATOR.createFromParcel(data);
517 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700518 boolean stopProfiling = data.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800519 if (token != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700520 activityIdle(token, config, stopProfiling);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800521 }
522 reply.writeNoException();
523 return true;
524 }
525
Dianne Hackbornad9b32112012-09-17 15:35:01 -0700526 case ACTIVITY_RESUMED_TRANSACTION: {
527 data.enforceInterface(IActivityManager.descriptor);
528 IBinder token = data.readStrongBinder();
529 activityResumed(token);
530 reply.writeNoException();
531 return true;
532 }
533
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800534 case ACTIVITY_PAUSED_TRANSACTION: {
535 data.enforceInterface(IActivityManager.descriptor);
536 IBinder token = data.readStrongBinder();
Dianne Hackborna4e102e2014-09-04 22:52:27 -0700537 activityPaused(token);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800538 reply.writeNoException();
539 return true;
540 }
541
542 case ACTIVITY_STOPPED_TRANSACTION: {
543 data.enforceInterface(IActivityManager.descriptor);
544 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800545 Bundle map = data.readBundle();
Craig Mautnera0026042014-04-23 11:45:37 -0700546 PersistableBundle persistentState = data.readPersistableBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800547 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
Craig Mautnera0026042014-04-23 11:45:37 -0700548 activityStopped(token, map, persistentState, description);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800549 reply.writeNoException();
550 return true;
551 }
552
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800553 case ACTIVITY_SLEPT_TRANSACTION: {
554 data.enforceInterface(IActivityManager.descriptor);
555 IBinder token = data.readStrongBinder();
556 activitySlept(token);
557 reply.writeNoException();
558 return true;
559 }
560
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800561 case ACTIVITY_DESTROYED_TRANSACTION: {
562 data.enforceInterface(IActivityManager.descriptor);
563 IBinder token = data.readStrongBinder();
564 activityDestroyed(token);
565 reply.writeNoException();
566 return true;
567 }
568
569 case GET_CALLING_PACKAGE_TRANSACTION: {
570 data.enforceInterface(IActivityManager.descriptor);
571 IBinder token = data.readStrongBinder();
572 String res = token != null ? getCallingPackage(token) : null;
573 reply.writeNoException();
574 reply.writeString(res);
575 return true;
576 }
577
578 case GET_CALLING_ACTIVITY_TRANSACTION: {
579 data.enforceInterface(IActivityManager.descriptor);
580 IBinder token = data.readStrongBinder();
581 ComponentName cn = getCallingActivity(token);
582 reply.writeNoException();
583 ComponentName.writeToParcel(cn, reply);
584 return true;
585 }
586
Winson Chung1147c402014-05-14 11:05:00 -0700587 case GET_APP_TASKS_TRANSACTION: {
588 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -0700589 String callingPackage = data.readString();
590 List<IAppTask> list = getAppTasks(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -0700591 reply.writeNoException();
592 int N = list != null ? list.size() : -1;
593 reply.writeInt(N);
594 int i;
595 for (i=0; i<N; i++) {
596 IAppTask task = list.get(i);
597 reply.writeStrongBinder(task.asBinder());
598 }
599 return true;
600 }
601
Dianne Hackbornaec68bb2014-08-20 15:25:13 -0700602 case ADD_APP_TASK_TRANSACTION: {
603 data.enforceInterface(IActivityManager.descriptor);
604 IBinder activityToken = data.readStrongBinder();
605 Intent intent = Intent.CREATOR.createFromParcel(data);
606 ActivityManager.TaskDescription descr
607 = ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
608 Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data);
609 int res = addAppTask(activityToken, intent, descr, thumbnail);
610 reply.writeNoException();
611 reply.writeInt(res);
612 return true;
613 }
614
615 case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: {
616 data.enforceInterface(IActivityManager.descriptor);
617 Point size = getAppTaskThumbnailSize();
618 reply.writeNoException();
619 size.writeToParcel(reply, 0);
620 return true;
621 }
622
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800623 case GET_TASKS_TRANSACTION: {
624 data.enforceInterface(IActivityManager.descriptor);
625 int maxNum = data.readInt();
626 int fl = data.readInt();
Dianne Hackborn09233282014-04-30 11:33:59 -0700627 List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800628 reply.writeNoException();
629 int N = list != null ? list.size() : -1;
630 reply.writeInt(N);
631 int i;
632 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700633 ActivityManager.RunningTaskInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800634 info.writeToParcel(reply, 0);
635 }
636 return true;
637 }
638
639 case GET_RECENT_TASKS_TRANSACTION: {
640 data.enforceInterface(IActivityManager.descriptor);
641 int maxNum = data.readInt();
642 int fl = data.readInt();
Amith Yamasani82644082012-08-03 13:09:11 -0700643 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800644 List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -0700645 fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800646 reply.writeNoException();
647 reply.writeTypedList(list);
648 return true;
649 }
Dianne Hackborn15491c62012-09-19 10:59:14 -0700650
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700651 case GET_TASK_THUMBNAIL_TRANSACTION: {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800652 data.enforceInterface(IActivityManager.descriptor);
653 int id = data.readInt();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700654 ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id);
Dianne Hackbornd94df452011-02-16 18:53:31 -0800655 reply.writeNoException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700656 if (taskThumbnail != null) {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800657 reply.writeInt(1);
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700658 taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn15491c62012-09-19 10:59:14 -0700659 } else {
660 reply.writeInt(0);
661 }
662 return true;
663 }
664
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800665 case GET_SERVICES_TRANSACTION: {
666 data.enforceInterface(IActivityManager.descriptor);
667 int maxNum = data.readInt();
668 int fl = data.readInt();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700669 List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800670 reply.writeNoException();
671 int N = list != null ? list.size() : -1;
672 reply.writeInt(N);
673 int i;
674 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700675 ActivityManager.RunningServiceInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800676 info.writeToParcel(reply, 0);
677 }
678 return true;
679 }
680
681 case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: {
682 data.enforceInterface(IActivityManager.descriptor);
683 List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState();
684 reply.writeNoException();
685 reply.writeTypedList(list);
686 return true;
687 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700688
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800689 case GET_RUNNING_APP_PROCESSES_TRANSACTION: {
690 data.enforceInterface(IActivityManager.descriptor);
691 List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses();
692 reply.writeNoException();
693 reply.writeTypedList(list);
694 return true;
695 }
696
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -0700697 case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: {
698 data.enforceInterface(IActivityManager.descriptor);
699 List<ApplicationInfo> list = getRunningExternalApplications();
700 reply.writeNoException();
701 reply.writeTypedList(list);
702 return true;
703 }
704
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800705 case MOVE_TASK_TO_FRONT_TRANSACTION: {
706 data.enforceInterface(IActivityManager.descriptor);
707 int task = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800708 int fl = data.readInt();
Dianne Hackborn8078d8c2012-03-20 11:11:26 -0700709 Bundle options = data.readInt() != 0
710 ? Bundle.CREATOR.createFromParcel(data) : null;
711 moveTaskToFront(task, fl, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800712 reply.writeNoException();
713 return true;
714 }
715
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800716 case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: {
717 data.enforceInterface(IActivityManager.descriptor);
718 IBinder token = data.readStrongBinder();
719 boolean nonRoot = data.readInt() != 0;
720 boolean res = moveActivityTaskToBack(token, nonRoot);
721 reply.writeNoException();
722 reply.writeInt(res ? 1 : 0);
723 return true;
724 }
725
726 case MOVE_TASK_BACKWARDS_TRANSACTION: {
727 data.enforceInterface(IActivityManager.descriptor);
728 int task = data.readInt();
729 moveTaskBackwards(task);
730 reply.writeNoException();
731 return true;
732 }
733
Craig Mautnerc00204b2013-03-05 15:02:14 -0800734 case MOVE_TASK_TO_STACK_TRANSACTION: {
735 data.enforceInterface(IActivityManager.descriptor);
736 int taskId = data.readInt();
737 int stackId = data.readInt();
738 boolean toTop = data.readInt() != 0;
739 moveTaskToStack(taskId, stackId, toTop);
740 reply.writeNoException();
741 return true;
742 }
743
744 case RESIZE_STACK_TRANSACTION: {
745 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800746 int stackId = data.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800747 Rect r = Rect.CREATOR.createFromParcel(data);
748 resizeStack(stackId, r);
Craig Mautnerc00204b2013-03-05 15:02:14 -0800749 reply.writeNoException();
750 return true;
751 }
752
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800753 case GET_ALL_STACK_INFOS_TRANSACTION: {
Craig Mautner5ff12102013-05-24 12:50:15 -0700754 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800755 List<StackInfo> list = getAllStackInfos();
Craig Mautner5ff12102013-05-24 12:50:15 -0700756 reply.writeNoException();
757 reply.writeTypedList(list);
758 return true;
759 }
760
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800761 case GET_STACK_INFO_TRANSACTION: {
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700762 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800763 int stackId = data.readInt();
764 StackInfo info = getStackInfo(stackId);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700765 reply.writeNoException();
766 if (info != null) {
767 reply.writeInt(1);
768 info.writeToParcel(reply, 0);
769 } else {
770 reply.writeInt(0);
771 }
772 return true;
773 }
774
Winson Chung303e1ff2014-03-07 15:06:19 -0800775 case IS_IN_HOME_STACK_TRANSACTION: {
776 data.enforceInterface(IActivityManager.descriptor);
777 int taskId = data.readInt();
778 boolean isInHomeStack = isInHomeStack(taskId);
779 reply.writeNoException();
780 reply.writeInt(isInHomeStack ? 1 : 0);
781 return true;
782 }
783
Craig Mautnercf910b02013-04-23 11:23:27 -0700784 case SET_FOCUSED_STACK_TRANSACTION: {
785 data.enforceInterface(IActivityManager.descriptor);
786 int stackId = data.readInt();
787 setFocusedStack(stackId);
788 reply.writeNoException();
789 return true;
790 }
791
Winson Chungd16c5652015-01-26 16:11:07 -0800792 case GET_FOCUSED_STACK_ID_TRANSACTION: {
793 data.enforceInterface(IActivityManager.descriptor);
794 int focusedStackId = getFocusedStackId();
795 reply.writeNoException();
796 reply.writeInt(focusedStackId);
797 return true;
798 }
799
Winson Chung740c3ac2014-11-12 16:14:38 -0800800 case REGISTER_TASK_STACK_LISTENER_TRANSACTION: {
801 data.enforceInterface(IActivityManager.descriptor);
802 IBinder token = data.readStrongBinder();
803 registerTaskStackListener(ITaskStackListener.Stub.asInterface(token));
804 reply.writeNoException();
805 return true;
806 }
807
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800808 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
809 data.enforceInterface(IActivityManager.descriptor);
810 IBinder token = data.readStrongBinder();
811 boolean onlyRoot = data.readInt() != 0;
812 int res = token != null
813 ? getTaskForActivity(token, onlyRoot) : -1;
814 reply.writeNoException();
815 reply.writeInt(res);
816 return true;
817 }
818
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800819 case GET_CONTENT_PROVIDER_TRANSACTION: {
820 data.enforceInterface(IActivityManager.descriptor);
821 IBinder b = data.readStrongBinder();
822 IApplicationThread app = ApplicationThreadNative.asInterface(b);
823 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700824 int userId = data.readInt();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700825 boolean stable = data.readInt() != 0;
Jeff Sharkey6d515712012-09-20 16:06:08 -0700826 ContentProviderHolder cph = getContentProvider(app, name, userId, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800827 reply.writeNoException();
828 if (cph != null) {
829 reply.writeInt(1);
830 cph.writeToParcel(reply, 0);
831 } else {
832 reply.writeInt(0);
833 }
834 return true;
835 }
836
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800837 case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
838 data.enforceInterface(IActivityManager.descriptor);
839 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700840 int userId = data.readInt();
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800841 IBinder token = data.readStrongBinder();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700842 ContentProviderHolder cph = getContentProviderExternal(name, userId, token);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800843 reply.writeNoException();
844 if (cph != null) {
845 reply.writeInt(1);
846 cph.writeToParcel(reply, 0);
847 } else {
848 reply.writeInt(0);
849 }
850 return true;
851 }
852
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800853 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
854 data.enforceInterface(IActivityManager.descriptor);
855 IBinder b = data.readStrongBinder();
856 IApplicationThread app = ApplicationThreadNative.asInterface(b);
857 ArrayList<ContentProviderHolder> providers =
858 data.createTypedArrayList(ContentProviderHolder.CREATOR);
859 publishContentProviders(app, providers);
860 reply.writeNoException();
861 return true;
862 }
863
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700864 case REF_CONTENT_PROVIDER_TRANSACTION: {
865 data.enforceInterface(IActivityManager.descriptor);
866 IBinder b = data.readStrongBinder();
867 int stable = data.readInt();
868 int unstable = data.readInt();
869 boolean res = refContentProvider(b, stable, unstable);
870 reply.writeNoException();
871 reply.writeInt(res ? 1 : 0);
872 return true;
873 }
874
875 case UNSTABLE_PROVIDER_DIED_TRANSACTION: {
876 data.enforceInterface(IActivityManager.descriptor);
877 IBinder b = data.readStrongBinder();
878 unstableProviderDied(b);
879 reply.writeNoException();
880 return true;
881 }
882
Jeff Sharkey7aa76012013-09-30 14:26:27 -0700883 case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: {
884 data.enforceInterface(IActivityManager.descriptor);
885 IBinder b = data.readStrongBinder();
886 appNotRespondingViaProvider(b);
887 reply.writeNoException();
888 return true;
889 }
890
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800891 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
892 data.enforceInterface(IActivityManager.descriptor);
893 IBinder b = data.readStrongBinder();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700894 boolean stable = data.readInt() != 0;
895 removeContentProvider(b, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800896 reply.writeNoException();
897 return true;
898 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800899
900 case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
901 data.enforceInterface(IActivityManager.descriptor);
902 String name = data.readString();
903 IBinder token = data.readStrongBinder();
904 removeContentProviderExternal(name, token);
905 reply.writeNoException();
906 return true;
907 }
908
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700909 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
910 data.enforceInterface(IActivityManager.descriptor);
911 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
912 PendingIntent pi = getRunningServiceControlPanel(comp);
913 reply.writeNoException();
914 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
915 return true;
916 }
917
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800918 case START_SERVICE_TRANSACTION: {
919 data.enforceInterface(IActivityManager.descriptor);
920 IBinder b = data.readStrongBinder();
921 IApplicationThread app = ApplicationThreadNative.asInterface(b);
922 Intent service = Intent.CREATOR.createFromParcel(data);
923 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700924 int userId = data.readInt();
925 ComponentName cn = startService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800926 reply.writeNoException();
927 ComponentName.writeToParcel(cn, reply);
928 return true;
929 }
930
931 case STOP_SERVICE_TRANSACTION: {
932 data.enforceInterface(IActivityManager.descriptor);
933 IBinder b = data.readStrongBinder();
934 IApplicationThread app = ApplicationThreadNative.asInterface(b);
935 Intent service = Intent.CREATOR.createFromParcel(data);
936 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700937 int userId = data.readInt();
938 int res = stopService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800939 reply.writeNoException();
940 reply.writeInt(res);
941 return true;
942 }
943
944 case STOP_SERVICE_TOKEN_TRANSACTION: {
945 data.enforceInterface(IActivityManager.descriptor);
946 ComponentName className = ComponentName.readFromParcel(data);
947 IBinder token = data.readStrongBinder();
948 int startId = data.readInt();
949 boolean res = stopServiceToken(className, token, startId);
950 reply.writeNoException();
951 reply.writeInt(res ? 1 : 0);
952 return true;
953 }
954
955 case SET_SERVICE_FOREGROUND_TRANSACTION: {
956 data.enforceInterface(IActivityManager.descriptor);
957 ComponentName className = ComponentName.readFromParcel(data);
958 IBinder token = data.readStrongBinder();
Dianne Hackbornd8a43f62009-08-17 23:33:56 -0700959 int id = data.readInt();
960 Notification notification = null;
961 if (data.readInt() != 0) {
962 notification = Notification.CREATOR.createFromParcel(data);
963 }
964 boolean removeNotification = data.readInt() != 0;
965 setServiceForeground(className, token, id, notification, removeNotification);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800966 reply.writeNoException();
967 return true;
968 }
969
970 case BIND_SERVICE_TRANSACTION: {
971 data.enforceInterface(IActivityManager.descriptor);
972 IBinder b = data.readStrongBinder();
973 IApplicationThread app = ApplicationThreadNative.asInterface(b);
974 IBinder token = data.readStrongBinder();
975 Intent service = Intent.CREATOR.createFromParcel(data);
976 String resolvedType = data.readString();
977 b = data.readStrongBinder();
978 int fl = data.readInt();
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800979 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800980 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800981 int res = bindService(app, token, service, resolvedType, conn, fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800982 reply.writeNoException();
983 reply.writeInt(res);
984 return true;
985 }
986
987 case UNBIND_SERVICE_TRANSACTION: {
988 data.enforceInterface(IActivityManager.descriptor);
989 IBinder b = data.readStrongBinder();
990 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
991 boolean res = unbindService(conn);
992 reply.writeNoException();
993 reply.writeInt(res ? 1 : 0);
994 return true;
995 }
996
997 case PUBLISH_SERVICE_TRANSACTION: {
998 data.enforceInterface(IActivityManager.descriptor);
999 IBinder token = data.readStrongBinder();
1000 Intent intent = Intent.CREATOR.createFromParcel(data);
1001 IBinder service = data.readStrongBinder();
1002 publishService(token, intent, service);
1003 reply.writeNoException();
1004 return true;
1005 }
1006
1007 case UNBIND_FINISHED_TRANSACTION: {
1008 data.enforceInterface(IActivityManager.descriptor);
1009 IBinder token = data.readStrongBinder();
1010 Intent intent = Intent.CREATOR.createFromParcel(data);
1011 boolean doRebind = data.readInt() != 0;
1012 unbindFinished(token, intent, doRebind);
1013 reply.writeNoException();
1014 return true;
1015 }
1016
1017 case SERVICE_DONE_EXECUTING_TRANSACTION: {
1018 data.enforceInterface(IActivityManager.descriptor);
1019 IBinder token = data.readStrongBinder();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07001020 int type = data.readInt();
1021 int startId = data.readInt();
1022 int res = data.readInt();
1023 serviceDoneExecuting(token, type, startId, res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001024 reply.writeNoException();
1025 return true;
1026 }
1027
1028 case START_INSTRUMENTATION_TRANSACTION: {
1029 data.enforceInterface(IActivityManager.descriptor);
1030 ComponentName className = ComponentName.readFromParcel(data);
1031 String profileFile = data.readString();
1032 int fl = data.readInt();
1033 Bundle arguments = data.readBundle();
1034 IBinder b = data.readStrongBinder();
1035 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08001036 b = data.readStrongBinder();
1037 IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001038 int userId = data.readInt();
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01001039 String abiOverride = data.readString();
1040 boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId,
1041 abiOverride);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001042 reply.writeNoException();
1043 reply.writeInt(res ? 1 : 0);
1044 return true;
1045 }
1046
1047
1048 case FINISH_INSTRUMENTATION_TRANSACTION: {
1049 data.enforceInterface(IActivityManager.descriptor);
1050 IBinder b = data.readStrongBinder();
1051 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1052 int resultCode = data.readInt();
1053 Bundle results = data.readBundle();
1054 finishInstrumentation(app, resultCode, results);
1055 reply.writeNoException();
1056 return true;
1057 }
1058
1059 case GET_CONFIGURATION_TRANSACTION: {
1060 data.enforceInterface(IActivityManager.descriptor);
1061 Configuration config = getConfiguration();
1062 reply.writeNoException();
1063 config.writeToParcel(reply, 0);
1064 return true;
1065 }
1066
1067 case UPDATE_CONFIGURATION_TRANSACTION: {
1068 data.enforceInterface(IActivityManager.descriptor);
1069 Configuration config = Configuration.CREATOR.createFromParcel(data);
1070 updateConfiguration(config);
1071 reply.writeNoException();
1072 return true;
1073 }
1074
1075 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
1076 data.enforceInterface(IActivityManager.descriptor);
1077 IBinder token = data.readStrongBinder();
1078 int requestedOrientation = data.readInt();
1079 setRequestedOrientation(token, requestedOrientation);
1080 reply.writeNoException();
1081 return true;
1082 }
1083
1084 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
1085 data.enforceInterface(IActivityManager.descriptor);
1086 IBinder token = data.readStrongBinder();
1087 int req = getRequestedOrientation(token);
1088 reply.writeNoException();
1089 reply.writeInt(req);
1090 return true;
1091 }
1092
1093 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
1094 data.enforceInterface(IActivityManager.descriptor);
1095 IBinder token = data.readStrongBinder();
1096 ComponentName cn = getActivityClassForToken(token);
1097 reply.writeNoException();
1098 ComponentName.writeToParcel(cn, reply);
1099 return true;
1100 }
1101
1102 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
1103 data.enforceInterface(IActivityManager.descriptor);
1104 IBinder token = data.readStrongBinder();
1105 reply.writeNoException();
1106 reply.writeString(getPackageForToken(token));
1107 return true;
1108 }
1109
1110 case GET_INTENT_SENDER_TRANSACTION: {
1111 data.enforceInterface(IActivityManager.descriptor);
1112 int type = data.readInt();
1113 String packageName = data.readString();
1114 IBinder token = data.readStrongBinder();
1115 String resultWho = data.readString();
1116 int requestCode = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001117 Intent[] requestIntents;
1118 String[] requestResolvedTypes;
1119 if (data.readInt() != 0) {
1120 requestIntents = data.createTypedArray(Intent.CREATOR);
1121 requestResolvedTypes = data.createStringArray();
1122 } else {
1123 requestIntents = null;
1124 requestResolvedTypes = null;
1125 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001126 int fl = data.readInt();
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07001127 Bundle options = data.readInt() != 0
1128 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -07001129 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001130 IIntentSender res = getIntentSender(type, packageName, token,
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001131 resultWho, requestCode, requestIntents,
Dianne Hackborn41203752012-08-31 14:05:51 -07001132 requestResolvedTypes, fl, options, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001133 reply.writeNoException();
1134 reply.writeStrongBinder(res != null ? res.asBinder() : null);
1135 return true;
1136 }
1137
1138 case CANCEL_INTENT_SENDER_TRANSACTION: {
1139 data.enforceInterface(IActivityManager.descriptor);
1140 IIntentSender r = IIntentSender.Stub.asInterface(
1141 data.readStrongBinder());
1142 cancelIntentSender(r);
1143 reply.writeNoException();
1144 return true;
1145 }
1146
1147 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
1148 data.enforceInterface(IActivityManager.descriptor);
1149 IIntentSender r = IIntentSender.Stub.asInterface(
1150 data.readStrongBinder());
1151 String res = getPackageForIntentSender(r);
1152 reply.writeNoException();
1153 reply.writeString(res);
1154 return true;
1155 }
1156
Christopher Tatec4a07d12012-04-06 14:19:13 -07001157 case GET_UID_FOR_INTENT_SENDER_TRANSACTION: {
1158 data.enforceInterface(IActivityManager.descriptor);
1159 IIntentSender r = IIntentSender.Stub.asInterface(
1160 data.readStrongBinder());
1161 int res = getUidForIntentSender(r);
1162 reply.writeNoException();
1163 reply.writeInt(res);
1164 return true;
1165 }
1166
Dianne Hackborn41203752012-08-31 14:05:51 -07001167 case HANDLE_INCOMING_USER_TRANSACTION: {
1168 data.enforceInterface(IActivityManager.descriptor);
1169 int callingPid = data.readInt();
1170 int callingUid = data.readInt();
1171 int userId = data.readInt();
1172 boolean allowAll = data.readInt() != 0 ;
1173 boolean requireFull = data.readInt() != 0;
1174 String name = data.readString();
1175 String callerPackage = data.readString();
1176 int res = handleIncomingUser(callingPid, callingUid, userId, allowAll,
1177 requireFull, name, callerPackage);
1178 reply.writeNoException();
1179 reply.writeInt(res);
1180 return true;
1181 }
1182
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001183 case SET_PROCESS_LIMIT_TRANSACTION: {
1184 data.enforceInterface(IActivityManager.descriptor);
1185 int max = data.readInt();
1186 setProcessLimit(max);
1187 reply.writeNoException();
1188 return true;
1189 }
1190
1191 case GET_PROCESS_LIMIT_TRANSACTION: {
1192 data.enforceInterface(IActivityManager.descriptor);
1193 int limit = getProcessLimit();
1194 reply.writeNoException();
1195 reply.writeInt(limit);
1196 return true;
1197 }
1198
1199 case SET_PROCESS_FOREGROUND_TRANSACTION: {
1200 data.enforceInterface(IActivityManager.descriptor);
1201 IBinder token = data.readStrongBinder();
1202 int pid = data.readInt();
1203 boolean isForeground = data.readInt() != 0;
1204 setProcessForeground(token, pid, isForeground);
1205 reply.writeNoException();
1206 return true;
1207 }
1208
1209 case CHECK_PERMISSION_TRANSACTION: {
1210 data.enforceInterface(IActivityManager.descriptor);
1211 String perm = data.readString();
1212 int pid = data.readInt();
1213 int uid = data.readInt();
1214 int res = checkPermission(perm, pid, uid);
1215 reply.writeNoException();
1216 reply.writeInt(res);
1217 return true;
1218 }
1219
Dianne Hackbornff170242014-11-19 10:59:01 -08001220 case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: {
1221 data.enforceInterface(IActivityManager.descriptor);
1222 String perm = data.readString();
1223 int pid = data.readInt();
1224 int uid = data.readInt();
1225 IBinder token = data.readStrongBinder();
1226 int res = checkPermissionWithToken(perm, pid, uid, token);
1227 reply.writeNoException();
1228 reply.writeInt(res);
1229 return true;
1230 }
1231
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001232 case CHECK_URI_PERMISSION_TRANSACTION: {
1233 data.enforceInterface(IActivityManager.descriptor);
1234 Uri uri = Uri.CREATOR.createFromParcel(data);
1235 int pid = data.readInt();
1236 int uid = data.readInt();
1237 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001238 int userId = data.readInt();
Dianne Hackbornff170242014-11-19 10:59:01 -08001239 IBinder callerToken = data.readStrongBinder();
1240 int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001241 reply.writeNoException();
1242 reply.writeInt(res);
1243 return true;
1244 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001245
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001246 case CLEAR_APP_DATA_TRANSACTION: {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001247 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001248 String packageName = data.readString();
1249 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
1250 data.readStrongBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -07001251 int userId = data.readInt();
1252 boolean res = clearApplicationUserData(packageName, observer, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001253 reply.writeNoException();
1254 reply.writeInt(res ? 1 : 0);
1255 return true;
1256 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001257
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001258 case GRANT_URI_PERMISSION_TRANSACTION: {
1259 data.enforceInterface(IActivityManager.descriptor);
1260 IBinder b = data.readStrongBinder();
1261 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1262 String targetPkg = data.readString();
1263 Uri uri = Uri.CREATOR.createFromParcel(data);
1264 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001265 int userId = data.readInt();
1266 grantUriPermission(app, targetPkg, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001267 reply.writeNoException();
1268 return true;
1269 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001270
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001271 case REVOKE_URI_PERMISSION_TRANSACTION: {
1272 data.enforceInterface(IActivityManager.descriptor);
1273 IBinder b = data.readStrongBinder();
1274 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1275 Uri uri = Uri.CREATOR.createFromParcel(data);
1276 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001277 int userId = data.readInt();
1278 revokeUriPermission(app, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001279 reply.writeNoException();
1280 return true;
1281 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001282
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001283 case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1284 data.enforceInterface(IActivityManager.descriptor);
1285 Uri uri = Uri.CREATOR.createFromParcel(data);
1286 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001287 int userId = data.readInt();
1288 takePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001289 reply.writeNoException();
1290 return true;
1291 }
1292
1293 case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1294 data.enforceInterface(IActivityManager.descriptor);
1295 Uri uri = Uri.CREATOR.createFromParcel(data);
1296 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001297 int userId = data.readInt();
1298 releasePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001299 reply.writeNoException();
1300 return true;
1301 }
1302
1303 case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: {
1304 data.enforceInterface(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07001305 final String packageName = data.readString();
1306 final boolean incoming = data.readInt() != 0;
1307 final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions(
1308 packageName, incoming);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001309 reply.writeNoException();
1310 perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1311 return true;
1312 }
1313
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001314 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
1315 data.enforceInterface(IActivityManager.descriptor);
1316 IBinder b = data.readStrongBinder();
1317 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1318 boolean waiting = data.readInt() != 0;
1319 showWaitingForDebugger(app, waiting);
1320 reply.writeNoException();
1321 return true;
1322 }
1323
1324 case GET_MEMORY_INFO_TRANSACTION: {
1325 data.enforceInterface(IActivityManager.descriptor);
1326 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
1327 getMemoryInfo(mi);
1328 reply.writeNoException();
1329 mi.writeToParcel(reply, 0);
1330 return true;
1331 }
1332
1333 case UNHANDLED_BACK_TRANSACTION: {
1334 data.enforceInterface(IActivityManager.descriptor);
1335 unhandledBack();
1336 reply.writeNoException();
1337 return true;
1338 }
1339
1340 case OPEN_CONTENT_URI_TRANSACTION: {
1341 data.enforceInterface(IActivityManager.descriptor);
1342 Uri uri = Uri.parse(data.readString());
1343 ParcelFileDescriptor pfd = openContentUri(uri);
1344 reply.writeNoException();
1345 if (pfd != null) {
1346 reply.writeInt(1);
1347 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1348 } else {
1349 reply.writeInt(0);
1350 }
1351 return true;
1352 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001353
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001354 case SET_LOCK_SCREEN_SHOWN_TRANSACTION: {
1355 data.enforceInterface(IActivityManager.descriptor);
1356 setLockScreenShown(data.readInt() != 0);
1357 reply.writeNoException();
1358 return true;
1359 }
1360
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001361 case SET_DEBUG_APP_TRANSACTION: {
1362 data.enforceInterface(IActivityManager.descriptor);
1363 String pn = data.readString();
1364 boolean wfd = data.readInt() != 0;
1365 boolean per = data.readInt() != 0;
1366 setDebugApp(pn, wfd, per);
1367 reply.writeNoException();
1368 return true;
1369 }
1370
1371 case SET_ALWAYS_FINISH_TRANSACTION: {
1372 data.enforceInterface(IActivityManager.descriptor);
1373 boolean enabled = data.readInt() != 0;
1374 setAlwaysFinish(enabled);
1375 reply.writeNoException();
1376 return true;
1377 }
1378
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001379 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001380 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001381 IActivityController watcher = IActivityController.Stub.asInterface(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001382 data.readStrongBinder());
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001383 setActivityController(watcher);
Sungmin Choicdb86bb2012-12-20 14:08:59 +09001384 reply.writeNoException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001385 return true;
1386 }
1387
1388 case ENTER_SAFE_MODE_TRANSACTION: {
1389 data.enforceInterface(IActivityManager.descriptor);
1390 enterSafeMode();
1391 reply.writeNoException();
1392 return true;
1393 }
1394
1395 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1396 data.enforceInterface(IActivityManager.descriptor);
1397 IIntentSender is = IIntentSender.Stub.asInterface(
1398 data.readStrongBinder());
Dianne Hackborn099bc622014-01-22 13:39:16 -08001399 int sourceUid = data.readInt();
1400 String sourcePkg = data.readString();
Dianne Hackborn1e383822015-04-10 14:02:33 -07001401 String tag = data.readString();
1402 noteWakeupAlarm(is, sourceUid, sourcePkg, tag);
1403 reply.writeNoException();
1404 return true;
1405 }
1406
1407 case NOTE_ALARM_START_TRANSACTION: {
1408 data.enforceInterface(IActivityManager.descriptor);
1409 IIntentSender is = IIntentSender.Stub.asInterface(
1410 data.readStrongBinder());
1411 int sourceUid = data.readInt();
1412 String tag = data.readString();
1413 noteAlarmStart(is, sourceUid, tag);
1414 reply.writeNoException();
1415 return true;
1416 }
1417
1418 case NOTE_ALARM_FINISH_TRANSACTION: {
1419 data.enforceInterface(IActivityManager.descriptor);
1420 IIntentSender is = IIntentSender.Stub.asInterface(
1421 data.readStrongBinder());
1422 int sourceUid = data.readInt();
1423 String tag = data.readString();
1424 noteAlarmFinish(is, sourceUid, tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001425 reply.writeNoException();
1426 return true;
1427 }
1428
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001429 case KILL_PIDS_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001430 data.enforceInterface(IActivityManager.descriptor);
1431 int[] pids = data.createIntArray();
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001432 String reason = data.readString();
Dianne Hackborn64825172011-03-02 21:32:58 -08001433 boolean secure = data.readInt() != 0;
1434 boolean res = killPids(pids, reason, secure);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001435 reply.writeNoException();
1436 reply.writeInt(res ? 1 : 0);
1437 return true;
1438 }
1439
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07001440 case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: {
1441 data.enforceInterface(IActivityManager.descriptor);
1442 String reason = data.readString();
1443 boolean res = killProcessesBelowForeground(reason);
1444 reply.writeNoException();
1445 reply.writeInt(res ? 1 : 0);
1446 return true;
1447 }
1448
Dan Egnor60d87622009-12-16 16:32:58 -08001449 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1450 data.enforceInterface(IActivityManager.descriptor);
1451 IBinder app = data.readStrongBinder();
1452 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1453 handleApplicationCrash(app, ci);
1454 reply.writeNoException();
1455 return true;
1456 }
1457
1458 case HANDLE_APPLICATION_WTF_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001459 data.enforceInterface(IActivityManager.descriptor);
1460 IBinder app = data.readStrongBinder();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001461 String tag = data.readString();
Dianne Hackborn52322712014-08-26 22:47:26 -07001462 boolean system = data.readInt() != 0;
Dan Egnorb7f03672009-12-09 16:22:32 -08001463 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
Dianne Hackborn52322712014-08-26 22:47:26 -07001464 boolean res = handleApplicationWtf(app, tag, system, ci);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001465 reply.writeNoException();
Dan Egnor60d87622009-12-16 16:32:58 -08001466 reply.writeInt(res ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001467 return true;
1468 }
Dan Egnorb7f03672009-12-09 16:22:32 -08001469
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001470 case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: {
1471 data.enforceInterface(IActivityManager.descriptor);
1472 IBinder app = data.readStrongBinder();
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07001473 int violationMask = data.readInt();
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07001474 StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data);
1475 handleApplicationStrictModeViolation(app, violationMask, info);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001476 reply.writeNoException();
1477 return true;
1478 }
1479
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001480 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1481 data.enforceInterface(IActivityManager.descriptor);
1482 int sig = data.readInt();
1483 signalPersistentProcesses(sig);
1484 reply.writeNoException();
1485 return true;
1486 }
1487
Dianne Hackborn03abb812010-01-04 18:43:19 -08001488 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1489 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001490 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001491 int userId = data.readInt();
1492 killBackgroundProcesses(packageName, userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08001493 reply.writeNoException();
1494 return true;
1495 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08001496
1497 case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
1498 data.enforceInterface(IActivityManager.descriptor);
1499 killAllBackgroundProcesses();
1500 reply.writeNoException();
1501 return true;
1502 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001503
Dianne Hackborn03abb812010-01-04 18:43:19 -08001504 case FORCE_STOP_PACKAGE_TRANSACTION: {
1505 data.enforceInterface(IActivityManager.descriptor);
1506 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001507 int userId = data.readInt();
1508 forceStopPackage(packageName, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001509 reply.writeNoException();
1510 return true;
1511 }
Dianne Hackborn27ff9132012-03-06 14:57:58 -08001512
1513 case GET_MY_MEMORY_STATE_TRANSACTION: {
1514 data.enforceInterface(IActivityManager.descriptor);
1515 ActivityManager.RunningAppProcessInfo info =
1516 new ActivityManager.RunningAppProcessInfo();
1517 getMyMemoryState(info);
1518 reply.writeNoException();
1519 info.writeToParcel(reply, 0);
1520 return true;
1521 }
1522
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001523 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1524 data.enforceInterface(IActivityManager.descriptor);
1525 ConfigurationInfo config = getDeviceConfigurationInfo();
1526 reply.writeNoException();
1527 config.writeToParcel(reply, 0);
1528 return true;
1529 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001530
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001531 case PROFILE_CONTROL_TRANSACTION: {
1532 data.enforceInterface(IActivityManager.descriptor);
1533 String process = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001534 int userId = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001535 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001536 int profileType = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -07001537 ProfilerInfo profilerInfo = data.readInt() != 0
1538 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
1539 boolean res = profileControl(process, userId, start, profilerInfo, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001540 reply.writeNoException();
1541 reply.writeInt(res ? 1 : 0);
1542 return true;
1543 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001544
Dianne Hackborn55280a92009-05-07 15:53:46 -07001545 case SHUTDOWN_TRANSACTION: {
1546 data.enforceInterface(IActivityManager.descriptor);
1547 boolean res = shutdown(data.readInt());
1548 reply.writeNoException();
1549 reply.writeInt(res ? 1 : 0);
1550 return true;
1551 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001552
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001553 case STOP_APP_SWITCHES_TRANSACTION: {
1554 data.enforceInterface(IActivityManager.descriptor);
1555 stopAppSwitches();
1556 reply.writeNoException();
1557 return true;
1558 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001559
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001560 case RESUME_APP_SWITCHES_TRANSACTION: {
1561 data.enforceInterface(IActivityManager.descriptor);
1562 resumeAppSwitches();
1563 reply.writeNoException();
1564 return true;
1565 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001566
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001567 case PEEK_SERVICE_TRANSACTION: {
1568 data.enforceInterface(IActivityManager.descriptor);
1569 Intent service = Intent.CREATOR.createFromParcel(data);
1570 String resolvedType = data.readString();
1571 IBinder binder = peekService(service, resolvedType);
1572 reply.writeNoException();
1573 reply.writeStrongBinder(binder);
1574 return true;
1575 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001576
Christopher Tate181fafa2009-05-14 11:12:14 -07001577 case START_BACKUP_AGENT_TRANSACTION: {
1578 data.enforceInterface(IActivityManager.descriptor);
1579 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1580 int backupRestoreMode = data.readInt();
1581 boolean success = bindBackupAgent(info, backupRestoreMode);
1582 reply.writeNoException();
1583 reply.writeInt(success ? 1 : 0);
1584 return true;
1585 }
1586
1587 case BACKUP_AGENT_CREATED_TRANSACTION: {
1588 data.enforceInterface(IActivityManager.descriptor);
1589 String packageName = data.readString();
1590 IBinder agent = data.readStrongBinder();
1591 backupAgentCreated(packageName, agent);
1592 reply.writeNoException();
1593 return true;
1594 }
1595
1596 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1597 data.enforceInterface(IActivityManager.descriptor);
1598 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1599 unbindBackupAgent(info);
1600 reply.writeNoException();
1601 return true;
1602 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001603
1604 case ADD_PACKAGE_DEPENDENCY_TRANSACTION: {
1605 data.enforceInterface(IActivityManager.descriptor);
1606 String packageName = data.readString();
1607 addPackageDependency(packageName);
1608 reply.writeNoException();
1609 return true;
1610 }
1611
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001612 case KILL_APPLICATION_WITH_APPID_TRANSACTION: {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001613 data.enforceInterface(IActivityManager.descriptor);
1614 String pkg = data.readString();
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001615 int appid = data.readInt();
Dianne Hackborn21d9b562013-05-28 17:46:59 -07001616 String reason = data.readString();
1617 killApplicationWithAppId(pkg, appid, reason);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001618 reply.writeNoException();
1619 return true;
1620 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001621
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001622 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1623 data.enforceInterface(IActivityManager.descriptor);
1624 String reason = data.readString();
1625 closeSystemDialogs(reason);
1626 reply.writeNoException();
1627 return true;
1628 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001629
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001630 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1631 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001632 int[] pids = data.createIntArray();
1633 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001634 reply.writeNoException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001635 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001636 return true;
1637 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001638
1639 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1640 data.enforceInterface(IActivityManager.descriptor);
1641 String processName = data.readString();
1642 int uid = data.readInt();
1643 killApplicationProcess(processName, uid);
1644 reply.writeNoException();
1645 return true;
1646 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001647
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001648 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1649 data.enforceInterface(IActivityManager.descriptor);
1650 IBinder token = data.readStrongBinder();
1651 String packageName = data.readString();
1652 int enterAnim = data.readInt();
1653 int exitAnim = data.readInt();
1654 overridePendingTransition(token, packageName, enterAnim, exitAnim);
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001655 reply.writeNoException();
1656 return true;
1657 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001658
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001659 case IS_USER_A_MONKEY_TRANSACTION: {
1660 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001661 boolean areThey = isUserAMonkey();
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001662 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001663 reply.writeInt(areThey ? 1 : 0);
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001664 return true;
1665 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001666
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07001667 case SET_USER_IS_MONKEY_TRANSACTION: {
1668 data.enforceInterface(IActivityManager.descriptor);
1669 final boolean monkey = (data.readInt() == 1);
1670 setUserIsMonkey(monkey);
1671 reply.writeNoException();
1672 return true;
1673 }
1674
Dianne Hackborn860755f2010-06-03 18:47:52 -07001675 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1676 data.enforceInterface(IActivityManager.descriptor);
1677 finishHeavyWeightApp();
1678 reply.writeNoException();
1679 return true;
1680 }
Daniel Sandler69a48172010-06-23 16:29:36 -04001681
1682 case IS_IMMERSIVE_TRANSACTION: {
1683 data.enforceInterface(IActivityManager.descriptor);
1684 IBinder token = data.readStrongBinder();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001685 boolean isit = isImmersive(token);
Daniel Sandler69a48172010-06-23 16:29:36 -04001686 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001687 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001688 return true;
1689 }
1690
Craig Mautnerd61dc202014-07-07 11:09:11 -07001691 case IS_TOP_OF_TASK_TRANSACTION: {
1692 data.enforceInterface(IActivityManager.descriptor);
1693 IBinder token = data.readStrongBinder();
1694 final boolean isTopOfTask = isTopOfTask(token);
1695 reply.writeNoException();
1696 reply.writeInt(isTopOfTask ? 1 : 0);
1697 return true;
1698 }
1699
Craig Mautner5eda9b32013-07-02 11:58:16 -07001700 case CONVERT_FROM_TRANSLUCENT_TRANSACTION: {
Craig Mautner4addfc52013-06-25 08:05:45 -07001701 data.enforceInterface(IActivityManager.descriptor);
1702 IBinder token = data.readStrongBinder();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001703 boolean converted = convertFromTranslucent(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001704 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001705 reply.writeInt(converted ? 1 : 0);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001706 return true;
1707 }
1708
1709 case CONVERT_TO_TRANSLUCENT_TRANSACTION: {
1710 data.enforceInterface(IActivityManager.descriptor);
1711 IBinder token = data.readStrongBinder();
Craig Mautner233ceee2014-05-09 17:05:11 -07001712 final Bundle bundle;
1713 if (data.readInt() == 0) {
1714 bundle = null;
1715 } else {
1716 bundle = data.readBundle();
1717 }
1718 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
1719 boolean converted = convertToTranslucent(token, options);
Craig Mautner4addfc52013-06-25 08:05:45 -07001720 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001721 reply.writeInt(converted ? 1 : 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07001722 return true;
1723 }
1724
Craig Mautner233ceee2014-05-09 17:05:11 -07001725 case GET_ACTIVITY_OPTIONS_TRANSACTION: {
1726 data.enforceInterface(IActivityManager.descriptor);
1727 IBinder token = data.readStrongBinder();
1728 final ActivityOptions options = getActivityOptions(token);
1729 reply.writeNoException();
1730 reply.writeBundle(options == null ? null : options.toBundle());
1731 return true;
1732 }
1733
Daniel Sandler69a48172010-06-23 16:29:36 -04001734 case SET_IMMERSIVE_TRANSACTION: {
1735 data.enforceInterface(IActivityManager.descriptor);
1736 IBinder token = data.readStrongBinder();
1737 boolean imm = data.readInt() == 1;
1738 setImmersive(token, imm);
1739 reply.writeNoException();
1740 return true;
1741 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001742
Daniel Sandler69a48172010-06-23 16:29:36 -04001743 case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
1744 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001745 boolean isit = isTopActivityImmersive();
Daniel Sandler69a48172010-06-23 16:29:36 -04001746 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001747 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001748 return true;
1749 }
1750
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001751 case CRASH_APPLICATION_TRANSACTION: {
1752 data.enforceInterface(IActivityManager.descriptor);
1753 int uid = data.readInt();
1754 int initialPid = data.readInt();
1755 String packageName = data.readString();
1756 String message = data.readString();
1757 crashApplication(uid, initialPid, packageName, message);
1758 reply.writeNoException();
1759 return true;
1760 }
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001761
1762 case GET_PROVIDER_MIME_TYPE_TRANSACTION: {
1763 data.enforceInterface(IActivityManager.descriptor);
1764 Uri uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001765 int userId = data.readInt();
1766 String type = getProviderMimeType(uri, userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001767 reply.writeNoException();
1768 reply.writeString(type);
1769 return true;
1770 }
1771
Dianne Hackborn7e269642010-08-25 19:50:20 -07001772 case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
1773 data.enforceInterface(IActivityManager.descriptor);
1774 String name = data.readString();
1775 IBinder perm = newUriPermissionOwner(name);
1776 reply.writeNoException();
1777 reply.writeStrongBinder(perm);
1778 return true;
1779 }
1780
1781 case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1782 data.enforceInterface(IActivityManager.descriptor);
1783 IBinder owner = data.readStrongBinder();
1784 int fromUid = data.readInt();
1785 String targetPkg = data.readString();
1786 Uri uri = Uri.CREATOR.createFromParcel(data);
1787 int mode = data.readInt();
Nicolas Prevotf1939902014-06-25 09:29:02 +01001788 int sourceUserId = data.readInt();
1789 int targetUserId = data.readInt();
1790 grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId,
1791 targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001792 reply.writeNoException();
1793 return true;
1794 }
1795
1796 case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1797 data.enforceInterface(IActivityManager.descriptor);
1798 IBinder owner = data.readStrongBinder();
1799 Uri uri = null;
1800 if (data.readInt() != 0) {
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001801 uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001802 }
1803 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001804 int userId = data.readInt();
1805 revokeUriPermissionFromOwner(owner, uri, mode, userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001806 reply.writeNoException();
1807 return true;
1808 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001809
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001810 case CHECK_GRANT_URI_PERMISSION_TRANSACTION: {
1811 data.enforceInterface(IActivityManager.descriptor);
1812 int callingUid = data.readInt();
1813 String targetPkg = data.readString();
1814 Uri uri = Uri.CREATOR.createFromParcel(data);
1815 int modeFlags = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001816 int userId = data.readInt();
1817 int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001818 reply.writeNoException();
1819 reply.writeInt(res);
1820 return true;
1821 }
1822
Andy McFadden824c5102010-07-09 16:26:57 -07001823 case DUMP_HEAP_TRANSACTION: {
1824 data.enforceInterface(IActivityManager.descriptor);
1825 String process = data.readString();
Dianne Hackbornb12e1352012-09-26 11:39:20 -07001826 int userId = data.readInt();
Andy McFadden824c5102010-07-09 16:26:57 -07001827 boolean managed = data.readInt() != 0;
1828 String path = data.readString();
1829 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -07001830 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborn1676c852012-09-10 14:52:30 -07001831 boolean res = dumpHeap(process, userId, managed, path, fd);
Andy McFadden824c5102010-07-09 16:26:57 -07001832 reply.writeNoException();
1833 reply.writeInt(res ? 1 : 0);
1834 return true;
1835 }
1836
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001837 case START_ACTIVITIES_TRANSACTION:
1838 {
1839 data.enforceInterface(IActivityManager.descriptor);
1840 IBinder b = data.readStrongBinder();
1841 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001842 String callingPackage = data.readString();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001843 Intent[] intents = data.createTypedArray(Intent.CREATOR);
1844 String[] resolvedTypes = data.createStringArray();
1845 IBinder resultTo = data.readStrongBinder();
Dianne Hackborna4972e92012-03-14 10:38:05 -07001846 Bundle options = data.readInt() != 0
1847 ? Bundle.CREATOR.createFromParcel(data) : null;
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001848 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001849 int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001850 options, userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001851 reply.writeNoException();
1852 reply.writeInt(result);
1853 return true;
1854 }
1855
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001856 case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1857 {
1858 data.enforceInterface(IActivityManager.descriptor);
1859 int mode = getFrontActivityScreenCompatMode();
1860 reply.writeNoException();
1861 reply.writeInt(mode);
1862 return true;
1863 }
1864
1865 case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1866 {
1867 data.enforceInterface(IActivityManager.descriptor);
1868 int mode = data.readInt();
1869 setFrontActivityScreenCompatMode(mode);
1870 reply.writeNoException();
1871 reply.writeInt(mode);
1872 return true;
1873 }
1874
1875 case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1876 {
1877 data.enforceInterface(IActivityManager.descriptor);
1878 String pkg = data.readString();
1879 int mode = getPackageScreenCompatMode(pkg);
1880 reply.writeNoException();
1881 reply.writeInt(mode);
1882 return true;
1883 }
1884
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001885 case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1886 {
1887 data.enforceInterface(IActivityManager.descriptor);
1888 String pkg = data.readString();
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001889 int mode = data.readInt();
1890 setPackageScreenCompatMode(pkg, mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001891 reply.writeNoException();
1892 return true;
1893 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001894
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001895 case SWITCH_USER_TRANSACTION: {
1896 data.enforceInterface(IActivityManager.descriptor);
1897 int userid = data.readInt();
1898 boolean result = switchUser(userid);
1899 reply.writeNoException();
1900 reply.writeInt(result ? 1 : 0);
1901 return true;
1902 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07001903
Kenny Guy08488bf2014-02-21 17:40:37 +00001904 case START_USER_IN_BACKGROUND_TRANSACTION: {
1905 data.enforceInterface(IActivityManager.descriptor);
1906 int userid = data.readInt();
1907 boolean result = startUserInBackground(userid);
1908 reply.writeNoException();
1909 reply.writeInt(result ? 1 : 0);
1910 return true;
1911 }
1912
Dianne Hackborn80a4af22012-08-27 19:18:31 -07001913 case STOP_USER_TRANSACTION: {
1914 data.enforceInterface(IActivityManager.descriptor);
1915 int userid = data.readInt();
1916 IStopUserCallback callback = IStopUserCallback.Stub.asInterface(
1917 data.readStrongBinder());
1918 int result = stopUser(userid, callback);
1919 reply.writeNoException();
1920 reply.writeInt(result);
1921 return true;
1922 }
1923
Amith Yamasani52f1d752012-03-28 18:19:29 -07001924 case GET_CURRENT_USER_TRANSACTION: {
1925 data.enforceInterface(IActivityManager.descriptor);
1926 UserInfo userInfo = getCurrentUser();
1927 reply.writeNoException();
1928 userInfo.writeToParcel(reply, 0);
1929 return true;
1930 }
1931
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001932 case IS_USER_RUNNING_TRANSACTION: {
1933 data.enforceInterface(IActivityManager.descriptor);
1934 int userid = data.readInt();
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07001935 boolean orStopping = data.readInt() != 0;
1936 boolean result = isUserRunning(userid, orStopping);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001937 reply.writeNoException();
1938 reply.writeInt(result ? 1 : 0);
1939 return true;
1940 }
1941
Dianne Hackbornc72fc672012-09-20 13:12:03 -07001942 case GET_RUNNING_USER_IDS_TRANSACTION: {
1943 data.enforceInterface(IActivityManager.descriptor);
1944 int[] result = getRunningUserIds();
1945 reply.writeNoException();
1946 reply.writeIntArray(result);
1947 return true;
1948 }
1949
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001950 case REMOVE_TASK_TRANSACTION:
1951 {
1952 data.enforceInterface(IActivityManager.descriptor);
1953 int taskId = data.readInt();
Wale Ogunwaled54b5782014-10-23 15:55:23 -07001954 boolean result = removeTask(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001955 reply.writeNoException();
1956 reply.writeInt(result ? 1 : 0);
1957 return true;
1958 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001959
Jeff Sharkeya4620792011-05-20 15:29:23 -07001960 case REGISTER_PROCESS_OBSERVER_TRANSACTION: {
1961 data.enforceInterface(IActivityManager.descriptor);
1962 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1963 data.readStrongBinder());
1964 registerProcessObserver(observer);
1965 return true;
1966 }
1967
1968 case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: {
1969 data.enforceInterface(IActivityManager.descriptor);
1970 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1971 data.readStrongBinder());
1972 unregisterProcessObserver(observer);
1973 return true;
1974 }
1975
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07001976 case REGISTER_UID_OBSERVER_TRANSACTION: {
1977 data.enforceInterface(IActivityManager.descriptor);
1978 IUidObserver observer = IUidObserver.Stub.asInterface(
1979 data.readStrongBinder());
1980 registerUidObserver(observer);
1981 return true;
1982 }
1983
1984 case UNREGISTER_UID_OBSERVER_TRANSACTION: {
1985 data.enforceInterface(IActivityManager.descriptor);
1986 IUidObserver observer = IUidObserver.Stub.asInterface(
1987 data.readStrongBinder());
1988 unregisterUidObserver(observer);
1989 return true;
1990 }
1991
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07001992 case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1993 {
1994 data.enforceInterface(IActivityManager.descriptor);
1995 String pkg = data.readString();
1996 boolean ask = getPackageAskScreenCompat(pkg);
1997 reply.writeNoException();
1998 reply.writeInt(ask ? 1 : 0);
1999 return true;
2000 }
2001
2002 case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
2003 {
2004 data.enforceInterface(IActivityManager.descriptor);
2005 String pkg = data.readString();
2006 boolean ask = data.readInt() != 0;
2007 setPackageAskScreenCompat(pkg, ask);
2008 reply.writeNoException();
2009 return true;
2010 }
2011
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002012 case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: {
2013 data.enforceInterface(IActivityManager.descriptor);
2014 IIntentSender r = IIntentSender.Stub.asInterface(
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002015 data.readStrongBinder());
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002016 boolean res = isIntentSenderTargetedToPackage(r);
2017 reply.writeNoException();
2018 reply.writeInt(res ? 1 : 0);
2019 return true;
2020 }
2021
Dianne Hackborn1927ae82012-06-22 15:21:36 -07002022 case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: {
2023 data.enforceInterface(IActivityManager.descriptor);
2024 IIntentSender r = IIntentSender.Stub.asInterface(
2025 data.readStrongBinder());
2026 boolean res = isIntentSenderAnActivity(r);
2027 reply.writeNoException();
2028 reply.writeInt(res ? 1 : 0);
2029 return true;
2030 }
2031
Dianne Hackborn81038902012-11-26 17:04:09 -08002032 case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: {
2033 data.enforceInterface(IActivityManager.descriptor);
2034 IIntentSender r = IIntentSender.Stub.asInterface(
2035 data.readStrongBinder());
2036 Intent intent = getIntentForIntentSender(r);
2037 reply.writeNoException();
2038 if (intent != null) {
2039 reply.writeInt(1);
2040 intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2041 } else {
2042 reply.writeInt(0);
2043 }
2044 return true;
2045 }
2046
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08002047 case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: {
2048 data.enforceInterface(IActivityManager.descriptor);
2049 IIntentSender r = IIntentSender.Stub.asInterface(
2050 data.readStrongBinder());
2051 String prefix = data.readString();
2052 String tag = getTagForIntentSender(r, prefix);
2053 reply.writeNoException();
2054 reply.writeString(tag);
2055 return true;
2056 }
2057
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002058 case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
2059 data.enforceInterface(IActivityManager.descriptor);
2060 Configuration config = Configuration.CREATOR.createFromParcel(data);
2061 updatePersistentConfiguration(config);
2062 reply.writeNoException();
2063 return true;
2064 }
2065
Dianne Hackbornb437e092011-08-05 17:50:29 -07002066 case GET_PROCESS_PSS_TRANSACTION: {
2067 data.enforceInterface(IActivityManager.descriptor);
2068 int[] pids = data.createIntArray();
2069 long[] pss = getProcessPss(pids);
2070 reply.writeNoException();
2071 reply.writeLongArray(pss);
2072 return true;
2073 }
2074
Dianne Hackborn661cd522011-08-22 00:26:20 -07002075 case SHOW_BOOT_MESSAGE_TRANSACTION: {
2076 data.enforceInterface(IActivityManager.descriptor);
2077 CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
2078 boolean always = data.readInt() != 0;
2079 showBootMessage(msg, always);
2080 reply.writeNoException();
2081 return true;
2082 }
2083
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002084 case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002085 data.enforceInterface(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002086 keyguardWaitingForActivityDrawn();
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002087 reply.writeNoException();
2088 return true;
2089 }
2090
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07002091 case KEYGUARD_GOING_AWAY_TRANSACTION: {
2092 data.enforceInterface(IActivityManager.descriptor);
2093 keyguardGoingAway(data.readInt() != 0, data.readInt() != 0);
2094 reply.writeNoException();
2095 return true;
2096 }
2097
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002098 case SHOULD_UP_RECREATE_TASK_TRANSACTION: {
Adam Powelldd8fab22012-03-22 17:47:27 -07002099 data.enforceInterface(IActivityManager.descriptor);
2100 IBinder token = data.readStrongBinder();
2101 String destAffinity = data.readString();
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002102 boolean res = shouldUpRecreateTask(token, destAffinity);
Adam Powelldd8fab22012-03-22 17:47:27 -07002103 reply.writeNoException();
2104 reply.writeInt(res ? 1 : 0);
2105 return true;
2106 }
2107
2108 case NAVIGATE_UP_TO_TRANSACTION: {
2109 data.enforceInterface(IActivityManager.descriptor);
2110 IBinder token = data.readStrongBinder();
2111 Intent target = Intent.CREATOR.createFromParcel(data);
2112 int resultCode = data.readInt();
2113 Intent resultData = null;
2114 if (data.readInt() != 0) {
2115 resultData = Intent.CREATOR.createFromParcel(data);
2116 }
2117 boolean res = navigateUpTo(token, target, resultCode, resultData);
2118 reply.writeNoException();
2119 reply.writeInt(res ? 1 : 0);
2120 return true;
2121 }
2122
Dianne Hackborn5320eb82012-05-18 12:05:04 -07002123 case GET_LAUNCHED_FROM_UID_TRANSACTION: {
2124 data.enforceInterface(IActivityManager.descriptor);
2125 IBinder token = data.readStrongBinder();
2126 int res = getLaunchedFromUid(token);
2127 reply.writeNoException();
2128 reply.writeInt(res);
2129 return true;
2130 }
2131
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002132 case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: {
2133 data.enforceInterface(IActivityManager.descriptor);
2134 IBinder token = data.readStrongBinder();
2135 String res = getLaunchedFromPackage(token);
2136 reply.writeNoException();
2137 reply.writeString(res);
2138 return true;
2139 }
2140
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002141 case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2142 data.enforceInterface(IActivityManager.descriptor);
2143 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2144 data.readStrongBinder());
2145 registerUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002146 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002147 return true;
2148 }
2149
2150 case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2151 data.enforceInterface(IActivityManager.descriptor);
2152 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2153 data.readStrongBinder());
2154 unregisterUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002155 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002156 return true;
2157 }
2158
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002159 case REQUEST_BUG_REPORT_TRANSACTION: {
2160 data.enforceInterface(IActivityManager.descriptor);
2161 requestBugReport();
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002162 reply.writeNoException();
2163 return true;
2164 }
2165
2166 case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: {
2167 data.enforceInterface(IActivityManager.descriptor);
2168 int pid = data.readInt();
2169 boolean aboveSystem = data.readInt() != 0;
Jeff Brownbd181bb2013-09-10 16:44:24 -07002170 String reason = data.readString();
2171 long res = inputDispatchingTimedOut(pid, aboveSystem, reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002172 reply.writeNoException();
2173 reply.writeLong(res);
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002174 return true;
2175 }
2176
Adam Skorydfc7fd72013-08-05 19:23:41 -07002177 case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002178 data.enforceInterface(IActivityManager.descriptor);
2179 int requestType = data.readInt();
Adam Skorydfc7fd72013-08-05 19:23:41 -07002180 Bundle res = getAssistContextExtras(requestType);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002181 reply.writeNoException();
2182 reply.writeBundle(res);
2183 return true;
2184 }
2185
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002186 case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
2187 data.enforceInterface(IActivityManager.descriptor);
2188 int requestType = data.readInt();
2189 IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder());
2190 requestAssistContextExtras(requestType, receiver);
2191 reply.writeNoException();
2192 return true;
2193 }
2194
Adam Skorydfc7fd72013-08-05 19:23:41 -07002195 case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002196 data.enforceInterface(IActivityManager.descriptor);
2197 IBinder token = data.readStrongBinder();
2198 Bundle extras = data.readBundle();
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07002199 AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data);
2200 AssistContent content = AssistContent.CREATOR.createFromParcel(data);
Dianne Hackborna3acdb32015-06-08 17:07:40 -07002201 Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null;
2202 reportAssistContextExtras(token, extras, structure, content, referrer);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002203 reply.writeNoException();
2204 return true;
2205 }
2206
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002207 case LAUNCH_ASSIST_INTENT_TRANSACTION: {
2208 data.enforceInterface(IActivityManager.descriptor);
2209 Intent intent = Intent.CREATOR.createFromParcel(data);
2210 int requestType = data.readInt();
2211 String hint = data.readString();
2212 int userHandle = data.readInt();
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07002213 Bundle args = data.readBundle();
2214 boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args);
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002215 reply.writeNoException();
2216 reply.writeInt(res ? 1 : 0);
2217 return true;
2218 }
2219
Benjamin Franzc200f442015-06-25 18:20:04 +01002220 case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: {
2221 data.enforceInterface(IActivityManager.descriptor);
2222 boolean res = isScreenCaptureAllowedOnCurrentActivity();
2223 reply.writeNoException();
2224 reply.writeInt(res ? 1 : 0);
2225 return true;
2226 }
2227
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002228 case KILL_UID_TRANSACTION: {
2229 data.enforceInterface(IActivityManager.descriptor);
2230 int uid = data.readInt();
2231 String reason = data.readString();
2232 killUid(uid, reason);
2233 reply.writeNoException();
2234 return true;
2235 }
2236
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07002237 case HANG_TRANSACTION: {
2238 data.enforceInterface(IActivityManager.descriptor);
2239 IBinder who = data.readStrongBinder();
2240 boolean allowRestart = data.readInt() != 0;
2241 hang(who, allowRestart);
2242 reply.writeNoException();
2243 return true;
2244 }
2245
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07002246 case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: {
2247 data.enforceInterface(IActivityManager.descriptor);
2248 IBinder token = data.readStrongBinder();
2249 reportActivityFullyDrawn(token);
2250 reply.writeNoException();
2251 return true;
2252 }
2253
Craig Mautner5eda9b32013-07-02 11:58:16 -07002254 case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: {
2255 data.enforceInterface(IActivityManager.descriptor);
2256 IBinder token = data.readStrongBinder();
2257 notifyActivityDrawn(token);
2258 reply.writeNoException();
2259 return true;
2260 }
Dianne Hackborn57a7f592013-07-22 18:21:32 -07002261
2262 case RESTART_TRANSACTION: {
2263 data.enforceInterface(IActivityManager.descriptor);
2264 restart();
2265 reply.writeNoException();
2266 return true;
2267 }
Jeff Sharkey08da7a12013-08-11 20:53:18 -07002268
Dianne Hackborn35f72be2013-09-16 10:57:39 -07002269 case PERFORM_IDLE_MAINTENANCE_TRANSACTION: {
2270 data.enforceInterface(IActivityManager.descriptor);
2271 performIdleMaintenance();
2272 reply.writeNoException();
2273 return true;
2274 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002275
Todd Kennedyca4d8422015-01-15 15:19:22 -08002276 case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: {
Craig Mautner4a1cb222013-12-04 16:14:06 -08002277 data.enforceInterface(IActivityManager.descriptor);
2278 IBinder parentActivityToken = data.readStrongBinder();
2279 IActivityContainerCallback callback =
Craig Mautnere3a00d72014-04-16 08:31:19 -07002280 IActivityContainerCallback.Stub.asInterface(data.readStrongBinder());
Craig Mautner4a1cb222013-12-04 16:14:06 -08002281 IActivityContainer activityContainer =
Todd Kennedyca4d8422015-01-15 15:19:22 -08002282 createVirtualActivityContainer(parentActivityToken, callback);
Craig Mautner4a1cb222013-12-04 16:14:06 -08002283 reply.writeNoException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08002284 if (activityContainer != null) {
2285 reply.writeInt(1);
2286 reply.writeStrongBinder(activityContainer.asBinder());
2287 } else {
2288 reply.writeInt(0);
2289 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002290 return true;
2291 }
2292
Craig Mautner95da1082014-02-24 17:54:35 -08002293 case DELETE_ACTIVITY_CONTAINER_TRANSACTION: {
2294 data.enforceInterface(IActivityManager.descriptor);
2295 IActivityContainer activityContainer =
2296 IActivityContainer.Stub.asInterface(data.readStrongBinder());
2297 deleteActivityContainer(activityContainer);
2298 reply.writeNoException();
2299 return true;
2300 }
2301
Todd Kennedy4900bf92015-01-16 16:05:14 -08002302 case CREATE_STACK_ON_DISPLAY: {
2303 data.enforceInterface(IActivityManager.descriptor);
2304 int displayId = data.readInt();
2305 IActivityContainer activityContainer = createStackOnDisplay(displayId);
2306 reply.writeNoException();
2307 if (activityContainer != null) {
2308 reply.writeInt(1);
2309 reply.writeStrongBinder(activityContainer.asBinder());
2310 } else {
2311 reply.writeInt(0);
2312 }
2313 return true;
2314 }
2315
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002316 case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: {
Craig Mautnere0a38842013-12-16 16:14:02 -08002317 data.enforceInterface(IActivityManager.descriptor);
2318 IBinder activityToken = data.readStrongBinder();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002319 int displayId = getActivityDisplayId(activityToken);
Craig Mautnere0a38842013-12-16 16:14:02 -08002320 reply.writeNoException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002321 reply.writeInt(displayId);
Craig Mautnere0a38842013-12-16 16:14:02 -08002322 return true;
2323 }
2324
Craig Mautneraea74a52014-03-08 14:23:10 -08002325 case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: {
2326 data.enforceInterface(IActivityManager.descriptor);
2327 final int taskId = data.readInt();
2328 startLockTaskMode(taskId);
2329 reply.writeNoException();
2330 return true;
2331 }
2332
2333 case START_LOCK_TASK_BY_TOKEN_TRANSACTION: {
2334 data.enforceInterface(IActivityManager.descriptor);
2335 IBinder token = data.readStrongBinder();
2336 startLockTaskMode(token);
2337 reply.writeNoException();
2338 return true;
2339 }
2340
Craig Mautnerd61dc202014-07-07 11:09:11 -07002341 case START_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002342 data.enforceInterface(IActivityManager.descriptor);
2343 startLockTaskModeOnCurrent();
2344 reply.writeNoException();
2345 return true;
2346 }
2347
Craig Mautneraea74a52014-03-08 14:23:10 -08002348 case STOP_LOCK_TASK_MODE_TRANSACTION: {
2349 data.enforceInterface(IActivityManager.descriptor);
2350 stopLockTaskMode();
2351 reply.writeNoException();
2352 return true;
2353 }
2354
Craig Mautnerd61dc202014-07-07 11:09:11 -07002355 case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002356 data.enforceInterface(IActivityManager.descriptor);
2357 stopLockTaskModeOnCurrent();
2358 reply.writeNoException();
2359 return true;
2360 }
2361
Craig Mautneraea74a52014-03-08 14:23:10 -08002362 case IS_IN_LOCK_TASK_MODE_TRANSACTION: {
2363 data.enforceInterface(IActivityManager.descriptor);
2364 final boolean isInLockTaskMode = isInLockTaskMode();
2365 reply.writeNoException();
2366 reply.writeInt(isInLockTaskMode ? 1 : 0);
2367 return true;
2368 }
Craig Mautner2fbd7542014-03-21 09:34:07 -07002369
Benjamin Franz43261142015-02-11 15:59:44 +00002370 case GET_LOCK_TASK_MODE_STATE_TRANSACTION: {
2371 data.enforceInterface(IActivityManager.descriptor);
2372 final int lockTaskModeState = getLockTaskModeState();
2373 reply.writeNoException();
2374 reply.writeInt(lockTaskModeState);
2375 return true;
2376 }
2377
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07002378 case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: {
2379 data.enforceInterface(IActivityManager.descriptor);
2380 final IBinder token = data.readStrongBinder();
2381 showLockTaskEscapeMessage(token);
2382 reply.writeNoException();
2383 return true;
2384 }
2385
Winson Chunga449dc02014-05-16 11:15:04 -07002386 case SET_TASK_DESCRIPTION_TRANSACTION: {
Craig Mautner2fbd7542014-03-21 09:34:07 -07002387 data.enforceInterface(IActivityManager.descriptor);
2388 IBinder token = data.readStrongBinder();
Winson Chunga449dc02014-05-16 11:15:04 -07002389 ActivityManager.TaskDescription values =
2390 ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
2391 setTaskDescription(token, values);
Craig Mautner2fbd7542014-03-21 09:34:07 -07002392 reply.writeNoException();
2393 return true;
2394 }
Craig Mautneree2e45a2014-06-27 12:10:03 -07002395
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08002396 case SET_TASK_RESIZEABLE_TRANSACTION: {
2397 data.enforceInterface(IActivityManager.descriptor);
2398 int taskId = data.readInt();
2399 boolean resizeable = (data.readInt() == 1) ? true : false;
2400 setTaskResizeable(taskId, resizeable);
2401 reply.writeNoException();
2402 return true;
2403 }
2404
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002405 case RESIZE_TASK_TRANSACTION: {
2406 data.enforceInterface(IActivityManager.descriptor);
2407 int taskId = data.readInt();
2408 Rect r = Rect.CREATOR.createFromParcel(data);
2409 resizeTask(taskId, r);
2410 reply.writeNoException();
2411 return true;
2412 }
2413
Craig Mautner648f69b2014-09-18 14:16:26 -07002414 case GET_TASK_DESCRIPTION_ICON_TRANSACTION: {
2415 data.enforceInterface(IActivityManager.descriptor);
2416 String filename = data.readString();
2417 Bitmap icon = getTaskDescriptionIcon(filename);
2418 reply.writeNoException();
2419 if (icon == null) {
2420 reply.writeInt(0);
2421 } else {
2422 reply.writeInt(1);
2423 icon.writeToParcel(reply, 0);
2424 }
2425 return true;
2426 }
2427
Winson Chung044d5292014-11-06 11:05:19 -08002428 case START_IN_PLACE_ANIMATION_TRANSACTION: {
2429 data.enforceInterface(IActivityManager.descriptor);
2430 final Bundle bundle;
2431 if (data.readInt() == 0) {
2432 bundle = null;
2433 } else {
2434 bundle = data.readBundle();
2435 }
2436 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
2437 startInPlaceAnimationOnFrontMostApplication(options);
2438 reply.writeNoException();
2439 return true;
2440 }
2441
Jose Lima4b6c6692014-08-12 17:41:12 -07002442 case REQUEST_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002443 data.enforceInterface(IActivityManager.descriptor);
2444 IBinder token = data.readStrongBinder();
2445 boolean enable = data.readInt() > 0;
Jose Lima4b6c6692014-08-12 17:41:12 -07002446 boolean success = requestVisibleBehind(token, enable);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002447 reply.writeNoException();
2448 reply.writeInt(success ? 1 : 0);
2449 return true;
2450 }
2451
Jose Lima4b6c6692014-08-12 17:41:12 -07002452 case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002453 data.enforceInterface(IActivityManager.descriptor);
2454 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002455 final boolean enabled = isBackgroundVisibleBehind(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002456 reply.writeNoException();
2457 reply.writeInt(enabled ? 1 : 0);
2458 return true;
2459 }
2460
Jose Lima4b6c6692014-08-12 17:41:12 -07002461 case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002462 data.enforceInterface(IActivityManager.descriptor);
2463 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002464 backgroundResourcesReleased(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002465 reply.writeNoException();
2466 return true;
2467 }
Craig Mautnerbb742462014-07-07 15:28:55 -07002468
2469 case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: {
2470 data.enforceInterface(IActivityManager.descriptor);
2471 IBinder token = data.readStrongBinder();
2472 notifyLaunchTaskBehindComplete(token);
2473 reply.writeNoException();
2474 return true;
2475 }
Craig Mautner8746a472014-07-24 15:12:54 -07002476
2477 case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: {
2478 data.enforceInterface(IActivityManager.descriptor);
2479 IBinder token = data.readStrongBinder();
2480 notifyEnterAnimationComplete(token);
2481 reply.writeNoException();
2482 return true;
2483 }
Craig Mautner6e2f3952014-09-09 14:26:41 -07002484
2485 case BOOT_ANIMATION_COMPLETE_TRANSACTION: {
2486 data.enforceInterface(IActivityManager.descriptor);
2487 bootAnimationComplete();
2488 reply.writeNoException();
2489 return true;
2490 }
Wale Ogunwale18795a22014-12-03 11:38:33 -08002491
Jeff Sharkey605eb792014-11-04 13:34:06 -08002492 case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: {
2493 data.enforceInterface(IActivityManager.descriptor);
2494 final int uid = data.readInt();
2495 final byte[] firstPacket = data.createByteArray();
2496 notifyCleartextNetwork(uid, firstPacket);
2497 reply.writeNoException();
2498 return true;
2499 }
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002500
2501 case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: {
2502 data.enforceInterface(IActivityManager.descriptor);
2503 String procName = data.readString();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002504 int uid = data.readInt();
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002505 long maxMemSize = data.readLong();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002506 String reportPackage = data.readString();
2507 setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002508 reply.writeNoException();
2509 return true;
2510 }
2511
2512 case DUMP_HEAP_FINISHED_TRANSACTION: {
2513 data.enforceInterface(IActivityManager.descriptor);
2514 String path = data.readString();
2515 dumpHeapFinished(path);
2516 reply.writeNoException();
2517 return true;
2518 }
Dianne Hackborn3d07c942015-03-13 18:02:54 -07002519
2520 case SET_VOICE_KEEP_AWAKE_TRANSACTION: {
2521 data.enforceInterface(IActivityManager.descriptor);
2522 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
2523 data.readStrongBinder());
2524 boolean keepAwake = data.readInt() != 0;
2525 setVoiceKeepAwake(session, keepAwake);
2526 reply.writeNoException();
2527 return true;
2528 }
Craig Mautnere5600772015-04-03 21:36:37 -07002529
2530 case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: {
2531 data.enforceInterface(IActivityManager.descriptor);
2532 int userId = data.readInt();
2533 String[] packages = data.readStringArray();
2534 updateLockTaskPackages(userId, packages);
2535 reply.writeNoException();
2536 return true;
2537 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07002538
Craig Mautner015c5e52015-04-23 10:39:39 -07002539 case UPDATE_DEVICE_OWNER_TRANSACTION: {
2540 data.enforceInterface(IActivityManager.descriptor);
2541 String packageName = data.readString();
2542 updateDeviceOwner(packageName);
2543 reply.writeNoException();
2544 return true;
2545 }
2546
Dianne Hackborn1e383822015-04-10 14:02:33 -07002547 case GET_PACKAGE_PROCESS_STATE_TRANSACTION: {
2548 data.enforceInterface(IActivityManager.descriptor);
2549 String pkg = data.readString();
Adam Lesinskic30454c2015-06-24 13:24:35 -07002550 String callingPackage = data.readString();
2551 int res = getPackageProcessState(pkg, callingPackage);
Dianne Hackborn1e383822015-04-10 14:02:33 -07002552 reply.writeNoException();
2553 reply.writeInt(res);
2554 return true;
2555 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07002556
2557 case SET_PROCESS_MEMORY_TRIM_TRANSACTION: {
2558 data.enforceInterface(IActivityManager.descriptor);
2559 String process = data.readString();
2560 int userId = data.readInt();
2561 int level = data.readInt();
2562 boolean res = setProcessMemoryTrimLevel(process, userId, level);
2563 reply.writeNoException();
2564 reply.writeInt(res ? 1 : 0);
2565 return true;
2566 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002567 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002568
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002569 return super.onTransact(code, data, reply, flags);
2570 }
2571
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002572 public IBinder asBinder() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002573 return this;
2574 }
2575
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002576 private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
2577 protected IActivityManager create() {
2578 IBinder b = ServiceManager.getService("activity");
Joe Onorato43a17652011-04-06 19:22:23 -07002579 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002580 Log.v("ActivityManager", "default service binder = " + b);
2581 }
2582 IActivityManager am = asInterface(b);
Joe Onorato43a17652011-04-06 19:22:23 -07002583 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002584 Log.v("ActivityManager", "default service = " + am);
2585 }
2586 return am;
2587 }
2588 };
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002589}
2590
2591class ActivityManagerProxy implements IActivityManager
2592{
2593 public ActivityManagerProxy(IBinder remote)
2594 {
2595 mRemote = remote;
2596 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002597
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002598 public IBinder asBinder()
2599 {
2600 return mRemote;
2601 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002602
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002603 public int startActivity(IApplicationThread caller, String callingPackage, Intent intent,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002604 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002605 int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002606 Parcel data = Parcel.obtain();
2607 Parcel reply = Parcel.obtain();
2608 data.writeInterfaceToken(IActivityManager.descriptor);
2609 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002610 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002611 intent.writeToParcel(data, 0);
2612 data.writeString(resolvedType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002613 data.writeStrongBinder(resultTo);
2614 data.writeString(resultWho);
2615 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002616 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002617 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002618 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002619 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002620 } else {
2621 data.writeInt(0);
2622 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002623 if (options != null) {
2624 data.writeInt(1);
2625 options.writeToParcel(data, 0);
2626 } else {
2627 data.writeInt(0);
2628 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002629 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2630 reply.readException();
2631 int result = reply.readInt();
2632 reply.recycle();
2633 data.recycle();
2634 return result;
2635 }
Amith Yamasani82644082012-08-03 13:09:11 -07002636
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002637 public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent,
Amith Yamasani82644082012-08-03 13:09:11 -07002638 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002639 int startFlags, ProfilerInfo profilerInfo, Bundle options,
2640 int userId) throws RemoteException {
Amith Yamasani82644082012-08-03 13:09:11 -07002641 Parcel data = Parcel.obtain();
2642 Parcel reply = Parcel.obtain();
2643 data.writeInterfaceToken(IActivityManager.descriptor);
2644 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002645 data.writeString(callingPackage);
Amith Yamasani82644082012-08-03 13:09:11 -07002646 intent.writeToParcel(data, 0);
2647 data.writeString(resolvedType);
2648 data.writeStrongBinder(resultTo);
2649 data.writeString(resultWho);
2650 data.writeInt(requestCode);
2651 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002652 if (profilerInfo != null) {
Amith Yamasani82644082012-08-03 13:09:11 -07002653 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002654 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Amith Yamasani82644082012-08-03 13:09:11 -07002655 } else {
2656 data.writeInt(0);
2657 }
2658 if (options != null) {
2659 data.writeInt(1);
2660 options.writeToParcel(data, 0);
2661 } else {
2662 data.writeInt(0);
2663 }
2664 data.writeInt(userId);
2665 mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0);
2666 reply.readException();
2667 int result = reply.readInt();
2668 reply.recycle();
2669 data.recycle();
2670 return result;
2671 }
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002672 public int startActivityAsCaller(IApplicationThread caller, String callingPackage,
2673 Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Sharkey97978802014-10-14 10:48:18 -07002674 int startFlags, ProfilerInfo profilerInfo, Bundle options, int userId) throws RemoteException {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002675 Parcel data = Parcel.obtain();
2676 Parcel reply = Parcel.obtain();
2677 data.writeInterfaceToken(IActivityManager.descriptor);
2678 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2679 data.writeString(callingPackage);
2680 intent.writeToParcel(data, 0);
2681 data.writeString(resolvedType);
2682 data.writeStrongBinder(resultTo);
2683 data.writeString(resultWho);
2684 data.writeInt(requestCode);
2685 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002686 if (profilerInfo != null) {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002687 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002688 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002689 } else {
2690 data.writeInt(0);
2691 }
2692 if (options != null) {
2693 data.writeInt(1);
2694 options.writeToParcel(data, 0);
2695 } else {
2696 data.writeInt(0);
2697 }
Jeff Sharkey97978802014-10-14 10:48:18 -07002698 data.writeInt(userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002699 mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0);
2700 reply.readException();
2701 int result = reply.readInt();
2702 reply.recycle();
2703 data.recycle();
2704 return result;
2705 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002706 public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage,
2707 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Jeff Hao1b012d32014-08-20 10:35:34 -07002708 int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options,
2709 int userId) throws RemoteException {
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002710 Parcel data = Parcel.obtain();
2711 Parcel reply = Parcel.obtain();
2712 data.writeInterfaceToken(IActivityManager.descriptor);
2713 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002714 data.writeString(callingPackage);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002715 intent.writeToParcel(data, 0);
2716 data.writeString(resolvedType);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002717 data.writeStrongBinder(resultTo);
2718 data.writeString(resultWho);
2719 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002720 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002721 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002722 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002723 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002724 } else {
2725 data.writeInt(0);
2726 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002727 if (options != null) {
2728 data.writeInt(1);
2729 options.writeToParcel(data, 0);
2730 } else {
2731 data.writeInt(0);
2732 }
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002733 data.writeInt(userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002734 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
2735 reply.readException();
2736 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
2737 reply.recycle();
2738 data.recycle();
2739 return result;
2740 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002741 public int startActivityWithConfig(IApplicationThread caller, String callingPackage,
2742 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002743 int requestCode, int startFlags, Configuration config,
Dianne Hackborn41203752012-08-31 14:05:51 -07002744 Bundle options, int userId) throws RemoteException {
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002745 Parcel data = Parcel.obtain();
2746 Parcel reply = Parcel.obtain();
2747 data.writeInterfaceToken(IActivityManager.descriptor);
2748 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002749 data.writeString(callingPackage);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002750 intent.writeToParcel(data, 0);
2751 data.writeString(resolvedType);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002752 data.writeStrongBinder(resultTo);
2753 data.writeString(resultWho);
2754 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002755 data.writeInt(startFlags);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002756 config.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002757 if (options != null) {
2758 data.writeInt(1);
2759 options.writeToParcel(data, 0);
2760 } else {
2761 data.writeInt(0);
2762 }
Dianne Hackborn41203752012-08-31 14:05:51 -07002763 data.writeInt(userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002764 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2765 reply.readException();
2766 int result = reply.readInt();
2767 reply.recycle();
2768 data.recycle();
2769 return result;
2770 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002771 public int startActivityIntentSender(IApplicationThread caller,
2772 IntentSender intent, Intent fillInIntent, String resolvedType,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002773 IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002774 int flagsMask, int flagsValues, Bundle options) throws RemoteException {
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002775 Parcel data = Parcel.obtain();
2776 Parcel reply = Parcel.obtain();
2777 data.writeInterfaceToken(IActivityManager.descriptor);
2778 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2779 intent.writeToParcel(data, 0);
2780 if (fillInIntent != null) {
2781 data.writeInt(1);
2782 fillInIntent.writeToParcel(data, 0);
2783 } else {
2784 data.writeInt(0);
2785 }
2786 data.writeString(resolvedType);
2787 data.writeStrongBinder(resultTo);
2788 data.writeString(resultWho);
2789 data.writeInt(requestCode);
2790 data.writeInt(flagsMask);
2791 data.writeInt(flagsValues);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002792 if (options != null) {
2793 data.writeInt(1);
2794 options.writeToParcel(data, 0);
2795 } else {
2796 data.writeInt(0);
2797 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002798 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002799 reply.readException();
2800 int result = reply.readInt();
2801 reply.recycle();
2802 data.recycle();
2803 return result;
2804 }
Dianne Hackborn91097de2014-04-04 18:02:06 -07002805 public int startVoiceActivity(String callingPackage, int callingPid, int callingUid,
2806 Intent intent, String resolvedType, IVoiceInteractionSession session,
Jeff Hao1b012d32014-08-20 10:35:34 -07002807 IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo,
2808 Bundle options, int userId) throws RemoteException {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002809 Parcel data = Parcel.obtain();
2810 Parcel reply = Parcel.obtain();
2811 data.writeInterfaceToken(IActivityManager.descriptor);
2812 data.writeString(callingPackage);
2813 data.writeInt(callingPid);
2814 data.writeInt(callingUid);
2815 intent.writeToParcel(data, 0);
2816 data.writeString(resolvedType);
2817 data.writeStrongBinder(session.asBinder());
2818 data.writeStrongBinder(interactor.asBinder());
2819 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002820 if (profilerInfo != null) {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002821 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002822 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn91097de2014-04-04 18:02:06 -07002823 } else {
2824 data.writeInt(0);
2825 }
2826 if (options != null) {
2827 data.writeInt(1);
2828 options.writeToParcel(data, 0);
2829 } else {
2830 data.writeInt(0);
2831 }
2832 data.writeInt(userId);
2833 mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0);
2834 reply.readException();
2835 int result = reply.readInt();
2836 reply.recycle();
2837 data.recycle();
2838 return result;
2839 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002840 public boolean startNextMatchingActivity(IBinder callingActivity,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002841 Intent intent, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002842 Parcel data = Parcel.obtain();
2843 Parcel reply = Parcel.obtain();
2844 data.writeInterfaceToken(IActivityManager.descriptor);
2845 data.writeStrongBinder(callingActivity);
2846 intent.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002847 if (options != null) {
2848 data.writeInt(1);
2849 options.writeToParcel(data, 0);
2850 } else {
2851 data.writeInt(0);
2852 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002853 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
2854 reply.readException();
2855 int result = reply.readInt();
2856 reply.recycle();
2857 data.recycle();
2858 return result != 0;
2859 }
Craig Mautnerdc00cbe2014-07-20 17:48:47 -07002860 public int startActivityFromRecents(int taskId, Bundle options) throws RemoteException {
2861 Parcel data = Parcel.obtain();
2862 Parcel reply = Parcel.obtain();
2863 data.writeInterfaceToken(IActivityManager.descriptor);
2864 data.writeInt(taskId);
2865 if (options == null) {
2866 data.writeInt(0);
2867 } else {
2868 data.writeInt(1);
2869 options.writeToParcel(data, 0);
2870 }
2871 mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0);
2872 reply.readException();
2873 int result = reply.readInt();
2874 reply.recycle();
2875 data.recycle();
2876 return result;
2877 }
Winson Chung3b3f4642014-04-22 10:08:18 -07002878 public boolean finishActivity(IBinder token, int resultCode, Intent resultData, boolean finishTask)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002879 throws RemoteException {
2880 Parcel data = Parcel.obtain();
2881 Parcel reply = Parcel.obtain();
2882 data.writeInterfaceToken(IActivityManager.descriptor);
2883 data.writeStrongBinder(token);
2884 data.writeInt(resultCode);
2885 if (resultData != null) {
2886 data.writeInt(1);
2887 resultData.writeToParcel(data, 0);
2888 } else {
2889 data.writeInt(0);
2890 }
Winson Chung3b3f4642014-04-22 10:08:18 -07002891 data.writeInt(finishTask ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002892 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
2893 reply.readException();
2894 boolean res = reply.readInt() != 0;
2895 data.recycle();
2896 reply.recycle();
2897 return res;
2898 }
2899 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
2900 {
2901 Parcel data = Parcel.obtain();
2902 Parcel reply = Parcel.obtain();
2903 data.writeInterfaceToken(IActivityManager.descriptor);
2904 data.writeStrongBinder(token);
2905 data.writeString(resultWho);
2906 data.writeInt(requestCode);
2907 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
2908 reply.readException();
2909 data.recycle();
2910 reply.recycle();
2911 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -07002912 public boolean finishActivityAffinity(IBinder token) throws RemoteException {
2913 Parcel data = Parcel.obtain();
2914 Parcel reply = Parcel.obtain();
2915 data.writeInterfaceToken(IActivityManager.descriptor);
2916 data.writeStrongBinder(token);
2917 mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0);
2918 reply.readException();
2919 boolean res = reply.readInt() != 0;
2920 data.recycle();
2921 reply.recycle();
2922 return res;
2923 }
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -07002924 public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException {
2925 Parcel data = Parcel.obtain();
2926 Parcel reply = Parcel.obtain();
2927 data.writeInterfaceToken(IActivityManager.descriptor);
2928 data.writeStrongBinder(session.asBinder());
2929 mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0);
2930 reply.readException();
2931 data.recycle();
2932 reply.recycle();
2933 }
Dianne Hackborn89ad4562014-08-24 16:45:38 -07002934 public boolean releaseActivityInstance(IBinder token) throws RemoteException {
2935 Parcel data = Parcel.obtain();
2936 Parcel reply = Parcel.obtain();
2937 data.writeInterfaceToken(IActivityManager.descriptor);
2938 data.writeStrongBinder(token);
2939 mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0);
2940 reply.readException();
2941 boolean res = reply.readInt() != 0;
2942 data.recycle();
2943 reply.recycle();
2944 return res;
2945 }
2946 public void releaseSomeActivities(IApplicationThread app) throws RemoteException {
2947 Parcel data = Parcel.obtain();
2948 Parcel reply = Parcel.obtain();
2949 data.writeInterfaceToken(IActivityManager.descriptor);
2950 data.writeStrongBinder(app.asBinder());
2951 mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0);
2952 reply.readException();
2953 data.recycle();
2954 reply.recycle();
2955 }
Dianne Hackborn061d58a2010-03-12 15:07:06 -08002956 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
2957 Parcel data = Parcel.obtain();
2958 Parcel reply = Parcel.obtain();
2959 data.writeInterfaceToken(IActivityManager.descriptor);
2960 data.writeStrongBinder(token);
2961 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
2962 reply.readException();
2963 boolean res = reply.readInt() != 0;
2964 data.recycle();
2965 reply.recycle();
2966 return res;
2967 }
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002968 public Intent registerReceiver(IApplicationThread caller, String packageName,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002969 IIntentReceiver receiver,
Dianne Hackborn20e80982012-08-31 19:00:44 -07002970 IntentFilter filter, String perm, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002971 {
2972 Parcel data = Parcel.obtain();
2973 Parcel reply = Parcel.obtain();
2974 data.writeInterfaceToken(IActivityManager.descriptor);
2975 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002976 data.writeString(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002977 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
2978 filter.writeToParcel(data, 0);
2979 data.writeString(perm);
Dianne Hackborn20e80982012-08-31 19:00:44 -07002980 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002981 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2982 reply.readException();
2983 Intent intent = null;
2984 int haveIntent = reply.readInt();
2985 if (haveIntent != 0) {
2986 intent = Intent.CREATOR.createFromParcel(reply);
2987 }
2988 reply.recycle();
2989 data.recycle();
2990 return intent;
2991 }
2992 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
2993 {
2994 Parcel data = Parcel.obtain();
2995 Parcel reply = Parcel.obtain();
2996 data.writeInterfaceToken(IActivityManager.descriptor);
2997 data.writeStrongBinder(receiver.asBinder());
2998 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2999 reply.readException();
3000 data.recycle();
3001 reply.recycle();
3002 }
3003 public int broadcastIntent(IApplicationThread caller,
Dianne Hackborna750a632015-06-16 17:18:23 -07003004 Intent intent, String resolvedType, IIntentReceiver resultTo,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003005 int resultCode, String resultData, Bundle map,
Dianne Hackborna750a632015-06-16 17:18:23 -07003006 String requiredPermission, int appOp, Bundle options, boolean serialized,
Amith Yamasani742a6712011-05-04 14:49:28 -07003007 boolean sticky, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003008 {
3009 Parcel data = Parcel.obtain();
3010 Parcel reply = Parcel.obtain();
3011 data.writeInterfaceToken(IActivityManager.descriptor);
3012 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3013 intent.writeToParcel(data, 0);
3014 data.writeString(resolvedType);
3015 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
3016 data.writeInt(resultCode);
3017 data.writeString(resultData);
3018 data.writeBundle(map);
3019 data.writeString(requiredPermission);
Dianne Hackbornf51f6122013-02-04 18:23:34 -08003020 data.writeInt(appOp);
Dianne Hackborna750a632015-06-16 17:18:23 -07003021 data.writeBundle(options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003022 data.writeInt(serialized ? 1 : 0);
3023 data.writeInt(sticky ? 1 : 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003024 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003025 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
3026 reply.readException();
3027 int res = reply.readInt();
3028 reply.recycle();
3029 data.recycle();
3030 return res;
3031 }
Amith Yamasani742a6712011-05-04 14:49:28 -07003032 public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
3033 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003034 {
3035 Parcel data = Parcel.obtain();
3036 Parcel reply = Parcel.obtain();
3037 data.writeInterfaceToken(IActivityManager.descriptor);
3038 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3039 intent.writeToParcel(data, 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003040 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003041 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
3042 reply.readException();
3043 data.recycle();
3044 reply.recycle();
3045 }
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003046 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map,
3047 boolean abortBroadcast, int flags) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003048 {
3049 Parcel data = Parcel.obtain();
3050 Parcel reply = Parcel.obtain();
3051 data.writeInterfaceToken(IActivityManager.descriptor);
3052 data.writeStrongBinder(who);
3053 data.writeInt(resultCode);
3054 data.writeString(resultData);
3055 data.writeBundle(map);
3056 data.writeInt(abortBroadcast ? 1 : 0);
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003057 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003058 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3059 reply.readException();
3060 data.recycle();
3061 reply.recycle();
3062 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003063 public void attachApplication(IApplicationThread app) throws RemoteException
3064 {
3065 Parcel data = Parcel.obtain();
3066 Parcel reply = Parcel.obtain();
3067 data.writeInterfaceToken(IActivityManager.descriptor);
3068 data.writeStrongBinder(app.asBinder());
3069 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
3070 reply.readException();
3071 data.recycle();
3072 reply.recycle();
3073 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003074 public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
3075 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003076 {
3077 Parcel data = Parcel.obtain();
3078 Parcel reply = Parcel.obtain();
3079 data.writeInterfaceToken(IActivityManager.descriptor);
3080 data.writeStrongBinder(token);
Dianne Hackborne88846e2009-09-30 21:34:25 -07003081 if (config != null) {
3082 data.writeInt(1);
3083 config.writeToParcel(data, 0);
3084 } else {
3085 data.writeInt(0);
3086 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003087 data.writeInt(stopProfiling ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003088 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3089 reply.readException();
3090 data.recycle();
3091 reply.recycle();
3092 }
Dianne Hackbornad9b32112012-09-17 15:35:01 -07003093 public void activityResumed(IBinder token) throws RemoteException
3094 {
3095 Parcel data = Parcel.obtain();
3096 Parcel reply = Parcel.obtain();
3097 data.writeInterfaceToken(IActivityManager.descriptor);
3098 data.writeStrongBinder(token);
3099 mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0);
3100 reply.readException();
3101 data.recycle();
3102 reply.recycle();
3103 }
Dianne Hackborna4e102e2014-09-04 22:52:27 -07003104 public void activityPaused(IBinder token) throws RemoteException
Dianne Hackborn0aae2d42010-12-07 23:51:29 -08003105 {
3106 Parcel data = Parcel.obtain();
3107 Parcel reply = Parcel.obtain();
3108 data.writeInterfaceToken(IActivityManager.descriptor);
3109 data.writeStrongBinder(token);
3110 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
3111 reply.readException();
3112 data.recycle();
3113 reply.recycle();
3114 }
3115 public void activityStopped(IBinder token, Bundle state,
Craig Mautnera0026042014-04-23 11:45:37 -07003116 PersistableBundle persistentState, CharSequence description) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003117 {
3118 Parcel data = Parcel.obtain();
3119 Parcel reply = Parcel.obtain();
3120 data.writeInterfaceToken(IActivityManager.descriptor);
3121 data.writeStrongBinder(token);
3122 data.writeBundle(state);
Craig Mautnera0026042014-04-23 11:45:37 -07003123 data.writePersistableBundle(persistentState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003124 TextUtils.writeToParcel(description, data, 0);
3125 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3126 reply.readException();
3127 data.recycle();
3128 reply.recycle();
3129 }
Dianne Hackborn4eba96b2011-01-21 13:34:36 -08003130 public void activitySlept(IBinder token) throws RemoteException
3131 {
3132 Parcel data = Parcel.obtain();
3133 Parcel reply = Parcel.obtain();
3134 data.writeInterfaceToken(IActivityManager.descriptor);
3135 data.writeStrongBinder(token);
3136 mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3137 reply.readException();
3138 data.recycle();
3139 reply.recycle();
3140 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003141 public void activityDestroyed(IBinder token) throws RemoteException
3142 {
3143 Parcel data = Parcel.obtain();
3144 Parcel reply = Parcel.obtain();
3145 data.writeInterfaceToken(IActivityManager.descriptor);
3146 data.writeStrongBinder(token);
3147 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3148 reply.readException();
3149 data.recycle();
3150 reply.recycle();
3151 }
3152 public String getCallingPackage(IBinder token) throws RemoteException
3153 {
3154 Parcel data = Parcel.obtain();
3155 Parcel reply = Parcel.obtain();
3156 data.writeInterfaceToken(IActivityManager.descriptor);
3157 data.writeStrongBinder(token);
3158 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
3159 reply.readException();
3160 String res = reply.readString();
3161 data.recycle();
3162 reply.recycle();
3163 return res;
3164 }
3165 public ComponentName getCallingActivity(IBinder token)
3166 throws RemoteException {
3167 Parcel data = Parcel.obtain();
3168 Parcel reply = Parcel.obtain();
3169 data.writeInterfaceToken(IActivityManager.descriptor);
3170 data.writeStrongBinder(token);
3171 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
3172 reply.readException();
3173 ComponentName res = ComponentName.readFromParcel(reply);
3174 data.recycle();
3175 reply.recycle();
3176 return res;
3177 }
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003178 public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException {
Winson Chung1147c402014-05-14 11:05:00 -07003179 Parcel data = Parcel.obtain();
3180 Parcel reply = Parcel.obtain();
3181 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003182 data.writeString(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -07003183 mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0);
3184 reply.readException();
3185 ArrayList<IAppTask> list = null;
3186 int N = reply.readInt();
3187 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003188 list = new ArrayList<>();
Winson Chung1147c402014-05-14 11:05:00 -07003189 while (N > 0) {
3190 IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder());
3191 list.add(task);
3192 N--;
3193 }
3194 }
3195 data.recycle();
3196 reply.recycle();
3197 return list;
3198 }
Dianne Hackbornaec68bb2014-08-20 15:25:13 -07003199 public int addAppTask(IBinder activityToken, Intent intent,
3200 ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException {
3201 Parcel data = Parcel.obtain();
3202 Parcel reply = Parcel.obtain();
3203 data.writeInterfaceToken(IActivityManager.descriptor);
3204 data.writeStrongBinder(activityToken);
3205 intent.writeToParcel(data, 0);
3206 description.writeToParcel(data, 0);
3207 thumbnail.writeToParcel(data, 0);
3208 mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0);
3209 reply.readException();
3210 int res = reply.readInt();
3211 data.recycle();
3212 reply.recycle();
3213 return res;
3214 }
3215 public Point getAppTaskThumbnailSize() throws RemoteException {
3216 Parcel data = Parcel.obtain();
3217 Parcel reply = Parcel.obtain();
3218 data.writeInterfaceToken(IActivityManager.descriptor);
3219 mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0);
3220 reply.readException();
3221 Point size = Point.CREATOR.createFromParcel(reply);
3222 data.recycle();
3223 reply.recycle();
3224 return size;
3225 }
Todd Kennedye635f662015-01-20 10:36:49 -08003226 public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags)
3227 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003228 Parcel data = Parcel.obtain();
3229 Parcel reply = Parcel.obtain();
3230 data.writeInterfaceToken(IActivityManager.descriptor);
3231 data.writeInt(maxNum);
3232 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003233 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
3234 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003235 ArrayList<ActivityManager.RunningTaskInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003236 int N = reply.readInt();
3237 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003238 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003239 while (N > 0) {
3240 ActivityManager.RunningTaskInfo info =
3241 ActivityManager.RunningTaskInfo.CREATOR
Winson Chung1147c402014-05-14 11:05:00 -07003242 .createFromParcel(reply);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003243 list.add(info);
3244 N--;
3245 }
3246 }
3247 data.recycle();
3248 reply.recycle();
3249 return list;
3250 }
3251 public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -07003252 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003253 Parcel data = Parcel.obtain();
3254 Parcel reply = Parcel.obtain();
3255 data.writeInterfaceToken(IActivityManager.descriptor);
3256 data.writeInt(maxNum);
3257 data.writeInt(flags);
Amith Yamasani82644082012-08-03 13:09:11 -07003258 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003259 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
3260 reply.readException();
3261 ArrayList<ActivityManager.RecentTaskInfo> list
3262 = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR);
3263 data.recycle();
3264 reply.recycle();
3265 return list;
3266 }
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003267 public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException {
Dianne Hackbornd94df452011-02-16 18:53:31 -08003268 Parcel data = Parcel.obtain();
3269 Parcel reply = Parcel.obtain();
3270 data.writeInterfaceToken(IActivityManager.descriptor);
3271 data.writeInt(id);
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003272 mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003273 reply.readException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003274 ActivityManager.TaskThumbnail taskThumbnail = null;
Dianne Hackbornd94df452011-02-16 18:53:31 -08003275 if (reply.readInt() != 0) {
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003276 taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003277 }
3278 data.recycle();
3279 reply.recycle();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003280 return taskThumbnail;
Dianne Hackborn15491c62012-09-19 10:59:14 -07003281 }
Todd Kennedye635f662015-01-20 10:36:49 -08003282 public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags)
3283 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003284 Parcel data = Parcel.obtain();
3285 Parcel reply = Parcel.obtain();
3286 data.writeInterfaceToken(IActivityManager.descriptor);
3287 data.writeInt(maxNum);
3288 data.writeInt(flags);
3289 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
3290 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003291 ArrayList<ActivityManager.RunningServiceInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003292 int N = reply.readInt();
3293 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003294 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003295 while (N > 0) {
3296 ActivityManager.RunningServiceInfo info =
3297 ActivityManager.RunningServiceInfo.CREATOR
3298 .createFromParcel(reply);
3299 list.add(info);
3300 N--;
3301 }
3302 }
3303 data.recycle();
3304 reply.recycle();
3305 return list;
3306 }
3307 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
3308 throws RemoteException {
3309 Parcel data = Parcel.obtain();
3310 Parcel reply = Parcel.obtain();
3311 data.writeInterfaceToken(IActivityManager.descriptor);
3312 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
3313 reply.readException();
3314 ArrayList<ActivityManager.ProcessErrorStateInfo> list
3315 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
3316 data.recycle();
3317 reply.recycle();
3318 return list;
3319 }
3320 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
3321 throws RemoteException {
3322 Parcel data = Parcel.obtain();
3323 Parcel reply = Parcel.obtain();
3324 data.writeInterfaceToken(IActivityManager.descriptor);
3325 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
3326 reply.readException();
3327 ArrayList<ActivityManager.RunningAppProcessInfo> list
3328 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
3329 data.recycle();
3330 reply.recycle();
3331 return list;
3332 }
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -07003333 public List<ApplicationInfo> getRunningExternalApplications()
3334 throws RemoteException {
3335 Parcel data = Parcel.obtain();
3336 Parcel reply = Parcel.obtain();
3337 data.writeInterfaceToken(IActivityManager.descriptor);
3338 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
3339 reply.readException();
3340 ArrayList<ApplicationInfo> list
3341 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
3342 data.recycle();
3343 reply.recycle();
3344 return list;
3345 }
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003346 public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003347 {
3348 Parcel data = Parcel.obtain();
3349 Parcel reply = Parcel.obtain();
3350 data.writeInterfaceToken(IActivityManager.descriptor);
3351 data.writeInt(task);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003352 data.writeInt(flags);
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003353 if (options != null) {
3354 data.writeInt(1);
3355 options.writeToParcel(data, 0);
3356 } else {
3357 data.writeInt(0);
3358 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003359 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
3360 reply.readException();
3361 data.recycle();
3362 reply.recycle();
3363 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003364 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
3365 throws RemoteException {
3366 Parcel data = Parcel.obtain();
3367 Parcel reply = Parcel.obtain();
3368 data.writeInterfaceToken(IActivityManager.descriptor);
3369 data.writeStrongBinder(token);
3370 data.writeInt(nonRoot ? 1 : 0);
3371 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
3372 reply.readException();
3373 boolean res = reply.readInt() != 0;
3374 data.recycle();
3375 reply.recycle();
3376 return res;
3377 }
3378 public void moveTaskBackwards(int task) throws RemoteException
3379 {
3380 Parcel data = Parcel.obtain();
3381 Parcel reply = Parcel.obtain();
3382 data.writeInterfaceToken(IActivityManager.descriptor);
3383 data.writeInt(task);
3384 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
3385 reply.readException();
3386 data.recycle();
3387 reply.recycle();
3388 }
Craig Mautnerc00204b2013-03-05 15:02:14 -08003389 @Override
Craig Mautnerc00204b2013-03-05 15:02:14 -08003390 public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException
3391 {
3392 Parcel data = Parcel.obtain();
3393 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003394 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003395 data.writeInt(taskId);
3396 data.writeInt(stackId);
3397 data.writeInt(toTop ? 1 : 0);
3398 mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0);
3399 reply.readException();
3400 data.recycle();
3401 reply.recycle();
3402 }
3403 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003404 public void resizeStack(int stackBoxId, Rect r) throws RemoteException
Craig Mautnerc00204b2013-03-05 15:02:14 -08003405 {
3406 Parcel data = Parcel.obtain();
3407 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003408 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautner5a449152013-05-24 15:49:29 -07003409 data.writeInt(stackBoxId);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003410 r.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07003411 mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003412 reply.readException();
3413 data.recycle();
3414 reply.recycle();
3415 }
Craig Mautner967212c2013-04-13 21:10:58 -07003416 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003417 public List<StackInfo> getAllStackInfos() throws RemoteException
Craig Mautner5ff12102013-05-24 12:50:15 -07003418 {
3419 Parcel data = Parcel.obtain();
3420 Parcel reply = Parcel.obtain();
3421 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003422 mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0);
Craig Mautner5ff12102013-05-24 12:50:15 -07003423 reply.readException();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003424 ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR);
Craig Mautner967212c2013-04-13 21:10:58 -07003425 data.recycle();
3426 reply.recycle();
3427 return list;
3428 }
Craig Mautnercf910b02013-04-23 11:23:27 -07003429 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003430 public StackInfo getStackInfo(int stackId) throws RemoteException
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003431 {
3432 Parcel data = Parcel.obtain();
3433 Parcel reply = Parcel.obtain();
3434 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003435 data.writeInt(stackId);
3436 mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003437 reply.readException();
3438 int res = reply.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003439 StackInfo info = null;
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003440 if (res != 0) {
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003441 info = StackInfo.CREATOR.createFromParcel(reply);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003442 }
3443 data.recycle();
3444 reply.recycle();
3445 return info;
3446 }
3447 @Override
Winson Chung303e1ff2014-03-07 15:06:19 -08003448 public boolean isInHomeStack(int taskId) throws RemoteException {
3449 Parcel data = Parcel.obtain();
3450 Parcel reply = Parcel.obtain();
3451 data.writeInterfaceToken(IActivityManager.descriptor);
3452 data.writeInt(taskId);
3453 mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0);
3454 reply.readException();
3455 boolean isInHomeStack = reply.readInt() > 0;
3456 data.recycle();
3457 reply.recycle();
3458 return isInHomeStack;
3459 }
3460 @Override
Craig Mautnercf910b02013-04-23 11:23:27 -07003461 public void setFocusedStack(int stackId) throws RemoteException
3462 {
3463 Parcel data = Parcel.obtain();
3464 Parcel reply = Parcel.obtain();
3465 data.writeInterfaceToken(IActivityManager.descriptor);
3466 data.writeInt(stackId);
Dianne Hackborn1e383822015-04-10 14:02:33 -07003467 mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0);
Craig Mautnercf910b02013-04-23 11:23:27 -07003468 reply.readException();
3469 data.recycle();
3470 reply.recycle();
3471 }
Winson Chung740c3ac2014-11-12 16:14:38 -08003472 @Override
Winson Chungd16c5652015-01-26 16:11:07 -08003473 public int getFocusedStackId() throws RemoteException {
3474 Parcel data = Parcel.obtain();
3475 Parcel reply = Parcel.obtain();
3476 data.writeInterfaceToken(IActivityManager.descriptor);
3477 mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0);
3478 reply.readException();
3479 int focusedStackId = reply.readInt();
3480 data.recycle();
3481 reply.recycle();
3482 return focusedStackId;
3483 }
3484 @Override
Winson Chung740c3ac2014-11-12 16:14:38 -08003485 public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException
3486 {
3487 Parcel data = Parcel.obtain();
3488 Parcel reply = Parcel.obtain();
3489 data.writeInterfaceToken(IActivityManager.descriptor);
3490 data.writeStrongBinder(listener.asBinder());
Dianne Hackborn1e383822015-04-10 14:02:33 -07003491 mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0);
Winson Chung740c3ac2014-11-12 16:14:38 -08003492 reply.readException();
3493 data.recycle();
3494 reply.recycle();
3495 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003496 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
3497 {
3498 Parcel data = Parcel.obtain();
3499 Parcel reply = Parcel.obtain();
3500 data.writeInterfaceToken(IActivityManager.descriptor);
3501 data.writeStrongBinder(token);
3502 data.writeInt(onlyRoot ? 1 : 0);
3503 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
3504 reply.readException();
3505 int res = reply.readInt();
3506 data.recycle();
3507 reply.recycle();
3508 return res;
3509 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003510 public ContentProviderHolder getContentProvider(IApplicationThread caller,
Jeff Sharkey6d515712012-09-20 16:06:08 -07003511 String name, int userId, boolean stable) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003512 Parcel data = Parcel.obtain();
3513 Parcel reply = Parcel.obtain();
3514 data.writeInterfaceToken(IActivityManager.descriptor);
3515 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3516 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003517 data.writeInt(userId);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003518 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003519 mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3520 reply.readException();
3521 int res = reply.readInt();
3522 ContentProviderHolder cph = null;
3523 if (res != 0) {
3524 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3525 }
3526 data.recycle();
3527 reply.recycle();
3528 return cph;
3529 }
Jeff Sharkey6d515712012-09-20 16:06:08 -07003530 public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token)
3531 throws RemoteException {
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003532 Parcel data = Parcel.obtain();
3533 Parcel reply = Parcel.obtain();
3534 data.writeInterfaceToken(IActivityManager.descriptor);
3535 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003536 data.writeInt(userId);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003537 data.writeStrongBinder(token);
3538 mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3539 reply.readException();
3540 int res = reply.readInt();
3541 ContentProviderHolder cph = null;
3542 if (res != 0) {
3543 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3544 }
3545 data.recycle();
3546 reply.recycle();
3547 return cph;
3548 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003549 public void publishContentProviders(IApplicationThread caller,
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003550 List<ContentProviderHolder> providers) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003551 {
3552 Parcel data = Parcel.obtain();
3553 Parcel reply = Parcel.obtain();
3554 data.writeInterfaceToken(IActivityManager.descriptor);
3555 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3556 data.writeTypedList(providers);
3557 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
3558 reply.readException();
3559 data.recycle();
3560 reply.recycle();
3561 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003562 public boolean refContentProvider(IBinder connection, int stable, int unstable)
3563 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003564 Parcel data = Parcel.obtain();
3565 Parcel reply = Parcel.obtain();
3566 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003567 data.writeStrongBinder(connection);
3568 data.writeInt(stable);
3569 data.writeInt(unstable);
3570 mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3571 reply.readException();
3572 boolean res = reply.readInt() != 0;
3573 data.recycle();
3574 reply.recycle();
3575 return res;
3576 }
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003577
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003578 public void unstableProviderDied(IBinder connection) throws RemoteException {
3579 Parcel data = Parcel.obtain();
3580 Parcel reply = Parcel.obtain();
3581 data.writeInterfaceToken(IActivityManager.descriptor);
3582 data.writeStrongBinder(connection);
3583 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0);
3584 reply.readException();
3585 data.recycle();
3586 reply.recycle();
3587 }
3588
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003589 @Override
3590 public void appNotRespondingViaProvider(IBinder connection) throws RemoteException {
3591 Parcel data = Parcel.obtain();
3592 Parcel reply = Parcel.obtain();
3593 data.writeInterfaceToken(IActivityManager.descriptor);
3594 data.writeStrongBinder(connection);
3595 mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0);
3596 reply.readException();
3597 data.recycle();
3598 reply.recycle();
3599 }
3600
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003601 public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException {
3602 Parcel data = Parcel.obtain();
3603 Parcel reply = Parcel.obtain();
3604 data.writeInterfaceToken(IActivityManager.descriptor);
3605 data.writeStrongBinder(connection);
3606 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003607 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3608 reply.readException();
3609 data.recycle();
3610 reply.recycle();
3611 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003612
3613 public void removeContentProviderExternal(String name, IBinder token) throws RemoteException {
3614 Parcel data = Parcel.obtain();
3615 Parcel reply = Parcel.obtain();
3616 data.writeInterfaceToken(IActivityManager.descriptor);
3617 data.writeString(name);
3618 data.writeStrongBinder(token);
3619 mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3620 reply.readException();
3621 data.recycle();
3622 reply.recycle();
3623 }
3624
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07003625 public PendingIntent getRunningServiceControlPanel(ComponentName service)
3626 throws RemoteException
3627 {
3628 Parcel data = Parcel.obtain();
3629 Parcel reply = Parcel.obtain();
3630 data.writeInterfaceToken(IActivityManager.descriptor);
3631 service.writeToParcel(data, 0);
3632 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
3633 reply.readException();
3634 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
3635 data.recycle();
3636 reply.recycle();
3637 return res;
3638 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003639
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003640 public ComponentName startService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003641 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003642 {
3643 Parcel data = Parcel.obtain();
3644 Parcel reply = Parcel.obtain();
3645 data.writeInterfaceToken(IActivityManager.descriptor);
3646 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3647 service.writeToParcel(data, 0);
3648 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003649 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003650 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
3651 reply.readException();
3652 ComponentName res = ComponentName.readFromParcel(reply);
3653 data.recycle();
3654 reply.recycle();
3655 return res;
3656 }
3657 public int stopService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003658 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003659 {
3660 Parcel data = Parcel.obtain();
3661 Parcel reply = Parcel.obtain();
3662 data.writeInterfaceToken(IActivityManager.descriptor);
3663 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3664 service.writeToParcel(data, 0);
3665 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003666 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003667 mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0);
3668 reply.readException();
3669 int res = reply.readInt();
3670 reply.recycle();
3671 data.recycle();
3672 return res;
3673 }
3674 public boolean stopServiceToken(ComponentName className, IBinder token,
3675 int startId) throws RemoteException {
3676 Parcel data = Parcel.obtain();
3677 Parcel reply = Parcel.obtain();
3678 data.writeInterfaceToken(IActivityManager.descriptor);
3679 ComponentName.writeToParcel(className, data);
3680 data.writeStrongBinder(token);
3681 data.writeInt(startId);
3682 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
3683 reply.readException();
3684 boolean res = reply.readInt() != 0;
3685 data.recycle();
3686 reply.recycle();
3687 return res;
3688 }
3689 public void setServiceForeground(ComponentName className, IBinder token,
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003690 int id, Notification notification, boolean removeNotification) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003691 Parcel data = Parcel.obtain();
3692 Parcel reply = Parcel.obtain();
3693 data.writeInterfaceToken(IActivityManager.descriptor);
3694 ComponentName.writeToParcel(className, data);
3695 data.writeStrongBinder(token);
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003696 data.writeInt(id);
3697 if (notification != null) {
3698 data.writeInt(1);
3699 notification.writeToParcel(data, 0);
3700 } else {
3701 data.writeInt(0);
3702 }
3703 data.writeInt(removeNotification ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003704 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
3705 reply.readException();
3706 data.recycle();
3707 reply.recycle();
3708 }
3709 public int bindService(IApplicationThread caller, IBinder token,
3710 Intent service, String resolvedType, IServiceConnection connection,
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003711 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003712 Parcel data = Parcel.obtain();
3713 Parcel reply = Parcel.obtain();
3714 data.writeInterfaceToken(IActivityManager.descriptor);
3715 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3716 data.writeStrongBinder(token);
3717 service.writeToParcel(data, 0);
3718 data.writeString(resolvedType);
3719 data.writeStrongBinder(connection.asBinder());
3720 data.writeInt(flags);
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003721 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003722 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
3723 reply.readException();
3724 int res = reply.readInt();
3725 data.recycle();
3726 reply.recycle();
3727 return res;
3728 }
3729 public boolean unbindService(IServiceConnection connection) throws RemoteException
3730 {
3731 Parcel data = Parcel.obtain();
3732 Parcel reply = Parcel.obtain();
3733 data.writeInterfaceToken(IActivityManager.descriptor);
3734 data.writeStrongBinder(connection.asBinder());
3735 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
3736 reply.readException();
3737 boolean res = reply.readInt() != 0;
3738 data.recycle();
3739 reply.recycle();
3740 return res;
3741 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003742
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003743 public void publishService(IBinder token,
3744 Intent intent, IBinder service) throws RemoteException {
3745 Parcel data = Parcel.obtain();
3746 Parcel reply = Parcel.obtain();
3747 data.writeInterfaceToken(IActivityManager.descriptor);
3748 data.writeStrongBinder(token);
3749 intent.writeToParcel(data, 0);
3750 data.writeStrongBinder(service);
3751 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
3752 reply.readException();
3753 data.recycle();
3754 reply.recycle();
3755 }
3756
3757 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
3758 throws RemoteException {
3759 Parcel data = Parcel.obtain();
3760 Parcel reply = Parcel.obtain();
3761 data.writeInterfaceToken(IActivityManager.descriptor);
3762 data.writeStrongBinder(token);
3763 intent.writeToParcel(data, 0);
3764 data.writeInt(doRebind ? 1 : 0);
3765 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
3766 reply.readException();
3767 data.recycle();
3768 reply.recycle();
3769 }
3770
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003771 public void serviceDoneExecuting(IBinder token, int type, int startId,
3772 int res) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003773 Parcel data = Parcel.obtain();
3774 Parcel reply = Parcel.obtain();
3775 data.writeInterfaceToken(IActivityManager.descriptor);
3776 data.writeStrongBinder(token);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003777 data.writeInt(type);
3778 data.writeInt(startId);
3779 data.writeInt(res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003780 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3781 reply.readException();
3782 data.recycle();
3783 reply.recycle();
3784 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003785
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003786 public IBinder peekService(Intent service, String resolvedType) throws RemoteException {
3787 Parcel data = Parcel.obtain();
3788 Parcel reply = Parcel.obtain();
3789 data.writeInterfaceToken(IActivityManager.descriptor);
3790 service.writeToParcel(data, 0);
3791 data.writeString(resolvedType);
3792 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
3793 reply.readException();
3794 IBinder binder = reply.readStrongBinder();
3795 reply.recycle();
3796 data.recycle();
3797 return binder;
3798 }
3799
Christopher Tate181fafa2009-05-14 11:12:14 -07003800 public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
3801 throws RemoteException {
3802 Parcel data = Parcel.obtain();
3803 Parcel reply = Parcel.obtain();
3804 data.writeInterfaceToken(IActivityManager.descriptor);
3805 app.writeToParcel(data, 0);
3806 data.writeInt(backupRestoreMode);
3807 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3808 reply.readException();
3809 boolean success = reply.readInt() != 0;
3810 reply.recycle();
3811 data.recycle();
3812 return success;
3813 }
3814
Christopher Tate346acb12012-10-15 19:20:25 -07003815 public void clearPendingBackup() throws RemoteException {
3816 Parcel data = Parcel.obtain();
3817 Parcel reply = Parcel.obtain();
3818 data.writeInterfaceToken(IActivityManager.descriptor);
3819 mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0);
3820 reply.recycle();
3821 data.recycle();
3822 }
3823
Christopher Tate181fafa2009-05-14 11:12:14 -07003824 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
3825 Parcel data = Parcel.obtain();
3826 Parcel reply = Parcel.obtain();
3827 data.writeInterfaceToken(IActivityManager.descriptor);
3828 data.writeString(packageName);
3829 data.writeStrongBinder(agent);
3830 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
3831 reply.recycle();
3832 data.recycle();
3833 }
3834
3835 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
3836 Parcel data = Parcel.obtain();
3837 Parcel reply = Parcel.obtain();
3838 data.writeInterfaceToken(IActivityManager.descriptor);
3839 app.writeToParcel(data, 0);
3840 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3841 reply.readException();
3842 reply.recycle();
3843 data.recycle();
3844 }
3845
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003846 public boolean startInstrumentation(ComponentName className, String profileFile,
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003847 int flags, Bundle arguments, IInstrumentationWatcher watcher,
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01003848 IUiAutomationConnection connection, int userId, String instructionSet)
3849 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003850 Parcel data = Parcel.obtain();
3851 Parcel reply = Parcel.obtain();
3852 data.writeInterfaceToken(IActivityManager.descriptor);
3853 ComponentName.writeToParcel(className, data);
3854 data.writeString(profileFile);
3855 data.writeInt(flags);
3856 data.writeBundle(arguments);
3857 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003858 data.writeStrongBinder(connection != null ? connection.asBinder() : null);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07003859 data.writeInt(userId);
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01003860 data.writeString(instructionSet);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003861 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3862 reply.readException();
3863 boolean res = reply.readInt() != 0;
3864 reply.recycle();
3865 data.recycle();
3866 return res;
3867 }
3868
3869 public void finishInstrumentation(IApplicationThread target,
3870 int resultCode, Bundle results) throws RemoteException {
3871 Parcel data = Parcel.obtain();
3872 Parcel reply = Parcel.obtain();
3873 data.writeInterfaceToken(IActivityManager.descriptor);
3874 data.writeStrongBinder(target != null ? target.asBinder() : null);
3875 data.writeInt(resultCode);
3876 data.writeBundle(results);
3877 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3878 reply.readException();
3879 data.recycle();
3880 reply.recycle();
3881 }
3882 public Configuration getConfiguration() throws RemoteException
3883 {
3884 Parcel data = Parcel.obtain();
3885 Parcel reply = Parcel.obtain();
3886 data.writeInterfaceToken(IActivityManager.descriptor);
3887 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
3888 reply.readException();
3889 Configuration res = Configuration.CREATOR.createFromParcel(reply);
3890 reply.recycle();
3891 data.recycle();
3892 return res;
3893 }
3894 public void updateConfiguration(Configuration values) throws RemoteException
3895 {
3896 Parcel data = Parcel.obtain();
3897 Parcel reply = Parcel.obtain();
3898 data.writeInterfaceToken(IActivityManager.descriptor);
3899 values.writeToParcel(data, 0);
3900 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
3901 reply.readException();
3902 data.recycle();
3903 reply.recycle();
3904 }
3905 public void setRequestedOrientation(IBinder token, int requestedOrientation)
3906 throws RemoteException {
3907 Parcel data = Parcel.obtain();
3908 Parcel reply = Parcel.obtain();
3909 data.writeInterfaceToken(IActivityManager.descriptor);
3910 data.writeStrongBinder(token);
3911 data.writeInt(requestedOrientation);
3912 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3913 reply.readException();
3914 data.recycle();
3915 reply.recycle();
3916 }
3917 public int getRequestedOrientation(IBinder token) throws RemoteException {
3918 Parcel data = Parcel.obtain();
3919 Parcel reply = Parcel.obtain();
3920 data.writeInterfaceToken(IActivityManager.descriptor);
3921 data.writeStrongBinder(token);
3922 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3923 reply.readException();
3924 int res = reply.readInt();
3925 data.recycle();
3926 reply.recycle();
3927 return res;
3928 }
3929 public ComponentName getActivityClassForToken(IBinder token)
3930 throws RemoteException {
3931 Parcel data = Parcel.obtain();
3932 Parcel reply = Parcel.obtain();
3933 data.writeInterfaceToken(IActivityManager.descriptor);
3934 data.writeStrongBinder(token);
3935 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
3936 reply.readException();
3937 ComponentName res = ComponentName.readFromParcel(reply);
3938 data.recycle();
3939 reply.recycle();
3940 return res;
3941 }
3942 public String getPackageForToken(IBinder token) throws RemoteException
3943 {
3944 Parcel data = Parcel.obtain();
3945 Parcel reply = Parcel.obtain();
3946 data.writeInterfaceToken(IActivityManager.descriptor);
3947 data.writeStrongBinder(token);
3948 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
3949 reply.readException();
3950 String res = reply.readString();
3951 data.recycle();
3952 reply.recycle();
3953 return res;
3954 }
3955 public IIntentSender getIntentSender(int type,
3956 String packageName, IBinder token, String resultWho,
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003957 int requestCode, Intent[] intents, String[] resolvedTypes, int flags,
Dianne Hackborn41203752012-08-31 14:05:51 -07003958 Bundle options, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003959 Parcel data = Parcel.obtain();
3960 Parcel reply = Parcel.obtain();
3961 data.writeInterfaceToken(IActivityManager.descriptor);
3962 data.writeInt(type);
3963 data.writeString(packageName);
3964 data.writeStrongBinder(token);
3965 data.writeString(resultWho);
3966 data.writeInt(requestCode);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003967 if (intents != null) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003968 data.writeInt(1);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003969 data.writeTypedArray(intents, 0);
3970 data.writeStringArray(resolvedTypes);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003971 } else {
3972 data.writeInt(0);
3973 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003974 data.writeInt(flags);
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003975 if (options != null) {
3976 data.writeInt(1);
3977 options.writeToParcel(data, 0);
3978 } else {
3979 data.writeInt(0);
3980 }
Dianne Hackborn41203752012-08-31 14:05:51 -07003981 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003982 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
3983 reply.readException();
3984 IIntentSender res = IIntentSender.Stub.asInterface(
Dianne Hackbornff170242014-11-19 10:59:01 -08003985 reply.readStrongBinder());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003986 data.recycle();
3987 reply.recycle();
3988 return res;
3989 }
3990 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
3991 Parcel data = Parcel.obtain();
3992 Parcel reply = Parcel.obtain();
3993 data.writeInterfaceToken(IActivityManager.descriptor);
3994 data.writeStrongBinder(sender.asBinder());
3995 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
3996 reply.readException();
3997 data.recycle();
3998 reply.recycle();
3999 }
4000 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
4001 Parcel data = Parcel.obtain();
4002 Parcel reply = Parcel.obtain();
4003 data.writeInterfaceToken(IActivityManager.descriptor);
4004 data.writeStrongBinder(sender.asBinder());
4005 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4006 reply.readException();
4007 String res = reply.readString();
4008 data.recycle();
4009 reply.recycle();
4010 return res;
4011 }
Christopher Tatec4a07d12012-04-06 14:19:13 -07004012 public int getUidForIntentSender(IIntentSender sender) throws RemoteException {
4013 Parcel data = Parcel.obtain();
4014 Parcel reply = Parcel.obtain();
4015 data.writeInterfaceToken(IActivityManager.descriptor);
4016 data.writeStrongBinder(sender.asBinder());
4017 mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4018 reply.readException();
4019 int res = reply.readInt();
4020 data.recycle();
4021 reply.recycle();
4022 return res;
4023 }
Dianne Hackborn41203752012-08-31 14:05:51 -07004024 public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
4025 boolean requireFull, String name, String callerPackage) throws RemoteException {
4026 Parcel data = Parcel.obtain();
4027 Parcel reply = Parcel.obtain();
4028 data.writeInterfaceToken(IActivityManager.descriptor);
4029 data.writeInt(callingPid);
4030 data.writeInt(callingUid);
4031 data.writeInt(userId);
4032 data.writeInt(allowAll ? 1 : 0);
4033 data.writeInt(requireFull ? 1 : 0);
4034 data.writeString(name);
4035 data.writeString(callerPackage);
4036 mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0);
4037 reply.readException();
4038 int res = reply.readInt();
4039 data.recycle();
4040 reply.recycle();
4041 return res;
4042 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004043 public void setProcessLimit(int max) throws RemoteException
4044 {
4045 Parcel data = Parcel.obtain();
4046 Parcel reply = Parcel.obtain();
4047 data.writeInterfaceToken(IActivityManager.descriptor);
4048 data.writeInt(max);
4049 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4050 reply.readException();
4051 data.recycle();
4052 reply.recycle();
4053 }
4054 public int getProcessLimit() throws RemoteException
4055 {
4056 Parcel data = Parcel.obtain();
4057 Parcel reply = Parcel.obtain();
4058 data.writeInterfaceToken(IActivityManager.descriptor);
4059 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4060 reply.readException();
4061 int res = reply.readInt();
4062 data.recycle();
4063 reply.recycle();
4064 return res;
4065 }
4066 public void setProcessForeground(IBinder token, int pid,
4067 boolean isForeground) throws RemoteException {
4068 Parcel data = Parcel.obtain();
4069 Parcel reply = Parcel.obtain();
4070 data.writeInterfaceToken(IActivityManager.descriptor);
4071 data.writeStrongBinder(token);
4072 data.writeInt(pid);
4073 data.writeInt(isForeground ? 1 : 0);
4074 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
4075 reply.readException();
4076 data.recycle();
4077 reply.recycle();
4078 }
4079 public int checkPermission(String permission, int pid, int uid)
4080 throws RemoteException {
4081 Parcel data = Parcel.obtain();
4082 Parcel reply = Parcel.obtain();
4083 data.writeInterfaceToken(IActivityManager.descriptor);
4084 data.writeString(permission);
4085 data.writeInt(pid);
4086 data.writeInt(uid);
4087 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
4088 reply.readException();
4089 int res = reply.readInt();
4090 data.recycle();
4091 reply.recycle();
4092 return res;
4093 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004094 public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken)
4095 throws RemoteException {
4096 Parcel data = Parcel.obtain();
4097 Parcel reply = Parcel.obtain();
4098 data.writeInterfaceToken(IActivityManager.descriptor);
4099 data.writeString(permission);
4100 data.writeInt(pid);
4101 data.writeInt(uid);
4102 data.writeStrongBinder(callerToken);
4103 mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0);
4104 reply.readException();
4105 int res = reply.readInt();
4106 data.recycle();
4107 reply.recycle();
4108 return res;
4109 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004110 public boolean clearApplicationUserData(final String packageName,
Amith Yamasani742a6712011-05-04 14:49:28 -07004111 final IPackageDataObserver observer, final int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004112 Parcel data = Parcel.obtain();
4113 Parcel reply = Parcel.obtain();
4114 data.writeInterfaceToken(IActivityManager.descriptor);
4115 data.writeString(packageName);
Christopher Tate31b65f92013-09-09 14:17:27 -07004116 data.writeStrongBinder((observer != null) ? observer.asBinder() : null);
Amith Yamasani742a6712011-05-04 14:49:28 -07004117 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004118 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
4119 reply.readException();
4120 boolean res = reply.readInt() != 0;
4121 data.recycle();
4122 reply.recycle();
4123 return res;
4124 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004125 public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId,
4126 IBinder callerToken) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004127 Parcel data = Parcel.obtain();
4128 Parcel reply = Parcel.obtain();
4129 data.writeInterfaceToken(IActivityManager.descriptor);
4130 uri.writeToParcel(data, 0);
4131 data.writeInt(pid);
4132 data.writeInt(uid);
4133 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004134 data.writeInt(userId);
Dianne Hackbornff170242014-11-19 10:59:01 -08004135 data.writeStrongBinder(callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004136 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
4137 reply.readException();
4138 int res = reply.readInt();
4139 data.recycle();
4140 reply.recycle();
4141 return res;
4142 }
4143 public void grantUriPermission(IApplicationThread caller, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004144 Uri uri, int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004145 Parcel data = Parcel.obtain();
4146 Parcel reply = Parcel.obtain();
4147 data.writeInterfaceToken(IActivityManager.descriptor);
4148 data.writeStrongBinder(caller.asBinder());
4149 data.writeString(targetPkg);
4150 uri.writeToParcel(data, 0);
4151 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004152 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004153 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4154 reply.readException();
4155 data.recycle();
4156 reply.recycle();
4157 }
4158 public void revokeUriPermission(IApplicationThread caller, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004159 int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004160 Parcel data = Parcel.obtain();
4161 Parcel reply = Parcel.obtain();
4162 data.writeInterfaceToken(IActivityManager.descriptor);
4163 data.writeStrongBinder(caller.asBinder());
4164 uri.writeToParcel(data, 0);
4165 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004166 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004167 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4168 reply.readException();
4169 data.recycle();
4170 reply.recycle();
4171 }
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004172
4173 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004174 public void takePersistableUriPermission(Uri uri, int mode, int userId)
4175 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004176 Parcel data = Parcel.obtain();
4177 Parcel reply = Parcel.obtain();
4178 data.writeInterfaceToken(IActivityManager.descriptor);
4179 uri.writeToParcel(data, 0);
4180 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004181 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004182 mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4183 reply.readException();
4184 data.recycle();
4185 reply.recycle();
4186 }
4187
4188 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004189 public void releasePersistableUriPermission(Uri uri, int mode, int userId)
4190 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004191 Parcel data = Parcel.obtain();
4192 Parcel reply = Parcel.obtain();
4193 data.writeInterfaceToken(IActivityManager.descriptor);
4194 uri.writeToParcel(data, 0);
4195 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004196 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004197 mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4198 reply.readException();
4199 data.recycle();
4200 reply.recycle();
4201 }
4202
4203 @Override
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004204 public ParceledListSlice<UriPermission> getPersistedUriPermissions(
4205 String packageName, boolean incoming) throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004206 Parcel data = Parcel.obtain();
4207 Parcel reply = Parcel.obtain();
4208 data.writeInterfaceToken(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004209 data.writeString(packageName);
4210 data.writeInt(incoming ? 1 : 0);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004211 mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
4212 reply.readException();
4213 final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel(
4214 reply);
4215 data.recycle();
4216 reply.recycle();
4217 return perms;
4218 }
4219
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004220 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
4221 throws RemoteException {
4222 Parcel data = Parcel.obtain();
4223 Parcel reply = Parcel.obtain();
4224 data.writeInterfaceToken(IActivityManager.descriptor);
4225 data.writeStrongBinder(who.asBinder());
4226 data.writeInt(waiting ? 1 : 0);
4227 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
4228 reply.readException();
4229 data.recycle();
4230 reply.recycle();
4231 }
4232 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
4233 Parcel data = Parcel.obtain();
4234 Parcel reply = Parcel.obtain();
4235 data.writeInterfaceToken(IActivityManager.descriptor);
4236 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
4237 reply.readException();
4238 outInfo.readFromParcel(reply);
4239 data.recycle();
4240 reply.recycle();
4241 }
4242 public void unhandledBack() throws RemoteException
4243 {
4244 Parcel data = Parcel.obtain();
4245 Parcel reply = Parcel.obtain();
4246 data.writeInterfaceToken(IActivityManager.descriptor);
4247 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
4248 reply.readException();
4249 data.recycle();
4250 reply.recycle();
4251 }
4252 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
4253 {
4254 Parcel data = Parcel.obtain();
4255 Parcel reply = Parcel.obtain();
4256 data.writeInterfaceToken(IActivityManager.descriptor);
4257 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
4258 reply.readException();
4259 ParcelFileDescriptor pfd = null;
4260 if (reply.readInt() != 0) {
4261 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
4262 }
4263 data.recycle();
4264 reply.recycle();
4265 return pfd;
4266 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07004267 public void setLockScreenShown(boolean shown) throws RemoteException
4268 {
4269 Parcel data = Parcel.obtain();
4270 Parcel reply = Parcel.obtain();
4271 data.writeInterfaceToken(IActivityManager.descriptor);
4272 data.writeInt(shown ? 1 : 0);
4273 mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0);
4274 reply.readException();
4275 data.recycle();
4276 reply.recycle();
4277 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004278 public void setDebugApp(
4279 String packageName, boolean waitForDebugger, boolean persistent)
4280 throws RemoteException
4281 {
4282 Parcel data = Parcel.obtain();
4283 Parcel reply = Parcel.obtain();
4284 data.writeInterfaceToken(IActivityManager.descriptor);
4285 data.writeString(packageName);
4286 data.writeInt(waitForDebugger ? 1 : 0);
4287 data.writeInt(persistent ? 1 : 0);
4288 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
4289 reply.readException();
4290 data.recycle();
4291 reply.recycle();
4292 }
4293 public void setAlwaysFinish(boolean enabled) throws RemoteException
4294 {
4295 Parcel data = Parcel.obtain();
4296 Parcel reply = Parcel.obtain();
4297 data.writeInterfaceToken(IActivityManager.descriptor);
4298 data.writeInt(enabled ? 1 : 0);
4299 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
4300 reply.readException();
4301 data.recycle();
4302 reply.recycle();
4303 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004304 public void setActivityController(IActivityController watcher) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004305 {
4306 Parcel data = Parcel.obtain();
4307 Parcel reply = Parcel.obtain();
4308 data.writeInterfaceToken(IActivityManager.descriptor);
4309 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004310 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004311 reply.readException();
4312 data.recycle();
4313 reply.recycle();
4314 }
4315 public void enterSafeMode() throws RemoteException {
4316 Parcel data = Parcel.obtain();
4317 data.writeInterfaceToken(IActivityManager.descriptor);
4318 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
4319 data.recycle();
4320 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07004321 public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag)
Dianne Hackborn099bc622014-01-22 13:39:16 -08004322 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004323 Parcel data = Parcel.obtain();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004324 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn099bc622014-01-22 13:39:16 -08004325 data.writeStrongBinder(sender.asBinder());
4326 data.writeInt(sourceUid);
4327 data.writeString(sourcePkg);
Dianne Hackborn1e383822015-04-10 14:02:33 -07004328 data.writeString(tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004329 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
4330 data.recycle();
4331 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07004332 public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag)
4333 throws RemoteException {
4334 Parcel data = Parcel.obtain();
4335 data.writeInterfaceToken(IActivityManager.descriptor);
4336 data.writeStrongBinder(sender.asBinder());
4337 data.writeInt(sourceUid);
4338 data.writeString(tag);
4339 mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0);
4340 data.recycle();
4341 }
4342 public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag)
4343 throws RemoteException {
4344 Parcel data = Parcel.obtain();
4345 data.writeInterfaceToken(IActivityManager.descriptor);
4346 data.writeStrongBinder(sender.asBinder());
4347 data.writeInt(sourceUid);
4348 data.writeString(tag);
4349 mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0);
4350 data.recycle();
4351 }
Dianne Hackborn64825172011-03-02 21:32:58 -08004352 public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004353 Parcel data = Parcel.obtain();
4354 Parcel reply = Parcel.obtain();
4355 data.writeInterfaceToken(IActivityManager.descriptor);
4356 data.writeIntArray(pids);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004357 data.writeString(reason);
Dianne Hackborn64825172011-03-02 21:32:58 -08004358 data.writeInt(secure ? 1 : 0);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004359 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07004360 reply.readException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004361 boolean res = reply.readInt() != 0;
4362 data.recycle();
4363 reply.recycle();
4364 return res;
4365 }
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07004366 @Override
4367 public boolean killProcessesBelowForeground(String reason) throws RemoteException {
4368 Parcel data = Parcel.obtain();
4369 Parcel reply = Parcel.obtain();
4370 data.writeInterfaceToken(IActivityManager.descriptor);
4371 data.writeString(reason);
4372 mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0);
4373 boolean res = reply.readInt() != 0;
4374 data.recycle();
4375 reply.recycle();
4376 return res;
4377 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004378 public boolean testIsSystemReady()
4379 {
4380 /* this base class version is never called */
4381 return true;
4382 }
Dan Egnor60d87622009-12-16 16:32:58 -08004383 public void handleApplicationCrash(IBinder app,
4384 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
4385 {
4386 Parcel data = Parcel.obtain();
4387 Parcel reply = Parcel.obtain();
4388 data.writeInterfaceToken(IActivityManager.descriptor);
4389 data.writeStrongBinder(app);
4390 crashInfo.writeToParcel(data, 0);
4391 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
4392 reply.readException();
4393 reply.recycle();
4394 data.recycle();
4395 }
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004396
Dianne Hackborn52322712014-08-26 22:47:26 -07004397 public boolean handleApplicationWtf(IBinder app, String tag, boolean system,
Dan Egnorb7f03672009-12-09 16:22:32 -08004398 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004399 {
4400 Parcel data = Parcel.obtain();
4401 Parcel reply = Parcel.obtain();
4402 data.writeInterfaceToken(IActivityManager.descriptor);
4403 data.writeStrongBinder(app);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004404 data.writeString(tag);
Dianne Hackborn52322712014-08-26 22:47:26 -07004405 data.writeInt(system ? 1 : 0);
Dan Egnorb7f03672009-12-09 16:22:32 -08004406 crashInfo.writeToParcel(data, 0);
Dan Egnor60d87622009-12-16 16:32:58 -08004407 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004408 reply.readException();
Dan Egnor60d87622009-12-16 16:32:58 -08004409 boolean res = reply.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004410 reply.recycle();
4411 data.recycle();
Dan Egnor60d87622009-12-16 16:32:58 -08004412 return res;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004413 }
Dan Egnorb7f03672009-12-09 16:22:32 -08004414
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004415 public void handleApplicationStrictModeViolation(IBinder app,
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004416 int violationMask,
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004417 StrictMode.ViolationInfo info) throws RemoteException
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004418 {
4419 Parcel data = Parcel.obtain();
4420 Parcel reply = Parcel.obtain();
4421 data.writeInterfaceToken(IActivityManager.descriptor);
4422 data.writeStrongBinder(app);
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004423 data.writeInt(violationMask);
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004424 info.writeToParcel(data, 0);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004425 mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0);
4426 reply.readException();
4427 reply.recycle();
4428 data.recycle();
4429 }
4430
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004431 public void signalPersistentProcesses(int sig) throws RemoteException {
4432 Parcel data = Parcel.obtain();
4433 Parcel reply = Parcel.obtain();
4434 data.writeInterfaceToken(IActivityManager.descriptor);
4435 data.writeInt(sig);
4436 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
4437 reply.readException();
4438 data.recycle();
4439 reply.recycle();
4440 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004441
Dianne Hackborn1676c852012-09-10 14:52:30 -07004442 public void killBackgroundProcesses(String packageName, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004443 Parcel data = Parcel.obtain();
4444 Parcel reply = Parcel.obtain();
4445 data.writeInterfaceToken(IActivityManager.descriptor);
4446 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004447 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004448 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4449 reply.readException();
4450 data.recycle();
4451 reply.recycle();
4452 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004453
4454 public void killAllBackgroundProcesses() throws RemoteException {
4455 Parcel data = Parcel.obtain();
4456 Parcel reply = Parcel.obtain();
4457 data.writeInterfaceToken(IActivityManager.descriptor);
4458 mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4459 reply.readException();
4460 data.recycle();
4461 reply.recycle();
4462 }
4463
Dianne Hackborn1676c852012-09-10 14:52:30 -07004464 public void forceStopPackage(String packageName, int userId) throws RemoteException {
Dianne Hackborn03abb812010-01-04 18:43:19 -08004465 Parcel data = Parcel.obtain();
4466 Parcel reply = Parcel.obtain();
4467 data.writeInterfaceToken(IActivityManager.descriptor);
4468 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004469 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004470 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004471 reply.readException();
4472 data.recycle();
4473 reply.recycle();
4474 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004475
Dianne Hackborn27ff9132012-03-06 14:57:58 -08004476 public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
4477 throws RemoteException
4478 {
4479 Parcel data = Parcel.obtain();
4480 Parcel reply = Parcel.obtain();
4481 data.writeInterfaceToken(IActivityManager.descriptor);
4482 mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0);
4483 reply.readException();
4484 outInfo.readFromParcel(reply);
4485 reply.recycle();
4486 data.recycle();
4487 }
4488
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004489 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
4490 {
4491 Parcel data = Parcel.obtain();
4492 Parcel reply = Parcel.obtain();
4493 data.writeInterfaceToken(IActivityManager.descriptor);
4494 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
4495 reply.readException();
4496 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
4497 reply.recycle();
4498 data.recycle();
4499 return res;
4500 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004501
Dianne Hackborn1676c852012-09-10 14:52:30 -07004502 public boolean profileControl(String process, int userId, boolean start,
Jeff Hao1b012d32014-08-20 10:35:34 -07004503 ProfilerInfo profilerInfo, int profileType) throws RemoteException
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004504 {
4505 Parcel data = Parcel.obtain();
4506 Parcel reply = Parcel.obtain();
4507 data.writeInterfaceToken(IActivityManager.descriptor);
4508 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004509 data.writeInt(userId);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004510 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07004511 data.writeInt(profileType);
Jeff Hao1b012d32014-08-20 10:35:34 -07004512 if (profilerInfo != null) {
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004513 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07004514 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004515 } else {
4516 data.writeInt(0);
4517 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004518 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
4519 reply.readException();
4520 boolean res = reply.readInt() != 0;
4521 reply.recycle();
4522 data.recycle();
4523 return res;
4524 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004525
Dianne Hackborn55280a92009-05-07 15:53:46 -07004526 public boolean shutdown(int timeout) throws RemoteException
4527 {
4528 Parcel data = Parcel.obtain();
4529 Parcel reply = Parcel.obtain();
4530 data.writeInterfaceToken(IActivityManager.descriptor);
4531 data.writeInt(timeout);
4532 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
4533 reply.readException();
4534 boolean res = reply.readInt() != 0;
4535 reply.recycle();
4536 data.recycle();
4537 return res;
4538 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004539
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07004540 public void stopAppSwitches() throws RemoteException {
4541 Parcel data = Parcel.obtain();
4542 Parcel reply = Parcel.obtain();
4543 data.writeInterfaceToken(IActivityManager.descriptor);
4544 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
4545 reply.readException();
4546 reply.recycle();
4547 data.recycle();
4548 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004549
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07004550 public void resumeAppSwitches() throws RemoteException {
4551 Parcel data = Parcel.obtain();
4552 Parcel reply = Parcel.obtain();
4553 data.writeInterfaceToken(IActivityManager.descriptor);
4554 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
4555 reply.readException();
4556 reply.recycle();
4557 data.recycle();
4558 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07004559
4560 public void addPackageDependency(String packageName) throws RemoteException {
4561 Parcel data = Parcel.obtain();
4562 Parcel reply = Parcel.obtain();
4563 data.writeInterfaceToken(IActivityManager.descriptor);
4564 data.writeString(packageName);
4565 mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0);
4566 reply.readException();
4567 data.recycle();
4568 reply.recycle();
4569 }
4570
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004571 public void killApplicationWithAppId(String pkg, int appid, String reason)
4572 throws RemoteException {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004573 Parcel data = Parcel.obtain();
4574 Parcel reply = Parcel.obtain();
4575 data.writeInterfaceToken(IActivityManager.descriptor);
4576 data.writeString(pkg);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004577 data.writeInt(appid);
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004578 data.writeString(reason);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004579 mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004580 reply.readException();
4581 data.recycle();
4582 reply.recycle();
4583 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004584
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07004585 public void closeSystemDialogs(String reason) throws RemoteException {
4586 Parcel data = Parcel.obtain();
4587 Parcel reply = Parcel.obtain();
4588 data.writeInterfaceToken(IActivityManager.descriptor);
4589 data.writeString(reason);
4590 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
4591 reply.readException();
4592 data.recycle();
4593 reply.recycle();
4594 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004595
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004596 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004597 throws RemoteException {
4598 Parcel data = Parcel.obtain();
4599 Parcel reply = Parcel.obtain();
4600 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004601 data.writeIntArray(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004602 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
4603 reply.readException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004604 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004605 data.recycle();
4606 reply.recycle();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004607 return res;
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004608 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07004609
4610 public void killApplicationProcess(String processName, int uid) throws RemoteException {
4611 Parcel data = Parcel.obtain();
4612 Parcel reply = Parcel.obtain();
4613 data.writeInterfaceToken(IActivityManager.descriptor);
4614 data.writeString(processName);
4615 data.writeInt(uid);
4616 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
4617 reply.readException();
4618 data.recycle();
4619 reply.recycle();
4620 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004621
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07004622 public void overridePendingTransition(IBinder token, String packageName,
4623 int enterAnim, int exitAnim) throws RemoteException {
4624 Parcel data = Parcel.obtain();
4625 Parcel reply = Parcel.obtain();
4626 data.writeInterfaceToken(IActivityManager.descriptor);
4627 data.writeStrongBinder(token);
4628 data.writeString(packageName);
4629 data.writeInt(enterAnim);
4630 data.writeInt(exitAnim);
4631 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
4632 reply.readException();
4633 data.recycle();
4634 reply.recycle();
4635 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004636
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08004637 public boolean isUserAMonkey() throws RemoteException {
4638 Parcel data = Parcel.obtain();
4639 Parcel reply = Parcel.obtain();
4640 data.writeInterfaceToken(IActivityManager.descriptor);
4641 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
4642 reply.readException();
4643 boolean res = reply.readInt() != 0;
4644 data.recycle();
4645 reply.recycle();
4646 return res;
4647 }
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07004648
4649 public void setUserIsMonkey(boolean monkey) throws RemoteException {
4650 Parcel data = Parcel.obtain();
4651 Parcel reply = Parcel.obtain();
4652 data.writeInterfaceToken(IActivityManager.descriptor);
4653 data.writeInt(monkey ? 1 : 0);
4654 mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0);
4655 reply.readException();
4656 data.recycle();
4657 reply.recycle();
4658 }
4659
Dianne Hackborn860755f2010-06-03 18:47:52 -07004660 public void finishHeavyWeightApp() throws RemoteException {
4661 Parcel data = Parcel.obtain();
4662 Parcel reply = Parcel.obtain();
4663 data.writeInterfaceToken(IActivityManager.descriptor);
4664 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
4665 reply.readException();
4666 data.recycle();
4667 reply.recycle();
4668 }
Craig Mautner4addfc52013-06-25 08:05:45 -07004669
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004670 public boolean convertFromTranslucent(IBinder token)
Craig Mautner4addfc52013-06-25 08:05:45 -07004671 throws RemoteException {
4672 Parcel data = Parcel.obtain();
4673 Parcel reply = Parcel.obtain();
4674 data.writeInterfaceToken(IActivityManager.descriptor);
4675 data.writeStrongBinder(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07004676 mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0);
4677 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004678 boolean res = reply.readInt() != 0;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004679 data.recycle();
4680 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004681 return res;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004682 }
4683
Craig Mautner233ceee2014-05-09 17:05:11 -07004684 public boolean convertToTranslucent(IBinder token, ActivityOptions options)
Craig Mautner5eda9b32013-07-02 11:58:16 -07004685 throws RemoteException {
4686 Parcel data = Parcel.obtain();
4687 Parcel reply = Parcel.obtain();
4688 data.writeInterfaceToken(IActivityManager.descriptor);
4689 data.writeStrongBinder(token);
Craig Mautner233ceee2014-05-09 17:05:11 -07004690 if (options == null) {
4691 data.writeInt(0);
4692 } else {
4693 data.writeInt(1);
4694 data.writeBundle(options.toBundle());
4695 }
Craig Mautner5eda9b32013-07-02 11:58:16 -07004696 mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07004697 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004698 boolean res = reply.readInt() != 0;
Craig Mautner4addfc52013-06-25 08:05:45 -07004699 data.recycle();
4700 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004701 return res;
Craig Mautner4addfc52013-06-25 08:05:45 -07004702 }
4703
Craig Mautner233ceee2014-05-09 17:05:11 -07004704 public ActivityOptions getActivityOptions(IBinder token) throws RemoteException {
4705 Parcel data = Parcel.obtain();
4706 Parcel reply = Parcel.obtain();
4707 data.writeInterfaceToken(IActivityManager.descriptor);
4708 data.writeStrongBinder(token);
4709 mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0);
4710 reply.readException();
4711 Bundle bundle = reply.readBundle();
4712 ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
4713 data.recycle();
4714 reply.recycle();
4715 return options;
4716 }
4717
Daniel Sandler69a48172010-06-23 16:29:36 -04004718 public void setImmersive(IBinder token, boolean immersive)
4719 throws RemoteException {
4720 Parcel data = Parcel.obtain();
4721 Parcel reply = Parcel.obtain();
4722 data.writeInterfaceToken(IActivityManager.descriptor);
4723 data.writeStrongBinder(token);
4724 data.writeInt(immersive ? 1 : 0);
4725 mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
4726 reply.readException();
4727 data.recycle();
4728 reply.recycle();
4729 }
4730
4731 public boolean isImmersive(IBinder token)
4732 throws RemoteException {
4733 Parcel data = Parcel.obtain();
4734 Parcel reply = Parcel.obtain();
4735 data.writeInterfaceToken(IActivityManager.descriptor);
4736 data.writeStrongBinder(token);
4737 mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004738 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004739 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004740 data.recycle();
4741 reply.recycle();
4742 return res;
4743 }
4744
Craig Mautnerd61dc202014-07-07 11:09:11 -07004745 public boolean isTopOfTask(IBinder token) throws RemoteException {
4746 Parcel data = Parcel.obtain();
4747 Parcel reply = Parcel.obtain();
4748 data.writeInterfaceToken(IActivityManager.descriptor);
4749 data.writeStrongBinder(token);
4750 mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0);
4751 reply.readException();
4752 boolean res = reply.readInt() == 1;
4753 data.recycle();
4754 reply.recycle();
4755 return res;
4756 }
4757
Daniel Sandler69a48172010-06-23 16:29:36 -04004758 public boolean isTopActivityImmersive()
4759 throws RemoteException {
4760 Parcel data = Parcel.obtain();
4761 Parcel reply = Parcel.obtain();
4762 data.writeInterfaceToken(IActivityManager.descriptor);
4763 mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004764 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004765 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004766 data.recycle();
4767 reply.recycle();
4768 return res;
4769 }
4770
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004771 public void crashApplication(int uid, int initialPid, String packageName,
4772 String message) throws RemoteException {
4773 Parcel data = Parcel.obtain();
4774 Parcel reply = Parcel.obtain();
4775 data.writeInterfaceToken(IActivityManager.descriptor);
4776 data.writeInt(uid);
4777 data.writeInt(initialPid);
4778 data.writeString(packageName);
4779 data.writeString(message);
4780 mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0);
4781 reply.readException();
4782 data.recycle();
4783 reply.recycle();
4784 }
Andy McFadden824c5102010-07-09 16:26:57 -07004785
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004786 public String getProviderMimeType(Uri uri, int userId) throws RemoteException {
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004787 Parcel data = Parcel.obtain();
4788 Parcel reply = Parcel.obtain();
4789 data.writeInterfaceToken(IActivityManager.descriptor);
4790 uri.writeToParcel(data, 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004791 data.writeInt(userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004792 mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0);
4793 reply.readException();
4794 String res = reply.readString();
4795 data.recycle();
4796 reply.recycle();
4797 return res;
4798 }
4799
Dianne Hackborn7e269642010-08-25 19:50:20 -07004800 public IBinder newUriPermissionOwner(String name)
4801 throws RemoteException {
4802 Parcel data = Parcel.obtain();
4803 Parcel reply = Parcel.obtain();
4804 data.writeInterfaceToken(IActivityManager.descriptor);
4805 data.writeString(name);
4806 mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
4807 reply.readException();
4808 IBinder res = reply.readStrongBinder();
4809 data.recycle();
4810 reply.recycle();
4811 return res;
4812 }
4813
4814 public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
Nicolas Prevotf1939902014-06-25 09:29:02 +01004815 Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07004816 Parcel data = Parcel.obtain();
4817 Parcel reply = Parcel.obtain();
4818 data.writeInterfaceToken(IActivityManager.descriptor);
4819 data.writeStrongBinder(owner);
4820 data.writeInt(fromUid);
4821 data.writeString(targetPkg);
4822 uri.writeToParcel(data, 0);
4823 data.writeInt(mode);
Nicolas Prevotf1939902014-06-25 09:29:02 +01004824 data.writeInt(sourceUserId);
4825 data.writeInt(targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07004826 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4827 reply.readException();
4828 data.recycle();
4829 reply.recycle();
4830 }
4831
4832 public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004833 int mode, int userId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07004834 Parcel data = Parcel.obtain();
4835 Parcel reply = Parcel.obtain();
4836 data.writeInterfaceToken(IActivityManager.descriptor);
4837 data.writeStrongBinder(owner);
4838 if (uri != null) {
4839 data.writeInt(1);
4840 uri.writeToParcel(data, 0);
4841 } else {
4842 data.writeInt(0);
4843 }
4844 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004845 data.writeInt(userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07004846 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4847 reply.readException();
4848 data.recycle();
4849 reply.recycle();
4850 }
Dianne Hackbornc8f84972010-08-25 23:14:44 -07004851
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004852 public int checkGrantUriPermission(int callingUid, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004853 Uri uri, int modeFlags, int userId) throws RemoteException {
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004854 Parcel data = Parcel.obtain();
4855 Parcel reply = Parcel.obtain();
4856 data.writeInterfaceToken(IActivityManager.descriptor);
4857 data.writeInt(callingUid);
4858 data.writeString(targetPkg);
4859 uri.writeToParcel(data, 0);
4860 data.writeInt(modeFlags);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004861 data.writeInt(userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004862 mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4863 reply.readException();
4864 int res = reply.readInt();
4865 data.recycle();
4866 reply.recycle();
4867 return res;
4868 }
4869
Dianne Hackborn1676c852012-09-10 14:52:30 -07004870 public boolean dumpHeap(String process, int userId, boolean managed,
Andy McFadden824c5102010-07-09 16:26:57 -07004871 String path, ParcelFileDescriptor fd) throws RemoteException {
4872 Parcel data = Parcel.obtain();
4873 Parcel reply = Parcel.obtain();
4874 data.writeInterfaceToken(IActivityManager.descriptor);
4875 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004876 data.writeInt(userId);
Andy McFadden824c5102010-07-09 16:26:57 -07004877 data.writeInt(managed ? 1 : 0);
4878 data.writeString(path);
4879 if (fd != null) {
4880 data.writeInt(1);
4881 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
4882 } else {
4883 data.writeInt(0);
4884 }
4885 mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
4886 reply.readException();
4887 boolean res = reply.readInt() != 0;
4888 reply.recycle();
4889 data.recycle();
4890 return res;
4891 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004892
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004893 public int startActivities(IApplicationThread caller, String callingPackage,
Dianne Hackborna4972e92012-03-14 10:38:05 -07004894 Intent[] intents, String[] resolvedTypes, IBinder resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004895 Bundle options, int userId) throws RemoteException {
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004896 Parcel data = Parcel.obtain();
4897 Parcel reply = Parcel.obtain();
4898 data.writeInterfaceToken(IActivityManager.descriptor);
4899 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004900 data.writeString(callingPackage);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004901 data.writeTypedArray(intents, 0);
4902 data.writeStringArray(resolvedTypes);
4903 data.writeStrongBinder(resultTo);
Dianne Hackborna4972e92012-03-14 10:38:05 -07004904 if (options != null) {
4905 data.writeInt(1);
4906 options.writeToParcel(data, 0);
4907 } else {
4908 data.writeInt(0);
4909 }
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004910 data.writeInt(userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004911 mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0);
4912 reply.readException();
4913 int result = reply.readInt();
4914 reply.recycle();
4915 data.recycle();
4916 return result;
4917 }
4918
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004919 public int getFrontActivityScreenCompatMode() throws RemoteException {
4920 Parcel data = Parcel.obtain();
4921 Parcel reply = Parcel.obtain();
4922 data.writeInterfaceToken(IActivityManager.descriptor);
4923 mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4924 reply.readException();
4925 int mode = reply.readInt();
4926 reply.recycle();
4927 data.recycle();
4928 return mode;
4929 }
4930
4931 public void setFrontActivityScreenCompatMode(int mode) throws RemoteException {
4932 Parcel data = Parcel.obtain();
4933 Parcel reply = Parcel.obtain();
4934 data.writeInterfaceToken(IActivityManager.descriptor);
4935 data.writeInt(mode);
4936 mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4937 reply.readException();
4938 reply.recycle();
4939 data.recycle();
4940 }
4941
4942 public int getPackageScreenCompatMode(String packageName) throws RemoteException {
4943 Parcel data = Parcel.obtain();
4944 Parcel reply = Parcel.obtain();
4945 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004946 data.writeString(packageName);
4947 mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004948 reply.readException();
4949 int mode = reply.readInt();
4950 reply.recycle();
4951 data.recycle();
4952 return mode;
4953 }
4954
4955 public void setPackageScreenCompatMode(String packageName, int mode)
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004956 throws RemoteException {
4957 Parcel data = Parcel.obtain();
4958 Parcel reply = Parcel.obtain();
4959 data.writeInterfaceToken(IActivityManager.descriptor);
4960 data.writeString(packageName);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004961 data.writeInt(mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004962 mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4963 reply.readException();
4964 reply.recycle();
4965 data.recycle();
4966 }
4967
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004968 public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
4969 Parcel data = Parcel.obtain();
4970 Parcel reply = Parcel.obtain();
4971 data.writeInterfaceToken(IActivityManager.descriptor);
4972 data.writeString(packageName);
4973 mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4974 reply.readException();
4975 boolean ask = reply.readInt() != 0;
4976 reply.recycle();
4977 data.recycle();
4978 return ask;
4979 }
4980
4981 public void setPackageAskScreenCompat(String packageName, boolean ask)
4982 throws RemoteException {
4983 Parcel data = Parcel.obtain();
4984 Parcel reply = Parcel.obtain();
4985 data.writeInterfaceToken(IActivityManager.descriptor);
4986 data.writeString(packageName);
4987 data.writeInt(ask ? 1 : 0);
4988 mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4989 reply.readException();
4990 reply.recycle();
4991 data.recycle();
4992 }
4993
Amith Yamasani4b2e9342011-03-31 12:38:53 -07004994 public boolean switchUser(int userid) throws RemoteException {
4995 Parcel data = Parcel.obtain();
4996 Parcel reply = Parcel.obtain();
4997 data.writeInterfaceToken(IActivityManager.descriptor);
4998 data.writeInt(userid);
4999 mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0);
5000 reply.readException();
5001 boolean result = reply.readInt() != 0;
5002 reply.recycle();
5003 data.recycle();
5004 return result;
5005 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07005006
Kenny Guy08488bf2014-02-21 17:40:37 +00005007 public boolean startUserInBackground(int userid) throws RemoteException {
5008 Parcel data = Parcel.obtain();
5009 Parcel reply = Parcel.obtain();
5010 data.writeInterfaceToken(IActivityManager.descriptor);
5011 data.writeInt(userid);
5012 mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0);
5013 reply.readException();
5014 boolean result = reply.readInt() != 0;
5015 reply.recycle();
5016 data.recycle();
5017 return result;
5018 }
5019
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005020 public int stopUser(int userid, IStopUserCallback callback) throws RemoteException {
5021 Parcel data = Parcel.obtain();
5022 Parcel reply = Parcel.obtain();
5023 data.writeInterfaceToken(IActivityManager.descriptor);
5024 data.writeInt(userid);
5025 data.writeStrongInterface(callback);
5026 mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0);
5027 reply.readException();
5028 int result = reply.readInt();
5029 reply.recycle();
5030 data.recycle();
5031 return result;
5032 }
5033
Amith Yamasani52f1d752012-03-28 18:19:29 -07005034 public UserInfo getCurrentUser() throws RemoteException {
5035 Parcel data = Parcel.obtain();
5036 Parcel reply = Parcel.obtain();
5037 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005038 mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0);
Amith Yamasani52f1d752012-03-28 18:19:29 -07005039 reply.readException();
5040 UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply);
5041 reply.recycle();
5042 data.recycle();
5043 return userInfo;
5044 }
5045
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07005046 public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException {
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005047 Parcel data = Parcel.obtain();
5048 Parcel reply = Parcel.obtain();
5049 data.writeInterfaceToken(IActivityManager.descriptor);
5050 data.writeInt(userid);
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07005051 data.writeInt(orStopping ? 1 : 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005052 mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0);
5053 reply.readException();
5054 boolean result = reply.readInt() != 0;
5055 reply.recycle();
5056 data.recycle();
5057 return result;
5058 }
5059
Dianne Hackbornc72fc672012-09-20 13:12:03 -07005060 public int[] getRunningUserIds() throws RemoteException {
5061 Parcel data = Parcel.obtain();
5062 Parcel reply = Parcel.obtain();
5063 data.writeInterfaceToken(IActivityManager.descriptor);
5064 mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0);
5065 reply.readException();
5066 int[] result = reply.createIntArray();
5067 reply.recycle();
5068 data.recycle();
5069 return result;
5070 }
5071
Wale Ogunwaled54b5782014-10-23 15:55:23 -07005072 public boolean removeTask(int taskId) throws RemoteException {
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005073 Parcel data = Parcel.obtain();
5074 Parcel reply = Parcel.obtain();
5075 data.writeInterfaceToken(IActivityManager.descriptor);
5076 data.writeInt(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005077 mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
5078 reply.readException();
5079 boolean result = reply.readInt() != 0;
5080 reply.recycle();
5081 data.recycle();
5082 return result;
5083 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07005084
Jeff Sharkeya4620792011-05-20 15:29:23 -07005085 public void registerProcessObserver(IProcessObserver observer) throws RemoteException {
5086 Parcel data = Parcel.obtain();
5087 Parcel reply = Parcel.obtain();
5088 data.writeInterfaceToken(IActivityManager.descriptor);
5089 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5090 mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5091 reply.readException();
5092 data.recycle();
5093 reply.recycle();
5094 }
5095
5096 public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException {
5097 Parcel data = Parcel.obtain();
5098 Parcel reply = Parcel.obtain();
5099 data.writeInterfaceToken(IActivityManager.descriptor);
5100 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5101 mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5102 reply.readException();
5103 data.recycle();
5104 reply.recycle();
5105 }
5106
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07005107 public void registerUidObserver(IUidObserver observer) throws RemoteException {
5108 Parcel data = Parcel.obtain();
5109 Parcel reply = Parcel.obtain();
5110 data.writeInterfaceToken(IActivityManager.descriptor);
5111 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5112 mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0);
5113 reply.readException();
5114 data.recycle();
5115 reply.recycle();
5116 }
5117
5118 public void unregisterUidObserver(IUidObserver observer) throws RemoteException {
5119 Parcel data = Parcel.obtain();
5120 Parcel reply = Parcel.obtain();
5121 data.writeInterfaceToken(IActivityManager.descriptor);
5122 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5123 mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0);
5124 reply.readException();
5125 data.recycle();
5126 reply.recycle();
5127 }
5128
Dianne Hackborn6c418d52011-06-29 14:05:33 -07005129 public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException {
5130 Parcel data = Parcel.obtain();
5131 Parcel reply = Parcel.obtain();
5132 data.writeInterfaceToken(IActivityManager.descriptor);
5133 data.writeStrongBinder(sender.asBinder());
5134 mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0);
5135 reply.readException();
5136 boolean res = reply.readInt() != 0;
5137 data.recycle();
5138 reply.recycle();
5139 return res;
5140 }
5141
Dianne Hackborn1927ae82012-06-22 15:21:36 -07005142 public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException {
5143 Parcel data = Parcel.obtain();
5144 Parcel reply = Parcel.obtain();
5145 data.writeInterfaceToken(IActivityManager.descriptor);
5146 data.writeStrongBinder(sender.asBinder());
5147 mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0);
5148 reply.readException();
5149 boolean res = reply.readInt() != 0;
5150 data.recycle();
5151 reply.recycle();
5152 return res;
5153 }
5154
Dianne Hackborn81038902012-11-26 17:04:09 -08005155 public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException {
5156 Parcel data = Parcel.obtain();
5157 Parcel reply = Parcel.obtain();
5158 data.writeInterfaceToken(IActivityManager.descriptor);
5159 data.writeStrongBinder(sender.asBinder());
5160 mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5161 reply.readException();
5162 Intent res = reply.readInt() != 0
5163 ? Intent.CREATOR.createFromParcel(reply) : null;
5164 data.recycle();
5165 reply.recycle();
5166 return res;
5167 }
5168
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08005169 public String getTagForIntentSender(IIntentSender sender, String prefix)
5170 throws RemoteException {
5171 Parcel data = Parcel.obtain();
5172 Parcel reply = Parcel.obtain();
5173 data.writeInterfaceToken(IActivityManager.descriptor);
5174 data.writeStrongBinder(sender.asBinder());
5175 data.writeString(prefix);
5176 mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5177 reply.readException();
5178 String res = reply.readString();
5179 data.recycle();
5180 reply.recycle();
5181 return res;
5182 }
5183
Dianne Hackborn31ca8542011-07-19 14:58:28 -07005184 public void updatePersistentConfiguration(Configuration values) throws RemoteException
5185 {
5186 Parcel data = Parcel.obtain();
5187 Parcel reply = Parcel.obtain();
5188 data.writeInterfaceToken(IActivityManager.descriptor);
5189 values.writeToParcel(data, 0);
5190 mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0);
5191 reply.readException();
5192 data.recycle();
5193 reply.recycle();
5194 }
5195
Dianne Hackbornb437e092011-08-05 17:50:29 -07005196 public long[] getProcessPss(int[] pids) throws RemoteException {
5197 Parcel data = Parcel.obtain();
5198 Parcel reply = Parcel.obtain();
5199 data.writeInterfaceToken(IActivityManager.descriptor);
5200 data.writeIntArray(pids);
5201 mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0);
5202 reply.readException();
5203 long[] res = reply.createLongArray();
5204 data.recycle();
5205 reply.recycle();
5206 return res;
5207 }
5208
Dianne Hackborn661cd522011-08-22 00:26:20 -07005209 public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
5210 Parcel data = Parcel.obtain();
5211 Parcel reply = Parcel.obtain();
5212 data.writeInterfaceToken(IActivityManager.descriptor);
5213 TextUtils.writeToParcel(msg, data, 0);
5214 data.writeInt(always ? 1 : 0);
5215 mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
5216 reply.readException();
5217 data.recycle();
5218 reply.recycle();
5219 }
5220
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02005221 public void keyguardWaitingForActivityDrawn() throws RemoteException {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07005222 Parcel data = Parcel.obtain();
5223 Parcel reply = Parcel.obtain();
5224 data.writeInterfaceToken(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02005225 mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
Dianne Hackborn90c52de2011-09-23 12:57:44 -07005226 reply.readException();
5227 data.recycle();
5228 reply.recycle();
5229 }
5230
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07005231 public void keyguardGoingAway(boolean disableWindowAnimations,
5232 boolean keyguardGoingToNotificationShade) throws RemoteException {
5233 Parcel data = Parcel.obtain();
5234 Parcel reply = Parcel.obtain();
5235 data.writeInterfaceToken(IActivityManager.descriptor);
5236 data.writeInt(disableWindowAnimations ? 1 : 0);
5237 data.writeInt(keyguardGoingToNotificationShade ? 1 : 0);
5238 mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0);
5239 reply.readException();
5240 data.recycle();
5241 reply.recycle();
5242 }
5243
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07005244 public boolean shouldUpRecreateTask(IBinder token, String destAffinity)
Adam Powelldd8fab22012-03-22 17:47:27 -07005245 throws RemoteException {
5246 Parcel data = Parcel.obtain();
5247 Parcel reply = Parcel.obtain();
5248 data.writeInterfaceToken(IActivityManager.descriptor);
5249 data.writeStrongBinder(token);
5250 data.writeString(destAffinity);
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07005251 mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0);
Adam Powelldd8fab22012-03-22 17:47:27 -07005252 reply.readException();
5253 boolean result = reply.readInt() != 0;
5254 data.recycle();
5255 reply.recycle();
5256 return result;
5257 }
5258
5259 public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData)
5260 throws RemoteException {
5261 Parcel data = Parcel.obtain();
5262 Parcel reply = Parcel.obtain();
5263 data.writeInterfaceToken(IActivityManager.descriptor);
5264 data.writeStrongBinder(token);
5265 target.writeToParcel(data, 0);
5266 data.writeInt(resultCode);
5267 if (resultData != null) {
5268 data.writeInt(1);
5269 resultData.writeToParcel(data, 0);
5270 } else {
5271 data.writeInt(0);
5272 }
5273 mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0);
5274 reply.readException();
5275 boolean result = reply.readInt() != 0;
5276 data.recycle();
5277 reply.recycle();
5278 return result;
5279 }
5280
Dianne Hackborn5320eb82012-05-18 12:05:04 -07005281 public int getLaunchedFromUid(IBinder activityToken) throws RemoteException {
5282 Parcel data = Parcel.obtain();
5283 Parcel reply = Parcel.obtain();
5284 data.writeInterfaceToken(IActivityManager.descriptor);
5285 data.writeStrongBinder(activityToken);
5286 mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0);
5287 reply.readException();
5288 int result = reply.readInt();
5289 data.recycle();
5290 reply.recycle();
5291 return result;
5292 }
5293
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005294 public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException {
5295 Parcel data = Parcel.obtain();
5296 Parcel reply = Parcel.obtain();
5297 data.writeInterfaceToken(IActivityManager.descriptor);
5298 data.writeStrongBinder(activityToken);
5299 mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0);
5300 reply.readException();
5301 String result = reply.readString();
5302 data.recycle();
5303 reply.recycle();
5304 return result;
5305 }
5306
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07005307 public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5308 Parcel data = Parcel.obtain();
5309 Parcel reply = Parcel.obtain();
5310 data.writeInterfaceToken(IActivityManager.descriptor);
5311 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5312 mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5313 reply.readException();
5314 data.recycle();
5315 reply.recycle();
5316 }
5317
5318 public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5319 Parcel data = Parcel.obtain();
5320 Parcel reply = Parcel.obtain();
5321 data.writeInterfaceToken(IActivityManager.descriptor);
5322 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5323 mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5324 reply.readException();
5325 data.recycle();
5326 reply.recycle();
5327 }
5328
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07005329 public void requestBugReport() throws RemoteException {
5330 Parcel data = Parcel.obtain();
5331 Parcel reply = Parcel.obtain();
5332 data.writeInterfaceToken(IActivityManager.descriptor);
5333 mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0);
5334 reply.readException();
5335 data.recycle();
5336 reply.recycle();
5337 }
5338
Jeff Brownbd181bb2013-09-10 16:44:24 -07005339 public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason)
5340 throws RemoteException {
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005341 Parcel data = Parcel.obtain();
5342 Parcel reply = Parcel.obtain();
5343 data.writeInterfaceToken(IActivityManager.descriptor);
5344 data.writeInt(pid);
5345 data.writeInt(aboveSystem ? 1 : 0);
Jeff Brownbd181bb2013-09-10 16:44:24 -07005346 data.writeString(reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005347 mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0);
5348 reply.readException();
5349 long res = reply.readInt();
5350 data.recycle();
5351 reply.recycle();
5352 return res;
5353 }
5354
Adam Skorydfc7fd72013-08-05 19:23:41 -07005355 public Bundle getAssistContextExtras(int requestType) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005356 Parcel data = Parcel.obtain();
5357 Parcel reply = Parcel.obtain();
5358 data.writeInterfaceToken(IActivityManager.descriptor);
5359 data.writeInt(requestType);
Adam Skorydfc7fd72013-08-05 19:23:41 -07005360 mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005361 reply.readException();
5362 Bundle res = reply.readBundle();
5363 data.recycle();
5364 reply.recycle();
5365 return res;
5366 }
5367
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005368 public void requestAssistContextExtras(int requestType, IResultReceiver receiver)
5369 throws RemoteException {
5370 Parcel data = Parcel.obtain();
5371 Parcel reply = Parcel.obtain();
5372 data.writeInterfaceToken(IActivityManager.descriptor);
5373 data.writeInt(requestType);
5374 data.writeStrongBinder(receiver.asBinder());
5375 mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
5376 reply.readException();
5377 data.recycle();
5378 reply.recycle();
5379 }
5380
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07005381 public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure,
Dianne Hackborna3acdb32015-06-08 17:07:40 -07005382 AssistContent content, Uri referrer) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005383 Parcel data = Parcel.obtain();
5384 Parcel reply = Parcel.obtain();
5385 data.writeInterfaceToken(IActivityManager.descriptor);
5386 data.writeStrongBinder(token);
5387 data.writeBundle(extras);
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07005388 structure.writeToParcel(data, 0);
5389 content.writeToParcel(data, 0);
Dianne Hackborna3acdb32015-06-08 17:07:40 -07005390 if (referrer != null) {
5391 data.writeInt(1);
5392 referrer.writeToParcel(data, 0);
5393 } else {
5394 data.writeInt(0);
5395 }
Adam Skorydfc7fd72013-08-05 19:23:41 -07005396 mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005397 reply.readException();
5398 data.recycle();
5399 reply.recycle();
5400 }
5401
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07005402 public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle,
5403 Bundle args) throws RemoteException {
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07005404 Parcel data = Parcel.obtain();
5405 Parcel reply = Parcel.obtain();
5406 data.writeInterfaceToken(IActivityManager.descriptor);
5407 intent.writeToParcel(data, 0);
5408 data.writeInt(requestType);
5409 data.writeString(hint);
5410 data.writeInt(userHandle);
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07005411 data.writeBundle(args);
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07005412 mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0);
5413 reply.readException();
5414 boolean res = reply.readInt() != 0;
5415 data.recycle();
5416 reply.recycle();
5417 return res;
5418 }
5419
Benjamin Franzc200f442015-06-25 18:20:04 +01005420 public boolean isScreenCaptureAllowedOnCurrentActivity() throws RemoteException {
5421 Parcel data = Parcel.obtain();
5422 Parcel reply = Parcel.obtain();
5423 data.writeInterfaceToken(IActivityManager.descriptor);
5424 mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0);
5425 reply.readException();
5426 boolean res = reply.readInt() != 0;
5427 data.recycle();
5428 reply.recycle();
5429 return res;
5430 }
5431
Dianne Hackbornf1b78242013-04-08 22:28:59 -07005432 public void killUid(int uid, String reason) throws RemoteException {
5433 Parcel data = Parcel.obtain();
5434 Parcel reply = Parcel.obtain();
5435 data.writeInterfaceToken(IActivityManager.descriptor);
5436 data.writeInt(uid);
5437 data.writeString(reason);
5438 mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0);
5439 reply.readException();
5440 data.recycle();
5441 reply.recycle();
5442 }
5443
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07005444 public void hang(IBinder who, boolean allowRestart) throws RemoteException {
5445 Parcel data = Parcel.obtain();
5446 Parcel reply = Parcel.obtain();
5447 data.writeInterfaceToken(IActivityManager.descriptor);
5448 data.writeStrongBinder(who);
5449 data.writeInt(allowRestart ? 1 : 0);
5450 mRemote.transact(HANG_TRANSACTION, data, reply, 0);
5451 reply.readException();
5452 data.recycle();
5453 reply.recycle();
5454 }
5455
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07005456 public void reportActivityFullyDrawn(IBinder token) throws RemoteException {
5457 Parcel data = Parcel.obtain();
5458 Parcel reply = Parcel.obtain();
5459 data.writeInterfaceToken(IActivityManager.descriptor);
5460 data.writeStrongBinder(token);
5461 mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0);
5462 reply.readException();
5463 data.recycle();
5464 reply.recycle();
5465 }
5466
Craig Mautner5eda9b32013-07-02 11:58:16 -07005467 public void notifyActivityDrawn(IBinder token) throws RemoteException {
5468 Parcel data = Parcel.obtain();
5469 Parcel reply = Parcel.obtain();
5470 data.writeInterfaceToken(IActivityManager.descriptor);
5471 data.writeStrongBinder(token);
5472 mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
5473 reply.readException();
5474 data.recycle();
5475 reply.recycle();
5476 }
5477
Dianne Hackborn57a7f592013-07-22 18:21:32 -07005478 public void restart() throws RemoteException {
5479 Parcel data = Parcel.obtain();
5480 Parcel reply = Parcel.obtain();
5481 data.writeInterfaceToken(IActivityManager.descriptor);
5482 mRemote.transact(RESTART_TRANSACTION, data, reply, 0);
5483 reply.readException();
5484 data.recycle();
5485 reply.recycle();
5486 }
5487
Dianne Hackborn35f72be2013-09-16 10:57:39 -07005488 public void performIdleMaintenance() throws RemoteException {
5489 Parcel data = Parcel.obtain();
5490 Parcel reply = Parcel.obtain();
5491 data.writeInterfaceToken(IActivityManager.descriptor);
5492 mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0);
5493 reply.readException();
5494 data.recycle();
5495 reply.recycle();
5496 }
5497
Todd Kennedyca4d8422015-01-15 15:19:22 -08005498 public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken,
Craig Mautner4a1cb222013-12-04 16:14:06 -08005499 IActivityContainerCallback callback) throws RemoteException {
5500 Parcel data = Parcel.obtain();
5501 Parcel reply = Parcel.obtain();
5502 data.writeInterfaceToken(IActivityManager.descriptor);
5503 data.writeStrongBinder(parentActivityToken);
Craig Mautnere3a00d72014-04-16 08:31:19 -07005504 data.writeStrongBinder(callback == null ? null : callback.asBinder());
Todd Kennedyca4d8422015-01-15 15:19:22 -08005505 mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
Craig Mautner4a1cb222013-12-04 16:14:06 -08005506 reply.readException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08005507 final int result = reply.readInt();
5508 final IActivityContainer res;
5509 if (result == 1) {
5510 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5511 } else {
5512 res = null;
5513 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08005514 data.recycle();
5515 reply.recycle();
5516 return res;
5517 }
5518
Craig Mautner95da1082014-02-24 17:54:35 -08005519 public void deleteActivityContainer(IActivityContainer activityContainer)
5520 throws RemoteException {
5521 Parcel data = Parcel.obtain();
5522 Parcel reply = Parcel.obtain();
5523 data.writeInterfaceToken(IActivityManager.descriptor);
5524 data.writeStrongBinder(activityContainer.asBinder());
5525 mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
5526 reply.readException();
5527 data.recycle();
5528 reply.recycle();
5529 }
5530
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005531 @Override
Todd Kennedy4900bf92015-01-16 16:05:14 -08005532 public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException {
5533 Parcel data = Parcel.obtain();
5534 Parcel reply = Parcel.obtain();
5535 data.writeInterfaceToken(IActivityManager.descriptor);
5536 data.writeInt(displayId);
5537 mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0);
5538 reply.readException();
5539 final int result = reply.readInt();
5540 final IActivityContainer res;
5541 if (result == 1) {
5542 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5543 } else {
5544 res = null;
5545 }
5546 data.recycle();
5547 reply.recycle();
5548 return res;
5549 }
5550
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005551 @Override
5552 public int getActivityDisplayId(IBinder activityToken)
Craig Mautnere0a38842013-12-16 16:14:02 -08005553 throws RemoteException {
5554 Parcel data = Parcel.obtain();
5555 Parcel reply = Parcel.obtain();
5556 data.writeInterfaceToken(IActivityManager.descriptor);
5557 data.writeStrongBinder(activityToken);
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005558 mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0);
Craig Mautnere0a38842013-12-16 16:14:02 -08005559 reply.readException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005560 final int displayId = reply.readInt();
Craig Mautnere0a38842013-12-16 16:14:02 -08005561 data.recycle();
5562 reply.recycle();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005563 return displayId;
Craig Mautnere0a38842013-12-16 16:14:02 -08005564 }
5565
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005566 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005567 public void startLockTaskMode(int taskId) throws RemoteException {
5568 Parcel data = Parcel.obtain();
5569 Parcel reply = Parcel.obtain();
5570 data.writeInterfaceToken(IActivityManager.descriptor);
5571 data.writeInt(taskId);
5572 mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0);
5573 reply.readException();
5574 data.recycle();
5575 reply.recycle();
5576 }
5577
5578 @Override
5579 public void startLockTaskMode(IBinder token) throws RemoteException {
5580 Parcel data = Parcel.obtain();
5581 Parcel reply = Parcel.obtain();
5582 data.writeInterfaceToken(IActivityManager.descriptor);
5583 data.writeStrongBinder(token);
5584 mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0);
5585 reply.readException();
5586 data.recycle();
5587 reply.recycle();
5588 }
5589
5590 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005591 public void startLockTaskModeOnCurrent() throws RemoteException {
5592 Parcel data = Parcel.obtain();
5593 Parcel reply = Parcel.obtain();
5594 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005595 mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005596 reply.readException();
5597 data.recycle();
5598 reply.recycle();
5599 }
5600
5601 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005602 public void stopLockTaskMode() throws RemoteException {
5603 Parcel data = Parcel.obtain();
5604 Parcel reply = Parcel.obtain();
5605 data.writeInterfaceToken(IActivityManager.descriptor);
5606 mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5607 reply.readException();
5608 data.recycle();
5609 reply.recycle();
5610 }
5611
5612 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005613 public void stopLockTaskModeOnCurrent() throws RemoteException {
5614 Parcel data = Parcel.obtain();
5615 Parcel reply = Parcel.obtain();
5616 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005617 mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005618 reply.readException();
5619 data.recycle();
5620 reply.recycle();
5621 }
5622
5623 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005624 public boolean isInLockTaskMode() throws RemoteException {
5625 Parcel data = Parcel.obtain();
5626 Parcel reply = Parcel.obtain();
5627 data.writeInterfaceToken(IActivityManager.descriptor);
5628 mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5629 reply.readException();
5630 boolean isInLockTaskMode = reply.readInt() == 1;
5631 data.recycle();
5632 reply.recycle();
5633 return isInLockTaskMode;
5634 }
5635
Craig Mautner688b5102014-03-27 16:55:03 -07005636 @Override
Benjamin Franz43261142015-02-11 15:59:44 +00005637 public int getLockTaskModeState() throws RemoteException {
5638 Parcel data = Parcel.obtain();
5639 Parcel reply = Parcel.obtain();
5640 data.writeInterfaceToken(IActivityManager.descriptor);
5641 mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0);
5642 reply.readException();
5643 int lockTaskModeState = reply.readInt();
5644 data.recycle();
5645 reply.recycle();
5646 return lockTaskModeState;
5647 }
5648
5649 @Override
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07005650 public void showLockTaskEscapeMessage(IBinder token) throws RemoteException {
5651 Parcel data = Parcel.obtain();
5652 Parcel reply = Parcel.obtain();
5653 data.writeInterfaceToken(IActivityManager.descriptor);
5654 data.writeStrongBinder(token);
5655 mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply,
5656 IBinder.FLAG_ONEWAY);
5657 reply.readException();
5658 data.recycle();
5659 reply.recycle();
5660 }
5661
5662 @Override
Winson Chunga449dc02014-05-16 11:15:04 -07005663 public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values)
Winson Chung03a9bae2014-05-02 09:56:12 -07005664 throws RemoteException {
Craig Mautner2fbd7542014-03-21 09:34:07 -07005665 Parcel data = Parcel.obtain();
5666 Parcel reply = Parcel.obtain();
5667 data.writeInterfaceToken(IActivityManager.descriptor);
5668 data.writeStrongBinder(token);
Winson Chung03a9bae2014-05-02 09:56:12 -07005669 values.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005670 mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0);
Craig Mautner2fbd7542014-03-21 09:34:07 -07005671 reply.readException();
5672 data.recycle();
5673 reply.recycle();
5674 }
5675
Craig Mautneree2e45a2014-06-27 12:10:03 -07005676 @Override
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08005677 public void setTaskResizeable(int taskId, boolean resizeable) throws RemoteException {
5678 Parcel data = Parcel.obtain();
5679 Parcel reply = Parcel.obtain();
5680 data.writeInterfaceToken(IActivityManager.descriptor);
5681 data.writeInt(taskId);
5682 data.writeInt(resizeable ? 1 : 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005683 mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0);
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08005684 reply.readException();
5685 data.recycle();
5686 reply.recycle();
5687 }
5688
5689 @Override
Wale Ogunwale53a29a92015-02-23 15:42:52 -08005690 public void resizeTask(int taskId, Rect r) throws RemoteException
5691 {
5692 Parcel data = Parcel.obtain();
5693 Parcel reply = Parcel.obtain();
5694 data.writeInterfaceToken(IActivityManager.descriptor);
5695 data.writeInt(taskId);
5696 r.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005697 mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08005698 reply.readException();
5699 data.recycle();
5700 reply.recycle();
5701 }
5702
5703 @Override
Craig Mautner648f69b2014-09-18 14:16:26 -07005704 public Bitmap getTaskDescriptionIcon(String filename) throws RemoteException {
5705 Parcel data = Parcel.obtain();
5706 Parcel reply = Parcel.obtain();
5707 data.writeInterfaceToken(IActivityManager.descriptor);
5708 data.writeString(filename);
5709 mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0);
5710 reply.readException();
5711 final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply);
5712 data.recycle();
5713 reply.recycle();
5714 return icon;
5715 }
5716
5717 @Override
Winson Chung044d5292014-11-06 11:05:19 -08005718 public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options)
5719 throws RemoteException {
5720 Parcel data = Parcel.obtain();
5721 Parcel reply = Parcel.obtain();
5722 data.writeInterfaceToken(IActivityManager.descriptor);
5723 if (options == null) {
5724 data.writeInt(0);
5725 } else {
5726 data.writeInt(1);
5727 data.writeBundle(options.toBundle());
5728 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07005729 mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0);
Winson Chung044d5292014-11-06 11:05:19 -08005730 reply.readException();
5731 data.recycle();
5732 reply.recycle();
5733 }
5734
5735 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005736 public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005737 Parcel data = Parcel.obtain();
5738 Parcel reply = Parcel.obtain();
5739 data.writeInterfaceToken(IActivityManager.descriptor);
5740 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07005741 data.writeInt(visible ? 1 : 0);
5742 mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005743 reply.readException();
5744 boolean success = reply.readInt() > 0;
5745 data.recycle();
5746 reply.recycle();
5747 return success;
5748 }
5749
5750 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005751 public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005752 Parcel data = Parcel.obtain();
5753 Parcel reply = Parcel.obtain();
5754 data.writeInterfaceToken(IActivityManager.descriptor);
5755 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07005756 mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005757 reply.readException();
Jose Lima4b6c6692014-08-12 17:41:12 -07005758 final boolean visible = reply.readInt() > 0;
Craig Mautneree2e45a2014-06-27 12:10:03 -07005759 data.recycle();
5760 reply.recycle();
Jose Lima4b6c6692014-08-12 17:41:12 -07005761 return visible;
Craig Mautneree2e45a2014-06-27 12:10:03 -07005762 }
5763
5764 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005765 public void backgroundResourcesReleased(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005766 Parcel data = Parcel.obtain();
5767 Parcel reply = Parcel.obtain();
5768 data.writeInterfaceToken(IActivityManager.descriptor);
5769 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005770 mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0);
Craig Mautnerbb742462014-07-07 15:28:55 -07005771 reply.readException();
5772 data.recycle();
5773 reply.recycle();
5774 }
5775
5776 @Override
5777 public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException {
5778 Parcel data = Parcel.obtain();
5779 Parcel reply = Parcel.obtain();
5780 data.writeInterfaceToken(IActivityManager.descriptor);
5781 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005782 mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005783 reply.readException();
5784 data.recycle();
5785 reply.recycle();
5786 }
5787
Craig Mautner8746a472014-07-24 15:12:54 -07005788 @Override
5789 public void notifyEnterAnimationComplete(IBinder token) throws RemoteException {
5790 Parcel data = Parcel.obtain();
5791 Parcel reply = Parcel.obtain();
5792 data.writeInterfaceToken(IActivityManager.descriptor);
5793 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005794 mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautner8746a472014-07-24 15:12:54 -07005795 reply.readException();
5796 data.recycle();
5797 reply.recycle();
5798 }
5799
Craig Mautner6e2f3952014-09-09 14:26:41 -07005800 @Override
5801 public void bootAnimationComplete() throws RemoteException {
5802 Parcel data = Parcel.obtain();
5803 Parcel reply = Parcel.obtain();
5804 data.writeInterfaceToken(IActivityManager.descriptor);
5805 mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
5806 reply.readException();
5807 data.recycle();
5808 reply.recycle();
5809 }
5810
Wale Ogunwale18795a22014-12-03 11:38:33 -08005811 @Override
Jeff Sharkey605eb792014-11-04 13:34:06 -08005812 public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException {
5813 Parcel data = Parcel.obtain();
5814 Parcel reply = Parcel.obtain();
5815 data.writeInterfaceToken(IActivityManager.descriptor);
5816 data.writeInt(uid);
5817 data.writeByteArray(firstPacket);
5818 mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0);
5819 reply.readException();
5820 data.recycle();
5821 reply.recycle();
5822 }
5823
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005824 @Override
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07005825 public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize,
5826 String reportPackage) throws RemoteException {
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005827 Parcel data = Parcel.obtain();
5828 Parcel reply = Parcel.obtain();
5829 data.writeInterfaceToken(IActivityManager.descriptor);
5830 data.writeString(processName);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07005831 data.writeInt(uid);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005832 data.writeLong(maxMemSize);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07005833 data.writeString(reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005834 mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0);
5835 reply.readException();
5836 data.recycle();
5837 reply.recycle();
5838 }
5839
5840 @Override
5841 public void dumpHeapFinished(String path) throws RemoteException {
5842 Parcel data = Parcel.obtain();
5843 Parcel reply = Parcel.obtain();
5844 data.writeInterfaceToken(IActivityManager.descriptor);
5845 data.writeString(path);
5846 mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0);
5847 reply.readException();
5848 data.recycle();
5849 reply.recycle();
5850 }
5851
Dianne Hackborn3d07c942015-03-13 18:02:54 -07005852 @Override
5853 public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake)
5854 throws RemoteException {
5855 Parcel data = Parcel.obtain();
5856 Parcel reply = Parcel.obtain();
5857 data.writeInterfaceToken(IActivityManager.descriptor);
5858 data.writeStrongBinder(session.asBinder());
5859 data.writeInt(keepAwake ? 1 : 0);
5860 mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0);
5861 reply.readException();
5862 data.recycle();
5863 reply.recycle();
5864 }
5865
Craig Mautnere5600772015-04-03 21:36:37 -07005866 @Override
5867 public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException {
5868 Parcel data = Parcel.obtain();
5869 Parcel reply = Parcel.obtain();
5870 data.writeInterfaceToken(IActivityManager.descriptor);
5871 data.writeInt(userId);
5872 data.writeStringArray(packages);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005873 mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0);
Craig Mautnere5600772015-04-03 21:36:37 -07005874 reply.readException();
5875 data.recycle();
5876 reply.recycle();
5877 }
5878
Dianne Hackborn1e383822015-04-10 14:02:33 -07005879 @Override
Craig Mautner015c5e52015-04-23 10:39:39 -07005880 public void updateDeviceOwner(String packageName) throws RemoteException {
5881 Parcel data = Parcel.obtain();
5882 Parcel reply = Parcel.obtain();
5883 data.writeInterfaceToken(IActivityManager.descriptor);
5884 data.writeString(packageName);
5885 mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0);
5886 reply.readException();
5887 data.recycle();
5888 reply.recycle();
5889 }
5890
5891 @Override
Adam Lesinskic30454c2015-06-24 13:24:35 -07005892 public int getPackageProcessState(String packageName, String callingPackage)
5893 throws RemoteException {
Dianne Hackborn1e383822015-04-10 14:02:33 -07005894 Parcel data = Parcel.obtain();
5895 Parcel reply = Parcel.obtain();
5896 data.writeInterfaceToken(IActivityManager.descriptor);
5897 data.writeString(packageName);
Adam Lesinskic30454c2015-06-24 13:24:35 -07005898 data.writeString(callingPackage);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005899 mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0);
5900 reply.readException();
5901 int res = reply.readInt();
5902 data.recycle();
5903 reply.recycle();
5904 return res;
5905 }
5906
Stefan Kuhne16045c22015-06-05 07:18:06 -07005907 @Override
5908 public boolean setProcessMemoryTrimLevel(String process, int userId, int level)
5909 throws RemoteException {
5910 Parcel data = Parcel.obtain();
5911 Parcel reply = Parcel.obtain();
5912 data.writeInterfaceToken(IActivityManager.descriptor);
5913 data.writeString(process);
5914 data.writeInt(userId);
5915 data.writeInt(level);
5916 mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0);
5917 reply.readException();
5918 int res = reply.readInt();
5919 data.recycle();
5920 reply.recycle();
5921 return res != 0;
5922 }
5923
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005924 private IBinder mRemote;
5925}