blob: e4def1e0ab81c81b2bb737895d97e305f33ea162 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.app;
18
Craig Mautnerbdc748af2013-12-02 14:08:25 -080019import android.app.ActivityManager.StackInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080020import android.content.ComponentName;
Adam Powelldd8fab22012-03-22 17:47:27 -070021import android.content.IIntentReceiver;
22import android.content.IIntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023import android.content.Intent;
24import android.content.IntentFilter;
Dianne Hackbornfa82f222009-09-17 15:14:12 -070025import android.content.IntentSender;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070026import android.content.UriPermission;
Christopher Tate181fafa2009-05-14 11:12:14 -070027import android.content.pm.ApplicationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080028import android.content.pm.ConfigurationInfo;
29import android.content.pm.IPackageDataObserver;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070030import android.content.pm.ParceledListSlice;
Amith Yamasani52f1d752012-03-28 18:19:29 -070031import android.content.pm.UserInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080032import android.content.res.Configuration;
Dianne Hackbornaec68bb2014-08-20 15:25:13 -070033import android.graphics.Bitmap;
34import android.graphics.Point;
Craig Mautnerbdc748af2013-12-02 14:08:25 -080035import android.graphics.Rect;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080036import android.net.Uri;
37import android.os.Binder;
38import android.os.Bundle;
Dianne Hackborn3025ef32009-08-31 21:31:47 -070039import android.os.Debug;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080040import android.os.IBinder;
41import android.os.Parcel;
Adam Powelldd8fab22012-03-22 17:47:27 -070042import android.os.ParcelFileDescriptor;
43import android.os.Parcelable;
Craig Mautnera0026042014-04-23 11:45:37 -070044import android.os.PersistableBundle;
Adam Powelldd8fab22012-03-22 17:47:27 -070045import android.os.RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080046import android.os.ServiceManager;
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -070047import android.os.StrictMode;
Dianne Hackborn91097de2014-04-04 18:02:06 -070048import android.service.voice.IVoiceInteractionSession;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080049import android.text.TextUtils;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080050import android.util.Log;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080051import android.util.Singleton;
Dianne Hackborn91097de2014-04-04 18:02:06 -070052import com.android.internal.app.IVoiceInteractor;
Dianne Hackbornae6688b2015-02-11 17:02:41 -080053import com.android.internal.os.IResultReceiver;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080054
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080055import java.util.ArrayList;
56import java.util.List;
57
58/** {@hide} */
59public abstract class ActivityManagerNative extends Binder implements IActivityManager
60{
61 /**
62 * Cast a Binder object into an activity manager interface, generating
63 * a proxy if needed.
64 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080065 static public IActivityManager asInterface(IBinder obj) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080066 if (obj == null) {
67 return null;
68 }
69 IActivityManager in =
70 (IActivityManager)obj.queryLocalInterface(descriptor);
71 if (in != null) {
72 return in;
73 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080074
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080075 return new ActivityManagerProxy(obj);
76 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080077
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080078 /**
79 * Retrieve the system's default/global activity manager.
80 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080081 static public IActivityManager getDefault() {
82 return gDefault.get();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080083 }
84
85 /**
86 * Convenience for checking whether the system is ready. For internal use only.
87 */
88 static public boolean isSystemReady() {
89 if (!sSystemReady) {
90 sSystemReady = getDefault().testIsSystemReady();
91 }
92 return sSystemReady;
93 }
94 static boolean sSystemReady = false;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080095
Svet Ganov16a16892015-04-16 10:32:04 -070096 static public void broadcastStickyIntent(Intent intent, String permission, int userId) {
97 broadcastStickyIntent(intent, permission, AppOpsManager.OP_NONE, userId);
98 }
99
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800100 /**
101 * Convenience for sending a sticky broadcast. For internal use only.
102 * If you don't care about permission, use null.
103 */
Svet Ganov16a16892015-04-16 10:32:04 -0700104 static public void broadcastStickyIntent(Intent intent, String permission, int appOp,
105 int userId) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800106 try {
107 getDefault().broadcastIntent(
108 null, intent, null, null, Activity.RESULT_OK, null, null,
Svet Ganov16a16892015-04-16 10:32:04 -0700109 null /*permission*/, appOp, false, true, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800110 } catch (RemoteException ex) {
111 }
112 }
113
Dianne Hackborn1e383822015-04-10 14:02:33 -0700114 static public void noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg,
115 String tag) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800116 try {
Dianne Hackborn1e383822015-04-10 14:02:33 -0700117 getDefault().noteWakeupAlarm(ps.getTarget(), sourceUid, sourcePkg, tag);
118 } catch (RemoteException ex) {
119 }
120 }
121
122 static public void noteAlarmStart(PendingIntent ps, int sourceUid, String tag) {
123 try {
124 getDefault().noteAlarmStart(ps.getTarget(), sourceUid, tag);
125 } catch (RemoteException ex) {
126 }
127 }
128
129 static public void noteAlarmFinish(PendingIntent ps, int sourceUid, String tag) {
130 try {
131 getDefault().noteAlarmFinish(ps.getTarget(), sourceUid, tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800132 } catch (RemoteException ex) {
133 }
134 }
135
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -0800136 public ActivityManagerNative() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800137 attachInterface(this, descriptor);
138 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700139
140 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800141 public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
142 throws RemoteException {
143 switch (code) {
144 case START_ACTIVITY_TRANSACTION:
145 {
146 data.enforceInterface(IActivityManager.descriptor);
147 IBinder b = data.readStrongBinder();
148 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800149 String callingPackage = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800150 Intent intent = Intent.CREATOR.createFromParcel(data);
151 String resolvedType = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800152 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800153 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800154 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700155 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700156 ProfilerInfo profilerInfo = data.readInt() != 0
157 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700158 Bundle options = data.readInt() != 0
159 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800160 int result = startActivity(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700161 resultTo, resultWho, requestCode, startFlags, profilerInfo, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800162 reply.writeNoException();
163 reply.writeInt(result);
164 return true;
165 }
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700166
Amith Yamasani82644082012-08-03 13:09:11 -0700167 case START_ACTIVITY_AS_USER_TRANSACTION:
168 {
169 data.enforceInterface(IActivityManager.descriptor);
170 IBinder b = data.readStrongBinder();
171 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800172 String callingPackage = data.readString();
Amith Yamasani82644082012-08-03 13:09:11 -0700173 Intent intent = Intent.CREATOR.createFromParcel(data);
174 String resolvedType = data.readString();
175 IBinder resultTo = data.readStrongBinder();
176 String resultWho = data.readString();
177 int requestCode = data.readInt();
178 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700179 ProfilerInfo profilerInfo = data.readInt() != 0
180 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Amith Yamasani82644082012-08-03 13:09:11 -0700181 Bundle options = data.readInt() != 0
182 ? Bundle.CREATOR.createFromParcel(data) : null;
183 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800184 int result = startActivityAsUser(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700185 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Amith Yamasani82644082012-08-03 13:09:11 -0700186 reply.writeNoException();
187 reply.writeInt(result);
188 return true;
189 }
190
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700191 case START_ACTIVITY_AS_CALLER_TRANSACTION:
192 {
193 data.enforceInterface(IActivityManager.descriptor);
194 IBinder b = data.readStrongBinder();
195 IApplicationThread app = ApplicationThreadNative.asInterface(b);
196 String callingPackage = data.readString();
197 Intent intent = Intent.CREATOR.createFromParcel(data);
198 String resolvedType = data.readString();
199 IBinder resultTo = data.readStrongBinder();
200 String resultWho = data.readString();
201 int requestCode = data.readInt();
202 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700203 ProfilerInfo profilerInfo = data.readInt() != 0
204 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700205 Bundle options = data.readInt() != 0
206 ? Bundle.CREATOR.createFromParcel(data) : null;
Jeff Sharkey97978802014-10-14 10:48:18 -0700207 int userId = data.readInt();
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700208 int result = startActivityAsCaller(app, callingPackage, intent, resolvedType,
Jeff Sharkey97978802014-10-14 10:48:18 -0700209 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700210 reply.writeNoException();
211 reply.writeInt(result);
212 return true;
213 }
214
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800215 case START_ACTIVITY_AND_WAIT_TRANSACTION:
216 {
217 data.enforceInterface(IActivityManager.descriptor);
218 IBinder b = data.readStrongBinder();
219 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800220 String callingPackage = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800221 Intent intent = Intent.CREATOR.createFromParcel(data);
222 String resolvedType = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800223 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800224 String resultWho = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800225 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700226 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700227 ProfilerInfo profilerInfo = data.readInt() != 0
228 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700229 Bundle options = data.readInt() != 0
230 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -0700231 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800232 WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700233 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800234 reply.writeNoException();
235 result.writeToParcel(reply, 0);
236 return true;
237 }
238
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700239 case START_ACTIVITY_WITH_CONFIG_TRANSACTION:
240 {
241 data.enforceInterface(IActivityManager.descriptor);
242 IBinder b = data.readStrongBinder();
243 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800244 String callingPackage = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700245 Intent intent = Intent.CREATOR.createFromParcel(data);
246 String resolvedType = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700247 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700248 String resultWho = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700249 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700250 int startFlags = data.readInt();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700251 Configuration config = Configuration.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700252 Bundle options = data.readInt() != 0
253 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -0700254 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800255 int result = startActivityWithConfig(app, callingPackage, intent, resolvedType,
Dianne Hackborn41203752012-08-31 14:05:51 -0700256 resultTo, resultWho, requestCode, startFlags, config, options, userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700257 reply.writeNoException();
258 reply.writeInt(result);
259 return true;
260 }
261
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700262 case START_ACTIVITY_INTENT_SENDER_TRANSACTION:
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700263 {
264 data.enforceInterface(IActivityManager.descriptor);
265 IBinder b = data.readStrongBinder();
266 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700267 IntentSender intent = IntentSender.CREATOR.createFromParcel(data);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700268 Intent fillInIntent = null;
269 if (data.readInt() != 0) {
270 fillInIntent = Intent.CREATOR.createFromParcel(data);
271 }
272 String resolvedType = data.readString();
273 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700274 String resultWho = data.readString();
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700275 int requestCode = data.readInt();
276 int flagsMask = data.readInt();
277 int flagsValues = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700278 Bundle options = data.readInt() != 0
279 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700280 int result = startActivityIntentSender(app, intent,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700281 fillInIntent, resolvedType, resultTo, resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700282 requestCode, flagsMask, flagsValues, options);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700283 reply.writeNoException();
284 reply.writeInt(result);
285 return true;
286 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700287
Dianne Hackborn91097de2014-04-04 18:02:06 -0700288 case START_VOICE_ACTIVITY_TRANSACTION:
289 {
290 data.enforceInterface(IActivityManager.descriptor);
291 String callingPackage = data.readString();
292 int callingPid = data.readInt();
293 int callingUid = data.readInt();
294 Intent intent = Intent.CREATOR.createFromParcel(data);
295 String resolvedType = data.readString();
296 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
297 data.readStrongBinder());
298 IVoiceInteractor interactor = IVoiceInteractor.Stub.asInterface(
299 data.readStrongBinder());
300 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700301 ProfilerInfo profilerInfo = data.readInt() != 0
302 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborn91097de2014-04-04 18:02:06 -0700303 Bundle options = data.readInt() != 0
304 ? Bundle.CREATOR.createFromParcel(data) : null;
305 int userId = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700306 int result = startVoiceActivity(callingPackage, callingPid, callingUid, intent,
307 resolvedType, session, interactor, startFlags, profilerInfo, options, userId);
Dianne Hackborn91097de2014-04-04 18:02:06 -0700308 reply.writeNoException();
309 reply.writeInt(result);
310 return true;
311 }
312
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800313 case START_NEXT_MATCHING_ACTIVITY_TRANSACTION:
314 {
315 data.enforceInterface(IActivityManager.descriptor);
316 IBinder callingActivity = data.readStrongBinder();
317 Intent intent = Intent.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700318 Bundle options = data.readInt() != 0
319 ? Bundle.CREATOR.createFromParcel(data) : null;
320 boolean result = startNextMatchingActivity(callingActivity, intent, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800321 reply.writeNoException();
322 reply.writeInt(result ? 1 : 0);
323 return true;
324 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700325
Craig Mautnerdc00cbe2014-07-20 17:48:47 -0700326 case START_ACTIVITY_FROM_RECENTS_TRANSACTION:
327 {
328 data.enforceInterface(IActivityManager.descriptor);
329 int taskId = data.readInt();
330 Bundle options = data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data);
331 int result = startActivityFromRecents(taskId, options);
332 reply.writeNoException();
333 reply.writeInt(result);
334 return true;
335 }
336
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800337 case FINISH_ACTIVITY_TRANSACTION: {
338 data.enforceInterface(IActivityManager.descriptor);
339 IBinder token = data.readStrongBinder();
340 Intent resultData = null;
341 int resultCode = data.readInt();
342 if (data.readInt() != 0) {
343 resultData = Intent.CREATOR.createFromParcel(data);
344 }
Winson Chung3b3f4642014-04-22 10:08:18 -0700345 boolean finishTask = (data.readInt() != 0);
346 boolean res = finishActivity(token, resultCode, resultData, finishTask);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800347 reply.writeNoException();
348 reply.writeInt(res ? 1 : 0);
349 return true;
350 }
351
352 case FINISH_SUB_ACTIVITY_TRANSACTION: {
353 data.enforceInterface(IActivityManager.descriptor);
354 IBinder token = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700355 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800356 int requestCode = data.readInt();
357 finishSubActivity(token, resultWho, requestCode);
358 reply.writeNoException();
359 return true;
360 }
361
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700362 case FINISH_ACTIVITY_AFFINITY_TRANSACTION: {
363 data.enforceInterface(IActivityManager.descriptor);
364 IBinder token = data.readStrongBinder();
365 boolean res = finishActivityAffinity(token);
366 reply.writeNoException();
367 reply.writeInt(res ? 1 : 0);
368 return true;
369 }
370
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -0700371 case FINISH_VOICE_TASK_TRANSACTION: {
372 data.enforceInterface(IActivityManager.descriptor);
373 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
374 data.readStrongBinder());
375 finishVoiceTask(session);
376 reply.writeNoException();
377 return true;
378 }
379
Dianne Hackborn89ad4562014-08-24 16:45:38 -0700380 case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: {
381 data.enforceInterface(IActivityManager.descriptor);
382 IBinder token = data.readStrongBinder();
383 boolean res = releaseActivityInstance(token);
384 reply.writeNoException();
385 reply.writeInt(res ? 1 : 0);
386 return true;
387 }
388
389 case RELEASE_SOME_ACTIVITIES_TRANSACTION: {
390 data.enforceInterface(IActivityManager.descriptor);
391 IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder());
392 releaseSomeActivities(app);
393 reply.writeNoException();
394 return true;
395 }
396
Dianne Hackborn061d58a2010-03-12 15:07:06 -0800397 case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: {
398 data.enforceInterface(IActivityManager.descriptor);
399 IBinder token = data.readStrongBinder();
400 boolean res = willActivityBeVisible(token);
401 reply.writeNoException();
402 reply.writeInt(res ? 1 : 0);
403 return true;
404 }
405
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800406 case REGISTER_RECEIVER_TRANSACTION:
407 {
408 data.enforceInterface(IActivityManager.descriptor);
409 IBinder b = data.readStrongBinder();
410 IApplicationThread app =
411 b != null ? ApplicationThreadNative.asInterface(b) : null;
Dianne Hackborn6c418d52011-06-29 14:05:33 -0700412 String packageName = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800413 b = data.readStrongBinder();
414 IIntentReceiver rec
415 = b != null ? IIntentReceiver.Stub.asInterface(b) : null;
416 IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data);
417 String perm = data.readString();
Dianne Hackborn20e80982012-08-31 19:00:44 -0700418 int userId = data.readInt();
419 Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800420 reply.writeNoException();
421 if (intent != null) {
422 reply.writeInt(1);
423 intent.writeToParcel(reply, 0);
424 } else {
425 reply.writeInt(0);
426 }
427 return true;
428 }
429
430 case UNREGISTER_RECEIVER_TRANSACTION:
431 {
432 data.enforceInterface(IActivityManager.descriptor);
433 IBinder b = data.readStrongBinder();
434 if (b == null) {
435 return true;
436 }
437 IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b);
438 unregisterReceiver(rec);
439 reply.writeNoException();
440 return true;
441 }
442
443 case BROADCAST_INTENT_TRANSACTION:
444 {
445 data.enforceInterface(IActivityManager.descriptor);
446 IBinder b = data.readStrongBinder();
447 IApplicationThread app =
448 b != null ? ApplicationThreadNative.asInterface(b) : null;
449 Intent intent = Intent.CREATOR.createFromParcel(data);
450 String resolvedType = data.readString();
451 b = data.readStrongBinder();
452 IIntentReceiver resultTo =
453 b != null ? IIntentReceiver.Stub.asInterface(b) : null;
454 int resultCode = data.readInt();
455 String resultData = data.readString();
456 Bundle resultExtras = data.readBundle();
457 String perm = data.readString();
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800458 int appOp = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800459 boolean serialized = data.readInt() != 0;
460 boolean sticky = data.readInt() != 0;
Amith Yamasani742a6712011-05-04 14:49:28 -0700461 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800462 int res = broadcastIntent(app, intent, resolvedType, resultTo,
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800463 resultCode, resultData, resultExtras, perm, appOp,
Amith Yamasani742a6712011-05-04 14:49:28 -0700464 serialized, sticky, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800465 reply.writeNoException();
466 reply.writeInt(res);
467 return true;
468 }
469
470 case UNBROADCAST_INTENT_TRANSACTION:
471 {
472 data.enforceInterface(IActivityManager.descriptor);
473 IBinder b = data.readStrongBinder();
474 IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null;
475 Intent intent = Intent.CREATOR.createFromParcel(data);
Amith Yamasani742a6712011-05-04 14:49:28 -0700476 int userId = data.readInt();
477 unbroadcastIntent(app, intent, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800478 reply.writeNoException();
479 return true;
480 }
481
482 case FINISH_RECEIVER_TRANSACTION: {
483 data.enforceInterface(IActivityManager.descriptor);
484 IBinder who = data.readStrongBinder();
485 int resultCode = data.readInt();
486 String resultData = data.readString();
487 Bundle resultExtras = data.readBundle();
488 boolean resultAbort = data.readInt() != 0;
riddle_hsu1f5ac4d2015-01-03 15:38:21 +0800489 int intentFlags = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800490 if (who != null) {
riddle_hsu1f5ac4d2015-01-03 15:38:21 +0800491 finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800492 }
493 reply.writeNoException();
494 return true;
495 }
496
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800497 case ATTACH_APPLICATION_TRANSACTION: {
498 data.enforceInterface(IActivityManager.descriptor);
499 IApplicationThread app = ApplicationThreadNative.asInterface(
500 data.readStrongBinder());
501 if (app != null) {
502 attachApplication(app);
503 }
504 reply.writeNoException();
505 return true;
506 }
507
508 case ACTIVITY_IDLE_TRANSACTION: {
509 data.enforceInterface(IActivityManager.descriptor);
510 IBinder token = data.readStrongBinder();
Dianne Hackborne88846e2009-09-30 21:34:25 -0700511 Configuration config = null;
512 if (data.readInt() != 0) {
513 config = Configuration.CREATOR.createFromParcel(data);
514 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700515 boolean stopProfiling = data.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800516 if (token != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700517 activityIdle(token, config, stopProfiling);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800518 }
519 reply.writeNoException();
520 return true;
521 }
522
Dianne Hackbornad9b32112012-09-17 15:35:01 -0700523 case ACTIVITY_RESUMED_TRANSACTION: {
524 data.enforceInterface(IActivityManager.descriptor);
525 IBinder token = data.readStrongBinder();
526 activityResumed(token);
527 reply.writeNoException();
528 return true;
529 }
530
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800531 case ACTIVITY_PAUSED_TRANSACTION: {
532 data.enforceInterface(IActivityManager.descriptor);
533 IBinder token = data.readStrongBinder();
Dianne Hackborna4e102e2014-09-04 22:52:27 -0700534 activityPaused(token);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800535 reply.writeNoException();
536 return true;
537 }
538
539 case ACTIVITY_STOPPED_TRANSACTION: {
540 data.enforceInterface(IActivityManager.descriptor);
541 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800542 Bundle map = data.readBundle();
Craig Mautnera0026042014-04-23 11:45:37 -0700543 PersistableBundle persistentState = data.readPersistableBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800544 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
Craig Mautnera0026042014-04-23 11:45:37 -0700545 activityStopped(token, map, persistentState, description);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800546 reply.writeNoException();
547 return true;
548 }
549
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800550 case ACTIVITY_SLEPT_TRANSACTION: {
551 data.enforceInterface(IActivityManager.descriptor);
552 IBinder token = data.readStrongBinder();
553 activitySlept(token);
554 reply.writeNoException();
555 return true;
556 }
557
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800558 case ACTIVITY_DESTROYED_TRANSACTION: {
559 data.enforceInterface(IActivityManager.descriptor);
560 IBinder token = data.readStrongBinder();
561 activityDestroyed(token);
562 reply.writeNoException();
563 return true;
564 }
565
566 case GET_CALLING_PACKAGE_TRANSACTION: {
567 data.enforceInterface(IActivityManager.descriptor);
568 IBinder token = data.readStrongBinder();
569 String res = token != null ? getCallingPackage(token) : null;
570 reply.writeNoException();
571 reply.writeString(res);
572 return true;
573 }
574
575 case GET_CALLING_ACTIVITY_TRANSACTION: {
576 data.enforceInterface(IActivityManager.descriptor);
577 IBinder token = data.readStrongBinder();
578 ComponentName cn = getCallingActivity(token);
579 reply.writeNoException();
580 ComponentName.writeToParcel(cn, reply);
581 return true;
582 }
583
Winson Chung1147c402014-05-14 11:05:00 -0700584 case GET_APP_TASKS_TRANSACTION: {
585 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -0700586 String callingPackage = data.readString();
587 List<IAppTask> list = getAppTasks(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -0700588 reply.writeNoException();
589 int N = list != null ? list.size() : -1;
590 reply.writeInt(N);
591 int i;
592 for (i=0; i<N; i++) {
593 IAppTask task = list.get(i);
594 reply.writeStrongBinder(task.asBinder());
595 }
596 return true;
597 }
598
Dianne Hackbornaec68bb2014-08-20 15:25:13 -0700599 case ADD_APP_TASK_TRANSACTION: {
600 data.enforceInterface(IActivityManager.descriptor);
601 IBinder activityToken = data.readStrongBinder();
602 Intent intent = Intent.CREATOR.createFromParcel(data);
603 ActivityManager.TaskDescription descr
604 = ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
605 Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data);
606 int res = addAppTask(activityToken, intent, descr, thumbnail);
607 reply.writeNoException();
608 reply.writeInt(res);
609 return true;
610 }
611
612 case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: {
613 data.enforceInterface(IActivityManager.descriptor);
614 Point size = getAppTaskThumbnailSize();
615 reply.writeNoException();
616 size.writeToParcel(reply, 0);
617 return true;
618 }
619
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800620 case GET_TASKS_TRANSACTION: {
621 data.enforceInterface(IActivityManager.descriptor);
622 int maxNum = data.readInt();
623 int fl = data.readInt();
Dianne Hackborn09233282014-04-30 11:33:59 -0700624 List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800625 reply.writeNoException();
626 int N = list != null ? list.size() : -1;
627 reply.writeInt(N);
628 int i;
629 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700630 ActivityManager.RunningTaskInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800631 info.writeToParcel(reply, 0);
632 }
633 return true;
634 }
635
636 case GET_RECENT_TASKS_TRANSACTION: {
637 data.enforceInterface(IActivityManager.descriptor);
638 int maxNum = data.readInt();
639 int fl = data.readInt();
Amith Yamasani82644082012-08-03 13:09:11 -0700640 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800641 List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -0700642 fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800643 reply.writeNoException();
644 reply.writeTypedList(list);
645 return true;
646 }
Dianne Hackborn15491c62012-09-19 10:59:14 -0700647
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700648 case GET_TASK_THUMBNAIL_TRANSACTION: {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800649 data.enforceInterface(IActivityManager.descriptor);
650 int id = data.readInt();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700651 ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id);
Dianne Hackbornd94df452011-02-16 18:53:31 -0800652 reply.writeNoException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700653 if (taskThumbnail != null) {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800654 reply.writeInt(1);
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700655 taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn15491c62012-09-19 10:59:14 -0700656 } else {
657 reply.writeInt(0);
658 }
659 return true;
660 }
661
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800662 case GET_SERVICES_TRANSACTION: {
663 data.enforceInterface(IActivityManager.descriptor);
664 int maxNum = data.readInt();
665 int fl = data.readInt();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700666 List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800667 reply.writeNoException();
668 int N = list != null ? list.size() : -1;
669 reply.writeInt(N);
670 int i;
671 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700672 ActivityManager.RunningServiceInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800673 info.writeToParcel(reply, 0);
674 }
675 return true;
676 }
677
678 case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: {
679 data.enforceInterface(IActivityManager.descriptor);
680 List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState();
681 reply.writeNoException();
682 reply.writeTypedList(list);
683 return true;
684 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700685
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800686 case GET_RUNNING_APP_PROCESSES_TRANSACTION: {
687 data.enforceInterface(IActivityManager.descriptor);
688 List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses();
689 reply.writeNoException();
690 reply.writeTypedList(list);
691 return true;
692 }
693
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -0700694 case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: {
695 data.enforceInterface(IActivityManager.descriptor);
696 List<ApplicationInfo> list = getRunningExternalApplications();
697 reply.writeNoException();
698 reply.writeTypedList(list);
699 return true;
700 }
701
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800702 case MOVE_TASK_TO_FRONT_TRANSACTION: {
703 data.enforceInterface(IActivityManager.descriptor);
704 int task = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800705 int fl = data.readInt();
Dianne Hackborn8078d8c2012-03-20 11:11:26 -0700706 Bundle options = data.readInt() != 0
707 ? Bundle.CREATOR.createFromParcel(data) : null;
708 moveTaskToFront(task, fl, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800709 reply.writeNoException();
710 return true;
711 }
712
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800713 case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: {
714 data.enforceInterface(IActivityManager.descriptor);
715 IBinder token = data.readStrongBinder();
716 boolean nonRoot = data.readInt() != 0;
717 boolean res = moveActivityTaskToBack(token, nonRoot);
718 reply.writeNoException();
719 reply.writeInt(res ? 1 : 0);
720 return true;
721 }
722
723 case MOVE_TASK_BACKWARDS_TRANSACTION: {
724 data.enforceInterface(IActivityManager.descriptor);
725 int task = data.readInt();
726 moveTaskBackwards(task);
727 reply.writeNoException();
728 return true;
729 }
730
Craig Mautnerc00204b2013-03-05 15:02:14 -0800731 case MOVE_TASK_TO_STACK_TRANSACTION: {
732 data.enforceInterface(IActivityManager.descriptor);
733 int taskId = data.readInt();
734 int stackId = data.readInt();
735 boolean toTop = data.readInt() != 0;
736 moveTaskToStack(taskId, stackId, toTop);
737 reply.writeNoException();
738 return true;
739 }
740
741 case RESIZE_STACK_TRANSACTION: {
742 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800743 int stackId = data.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800744 Rect r = Rect.CREATOR.createFromParcel(data);
745 resizeStack(stackId, r);
Craig Mautnerc00204b2013-03-05 15:02:14 -0800746 reply.writeNoException();
747 return true;
748 }
749
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800750 case GET_ALL_STACK_INFOS_TRANSACTION: {
Craig Mautner5ff12102013-05-24 12:50:15 -0700751 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800752 List<StackInfo> list = getAllStackInfos();
Craig Mautner5ff12102013-05-24 12:50:15 -0700753 reply.writeNoException();
754 reply.writeTypedList(list);
755 return true;
756 }
757
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800758 case GET_STACK_INFO_TRANSACTION: {
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700759 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800760 int stackId = data.readInt();
761 StackInfo info = getStackInfo(stackId);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700762 reply.writeNoException();
763 if (info != null) {
764 reply.writeInt(1);
765 info.writeToParcel(reply, 0);
766 } else {
767 reply.writeInt(0);
768 }
769 return true;
770 }
771
Winson Chung303e1ff2014-03-07 15:06:19 -0800772 case IS_IN_HOME_STACK_TRANSACTION: {
773 data.enforceInterface(IActivityManager.descriptor);
774 int taskId = data.readInt();
775 boolean isInHomeStack = isInHomeStack(taskId);
776 reply.writeNoException();
777 reply.writeInt(isInHomeStack ? 1 : 0);
778 return true;
779 }
780
Craig Mautnercf910b02013-04-23 11:23:27 -0700781 case SET_FOCUSED_STACK_TRANSACTION: {
782 data.enforceInterface(IActivityManager.descriptor);
783 int stackId = data.readInt();
784 setFocusedStack(stackId);
785 reply.writeNoException();
786 return true;
787 }
788
Winson Chungd16c5652015-01-26 16:11:07 -0800789 case GET_FOCUSED_STACK_ID_TRANSACTION: {
790 data.enforceInterface(IActivityManager.descriptor);
791 int focusedStackId = getFocusedStackId();
792 reply.writeNoException();
793 reply.writeInt(focusedStackId);
794 return true;
795 }
796
Winson Chung740c3ac2014-11-12 16:14:38 -0800797 case REGISTER_TASK_STACK_LISTENER_TRANSACTION: {
798 data.enforceInterface(IActivityManager.descriptor);
799 IBinder token = data.readStrongBinder();
800 registerTaskStackListener(ITaskStackListener.Stub.asInterface(token));
801 reply.writeNoException();
802 return true;
803 }
804
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800805 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
806 data.enforceInterface(IActivityManager.descriptor);
807 IBinder token = data.readStrongBinder();
808 boolean onlyRoot = data.readInt() != 0;
809 int res = token != null
810 ? getTaskForActivity(token, onlyRoot) : -1;
811 reply.writeNoException();
812 reply.writeInt(res);
813 return true;
814 }
815
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800816 case GET_CONTENT_PROVIDER_TRANSACTION: {
817 data.enforceInterface(IActivityManager.descriptor);
818 IBinder b = data.readStrongBinder();
819 IApplicationThread app = ApplicationThreadNative.asInterface(b);
820 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700821 int userId = data.readInt();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700822 boolean stable = data.readInt() != 0;
Jeff Sharkey6d515712012-09-20 16:06:08 -0700823 ContentProviderHolder cph = getContentProvider(app, name, userId, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800824 reply.writeNoException();
825 if (cph != null) {
826 reply.writeInt(1);
827 cph.writeToParcel(reply, 0);
828 } else {
829 reply.writeInt(0);
830 }
831 return true;
832 }
833
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800834 case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
835 data.enforceInterface(IActivityManager.descriptor);
836 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700837 int userId = data.readInt();
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800838 IBinder token = data.readStrongBinder();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700839 ContentProviderHolder cph = getContentProviderExternal(name, userId, token);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800840 reply.writeNoException();
841 if (cph != null) {
842 reply.writeInt(1);
843 cph.writeToParcel(reply, 0);
844 } else {
845 reply.writeInt(0);
846 }
847 return true;
848 }
849
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800850 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
851 data.enforceInterface(IActivityManager.descriptor);
852 IBinder b = data.readStrongBinder();
853 IApplicationThread app = ApplicationThreadNative.asInterface(b);
854 ArrayList<ContentProviderHolder> providers =
855 data.createTypedArrayList(ContentProviderHolder.CREATOR);
856 publishContentProviders(app, providers);
857 reply.writeNoException();
858 return true;
859 }
860
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700861 case REF_CONTENT_PROVIDER_TRANSACTION: {
862 data.enforceInterface(IActivityManager.descriptor);
863 IBinder b = data.readStrongBinder();
864 int stable = data.readInt();
865 int unstable = data.readInt();
866 boolean res = refContentProvider(b, stable, unstable);
867 reply.writeNoException();
868 reply.writeInt(res ? 1 : 0);
869 return true;
870 }
871
872 case UNSTABLE_PROVIDER_DIED_TRANSACTION: {
873 data.enforceInterface(IActivityManager.descriptor);
874 IBinder b = data.readStrongBinder();
875 unstableProviderDied(b);
876 reply.writeNoException();
877 return true;
878 }
879
Jeff Sharkey7aa76012013-09-30 14:26:27 -0700880 case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: {
881 data.enforceInterface(IActivityManager.descriptor);
882 IBinder b = data.readStrongBinder();
883 appNotRespondingViaProvider(b);
884 reply.writeNoException();
885 return true;
886 }
887
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800888 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
889 data.enforceInterface(IActivityManager.descriptor);
890 IBinder b = data.readStrongBinder();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700891 boolean stable = data.readInt() != 0;
892 removeContentProvider(b, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800893 reply.writeNoException();
894 return true;
895 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800896
897 case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
898 data.enforceInterface(IActivityManager.descriptor);
899 String name = data.readString();
900 IBinder token = data.readStrongBinder();
901 removeContentProviderExternal(name, token);
902 reply.writeNoException();
903 return true;
904 }
905
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700906 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
907 data.enforceInterface(IActivityManager.descriptor);
908 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
909 PendingIntent pi = getRunningServiceControlPanel(comp);
910 reply.writeNoException();
911 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
912 return true;
913 }
914
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800915 case START_SERVICE_TRANSACTION: {
916 data.enforceInterface(IActivityManager.descriptor);
917 IBinder b = data.readStrongBinder();
918 IApplicationThread app = ApplicationThreadNative.asInterface(b);
919 Intent service = Intent.CREATOR.createFromParcel(data);
920 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700921 int userId = data.readInt();
922 ComponentName cn = startService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800923 reply.writeNoException();
924 ComponentName.writeToParcel(cn, reply);
925 return true;
926 }
927
928 case STOP_SERVICE_TRANSACTION: {
929 data.enforceInterface(IActivityManager.descriptor);
930 IBinder b = data.readStrongBinder();
931 IApplicationThread app = ApplicationThreadNative.asInterface(b);
932 Intent service = Intent.CREATOR.createFromParcel(data);
933 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700934 int userId = data.readInt();
935 int res = stopService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800936 reply.writeNoException();
937 reply.writeInt(res);
938 return true;
939 }
940
941 case STOP_SERVICE_TOKEN_TRANSACTION: {
942 data.enforceInterface(IActivityManager.descriptor);
943 ComponentName className = ComponentName.readFromParcel(data);
944 IBinder token = data.readStrongBinder();
945 int startId = data.readInt();
946 boolean res = stopServiceToken(className, token, startId);
947 reply.writeNoException();
948 reply.writeInt(res ? 1 : 0);
949 return true;
950 }
951
952 case SET_SERVICE_FOREGROUND_TRANSACTION: {
953 data.enforceInterface(IActivityManager.descriptor);
954 ComponentName className = ComponentName.readFromParcel(data);
955 IBinder token = data.readStrongBinder();
Dianne Hackbornd8a43f62009-08-17 23:33:56 -0700956 int id = data.readInt();
957 Notification notification = null;
958 if (data.readInt() != 0) {
959 notification = Notification.CREATOR.createFromParcel(data);
960 }
961 boolean removeNotification = data.readInt() != 0;
962 setServiceForeground(className, token, id, notification, removeNotification);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800963 reply.writeNoException();
964 return true;
965 }
966
967 case BIND_SERVICE_TRANSACTION: {
968 data.enforceInterface(IActivityManager.descriptor);
969 IBinder b = data.readStrongBinder();
970 IApplicationThread app = ApplicationThreadNative.asInterface(b);
971 IBinder token = data.readStrongBinder();
972 Intent service = Intent.CREATOR.createFromParcel(data);
973 String resolvedType = data.readString();
974 b = data.readStrongBinder();
975 int fl = data.readInt();
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800976 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800977 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
Amith Yamasani37ce3a82012-02-06 12:04:42 -0800978 int res = bindService(app, token, service, resolvedType, conn, fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800979 reply.writeNoException();
980 reply.writeInt(res);
981 return true;
982 }
983
984 case UNBIND_SERVICE_TRANSACTION: {
985 data.enforceInterface(IActivityManager.descriptor);
986 IBinder b = data.readStrongBinder();
987 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
988 boolean res = unbindService(conn);
989 reply.writeNoException();
990 reply.writeInt(res ? 1 : 0);
991 return true;
992 }
993
994 case PUBLISH_SERVICE_TRANSACTION: {
995 data.enforceInterface(IActivityManager.descriptor);
996 IBinder token = data.readStrongBinder();
997 Intent intent = Intent.CREATOR.createFromParcel(data);
998 IBinder service = data.readStrongBinder();
999 publishService(token, intent, service);
1000 reply.writeNoException();
1001 return true;
1002 }
1003
1004 case UNBIND_FINISHED_TRANSACTION: {
1005 data.enforceInterface(IActivityManager.descriptor);
1006 IBinder token = data.readStrongBinder();
1007 Intent intent = Intent.CREATOR.createFromParcel(data);
1008 boolean doRebind = data.readInt() != 0;
1009 unbindFinished(token, intent, doRebind);
1010 reply.writeNoException();
1011 return true;
1012 }
1013
1014 case SERVICE_DONE_EXECUTING_TRANSACTION: {
1015 data.enforceInterface(IActivityManager.descriptor);
1016 IBinder token = data.readStrongBinder();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07001017 int type = data.readInt();
1018 int startId = data.readInt();
1019 int res = data.readInt();
1020 serviceDoneExecuting(token, type, startId, res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001021 reply.writeNoException();
1022 return true;
1023 }
1024
1025 case START_INSTRUMENTATION_TRANSACTION: {
1026 data.enforceInterface(IActivityManager.descriptor);
1027 ComponentName className = ComponentName.readFromParcel(data);
1028 String profileFile = data.readString();
1029 int fl = data.readInt();
1030 Bundle arguments = data.readBundle();
1031 IBinder b = data.readStrongBinder();
1032 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08001033 b = data.readStrongBinder();
1034 IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001035 int userId = data.readInt();
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01001036 String abiOverride = data.readString();
1037 boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId,
1038 abiOverride);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001039 reply.writeNoException();
1040 reply.writeInt(res ? 1 : 0);
1041 return true;
1042 }
1043
1044
1045 case FINISH_INSTRUMENTATION_TRANSACTION: {
1046 data.enforceInterface(IActivityManager.descriptor);
1047 IBinder b = data.readStrongBinder();
1048 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1049 int resultCode = data.readInt();
1050 Bundle results = data.readBundle();
1051 finishInstrumentation(app, resultCode, results);
1052 reply.writeNoException();
1053 return true;
1054 }
1055
1056 case GET_CONFIGURATION_TRANSACTION: {
1057 data.enforceInterface(IActivityManager.descriptor);
1058 Configuration config = getConfiguration();
1059 reply.writeNoException();
1060 config.writeToParcel(reply, 0);
1061 return true;
1062 }
1063
1064 case UPDATE_CONFIGURATION_TRANSACTION: {
1065 data.enforceInterface(IActivityManager.descriptor);
1066 Configuration config = Configuration.CREATOR.createFromParcel(data);
1067 updateConfiguration(config);
1068 reply.writeNoException();
1069 return true;
1070 }
1071
1072 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
1073 data.enforceInterface(IActivityManager.descriptor);
1074 IBinder token = data.readStrongBinder();
1075 int requestedOrientation = data.readInt();
1076 setRequestedOrientation(token, requestedOrientation);
1077 reply.writeNoException();
1078 return true;
1079 }
1080
1081 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
1082 data.enforceInterface(IActivityManager.descriptor);
1083 IBinder token = data.readStrongBinder();
1084 int req = getRequestedOrientation(token);
1085 reply.writeNoException();
1086 reply.writeInt(req);
1087 return true;
1088 }
1089
1090 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
1091 data.enforceInterface(IActivityManager.descriptor);
1092 IBinder token = data.readStrongBinder();
1093 ComponentName cn = getActivityClassForToken(token);
1094 reply.writeNoException();
1095 ComponentName.writeToParcel(cn, reply);
1096 return true;
1097 }
1098
1099 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
1100 data.enforceInterface(IActivityManager.descriptor);
1101 IBinder token = data.readStrongBinder();
1102 reply.writeNoException();
1103 reply.writeString(getPackageForToken(token));
1104 return true;
1105 }
1106
1107 case GET_INTENT_SENDER_TRANSACTION: {
1108 data.enforceInterface(IActivityManager.descriptor);
1109 int type = data.readInt();
1110 String packageName = data.readString();
1111 IBinder token = data.readStrongBinder();
1112 String resultWho = data.readString();
1113 int requestCode = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001114 Intent[] requestIntents;
1115 String[] requestResolvedTypes;
1116 if (data.readInt() != 0) {
1117 requestIntents = data.createTypedArray(Intent.CREATOR);
1118 requestResolvedTypes = data.createStringArray();
1119 } else {
1120 requestIntents = null;
1121 requestResolvedTypes = null;
1122 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001123 int fl = data.readInt();
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07001124 Bundle options = data.readInt() != 0
1125 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -07001126 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001127 IIntentSender res = getIntentSender(type, packageName, token,
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001128 resultWho, requestCode, requestIntents,
Dianne Hackborn41203752012-08-31 14:05:51 -07001129 requestResolvedTypes, fl, options, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001130 reply.writeNoException();
1131 reply.writeStrongBinder(res != null ? res.asBinder() : null);
1132 return true;
1133 }
1134
1135 case CANCEL_INTENT_SENDER_TRANSACTION: {
1136 data.enforceInterface(IActivityManager.descriptor);
1137 IIntentSender r = IIntentSender.Stub.asInterface(
1138 data.readStrongBinder());
1139 cancelIntentSender(r);
1140 reply.writeNoException();
1141 return true;
1142 }
1143
1144 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
1145 data.enforceInterface(IActivityManager.descriptor);
1146 IIntentSender r = IIntentSender.Stub.asInterface(
1147 data.readStrongBinder());
1148 String res = getPackageForIntentSender(r);
1149 reply.writeNoException();
1150 reply.writeString(res);
1151 return true;
1152 }
1153
Christopher Tatec4a07d12012-04-06 14:19:13 -07001154 case GET_UID_FOR_INTENT_SENDER_TRANSACTION: {
1155 data.enforceInterface(IActivityManager.descriptor);
1156 IIntentSender r = IIntentSender.Stub.asInterface(
1157 data.readStrongBinder());
1158 int res = getUidForIntentSender(r);
1159 reply.writeNoException();
1160 reply.writeInt(res);
1161 return true;
1162 }
1163
Dianne Hackborn41203752012-08-31 14:05:51 -07001164 case HANDLE_INCOMING_USER_TRANSACTION: {
1165 data.enforceInterface(IActivityManager.descriptor);
1166 int callingPid = data.readInt();
1167 int callingUid = data.readInt();
1168 int userId = data.readInt();
1169 boolean allowAll = data.readInt() != 0 ;
1170 boolean requireFull = data.readInt() != 0;
1171 String name = data.readString();
1172 String callerPackage = data.readString();
1173 int res = handleIncomingUser(callingPid, callingUid, userId, allowAll,
1174 requireFull, name, callerPackage);
1175 reply.writeNoException();
1176 reply.writeInt(res);
1177 return true;
1178 }
1179
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001180 case SET_PROCESS_LIMIT_TRANSACTION: {
1181 data.enforceInterface(IActivityManager.descriptor);
1182 int max = data.readInt();
1183 setProcessLimit(max);
1184 reply.writeNoException();
1185 return true;
1186 }
1187
1188 case GET_PROCESS_LIMIT_TRANSACTION: {
1189 data.enforceInterface(IActivityManager.descriptor);
1190 int limit = getProcessLimit();
1191 reply.writeNoException();
1192 reply.writeInt(limit);
1193 return true;
1194 }
1195
1196 case SET_PROCESS_FOREGROUND_TRANSACTION: {
1197 data.enforceInterface(IActivityManager.descriptor);
1198 IBinder token = data.readStrongBinder();
1199 int pid = data.readInt();
1200 boolean isForeground = data.readInt() != 0;
1201 setProcessForeground(token, pid, isForeground);
1202 reply.writeNoException();
1203 return true;
1204 }
1205
1206 case CHECK_PERMISSION_TRANSACTION: {
1207 data.enforceInterface(IActivityManager.descriptor);
1208 String perm = data.readString();
1209 int pid = data.readInt();
1210 int uid = data.readInt();
1211 int res = checkPermission(perm, pid, uid);
1212 reply.writeNoException();
1213 reply.writeInt(res);
1214 return true;
1215 }
1216
Dianne Hackbornff170242014-11-19 10:59:01 -08001217 case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: {
1218 data.enforceInterface(IActivityManager.descriptor);
1219 String perm = data.readString();
1220 int pid = data.readInt();
1221 int uid = data.readInt();
1222 IBinder token = data.readStrongBinder();
1223 int res = checkPermissionWithToken(perm, pid, uid, token);
1224 reply.writeNoException();
1225 reply.writeInt(res);
1226 return true;
1227 }
1228
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001229 case CHECK_URI_PERMISSION_TRANSACTION: {
1230 data.enforceInterface(IActivityManager.descriptor);
1231 Uri uri = Uri.CREATOR.createFromParcel(data);
1232 int pid = data.readInt();
1233 int uid = data.readInt();
1234 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001235 int userId = data.readInt();
Dianne Hackbornff170242014-11-19 10:59:01 -08001236 IBinder callerToken = data.readStrongBinder();
1237 int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001238 reply.writeNoException();
1239 reply.writeInt(res);
1240 return true;
1241 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001242
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001243 case CLEAR_APP_DATA_TRANSACTION: {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001244 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001245 String packageName = data.readString();
1246 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
1247 data.readStrongBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -07001248 int userId = data.readInt();
1249 boolean res = clearApplicationUserData(packageName, observer, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001250 reply.writeNoException();
1251 reply.writeInt(res ? 1 : 0);
1252 return true;
1253 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001254
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001255 case GRANT_URI_PERMISSION_TRANSACTION: {
1256 data.enforceInterface(IActivityManager.descriptor);
1257 IBinder b = data.readStrongBinder();
1258 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1259 String targetPkg = data.readString();
1260 Uri uri = Uri.CREATOR.createFromParcel(data);
1261 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001262 int userId = data.readInt();
1263 grantUriPermission(app, targetPkg, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001264 reply.writeNoException();
1265 return true;
1266 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001267
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001268 case REVOKE_URI_PERMISSION_TRANSACTION: {
1269 data.enforceInterface(IActivityManager.descriptor);
1270 IBinder b = data.readStrongBinder();
1271 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1272 Uri uri = Uri.CREATOR.createFromParcel(data);
1273 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001274 int userId = data.readInt();
1275 revokeUriPermission(app, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001276 reply.writeNoException();
1277 return true;
1278 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001279
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001280 case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1281 data.enforceInterface(IActivityManager.descriptor);
1282 Uri uri = Uri.CREATOR.createFromParcel(data);
1283 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001284 int userId = data.readInt();
1285 takePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001286 reply.writeNoException();
1287 return true;
1288 }
1289
1290 case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1291 data.enforceInterface(IActivityManager.descriptor);
1292 Uri uri = Uri.CREATOR.createFromParcel(data);
1293 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001294 int userId = data.readInt();
1295 releasePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001296 reply.writeNoException();
1297 return true;
1298 }
1299
1300 case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: {
1301 data.enforceInterface(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07001302 final String packageName = data.readString();
1303 final boolean incoming = data.readInt() != 0;
1304 final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions(
1305 packageName, incoming);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001306 reply.writeNoException();
1307 perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1308 return true;
1309 }
1310
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001311 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
1312 data.enforceInterface(IActivityManager.descriptor);
1313 IBinder b = data.readStrongBinder();
1314 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1315 boolean waiting = data.readInt() != 0;
1316 showWaitingForDebugger(app, waiting);
1317 reply.writeNoException();
1318 return true;
1319 }
1320
1321 case GET_MEMORY_INFO_TRANSACTION: {
1322 data.enforceInterface(IActivityManager.descriptor);
1323 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
1324 getMemoryInfo(mi);
1325 reply.writeNoException();
1326 mi.writeToParcel(reply, 0);
1327 return true;
1328 }
1329
1330 case UNHANDLED_BACK_TRANSACTION: {
1331 data.enforceInterface(IActivityManager.descriptor);
1332 unhandledBack();
1333 reply.writeNoException();
1334 return true;
1335 }
1336
1337 case OPEN_CONTENT_URI_TRANSACTION: {
1338 data.enforceInterface(IActivityManager.descriptor);
1339 Uri uri = Uri.parse(data.readString());
1340 ParcelFileDescriptor pfd = openContentUri(uri);
1341 reply.writeNoException();
1342 if (pfd != null) {
1343 reply.writeInt(1);
1344 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1345 } else {
1346 reply.writeInt(0);
1347 }
1348 return true;
1349 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001350
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001351 case SET_LOCK_SCREEN_SHOWN_TRANSACTION: {
1352 data.enforceInterface(IActivityManager.descriptor);
1353 setLockScreenShown(data.readInt() != 0);
1354 reply.writeNoException();
1355 return true;
1356 }
1357
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001358 case SET_DEBUG_APP_TRANSACTION: {
1359 data.enforceInterface(IActivityManager.descriptor);
1360 String pn = data.readString();
1361 boolean wfd = data.readInt() != 0;
1362 boolean per = data.readInt() != 0;
1363 setDebugApp(pn, wfd, per);
1364 reply.writeNoException();
1365 return true;
1366 }
1367
1368 case SET_ALWAYS_FINISH_TRANSACTION: {
1369 data.enforceInterface(IActivityManager.descriptor);
1370 boolean enabled = data.readInt() != 0;
1371 setAlwaysFinish(enabled);
1372 reply.writeNoException();
1373 return true;
1374 }
1375
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001376 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001377 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001378 IActivityController watcher = IActivityController.Stub.asInterface(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001379 data.readStrongBinder());
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001380 setActivityController(watcher);
Sungmin Choicdb86bb2012-12-20 14:08:59 +09001381 reply.writeNoException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001382 return true;
1383 }
1384
1385 case ENTER_SAFE_MODE_TRANSACTION: {
1386 data.enforceInterface(IActivityManager.descriptor);
1387 enterSafeMode();
1388 reply.writeNoException();
1389 return true;
1390 }
1391
1392 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1393 data.enforceInterface(IActivityManager.descriptor);
1394 IIntentSender is = IIntentSender.Stub.asInterface(
1395 data.readStrongBinder());
Dianne Hackborn099bc622014-01-22 13:39:16 -08001396 int sourceUid = data.readInt();
1397 String sourcePkg = data.readString();
Dianne Hackborn1e383822015-04-10 14:02:33 -07001398 String tag = data.readString();
1399 noteWakeupAlarm(is, sourceUid, sourcePkg, tag);
1400 reply.writeNoException();
1401 return true;
1402 }
1403
1404 case NOTE_ALARM_START_TRANSACTION: {
1405 data.enforceInterface(IActivityManager.descriptor);
1406 IIntentSender is = IIntentSender.Stub.asInterface(
1407 data.readStrongBinder());
1408 int sourceUid = data.readInt();
1409 String tag = data.readString();
1410 noteAlarmStart(is, sourceUid, tag);
1411 reply.writeNoException();
1412 return true;
1413 }
1414
1415 case NOTE_ALARM_FINISH_TRANSACTION: {
1416 data.enforceInterface(IActivityManager.descriptor);
1417 IIntentSender is = IIntentSender.Stub.asInterface(
1418 data.readStrongBinder());
1419 int sourceUid = data.readInt();
1420 String tag = data.readString();
1421 noteAlarmFinish(is, sourceUid, tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001422 reply.writeNoException();
1423 return true;
1424 }
1425
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001426 case KILL_PIDS_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001427 data.enforceInterface(IActivityManager.descriptor);
1428 int[] pids = data.createIntArray();
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001429 String reason = data.readString();
Dianne Hackborn64825172011-03-02 21:32:58 -08001430 boolean secure = data.readInt() != 0;
1431 boolean res = killPids(pids, reason, secure);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001432 reply.writeNoException();
1433 reply.writeInt(res ? 1 : 0);
1434 return true;
1435 }
1436
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07001437 case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: {
1438 data.enforceInterface(IActivityManager.descriptor);
1439 String reason = data.readString();
1440 boolean res = killProcessesBelowForeground(reason);
1441 reply.writeNoException();
1442 reply.writeInt(res ? 1 : 0);
1443 return true;
1444 }
1445
Dan Egnor60d87622009-12-16 16:32:58 -08001446 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1447 data.enforceInterface(IActivityManager.descriptor);
1448 IBinder app = data.readStrongBinder();
1449 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1450 handleApplicationCrash(app, ci);
1451 reply.writeNoException();
1452 return true;
1453 }
1454
1455 case HANDLE_APPLICATION_WTF_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001456 data.enforceInterface(IActivityManager.descriptor);
1457 IBinder app = data.readStrongBinder();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001458 String tag = data.readString();
Dianne Hackborn52322712014-08-26 22:47:26 -07001459 boolean system = data.readInt() != 0;
Dan Egnorb7f03672009-12-09 16:22:32 -08001460 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
Dianne Hackborn52322712014-08-26 22:47:26 -07001461 boolean res = handleApplicationWtf(app, tag, system, ci);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001462 reply.writeNoException();
Dan Egnor60d87622009-12-16 16:32:58 -08001463 reply.writeInt(res ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001464 return true;
1465 }
Dan Egnorb7f03672009-12-09 16:22:32 -08001466
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001467 case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: {
1468 data.enforceInterface(IActivityManager.descriptor);
1469 IBinder app = data.readStrongBinder();
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07001470 int violationMask = data.readInt();
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07001471 StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data);
1472 handleApplicationStrictModeViolation(app, violationMask, info);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001473 reply.writeNoException();
1474 return true;
1475 }
1476
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001477 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1478 data.enforceInterface(IActivityManager.descriptor);
1479 int sig = data.readInt();
1480 signalPersistentProcesses(sig);
1481 reply.writeNoException();
1482 return true;
1483 }
1484
Dianne Hackborn03abb812010-01-04 18:43:19 -08001485 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1486 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001487 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001488 int userId = data.readInt();
1489 killBackgroundProcesses(packageName, userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08001490 reply.writeNoException();
1491 return true;
1492 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08001493
1494 case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
1495 data.enforceInterface(IActivityManager.descriptor);
1496 killAllBackgroundProcesses();
1497 reply.writeNoException();
1498 return true;
1499 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001500
Dianne Hackborn03abb812010-01-04 18:43:19 -08001501 case FORCE_STOP_PACKAGE_TRANSACTION: {
1502 data.enforceInterface(IActivityManager.descriptor);
1503 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001504 int userId = data.readInt();
1505 forceStopPackage(packageName, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001506 reply.writeNoException();
1507 return true;
1508 }
Dianne Hackborn27ff9132012-03-06 14:57:58 -08001509
1510 case GET_MY_MEMORY_STATE_TRANSACTION: {
1511 data.enforceInterface(IActivityManager.descriptor);
1512 ActivityManager.RunningAppProcessInfo info =
1513 new ActivityManager.RunningAppProcessInfo();
1514 getMyMemoryState(info);
1515 reply.writeNoException();
1516 info.writeToParcel(reply, 0);
1517 return true;
1518 }
1519
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001520 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1521 data.enforceInterface(IActivityManager.descriptor);
1522 ConfigurationInfo config = getDeviceConfigurationInfo();
1523 reply.writeNoException();
1524 config.writeToParcel(reply, 0);
1525 return true;
1526 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001527
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001528 case PROFILE_CONTROL_TRANSACTION: {
1529 data.enforceInterface(IActivityManager.descriptor);
1530 String process = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001531 int userId = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001532 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001533 int profileType = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -07001534 ProfilerInfo profilerInfo = data.readInt() != 0
1535 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
1536 boolean res = profileControl(process, userId, start, profilerInfo, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001537 reply.writeNoException();
1538 reply.writeInt(res ? 1 : 0);
1539 return true;
1540 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001541
Dianne Hackborn55280a92009-05-07 15:53:46 -07001542 case SHUTDOWN_TRANSACTION: {
1543 data.enforceInterface(IActivityManager.descriptor);
1544 boolean res = shutdown(data.readInt());
1545 reply.writeNoException();
1546 reply.writeInt(res ? 1 : 0);
1547 return true;
1548 }
1549
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001550 case STOP_APP_SWITCHES_TRANSACTION: {
1551 data.enforceInterface(IActivityManager.descriptor);
1552 stopAppSwitches();
1553 reply.writeNoException();
1554 return true;
1555 }
1556
1557 case RESUME_APP_SWITCHES_TRANSACTION: {
1558 data.enforceInterface(IActivityManager.descriptor);
1559 resumeAppSwitches();
1560 reply.writeNoException();
1561 return true;
1562 }
1563
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001564 case PEEK_SERVICE_TRANSACTION: {
1565 data.enforceInterface(IActivityManager.descriptor);
1566 Intent service = Intent.CREATOR.createFromParcel(data);
1567 String resolvedType = data.readString();
1568 IBinder binder = peekService(service, resolvedType);
1569 reply.writeNoException();
1570 reply.writeStrongBinder(binder);
1571 return true;
1572 }
Christopher Tate181fafa2009-05-14 11:12:14 -07001573
1574 case START_BACKUP_AGENT_TRANSACTION: {
1575 data.enforceInterface(IActivityManager.descriptor);
1576 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1577 int backupRestoreMode = data.readInt();
1578 boolean success = bindBackupAgent(info, backupRestoreMode);
1579 reply.writeNoException();
1580 reply.writeInt(success ? 1 : 0);
1581 return true;
1582 }
1583
1584 case BACKUP_AGENT_CREATED_TRANSACTION: {
1585 data.enforceInterface(IActivityManager.descriptor);
1586 String packageName = data.readString();
1587 IBinder agent = data.readStrongBinder();
1588 backupAgentCreated(packageName, agent);
1589 reply.writeNoException();
1590 return true;
1591 }
1592
1593 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1594 data.enforceInterface(IActivityManager.descriptor);
1595 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1596 unbindBackupAgent(info);
1597 reply.writeNoException();
1598 return true;
1599 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001600
1601 case ADD_PACKAGE_DEPENDENCY_TRANSACTION: {
1602 data.enforceInterface(IActivityManager.descriptor);
1603 String packageName = data.readString();
1604 addPackageDependency(packageName);
1605 reply.writeNoException();
1606 return true;
1607 }
1608
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001609 case KILL_APPLICATION_WITH_APPID_TRANSACTION: {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001610 data.enforceInterface(IActivityManager.descriptor);
1611 String pkg = data.readString();
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001612 int appid = data.readInt();
Dianne Hackborn21d9b562013-05-28 17:46:59 -07001613 String reason = data.readString();
1614 killApplicationWithAppId(pkg, appid, reason);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001615 reply.writeNoException();
1616 return true;
1617 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001618
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001619 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1620 data.enforceInterface(IActivityManager.descriptor);
1621 String reason = data.readString();
1622 closeSystemDialogs(reason);
1623 reply.writeNoException();
1624 return true;
1625 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001626
1627 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1628 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001629 int[] pids = data.createIntArray();
1630 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001631 reply.writeNoException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001632 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001633 return true;
1634 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001635
1636 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1637 data.enforceInterface(IActivityManager.descriptor);
1638 String processName = data.readString();
1639 int uid = data.readInt();
1640 killApplicationProcess(processName, uid);
1641 reply.writeNoException();
1642 return true;
1643 }
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001644
1645 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1646 data.enforceInterface(IActivityManager.descriptor);
1647 IBinder token = data.readStrongBinder();
1648 String packageName = data.readString();
1649 int enterAnim = data.readInt();
1650 int exitAnim = data.readInt();
1651 overridePendingTransition(token, packageName, enterAnim, exitAnim);
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001652 reply.writeNoException();
1653 return true;
1654 }
1655
1656 case IS_USER_A_MONKEY_TRANSACTION: {
1657 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001658 boolean areThey = isUserAMonkey();
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001659 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001660 reply.writeInt(areThey ? 1 : 0);
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001661 return true;
1662 }
Dianne Hackborn860755f2010-06-03 18:47:52 -07001663
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07001664 case SET_USER_IS_MONKEY_TRANSACTION: {
1665 data.enforceInterface(IActivityManager.descriptor);
1666 final boolean monkey = (data.readInt() == 1);
1667 setUserIsMonkey(monkey);
1668 reply.writeNoException();
1669 return true;
1670 }
1671
Dianne Hackborn860755f2010-06-03 18:47:52 -07001672 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1673 data.enforceInterface(IActivityManager.descriptor);
1674 finishHeavyWeightApp();
1675 reply.writeNoException();
1676 return true;
1677 }
Daniel Sandler69a48172010-06-23 16:29:36 -04001678
1679 case IS_IMMERSIVE_TRANSACTION: {
1680 data.enforceInterface(IActivityManager.descriptor);
1681 IBinder token = data.readStrongBinder();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001682 boolean isit = isImmersive(token);
Daniel Sandler69a48172010-06-23 16:29:36 -04001683 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001684 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001685 return true;
1686 }
1687
Craig Mautnerd61dc202014-07-07 11:09:11 -07001688 case IS_TOP_OF_TASK_TRANSACTION: {
1689 data.enforceInterface(IActivityManager.descriptor);
1690 IBinder token = data.readStrongBinder();
1691 final boolean isTopOfTask = isTopOfTask(token);
1692 reply.writeNoException();
1693 reply.writeInt(isTopOfTask ? 1 : 0);
1694 return true;
1695 }
1696
Craig Mautner5eda9b32013-07-02 11:58:16 -07001697 case CONVERT_FROM_TRANSLUCENT_TRANSACTION: {
Craig Mautner4addfc52013-06-25 08:05:45 -07001698 data.enforceInterface(IActivityManager.descriptor);
1699 IBinder token = data.readStrongBinder();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001700 boolean converted = convertFromTranslucent(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001701 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001702 reply.writeInt(converted ? 1 : 0);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001703 return true;
1704 }
1705
1706 case CONVERT_TO_TRANSLUCENT_TRANSACTION: {
1707 data.enforceInterface(IActivityManager.descriptor);
1708 IBinder token = data.readStrongBinder();
Craig Mautner233ceee2014-05-09 17:05:11 -07001709 final Bundle bundle;
1710 if (data.readInt() == 0) {
1711 bundle = null;
1712 } else {
1713 bundle = data.readBundle();
1714 }
1715 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
1716 boolean converted = convertToTranslucent(token, options);
Craig Mautner4addfc52013-06-25 08:05:45 -07001717 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001718 reply.writeInt(converted ? 1 : 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07001719 return true;
1720 }
1721
Craig Mautner233ceee2014-05-09 17:05:11 -07001722 case GET_ACTIVITY_OPTIONS_TRANSACTION: {
1723 data.enforceInterface(IActivityManager.descriptor);
1724 IBinder token = data.readStrongBinder();
1725 final ActivityOptions options = getActivityOptions(token);
1726 reply.writeNoException();
1727 reply.writeBundle(options == null ? null : options.toBundle());
1728 return true;
1729 }
1730
Daniel Sandler69a48172010-06-23 16:29:36 -04001731 case SET_IMMERSIVE_TRANSACTION: {
1732 data.enforceInterface(IActivityManager.descriptor);
1733 IBinder token = data.readStrongBinder();
1734 boolean imm = data.readInt() == 1;
1735 setImmersive(token, imm);
1736 reply.writeNoException();
1737 return true;
1738 }
1739
1740 case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
1741 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001742 boolean isit = isTopActivityImmersive();
Daniel Sandler69a48172010-06-23 16:29:36 -04001743 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001744 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001745 return true;
1746 }
1747
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001748 case CRASH_APPLICATION_TRANSACTION: {
1749 data.enforceInterface(IActivityManager.descriptor);
1750 int uid = data.readInt();
1751 int initialPid = data.readInt();
1752 String packageName = data.readString();
1753 String message = data.readString();
1754 crashApplication(uid, initialPid, packageName, message);
1755 reply.writeNoException();
1756 return true;
1757 }
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001758
1759 case GET_PROVIDER_MIME_TYPE_TRANSACTION: {
1760 data.enforceInterface(IActivityManager.descriptor);
1761 Uri uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001762 int userId = data.readInt();
1763 String type = getProviderMimeType(uri, userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001764 reply.writeNoException();
1765 reply.writeString(type);
1766 return true;
1767 }
1768
Dianne Hackborn7e269642010-08-25 19:50:20 -07001769 case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
1770 data.enforceInterface(IActivityManager.descriptor);
1771 String name = data.readString();
1772 IBinder perm = newUriPermissionOwner(name);
1773 reply.writeNoException();
1774 reply.writeStrongBinder(perm);
1775 return true;
1776 }
1777
1778 case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1779 data.enforceInterface(IActivityManager.descriptor);
1780 IBinder owner = data.readStrongBinder();
1781 int fromUid = data.readInt();
1782 String targetPkg = data.readString();
1783 Uri uri = Uri.CREATOR.createFromParcel(data);
1784 int mode = data.readInt();
Nicolas Prevotf1939902014-06-25 09:29:02 +01001785 int sourceUserId = data.readInt();
1786 int targetUserId = data.readInt();
1787 grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId,
1788 targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001789 reply.writeNoException();
1790 return true;
1791 }
1792
1793 case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1794 data.enforceInterface(IActivityManager.descriptor);
1795 IBinder owner = data.readStrongBinder();
1796 Uri uri = null;
1797 if (data.readInt() != 0) {
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001798 uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001799 }
1800 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001801 int userId = data.readInt();
1802 revokeUriPermissionFromOwner(owner, uri, mode, userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001803 reply.writeNoException();
1804 return true;
1805 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001806
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001807 case CHECK_GRANT_URI_PERMISSION_TRANSACTION: {
1808 data.enforceInterface(IActivityManager.descriptor);
1809 int callingUid = data.readInt();
1810 String targetPkg = data.readString();
1811 Uri uri = Uri.CREATOR.createFromParcel(data);
1812 int modeFlags = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001813 int userId = data.readInt();
1814 int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001815 reply.writeNoException();
1816 reply.writeInt(res);
1817 return true;
1818 }
1819
Andy McFadden824c5102010-07-09 16:26:57 -07001820 case DUMP_HEAP_TRANSACTION: {
1821 data.enforceInterface(IActivityManager.descriptor);
1822 String process = data.readString();
Dianne Hackbornb12e1352012-09-26 11:39:20 -07001823 int userId = data.readInt();
Andy McFadden824c5102010-07-09 16:26:57 -07001824 boolean managed = data.readInt() != 0;
1825 String path = data.readString();
1826 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -07001827 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborn1676c852012-09-10 14:52:30 -07001828 boolean res = dumpHeap(process, userId, managed, path, fd);
Andy McFadden824c5102010-07-09 16:26:57 -07001829 reply.writeNoException();
1830 reply.writeInt(res ? 1 : 0);
1831 return true;
1832 }
1833
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001834 case START_ACTIVITIES_TRANSACTION:
1835 {
1836 data.enforceInterface(IActivityManager.descriptor);
1837 IBinder b = data.readStrongBinder();
1838 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001839 String callingPackage = data.readString();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001840 Intent[] intents = data.createTypedArray(Intent.CREATOR);
1841 String[] resolvedTypes = data.createStringArray();
1842 IBinder resultTo = data.readStrongBinder();
Dianne Hackborna4972e92012-03-14 10:38:05 -07001843 Bundle options = data.readInt() != 0
1844 ? Bundle.CREATOR.createFromParcel(data) : null;
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001845 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001846 int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001847 options, userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001848 reply.writeNoException();
1849 reply.writeInt(result);
1850 return true;
1851 }
1852
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001853 case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1854 {
1855 data.enforceInterface(IActivityManager.descriptor);
1856 int mode = getFrontActivityScreenCompatMode();
1857 reply.writeNoException();
1858 reply.writeInt(mode);
1859 return true;
1860 }
1861
1862 case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1863 {
1864 data.enforceInterface(IActivityManager.descriptor);
1865 int mode = data.readInt();
1866 setFrontActivityScreenCompatMode(mode);
1867 reply.writeNoException();
1868 reply.writeInt(mode);
1869 return true;
1870 }
1871
1872 case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1873 {
1874 data.enforceInterface(IActivityManager.descriptor);
1875 String pkg = data.readString();
1876 int mode = getPackageScreenCompatMode(pkg);
1877 reply.writeNoException();
1878 reply.writeInt(mode);
1879 return true;
1880 }
1881
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001882 case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1883 {
1884 data.enforceInterface(IActivityManager.descriptor);
1885 String pkg = data.readString();
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001886 int mode = data.readInt();
1887 setPackageScreenCompatMode(pkg, mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001888 reply.writeNoException();
1889 return true;
1890 }
Dianne Hackbornaa9d84c2011-05-09 19:00:59 -07001891
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001892 case SWITCH_USER_TRANSACTION: {
1893 data.enforceInterface(IActivityManager.descriptor);
1894 int userid = data.readInt();
1895 boolean result = switchUser(userid);
1896 reply.writeNoException();
1897 reply.writeInt(result ? 1 : 0);
1898 return true;
1899 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07001900
Kenny Guy08488bf2014-02-21 17:40:37 +00001901 case START_USER_IN_BACKGROUND_TRANSACTION: {
1902 data.enforceInterface(IActivityManager.descriptor);
1903 int userid = data.readInt();
1904 boolean result = startUserInBackground(userid);
1905 reply.writeNoException();
1906 reply.writeInt(result ? 1 : 0);
1907 return true;
1908 }
1909
Dianne Hackborn80a4af22012-08-27 19:18:31 -07001910 case STOP_USER_TRANSACTION: {
1911 data.enforceInterface(IActivityManager.descriptor);
1912 int userid = data.readInt();
1913 IStopUserCallback callback = IStopUserCallback.Stub.asInterface(
1914 data.readStrongBinder());
1915 int result = stopUser(userid, callback);
1916 reply.writeNoException();
1917 reply.writeInt(result);
1918 return true;
1919 }
1920
Amith Yamasani52f1d752012-03-28 18:19:29 -07001921 case GET_CURRENT_USER_TRANSACTION: {
1922 data.enforceInterface(IActivityManager.descriptor);
1923 UserInfo userInfo = getCurrentUser();
1924 reply.writeNoException();
1925 userInfo.writeToParcel(reply, 0);
1926 return true;
1927 }
1928
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001929 case IS_USER_RUNNING_TRANSACTION: {
1930 data.enforceInterface(IActivityManager.descriptor);
1931 int userid = data.readInt();
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07001932 boolean orStopping = data.readInt() != 0;
1933 boolean result = isUserRunning(userid, orStopping);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001934 reply.writeNoException();
1935 reply.writeInt(result ? 1 : 0);
1936 return true;
1937 }
1938
Dianne Hackbornc72fc672012-09-20 13:12:03 -07001939 case GET_RUNNING_USER_IDS_TRANSACTION: {
1940 data.enforceInterface(IActivityManager.descriptor);
1941 int[] result = getRunningUserIds();
1942 reply.writeNoException();
1943 reply.writeIntArray(result);
1944 return true;
1945 }
1946
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001947 case REMOVE_TASK_TRANSACTION:
1948 {
1949 data.enforceInterface(IActivityManager.descriptor);
1950 int taskId = data.readInt();
Wale Ogunwaled54b5782014-10-23 15:55:23 -07001951 boolean result = removeTask(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001952 reply.writeNoException();
1953 reply.writeInt(result ? 1 : 0);
1954 return true;
1955 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001956
Jeff Sharkeya4620792011-05-20 15:29:23 -07001957 case REGISTER_PROCESS_OBSERVER_TRANSACTION: {
1958 data.enforceInterface(IActivityManager.descriptor);
1959 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1960 data.readStrongBinder());
1961 registerProcessObserver(observer);
1962 return true;
1963 }
1964
1965 case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: {
1966 data.enforceInterface(IActivityManager.descriptor);
1967 IProcessObserver observer = IProcessObserver.Stub.asInterface(
1968 data.readStrongBinder());
1969 unregisterProcessObserver(observer);
1970 return true;
1971 }
1972
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07001973 case REGISTER_UID_OBSERVER_TRANSACTION: {
1974 data.enforceInterface(IActivityManager.descriptor);
1975 IUidObserver observer = IUidObserver.Stub.asInterface(
1976 data.readStrongBinder());
1977 registerUidObserver(observer);
1978 return true;
1979 }
1980
1981 case UNREGISTER_UID_OBSERVER_TRANSACTION: {
1982 data.enforceInterface(IActivityManager.descriptor);
1983 IUidObserver observer = IUidObserver.Stub.asInterface(
1984 data.readStrongBinder());
1985 unregisterUidObserver(observer);
1986 return true;
1987 }
1988
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07001989 case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
1990 {
1991 data.enforceInterface(IActivityManager.descriptor);
1992 String pkg = data.readString();
1993 boolean ask = getPackageAskScreenCompat(pkg);
1994 reply.writeNoException();
1995 reply.writeInt(ask ? 1 : 0);
1996 return true;
1997 }
1998
1999 case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
2000 {
2001 data.enforceInterface(IActivityManager.descriptor);
2002 String pkg = data.readString();
2003 boolean ask = data.readInt() != 0;
2004 setPackageAskScreenCompat(pkg, ask);
2005 reply.writeNoException();
2006 return true;
2007 }
2008
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002009 case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: {
2010 data.enforceInterface(IActivityManager.descriptor);
2011 IIntentSender r = IIntentSender.Stub.asInterface(
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002012 data.readStrongBinder());
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002013 boolean res = isIntentSenderTargetedToPackage(r);
2014 reply.writeNoException();
2015 reply.writeInt(res ? 1 : 0);
2016 return true;
2017 }
2018
Dianne Hackborn1927ae82012-06-22 15:21:36 -07002019 case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: {
2020 data.enforceInterface(IActivityManager.descriptor);
2021 IIntentSender r = IIntentSender.Stub.asInterface(
2022 data.readStrongBinder());
2023 boolean res = isIntentSenderAnActivity(r);
2024 reply.writeNoException();
2025 reply.writeInt(res ? 1 : 0);
2026 return true;
2027 }
2028
Dianne Hackborn81038902012-11-26 17:04:09 -08002029 case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: {
2030 data.enforceInterface(IActivityManager.descriptor);
2031 IIntentSender r = IIntentSender.Stub.asInterface(
2032 data.readStrongBinder());
2033 Intent intent = getIntentForIntentSender(r);
2034 reply.writeNoException();
2035 if (intent != null) {
2036 reply.writeInt(1);
2037 intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2038 } else {
2039 reply.writeInt(0);
2040 }
2041 return true;
2042 }
2043
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08002044 case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: {
2045 data.enforceInterface(IActivityManager.descriptor);
2046 IIntentSender r = IIntentSender.Stub.asInterface(
2047 data.readStrongBinder());
2048 String prefix = data.readString();
2049 String tag = getTagForIntentSender(r, prefix);
2050 reply.writeNoException();
2051 reply.writeString(tag);
2052 return true;
2053 }
2054
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002055 case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
2056 data.enforceInterface(IActivityManager.descriptor);
2057 Configuration config = Configuration.CREATOR.createFromParcel(data);
2058 updatePersistentConfiguration(config);
2059 reply.writeNoException();
2060 return true;
2061 }
2062
Dianne Hackbornb437e092011-08-05 17:50:29 -07002063 case GET_PROCESS_PSS_TRANSACTION: {
2064 data.enforceInterface(IActivityManager.descriptor);
2065 int[] pids = data.createIntArray();
2066 long[] pss = getProcessPss(pids);
2067 reply.writeNoException();
2068 reply.writeLongArray(pss);
2069 return true;
2070 }
2071
Dianne Hackborn661cd522011-08-22 00:26:20 -07002072 case SHOW_BOOT_MESSAGE_TRANSACTION: {
2073 data.enforceInterface(IActivityManager.descriptor);
2074 CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
2075 boolean always = data.readInt() != 0;
2076 showBootMessage(msg, always);
2077 reply.writeNoException();
2078 return true;
2079 }
2080
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002081 case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002082 data.enforceInterface(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002083 keyguardWaitingForActivityDrawn();
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002084 reply.writeNoException();
2085 return true;
2086 }
2087
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07002088 case KEYGUARD_GOING_AWAY_TRANSACTION: {
2089 data.enforceInterface(IActivityManager.descriptor);
2090 keyguardGoingAway(data.readInt() != 0, data.readInt() != 0);
2091 reply.writeNoException();
2092 return true;
2093 }
2094
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002095 case SHOULD_UP_RECREATE_TASK_TRANSACTION: {
Adam Powelldd8fab22012-03-22 17:47:27 -07002096 data.enforceInterface(IActivityManager.descriptor);
2097 IBinder token = data.readStrongBinder();
2098 String destAffinity = data.readString();
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002099 boolean res = shouldUpRecreateTask(token, destAffinity);
Adam Powelldd8fab22012-03-22 17:47:27 -07002100 reply.writeNoException();
2101 reply.writeInt(res ? 1 : 0);
2102 return true;
2103 }
2104
2105 case NAVIGATE_UP_TO_TRANSACTION: {
2106 data.enforceInterface(IActivityManager.descriptor);
2107 IBinder token = data.readStrongBinder();
2108 Intent target = Intent.CREATOR.createFromParcel(data);
2109 int resultCode = data.readInt();
2110 Intent resultData = null;
2111 if (data.readInt() != 0) {
2112 resultData = Intent.CREATOR.createFromParcel(data);
2113 }
2114 boolean res = navigateUpTo(token, target, resultCode, resultData);
2115 reply.writeNoException();
2116 reply.writeInt(res ? 1 : 0);
2117 return true;
2118 }
2119
Dianne Hackborn5320eb82012-05-18 12:05:04 -07002120 case GET_LAUNCHED_FROM_UID_TRANSACTION: {
2121 data.enforceInterface(IActivityManager.descriptor);
2122 IBinder token = data.readStrongBinder();
2123 int res = getLaunchedFromUid(token);
2124 reply.writeNoException();
2125 reply.writeInt(res);
2126 return true;
2127 }
2128
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002129 case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: {
2130 data.enforceInterface(IActivityManager.descriptor);
2131 IBinder token = data.readStrongBinder();
2132 String res = getLaunchedFromPackage(token);
2133 reply.writeNoException();
2134 reply.writeString(res);
2135 return true;
2136 }
2137
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002138 case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2139 data.enforceInterface(IActivityManager.descriptor);
2140 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2141 data.readStrongBinder());
2142 registerUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002143 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002144 return true;
2145 }
2146
2147 case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2148 data.enforceInterface(IActivityManager.descriptor);
2149 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2150 data.readStrongBinder());
2151 unregisterUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002152 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002153 return true;
2154 }
2155
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002156 case REQUEST_BUG_REPORT_TRANSACTION: {
2157 data.enforceInterface(IActivityManager.descriptor);
2158 requestBugReport();
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002159 reply.writeNoException();
2160 return true;
2161 }
2162
2163 case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: {
2164 data.enforceInterface(IActivityManager.descriptor);
2165 int pid = data.readInt();
2166 boolean aboveSystem = data.readInt() != 0;
Jeff Brownbd181bb2013-09-10 16:44:24 -07002167 String reason = data.readString();
2168 long res = inputDispatchingTimedOut(pid, aboveSystem, reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002169 reply.writeNoException();
2170 reply.writeLong(res);
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002171 return true;
2172 }
2173
Adam Skorydfc7fd72013-08-05 19:23:41 -07002174 case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002175 data.enforceInterface(IActivityManager.descriptor);
2176 int requestType = data.readInt();
Adam Skorydfc7fd72013-08-05 19:23:41 -07002177 Bundle res = getAssistContextExtras(requestType);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002178 reply.writeNoException();
2179 reply.writeBundle(res);
2180 return true;
2181 }
2182
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002183 case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
2184 data.enforceInterface(IActivityManager.descriptor);
2185 int requestType = data.readInt();
2186 IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder());
2187 requestAssistContextExtras(requestType, receiver);
2188 reply.writeNoException();
2189 return true;
2190 }
2191
Adam Skorydfc7fd72013-08-05 19:23:41 -07002192 case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002193 data.enforceInterface(IActivityManager.descriptor);
2194 IBinder token = data.readStrongBinder();
2195 Bundle extras = data.readBundle();
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07002196 AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data);
2197 AssistContent content = AssistContent.CREATOR.createFromParcel(data);
2198 reportAssistContextExtras(token, extras, structure, content);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002199 reply.writeNoException();
2200 return true;
2201 }
2202
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002203 case LAUNCH_ASSIST_INTENT_TRANSACTION: {
2204 data.enforceInterface(IActivityManager.descriptor);
2205 Intent intent = Intent.CREATOR.createFromParcel(data);
2206 int requestType = data.readInt();
2207 String hint = data.readString();
2208 int userHandle = data.readInt();
2209 boolean res = launchAssistIntent(intent, requestType, hint, userHandle);
2210 reply.writeNoException();
2211 reply.writeInt(res ? 1 : 0);
2212 return true;
2213 }
2214
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002215 case KILL_UID_TRANSACTION: {
2216 data.enforceInterface(IActivityManager.descriptor);
2217 int uid = data.readInt();
2218 String reason = data.readString();
2219 killUid(uid, reason);
2220 reply.writeNoException();
2221 return true;
2222 }
2223
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07002224 case HANG_TRANSACTION: {
2225 data.enforceInterface(IActivityManager.descriptor);
2226 IBinder who = data.readStrongBinder();
2227 boolean allowRestart = data.readInt() != 0;
2228 hang(who, allowRestart);
2229 reply.writeNoException();
2230 return true;
2231 }
2232
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07002233 case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: {
2234 data.enforceInterface(IActivityManager.descriptor);
2235 IBinder token = data.readStrongBinder();
2236 reportActivityFullyDrawn(token);
2237 reply.writeNoException();
2238 return true;
2239 }
2240
Craig Mautner5eda9b32013-07-02 11:58:16 -07002241 case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: {
2242 data.enforceInterface(IActivityManager.descriptor);
2243 IBinder token = data.readStrongBinder();
2244 notifyActivityDrawn(token);
2245 reply.writeNoException();
2246 return true;
2247 }
Dianne Hackborn57a7f592013-07-22 18:21:32 -07002248
2249 case RESTART_TRANSACTION: {
2250 data.enforceInterface(IActivityManager.descriptor);
2251 restart();
2252 reply.writeNoException();
2253 return true;
2254 }
Jeff Sharkey08da7a12013-08-11 20:53:18 -07002255
Dianne Hackborn35f72be2013-09-16 10:57:39 -07002256 case PERFORM_IDLE_MAINTENANCE_TRANSACTION: {
2257 data.enforceInterface(IActivityManager.descriptor);
2258 performIdleMaintenance();
2259 reply.writeNoException();
2260 return true;
2261 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002262
Todd Kennedyca4d8422015-01-15 15:19:22 -08002263 case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: {
Craig Mautner4a1cb222013-12-04 16:14:06 -08002264 data.enforceInterface(IActivityManager.descriptor);
2265 IBinder parentActivityToken = data.readStrongBinder();
2266 IActivityContainerCallback callback =
Craig Mautnere3a00d72014-04-16 08:31:19 -07002267 IActivityContainerCallback.Stub.asInterface(data.readStrongBinder());
Craig Mautner4a1cb222013-12-04 16:14:06 -08002268 IActivityContainer activityContainer =
Todd Kennedyca4d8422015-01-15 15:19:22 -08002269 createVirtualActivityContainer(parentActivityToken, callback);
Craig Mautner4a1cb222013-12-04 16:14:06 -08002270 reply.writeNoException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08002271 if (activityContainer != null) {
2272 reply.writeInt(1);
2273 reply.writeStrongBinder(activityContainer.asBinder());
2274 } else {
2275 reply.writeInt(0);
2276 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002277 return true;
2278 }
2279
Craig Mautner95da1082014-02-24 17:54:35 -08002280 case DELETE_ACTIVITY_CONTAINER_TRANSACTION: {
2281 data.enforceInterface(IActivityManager.descriptor);
2282 IActivityContainer activityContainer =
2283 IActivityContainer.Stub.asInterface(data.readStrongBinder());
2284 deleteActivityContainer(activityContainer);
2285 reply.writeNoException();
2286 return true;
2287 }
2288
Todd Kennedy4900bf92015-01-16 16:05:14 -08002289 case CREATE_STACK_ON_DISPLAY: {
2290 data.enforceInterface(IActivityManager.descriptor);
2291 int displayId = data.readInt();
2292 IActivityContainer activityContainer = createStackOnDisplay(displayId);
2293 reply.writeNoException();
2294 if (activityContainer != null) {
2295 reply.writeInt(1);
2296 reply.writeStrongBinder(activityContainer.asBinder());
2297 } else {
2298 reply.writeInt(0);
2299 }
2300 return true;
2301 }
2302
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002303 case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: {
Craig Mautnere0a38842013-12-16 16:14:02 -08002304 data.enforceInterface(IActivityManager.descriptor);
2305 IBinder activityToken = data.readStrongBinder();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002306 int displayId = getActivityDisplayId(activityToken);
Craig Mautnere0a38842013-12-16 16:14:02 -08002307 reply.writeNoException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002308 reply.writeInt(displayId);
Craig Mautnere0a38842013-12-16 16:14:02 -08002309 return true;
2310 }
2311
Craig Mautneraea74a52014-03-08 14:23:10 -08002312 case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: {
2313 data.enforceInterface(IActivityManager.descriptor);
2314 final int taskId = data.readInt();
2315 startLockTaskMode(taskId);
2316 reply.writeNoException();
2317 return true;
2318 }
2319
2320 case START_LOCK_TASK_BY_TOKEN_TRANSACTION: {
2321 data.enforceInterface(IActivityManager.descriptor);
2322 IBinder token = data.readStrongBinder();
2323 startLockTaskMode(token);
2324 reply.writeNoException();
2325 return true;
2326 }
2327
Craig Mautnerd61dc202014-07-07 11:09:11 -07002328 case START_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002329 data.enforceInterface(IActivityManager.descriptor);
2330 startLockTaskModeOnCurrent();
2331 reply.writeNoException();
2332 return true;
2333 }
2334
Craig Mautneraea74a52014-03-08 14:23:10 -08002335 case STOP_LOCK_TASK_MODE_TRANSACTION: {
2336 data.enforceInterface(IActivityManager.descriptor);
2337 stopLockTaskMode();
2338 reply.writeNoException();
2339 return true;
2340 }
2341
Craig Mautnerd61dc202014-07-07 11:09:11 -07002342 case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002343 data.enforceInterface(IActivityManager.descriptor);
2344 stopLockTaskModeOnCurrent();
2345 reply.writeNoException();
2346 return true;
2347 }
2348
Craig Mautneraea74a52014-03-08 14:23:10 -08002349 case IS_IN_LOCK_TASK_MODE_TRANSACTION: {
2350 data.enforceInterface(IActivityManager.descriptor);
2351 final boolean isInLockTaskMode = isInLockTaskMode();
2352 reply.writeNoException();
2353 reply.writeInt(isInLockTaskMode ? 1 : 0);
2354 return true;
2355 }
Craig Mautner2fbd7542014-03-21 09:34:07 -07002356
Benjamin Franz43261142015-02-11 15:59:44 +00002357 case GET_LOCK_TASK_MODE_STATE_TRANSACTION: {
2358 data.enforceInterface(IActivityManager.descriptor);
2359 final int lockTaskModeState = getLockTaskModeState();
2360 reply.writeNoException();
2361 reply.writeInt(lockTaskModeState);
2362 return true;
2363 }
2364
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07002365 case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: {
2366 data.enforceInterface(IActivityManager.descriptor);
2367 final IBinder token = data.readStrongBinder();
2368 showLockTaskEscapeMessage(token);
2369 reply.writeNoException();
2370 return true;
2371 }
2372
Winson Chunga449dc02014-05-16 11:15:04 -07002373 case SET_TASK_DESCRIPTION_TRANSACTION: {
Craig Mautner2fbd7542014-03-21 09:34:07 -07002374 data.enforceInterface(IActivityManager.descriptor);
2375 IBinder token = data.readStrongBinder();
Winson Chunga449dc02014-05-16 11:15:04 -07002376 ActivityManager.TaskDescription values =
2377 ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
2378 setTaskDescription(token, values);
Craig Mautner2fbd7542014-03-21 09:34:07 -07002379 reply.writeNoException();
2380 return true;
2381 }
Craig Mautneree2e45a2014-06-27 12:10:03 -07002382
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08002383 case SET_TASK_RESIZEABLE_TRANSACTION: {
2384 data.enforceInterface(IActivityManager.descriptor);
2385 int taskId = data.readInt();
2386 boolean resizeable = (data.readInt() == 1) ? true : false;
2387 setTaskResizeable(taskId, resizeable);
2388 reply.writeNoException();
2389 return true;
2390 }
2391
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002392 case RESIZE_TASK_TRANSACTION: {
2393 data.enforceInterface(IActivityManager.descriptor);
2394 int taskId = data.readInt();
2395 Rect r = Rect.CREATOR.createFromParcel(data);
2396 resizeTask(taskId, r);
2397 reply.writeNoException();
2398 return true;
2399 }
2400
Craig Mautner648f69b2014-09-18 14:16:26 -07002401 case GET_TASK_DESCRIPTION_ICON_TRANSACTION: {
2402 data.enforceInterface(IActivityManager.descriptor);
2403 String filename = data.readString();
2404 Bitmap icon = getTaskDescriptionIcon(filename);
2405 reply.writeNoException();
2406 if (icon == null) {
2407 reply.writeInt(0);
2408 } else {
2409 reply.writeInt(1);
2410 icon.writeToParcel(reply, 0);
2411 }
2412 return true;
2413 }
2414
Winson Chung044d5292014-11-06 11:05:19 -08002415 case START_IN_PLACE_ANIMATION_TRANSACTION: {
2416 data.enforceInterface(IActivityManager.descriptor);
2417 final Bundle bundle;
2418 if (data.readInt() == 0) {
2419 bundle = null;
2420 } else {
2421 bundle = data.readBundle();
2422 }
2423 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
2424 startInPlaceAnimationOnFrontMostApplication(options);
2425 reply.writeNoException();
2426 return true;
2427 }
2428
Jose Lima4b6c6692014-08-12 17:41:12 -07002429 case REQUEST_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002430 data.enforceInterface(IActivityManager.descriptor);
2431 IBinder token = data.readStrongBinder();
2432 boolean enable = data.readInt() > 0;
Jose Lima4b6c6692014-08-12 17:41:12 -07002433 boolean success = requestVisibleBehind(token, enable);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002434 reply.writeNoException();
2435 reply.writeInt(success ? 1 : 0);
2436 return true;
2437 }
2438
Jose Lima4b6c6692014-08-12 17:41:12 -07002439 case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002440 data.enforceInterface(IActivityManager.descriptor);
2441 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002442 final boolean enabled = isBackgroundVisibleBehind(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002443 reply.writeNoException();
2444 reply.writeInt(enabled ? 1 : 0);
2445 return true;
2446 }
2447
Jose Lima4b6c6692014-08-12 17:41:12 -07002448 case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002449 data.enforceInterface(IActivityManager.descriptor);
2450 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002451 backgroundResourcesReleased(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002452 reply.writeNoException();
2453 return true;
2454 }
Craig Mautnerbb742462014-07-07 15:28:55 -07002455
2456 case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: {
2457 data.enforceInterface(IActivityManager.descriptor);
2458 IBinder token = data.readStrongBinder();
2459 notifyLaunchTaskBehindComplete(token);
2460 reply.writeNoException();
2461 return true;
2462 }
Craig Mautner8746a472014-07-24 15:12:54 -07002463
2464 case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: {
2465 data.enforceInterface(IActivityManager.descriptor);
2466 IBinder token = data.readStrongBinder();
2467 notifyEnterAnimationComplete(token);
2468 reply.writeNoException();
2469 return true;
2470 }
Craig Mautner6e2f3952014-09-09 14:26:41 -07002471
2472 case BOOT_ANIMATION_COMPLETE_TRANSACTION: {
2473 data.enforceInterface(IActivityManager.descriptor);
2474 bootAnimationComplete();
2475 reply.writeNoException();
2476 return true;
2477 }
Wale Ogunwale18795a22014-12-03 11:38:33 -08002478
Jeff Sharkey605eb792014-11-04 13:34:06 -08002479 case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: {
2480 data.enforceInterface(IActivityManager.descriptor);
2481 final int uid = data.readInt();
2482 final byte[] firstPacket = data.createByteArray();
2483 notifyCleartextNetwork(uid, firstPacket);
2484 reply.writeNoException();
2485 return true;
2486 }
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002487
2488 case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: {
2489 data.enforceInterface(IActivityManager.descriptor);
2490 String procName = data.readString();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002491 int uid = data.readInt();
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002492 long maxMemSize = data.readLong();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002493 String reportPackage = data.readString();
2494 setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002495 reply.writeNoException();
2496 return true;
2497 }
2498
2499 case DUMP_HEAP_FINISHED_TRANSACTION: {
2500 data.enforceInterface(IActivityManager.descriptor);
2501 String path = data.readString();
2502 dumpHeapFinished(path);
2503 reply.writeNoException();
2504 return true;
2505 }
Dianne Hackborn3d07c942015-03-13 18:02:54 -07002506
2507 case SET_VOICE_KEEP_AWAKE_TRANSACTION: {
2508 data.enforceInterface(IActivityManager.descriptor);
2509 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
2510 data.readStrongBinder());
2511 boolean keepAwake = data.readInt() != 0;
2512 setVoiceKeepAwake(session, keepAwake);
2513 reply.writeNoException();
2514 return true;
2515 }
Craig Mautnere5600772015-04-03 21:36:37 -07002516
2517 case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: {
2518 data.enforceInterface(IActivityManager.descriptor);
2519 int userId = data.readInt();
2520 String[] packages = data.readStringArray();
2521 updateLockTaskPackages(userId, packages);
2522 reply.writeNoException();
2523 return true;
2524 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07002525
Craig Mautner015c5e52015-04-23 10:39:39 -07002526 case UPDATE_DEVICE_OWNER_TRANSACTION: {
2527 data.enforceInterface(IActivityManager.descriptor);
2528 String packageName = data.readString();
2529 updateDeviceOwner(packageName);
2530 reply.writeNoException();
2531 return true;
2532 }
2533
Julia Reynolds13c58ba2015-04-20 16:42:54 -04002534 case UPDATE_PREFERRED_SETUP_ACTIVITY_TRANSACTION: {
2535 data.enforceInterface(IActivityManager.descriptor);
2536 ComponentName preferredActivity = ComponentName.readFromParcel(data);
2537 int userId = data.readInt();
2538 updatePreferredSetupActivity(preferredActivity, userId);
2539 reply.writeNoException();
2540 return true;
2541 }
2542
Dianne Hackborn1e383822015-04-10 14:02:33 -07002543 case GET_PACKAGE_PROCESS_STATE_TRANSACTION: {
2544 data.enforceInterface(IActivityManager.descriptor);
2545 String pkg = data.readString();
2546 int res = getPackageProcessState(pkg);
2547 reply.writeNoException();
2548 reply.writeInt(res);
2549 return true;
2550 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002551 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002552
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002553 return super.onTransact(code, data, reply, flags);
2554 }
2555
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002556 public IBinder asBinder() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002557 return this;
2558 }
2559
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002560 private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
2561 protected IActivityManager create() {
2562 IBinder b = ServiceManager.getService("activity");
Joe Onorato43a17652011-04-06 19:22:23 -07002563 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002564 Log.v("ActivityManager", "default service binder = " + b);
2565 }
2566 IActivityManager am = asInterface(b);
Joe Onorato43a17652011-04-06 19:22:23 -07002567 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002568 Log.v("ActivityManager", "default service = " + am);
2569 }
2570 return am;
2571 }
2572 };
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002573}
2574
2575class ActivityManagerProxy implements IActivityManager
2576{
2577 public ActivityManagerProxy(IBinder remote)
2578 {
2579 mRemote = remote;
2580 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002581
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002582 public IBinder asBinder()
2583 {
2584 return mRemote;
2585 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002586
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002587 public int startActivity(IApplicationThread caller, String callingPackage, Intent intent,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002588 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002589 int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002590 Parcel data = Parcel.obtain();
2591 Parcel reply = Parcel.obtain();
2592 data.writeInterfaceToken(IActivityManager.descriptor);
2593 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002594 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002595 intent.writeToParcel(data, 0);
2596 data.writeString(resolvedType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002597 data.writeStrongBinder(resultTo);
2598 data.writeString(resultWho);
2599 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002600 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002601 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002602 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002603 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002604 } else {
2605 data.writeInt(0);
2606 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002607 if (options != null) {
2608 data.writeInt(1);
2609 options.writeToParcel(data, 0);
2610 } else {
2611 data.writeInt(0);
2612 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002613 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2614 reply.readException();
2615 int result = reply.readInt();
2616 reply.recycle();
2617 data.recycle();
2618 return result;
2619 }
Amith Yamasani82644082012-08-03 13:09:11 -07002620
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002621 public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent,
Amith Yamasani82644082012-08-03 13:09:11 -07002622 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002623 int startFlags, ProfilerInfo profilerInfo, Bundle options,
2624 int userId) throws RemoteException {
Amith Yamasani82644082012-08-03 13:09:11 -07002625 Parcel data = Parcel.obtain();
2626 Parcel reply = Parcel.obtain();
2627 data.writeInterfaceToken(IActivityManager.descriptor);
2628 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002629 data.writeString(callingPackage);
Amith Yamasani82644082012-08-03 13:09:11 -07002630 intent.writeToParcel(data, 0);
2631 data.writeString(resolvedType);
2632 data.writeStrongBinder(resultTo);
2633 data.writeString(resultWho);
2634 data.writeInt(requestCode);
2635 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002636 if (profilerInfo != null) {
Amith Yamasani82644082012-08-03 13:09:11 -07002637 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002638 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Amith Yamasani82644082012-08-03 13:09:11 -07002639 } else {
2640 data.writeInt(0);
2641 }
2642 if (options != null) {
2643 data.writeInt(1);
2644 options.writeToParcel(data, 0);
2645 } else {
2646 data.writeInt(0);
2647 }
2648 data.writeInt(userId);
2649 mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0);
2650 reply.readException();
2651 int result = reply.readInt();
2652 reply.recycle();
2653 data.recycle();
2654 return result;
2655 }
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002656 public int startActivityAsCaller(IApplicationThread caller, String callingPackage,
2657 Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Sharkey97978802014-10-14 10:48:18 -07002658 int startFlags, ProfilerInfo profilerInfo, Bundle options, int userId) throws RemoteException {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002659 Parcel data = Parcel.obtain();
2660 Parcel reply = Parcel.obtain();
2661 data.writeInterfaceToken(IActivityManager.descriptor);
2662 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2663 data.writeString(callingPackage);
2664 intent.writeToParcel(data, 0);
2665 data.writeString(resolvedType);
2666 data.writeStrongBinder(resultTo);
2667 data.writeString(resultWho);
2668 data.writeInt(requestCode);
2669 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002670 if (profilerInfo != null) {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002671 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002672 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002673 } else {
2674 data.writeInt(0);
2675 }
2676 if (options != null) {
2677 data.writeInt(1);
2678 options.writeToParcel(data, 0);
2679 } else {
2680 data.writeInt(0);
2681 }
Jeff Sharkey97978802014-10-14 10:48:18 -07002682 data.writeInt(userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002683 mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0);
2684 reply.readException();
2685 int result = reply.readInt();
2686 reply.recycle();
2687 data.recycle();
2688 return result;
2689 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002690 public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage,
2691 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Jeff Hao1b012d32014-08-20 10:35:34 -07002692 int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options,
2693 int userId) throws RemoteException {
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002694 Parcel data = Parcel.obtain();
2695 Parcel reply = Parcel.obtain();
2696 data.writeInterfaceToken(IActivityManager.descriptor);
2697 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002698 data.writeString(callingPackage);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002699 intent.writeToParcel(data, 0);
2700 data.writeString(resolvedType);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002701 data.writeStrongBinder(resultTo);
2702 data.writeString(resultWho);
2703 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002704 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002705 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002706 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002707 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002708 } else {
2709 data.writeInt(0);
2710 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002711 if (options != null) {
2712 data.writeInt(1);
2713 options.writeToParcel(data, 0);
2714 } else {
2715 data.writeInt(0);
2716 }
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002717 data.writeInt(userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002718 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
2719 reply.readException();
2720 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
2721 reply.recycle();
2722 data.recycle();
2723 return result;
2724 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002725 public int startActivityWithConfig(IApplicationThread caller, String callingPackage,
2726 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002727 int requestCode, int startFlags, Configuration config,
Dianne Hackborn41203752012-08-31 14:05:51 -07002728 Bundle options, int userId) throws RemoteException {
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002729 Parcel data = Parcel.obtain();
2730 Parcel reply = Parcel.obtain();
2731 data.writeInterfaceToken(IActivityManager.descriptor);
2732 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002733 data.writeString(callingPackage);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002734 intent.writeToParcel(data, 0);
2735 data.writeString(resolvedType);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002736 data.writeStrongBinder(resultTo);
2737 data.writeString(resultWho);
2738 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002739 data.writeInt(startFlags);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002740 config.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002741 if (options != null) {
2742 data.writeInt(1);
2743 options.writeToParcel(data, 0);
2744 } else {
2745 data.writeInt(0);
2746 }
Dianne Hackborn41203752012-08-31 14:05:51 -07002747 data.writeInt(userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002748 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2749 reply.readException();
2750 int result = reply.readInt();
2751 reply.recycle();
2752 data.recycle();
2753 return result;
2754 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002755 public int startActivityIntentSender(IApplicationThread caller,
2756 IntentSender intent, Intent fillInIntent, String resolvedType,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002757 IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002758 int flagsMask, int flagsValues, Bundle options) throws RemoteException {
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002759 Parcel data = Parcel.obtain();
2760 Parcel reply = Parcel.obtain();
2761 data.writeInterfaceToken(IActivityManager.descriptor);
2762 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2763 intent.writeToParcel(data, 0);
2764 if (fillInIntent != null) {
2765 data.writeInt(1);
2766 fillInIntent.writeToParcel(data, 0);
2767 } else {
2768 data.writeInt(0);
2769 }
2770 data.writeString(resolvedType);
2771 data.writeStrongBinder(resultTo);
2772 data.writeString(resultWho);
2773 data.writeInt(requestCode);
2774 data.writeInt(flagsMask);
2775 data.writeInt(flagsValues);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002776 if (options != null) {
2777 data.writeInt(1);
2778 options.writeToParcel(data, 0);
2779 } else {
2780 data.writeInt(0);
2781 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002782 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002783 reply.readException();
2784 int result = reply.readInt();
2785 reply.recycle();
2786 data.recycle();
2787 return result;
2788 }
Dianne Hackborn91097de2014-04-04 18:02:06 -07002789 public int startVoiceActivity(String callingPackage, int callingPid, int callingUid,
2790 Intent intent, String resolvedType, IVoiceInteractionSession session,
Jeff Hao1b012d32014-08-20 10:35:34 -07002791 IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo,
2792 Bundle options, int userId) throws RemoteException {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002793 Parcel data = Parcel.obtain();
2794 Parcel reply = Parcel.obtain();
2795 data.writeInterfaceToken(IActivityManager.descriptor);
2796 data.writeString(callingPackage);
2797 data.writeInt(callingPid);
2798 data.writeInt(callingUid);
2799 intent.writeToParcel(data, 0);
2800 data.writeString(resolvedType);
2801 data.writeStrongBinder(session.asBinder());
2802 data.writeStrongBinder(interactor.asBinder());
2803 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002804 if (profilerInfo != null) {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002805 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002806 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn91097de2014-04-04 18:02:06 -07002807 } else {
2808 data.writeInt(0);
2809 }
2810 if (options != null) {
2811 data.writeInt(1);
2812 options.writeToParcel(data, 0);
2813 } else {
2814 data.writeInt(0);
2815 }
2816 data.writeInt(userId);
2817 mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0);
2818 reply.readException();
2819 int result = reply.readInt();
2820 reply.recycle();
2821 data.recycle();
2822 return result;
2823 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002824 public boolean startNextMatchingActivity(IBinder callingActivity,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002825 Intent intent, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002826 Parcel data = Parcel.obtain();
2827 Parcel reply = Parcel.obtain();
2828 data.writeInterfaceToken(IActivityManager.descriptor);
2829 data.writeStrongBinder(callingActivity);
2830 intent.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002831 if (options != null) {
2832 data.writeInt(1);
2833 options.writeToParcel(data, 0);
2834 } else {
2835 data.writeInt(0);
2836 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002837 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
2838 reply.readException();
2839 int result = reply.readInt();
2840 reply.recycle();
2841 data.recycle();
2842 return result != 0;
2843 }
Craig Mautnerdc00cbe2014-07-20 17:48:47 -07002844 public int startActivityFromRecents(int taskId, Bundle options) throws RemoteException {
2845 Parcel data = Parcel.obtain();
2846 Parcel reply = Parcel.obtain();
2847 data.writeInterfaceToken(IActivityManager.descriptor);
2848 data.writeInt(taskId);
2849 if (options == null) {
2850 data.writeInt(0);
2851 } else {
2852 data.writeInt(1);
2853 options.writeToParcel(data, 0);
2854 }
2855 mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0);
2856 reply.readException();
2857 int result = reply.readInt();
2858 reply.recycle();
2859 data.recycle();
2860 return result;
2861 }
Winson Chung3b3f4642014-04-22 10:08:18 -07002862 public boolean finishActivity(IBinder token, int resultCode, Intent resultData, boolean finishTask)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002863 throws RemoteException {
2864 Parcel data = Parcel.obtain();
2865 Parcel reply = Parcel.obtain();
2866 data.writeInterfaceToken(IActivityManager.descriptor);
2867 data.writeStrongBinder(token);
2868 data.writeInt(resultCode);
2869 if (resultData != null) {
2870 data.writeInt(1);
2871 resultData.writeToParcel(data, 0);
2872 } else {
2873 data.writeInt(0);
2874 }
Winson Chung3b3f4642014-04-22 10:08:18 -07002875 data.writeInt(finishTask ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002876 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
2877 reply.readException();
2878 boolean res = reply.readInt() != 0;
2879 data.recycle();
2880 reply.recycle();
2881 return res;
2882 }
2883 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
2884 {
2885 Parcel data = Parcel.obtain();
2886 Parcel reply = Parcel.obtain();
2887 data.writeInterfaceToken(IActivityManager.descriptor);
2888 data.writeStrongBinder(token);
2889 data.writeString(resultWho);
2890 data.writeInt(requestCode);
2891 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
2892 reply.readException();
2893 data.recycle();
2894 reply.recycle();
2895 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -07002896 public boolean finishActivityAffinity(IBinder token) throws RemoteException {
2897 Parcel data = Parcel.obtain();
2898 Parcel reply = Parcel.obtain();
2899 data.writeInterfaceToken(IActivityManager.descriptor);
2900 data.writeStrongBinder(token);
2901 mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0);
2902 reply.readException();
2903 boolean res = reply.readInt() != 0;
2904 data.recycle();
2905 reply.recycle();
2906 return res;
2907 }
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -07002908 public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException {
2909 Parcel data = Parcel.obtain();
2910 Parcel reply = Parcel.obtain();
2911 data.writeInterfaceToken(IActivityManager.descriptor);
2912 data.writeStrongBinder(session.asBinder());
2913 mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0);
2914 reply.readException();
2915 data.recycle();
2916 reply.recycle();
2917 }
Dianne Hackborn89ad4562014-08-24 16:45:38 -07002918 public boolean releaseActivityInstance(IBinder token) throws RemoteException {
2919 Parcel data = Parcel.obtain();
2920 Parcel reply = Parcel.obtain();
2921 data.writeInterfaceToken(IActivityManager.descriptor);
2922 data.writeStrongBinder(token);
2923 mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0);
2924 reply.readException();
2925 boolean res = reply.readInt() != 0;
2926 data.recycle();
2927 reply.recycle();
2928 return res;
2929 }
2930 public void releaseSomeActivities(IApplicationThread app) throws RemoteException {
2931 Parcel data = Parcel.obtain();
2932 Parcel reply = Parcel.obtain();
2933 data.writeInterfaceToken(IActivityManager.descriptor);
2934 data.writeStrongBinder(app.asBinder());
2935 mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0);
2936 reply.readException();
2937 data.recycle();
2938 reply.recycle();
2939 }
Dianne Hackborn061d58a2010-03-12 15:07:06 -08002940 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
2941 Parcel data = Parcel.obtain();
2942 Parcel reply = Parcel.obtain();
2943 data.writeInterfaceToken(IActivityManager.descriptor);
2944 data.writeStrongBinder(token);
2945 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
2946 reply.readException();
2947 boolean res = reply.readInt() != 0;
2948 data.recycle();
2949 reply.recycle();
2950 return res;
2951 }
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002952 public Intent registerReceiver(IApplicationThread caller, String packageName,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002953 IIntentReceiver receiver,
Dianne Hackborn20e80982012-08-31 19:00:44 -07002954 IntentFilter filter, String perm, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002955 {
2956 Parcel data = Parcel.obtain();
2957 Parcel reply = Parcel.obtain();
2958 data.writeInterfaceToken(IActivityManager.descriptor);
2959 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002960 data.writeString(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002961 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
2962 filter.writeToParcel(data, 0);
2963 data.writeString(perm);
Dianne Hackborn20e80982012-08-31 19:00:44 -07002964 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002965 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2966 reply.readException();
2967 Intent intent = null;
2968 int haveIntent = reply.readInt();
2969 if (haveIntent != 0) {
2970 intent = Intent.CREATOR.createFromParcel(reply);
2971 }
2972 reply.recycle();
2973 data.recycle();
2974 return intent;
2975 }
2976 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
2977 {
2978 Parcel data = Parcel.obtain();
2979 Parcel reply = Parcel.obtain();
2980 data.writeInterfaceToken(IActivityManager.descriptor);
2981 data.writeStrongBinder(receiver.asBinder());
2982 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
2983 reply.readException();
2984 data.recycle();
2985 reply.recycle();
2986 }
2987 public int broadcastIntent(IApplicationThread caller,
2988 Intent intent, String resolvedType, IIntentReceiver resultTo,
2989 int resultCode, String resultData, Bundle map,
Dianne Hackbornf51f6122013-02-04 18:23:34 -08002990 String requiredPermission, int appOp, boolean serialized,
Amith Yamasani742a6712011-05-04 14:49:28 -07002991 boolean sticky, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002992 {
2993 Parcel data = Parcel.obtain();
2994 Parcel reply = Parcel.obtain();
2995 data.writeInterfaceToken(IActivityManager.descriptor);
2996 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2997 intent.writeToParcel(data, 0);
2998 data.writeString(resolvedType);
2999 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
3000 data.writeInt(resultCode);
3001 data.writeString(resultData);
3002 data.writeBundle(map);
3003 data.writeString(requiredPermission);
Dianne Hackbornf51f6122013-02-04 18:23:34 -08003004 data.writeInt(appOp);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003005 data.writeInt(serialized ? 1 : 0);
3006 data.writeInt(sticky ? 1 : 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003007 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003008 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
3009 reply.readException();
3010 int res = reply.readInt();
3011 reply.recycle();
3012 data.recycle();
3013 return res;
3014 }
Amith Yamasani742a6712011-05-04 14:49:28 -07003015 public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
3016 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003017 {
3018 Parcel data = Parcel.obtain();
3019 Parcel reply = Parcel.obtain();
3020 data.writeInterfaceToken(IActivityManager.descriptor);
3021 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3022 intent.writeToParcel(data, 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003023 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003024 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
3025 reply.readException();
3026 data.recycle();
3027 reply.recycle();
3028 }
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003029 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map,
3030 boolean abortBroadcast, int flags) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003031 {
3032 Parcel data = Parcel.obtain();
3033 Parcel reply = Parcel.obtain();
3034 data.writeInterfaceToken(IActivityManager.descriptor);
3035 data.writeStrongBinder(who);
3036 data.writeInt(resultCode);
3037 data.writeString(resultData);
3038 data.writeBundle(map);
3039 data.writeInt(abortBroadcast ? 1 : 0);
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003040 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003041 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3042 reply.readException();
3043 data.recycle();
3044 reply.recycle();
3045 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003046 public void attachApplication(IApplicationThread app) throws RemoteException
3047 {
3048 Parcel data = Parcel.obtain();
3049 Parcel reply = Parcel.obtain();
3050 data.writeInterfaceToken(IActivityManager.descriptor);
3051 data.writeStrongBinder(app.asBinder());
3052 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
3053 reply.readException();
3054 data.recycle();
3055 reply.recycle();
3056 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003057 public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
3058 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003059 {
3060 Parcel data = Parcel.obtain();
3061 Parcel reply = Parcel.obtain();
3062 data.writeInterfaceToken(IActivityManager.descriptor);
3063 data.writeStrongBinder(token);
Dianne Hackborne88846e2009-09-30 21:34:25 -07003064 if (config != null) {
3065 data.writeInt(1);
3066 config.writeToParcel(data, 0);
3067 } else {
3068 data.writeInt(0);
3069 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003070 data.writeInt(stopProfiling ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003071 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3072 reply.readException();
3073 data.recycle();
3074 reply.recycle();
3075 }
Dianne Hackbornad9b32112012-09-17 15:35:01 -07003076 public void activityResumed(IBinder token) throws RemoteException
3077 {
3078 Parcel data = Parcel.obtain();
3079 Parcel reply = Parcel.obtain();
3080 data.writeInterfaceToken(IActivityManager.descriptor);
3081 data.writeStrongBinder(token);
3082 mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0);
3083 reply.readException();
3084 data.recycle();
3085 reply.recycle();
3086 }
Dianne Hackborna4e102e2014-09-04 22:52:27 -07003087 public void activityPaused(IBinder token) throws RemoteException
Dianne Hackborn0aae2d42010-12-07 23:51:29 -08003088 {
3089 Parcel data = Parcel.obtain();
3090 Parcel reply = Parcel.obtain();
3091 data.writeInterfaceToken(IActivityManager.descriptor);
3092 data.writeStrongBinder(token);
3093 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
3094 reply.readException();
3095 data.recycle();
3096 reply.recycle();
3097 }
3098 public void activityStopped(IBinder token, Bundle state,
Craig Mautnera0026042014-04-23 11:45:37 -07003099 PersistableBundle persistentState, CharSequence description) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003100 {
3101 Parcel data = Parcel.obtain();
3102 Parcel reply = Parcel.obtain();
3103 data.writeInterfaceToken(IActivityManager.descriptor);
3104 data.writeStrongBinder(token);
3105 data.writeBundle(state);
Craig Mautnera0026042014-04-23 11:45:37 -07003106 data.writePersistableBundle(persistentState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003107 TextUtils.writeToParcel(description, data, 0);
3108 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3109 reply.readException();
3110 data.recycle();
3111 reply.recycle();
3112 }
Dianne Hackborn4eba96b2011-01-21 13:34:36 -08003113 public void activitySlept(IBinder token) throws RemoteException
3114 {
3115 Parcel data = Parcel.obtain();
3116 Parcel reply = Parcel.obtain();
3117 data.writeInterfaceToken(IActivityManager.descriptor);
3118 data.writeStrongBinder(token);
3119 mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3120 reply.readException();
3121 data.recycle();
3122 reply.recycle();
3123 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003124 public void activityDestroyed(IBinder token) throws RemoteException
3125 {
3126 Parcel data = Parcel.obtain();
3127 Parcel reply = Parcel.obtain();
3128 data.writeInterfaceToken(IActivityManager.descriptor);
3129 data.writeStrongBinder(token);
3130 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3131 reply.readException();
3132 data.recycle();
3133 reply.recycle();
3134 }
3135 public String getCallingPackage(IBinder token) throws RemoteException
3136 {
3137 Parcel data = Parcel.obtain();
3138 Parcel reply = Parcel.obtain();
3139 data.writeInterfaceToken(IActivityManager.descriptor);
3140 data.writeStrongBinder(token);
3141 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
3142 reply.readException();
3143 String res = reply.readString();
3144 data.recycle();
3145 reply.recycle();
3146 return res;
3147 }
3148 public ComponentName getCallingActivity(IBinder token)
3149 throws RemoteException {
3150 Parcel data = Parcel.obtain();
3151 Parcel reply = Parcel.obtain();
3152 data.writeInterfaceToken(IActivityManager.descriptor);
3153 data.writeStrongBinder(token);
3154 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
3155 reply.readException();
3156 ComponentName res = ComponentName.readFromParcel(reply);
3157 data.recycle();
3158 reply.recycle();
3159 return res;
3160 }
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003161 public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException {
Winson Chung1147c402014-05-14 11:05:00 -07003162 Parcel data = Parcel.obtain();
3163 Parcel reply = Parcel.obtain();
3164 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003165 data.writeString(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -07003166 mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0);
3167 reply.readException();
3168 ArrayList<IAppTask> list = null;
3169 int N = reply.readInt();
3170 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003171 list = new ArrayList<>();
Winson Chung1147c402014-05-14 11:05:00 -07003172 while (N > 0) {
3173 IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder());
3174 list.add(task);
3175 N--;
3176 }
3177 }
3178 data.recycle();
3179 reply.recycle();
3180 return list;
3181 }
Dianne Hackbornaec68bb2014-08-20 15:25:13 -07003182 public int addAppTask(IBinder activityToken, Intent intent,
3183 ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException {
3184 Parcel data = Parcel.obtain();
3185 Parcel reply = Parcel.obtain();
3186 data.writeInterfaceToken(IActivityManager.descriptor);
3187 data.writeStrongBinder(activityToken);
3188 intent.writeToParcel(data, 0);
3189 description.writeToParcel(data, 0);
3190 thumbnail.writeToParcel(data, 0);
3191 mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0);
3192 reply.readException();
3193 int res = reply.readInt();
3194 data.recycle();
3195 reply.recycle();
3196 return res;
3197 }
3198 public Point getAppTaskThumbnailSize() throws RemoteException {
3199 Parcel data = Parcel.obtain();
3200 Parcel reply = Parcel.obtain();
3201 data.writeInterfaceToken(IActivityManager.descriptor);
3202 mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0);
3203 reply.readException();
3204 Point size = Point.CREATOR.createFromParcel(reply);
3205 data.recycle();
3206 reply.recycle();
3207 return size;
3208 }
Todd Kennedye635f662015-01-20 10:36:49 -08003209 public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags)
3210 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003211 Parcel data = Parcel.obtain();
3212 Parcel reply = Parcel.obtain();
3213 data.writeInterfaceToken(IActivityManager.descriptor);
3214 data.writeInt(maxNum);
3215 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003216 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
3217 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003218 ArrayList<ActivityManager.RunningTaskInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003219 int N = reply.readInt();
3220 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003221 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003222 while (N > 0) {
3223 ActivityManager.RunningTaskInfo info =
3224 ActivityManager.RunningTaskInfo.CREATOR
Winson Chung1147c402014-05-14 11:05:00 -07003225 .createFromParcel(reply);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003226 list.add(info);
3227 N--;
3228 }
3229 }
3230 data.recycle();
3231 reply.recycle();
3232 return list;
3233 }
3234 public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -07003235 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003236 Parcel data = Parcel.obtain();
3237 Parcel reply = Parcel.obtain();
3238 data.writeInterfaceToken(IActivityManager.descriptor);
3239 data.writeInt(maxNum);
3240 data.writeInt(flags);
Amith Yamasani82644082012-08-03 13:09:11 -07003241 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003242 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
3243 reply.readException();
3244 ArrayList<ActivityManager.RecentTaskInfo> list
3245 = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR);
3246 data.recycle();
3247 reply.recycle();
3248 return list;
3249 }
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003250 public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException {
Dianne Hackbornd94df452011-02-16 18:53:31 -08003251 Parcel data = Parcel.obtain();
3252 Parcel reply = Parcel.obtain();
3253 data.writeInterfaceToken(IActivityManager.descriptor);
3254 data.writeInt(id);
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003255 mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003256 reply.readException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003257 ActivityManager.TaskThumbnail taskThumbnail = null;
Dianne Hackbornd94df452011-02-16 18:53:31 -08003258 if (reply.readInt() != 0) {
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003259 taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003260 }
3261 data.recycle();
3262 reply.recycle();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003263 return taskThumbnail;
Dianne Hackborn15491c62012-09-19 10:59:14 -07003264 }
Todd Kennedye635f662015-01-20 10:36:49 -08003265 public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags)
3266 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003267 Parcel data = Parcel.obtain();
3268 Parcel reply = Parcel.obtain();
3269 data.writeInterfaceToken(IActivityManager.descriptor);
3270 data.writeInt(maxNum);
3271 data.writeInt(flags);
3272 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
3273 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003274 ArrayList<ActivityManager.RunningServiceInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003275 int N = reply.readInt();
3276 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003277 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003278 while (N > 0) {
3279 ActivityManager.RunningServiceInfo info =
3280 ActivityManager.RunningServiceInfo.CREATOR
3281 .createFromParcel(reply);
3282 list.add(info);
3283 N--;
3284 }
3285 }
3286 data.recycle();
3287 reply.recycle();
3288 return list;
3289 }
3290 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
3291 throws RemoteException {
3292 Parcel data = Parcel.obtain();
3293 Parcel reply = Parcel.obtain();
3294 data.writeInterfaceToken(IActivityManager.descriptor);
3295 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
3296 reply.readException();
3297 ArrayList<ActivityManager.ProcessErrorStateInfo> list
3298 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
3299 data.recycle();
3300 reply.recycle();
3301 return list;
3302 }
3303 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
3304 throws RemoteException {
3305 Parcel data = Parcel.obtain();
3306 Parcel reply = Parcel.obtain();
3307 data.writeInterfaceToken(IActivityManager.descriptor);
3308 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
3309 reply.readException();
3310 ArrayList<ActivityManager.RunningAppProcessInfo> list
3311 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
3312 data.recycle();
3313 reply.recycle();
3314 return list;
3315 }
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -07003316 public List<ApplicationInfo> getRunningExternalApplications()
3317 throws RemoteException {
3318 Parcel data = Parcel.obtain();
3319 Parcel reply = Parcel.obtain();
3320 data.writeInterfaceToken(IActivityManager.descriptor);
3321 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
3322 reply.readException();
3323 ArrayList<ApplicationInfo> list
3324 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
3325 data.recycle();
3326 reply.recycle();
3327 return list;
3328 }
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003329 public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003330 {
3331 Parcel data = Parcel.obtain();
3332 Parcel reply = Parcel.obtain();
3333 data.writeInterfaceToken(IActivityManager.descriptor);
3334 data.writeInt(task);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003335 data.writeInt(flags);
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003336 if (options != null) {
3337 data.writeInt(1);
3338 options.writeToParcel(data, 0);
3339 } else {
3340 data.writeInt(0);
3341 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003342 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
3343 reply.readException();
3344 data.recycle();
3345 reply.recycle();
3346 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003347 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
3348 throws RemoteException {
3349 Parcel data = Parcel.obtain();
3350 Parcel reply = Parcel.obtain();
3351 data.writeInterfaceToken(IActivityManager.descriptor);
3352 data.writeStrongBinder(token);
3353 data.writeInt(nonRoot ? 1 : 0);
3354 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
3355 reply.readException();
3356 boolean res = reply.readInt() != 0;
3357 data.recycle();
3358 reply.recycle();
3359 return res;
3360 }
3361 public void moveTaskBackwards(int task) throws RemoteException
3362 {
3363 Parcel data = Parcel.obtain();
3364 Parcel reply = Parcel.obtain();
3365 data.writeInterfaceToken(IActivityManager.descriptor);
3366 data.writeInt(task);
3367 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
3368 reply.readException();
3369 data.recycle();
3370 reply.recycle();
3371 }
Craig Mautnerc00204b2013-03-05 15:02:14 -08003372 @Override
Craig Mautnerc00204b2013-03-05 15:02:14 -08003373 public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException
3374 {
3375 Parcel data = Parcel.obtain();
3376 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003377 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003378 data.writeInt(taskId);
3379 data.writeInt(stackId);
3380 data.writeInt(toTop ? 1 : 0);
3381 mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0);
3382 reply.readException();
3383 data.recycle();
3384 reply.recycle();
3385 }
3386 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003387 public void resizeStack(int stackBoxId, Rect r) throws RemoteException
Craig Mautnerc00204b2013-03-05 15:02:14 -08003388 {
3389 Parcel data = Parcel.obtain();
3390 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003391 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautner5a449152013-05-24 15:49:29 -07003392 data.writeInt(stackBoxId);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003393 r.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07003394 mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003395 reply.readException();
3396 data.recycle();
3397 reply.recycle();
3398 }
Craig Mautner967212c2013-04-13 21:10:58 -07003399 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003400 public List<StackInfo> getAllStackInfos() throws RemoteException
Craig Mautner5ff12102013-05-24 12:50:15 -07003401 {
3402 Parcel data = Parcel.obtain();
3403 Parcel reply = Parcel.obtain();
3404 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003405 mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0);
Craig Mautner5ff12102013-05-24 12:50:15 -07003406 reply.readException();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003407 ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR);
Craig Mautner967212c2013-04-13 21:10:58 -07003408 data.recycle();
3409 reply.recycle();
3410 return list;
3411 }
Craig Mautnercf910b02013-04-23 11:23:27 -07003412 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003413 public StackInfo getStackInfo(int stackId) throws RemoteException
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003414 {
3415 Parcel data = Parcel.obtain();
3416 Parcel reply = Parcel.obtain();
3417 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003418 data.writeInt(stackId);
3419 mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003420 reply.readException();
3421 int res = reply.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003422 StackInfo info = null;
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003423 if (res != 0) {
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003424 info = StackInfo.CREATOR.createFromParcel(reply);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003425 }
3426 data.recycle();
3427 reply.recycle();
3428 return info;
3429 }
3430 @Override
Winson Chung303e1ff2014-03-07 15:06:19 -08003431 public boolean isInHomeStack(int taskId) throws RemoteException {
3432 Parcel data = Parcel.obtain();
3433 Parcel reply = Parcel.obtain();
3434 data.writeInterfaceToken(IActivityManager.descriptor);
3435 data.writeInt(taskId);
3436 mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0);
3437 reply.readException();
3438 boolean isInHomeStack = reply.readInt() > 0;
3439 data.recycle();
3440 reply.recycle();
3441 return isInHomeStack;
3442 }
3443 @Override
Craig Mautnercf910b02013-04-23 11:23:27 -07003444 public void setFocusedStack(int stackId) throws RemoteException
3445 {
3446 Parcel data = Parcel.obtain();
3447 Parcel reply = Parcel.obtain();
3448 data.writeInterfaceToken(IActivityManager.descriptor);
3449 data.writeInt(stackId);
Dianne Hackborn1e383822015-04-10 14:02:33 -07003450 mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0);
Craig Mautnercf910b02013-04-23 11:23:27 -07003451 reply.readException();
3452 data.recycle();
3453 reply.recycle();
3454 }
Winson Chung740c3ac2014-11-12 16:14:38 -08003455 @Override
Winson Chungd16c5652015-01-26 16:11:07 -08003456 public int getFocusedStackId() throws RemoteException {
3457 Parcel data = Parcel.obtain();
3458 Parcel reply = Parcel.obtain();
3459 data.writeInterfaceToken(IActivityManager.descriptor);
3460 mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0);
3461 reply.readException();
3462 int focusedStackId = reply.readInt();
3463 data.recycle();
3464 reply.recycle();
3465 return focusedStackId;
3466 }
3467 @Override
Winson Chung740c3ac2014-11-12 16:14:38 -08003468 public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException
3469 {
3470 Parcel data = Parcel.obtain();
3471 Parcel reply = Parcel.obtain();
3472 data.writeInterfaceToken(IActivityManager.descriptor);
3473 data.writeStrongBinder(listener.asBinder());
Dianne Hackborn1e383822015-04-10 14:02:33 -07003474 mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0);
Winson Chung740c3ac2014-11-12 16:14:38 -08003475 reply.readException();
3476 data.recycle();
3477 reply.recycle();
3478 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003479 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
3480 {
3481 Parcel data = Parcel.obtain();
3482 Parcel reply = Parcel.obtain();
3483 data.writeInterfaceToken(IActivityManager.descriptor);
3484 data.writeStrongBinder(token);
3485 data.writeInt(onlyRoot ? 1 : 0);
3486 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
3487 reply.readException();
3488 int res = reply.readInt();
3489 data.recycle();
3490 reply.recycle();
3491 return res;
3492 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003493 public ContentProviderHolder getContentProvider(IApplicationThread caller,
Jeff Sharkey6d515712012-09-20 16:06:08 -07003494 String name, int userId, boolean stable) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003495 Parcel data = Parcel.obtain();
3496 Parcel reply = Parcel.obtain();
3497 data.writeInterfaceToken(IActivityManager.descriptor);
3498 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3499 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003500 data.writeInt(userId);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003501 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003502 mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3503 reply.readException();
3504 int res = reply.readInt();
3505 ContentProviderHolder cph = null;
3506 if (res != 0) {
3507 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3508 }
3509 data.recycle();
3510 reply.recycle();
3511 return cph;
3512 }
Jeff Sharkey6d515712012-09-20 16:06:08 -07003513 public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token)
3514 throws RemoteException {
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003515 Parcel data = Parcel.obtain();
3516 Parcel reply = Parcel.obtain();
3517 data.writeInterfaceToken(IActivityManager.descriptor);
3518 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003519 data.writeInt(userId);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003520 data.writeStrongBinder(token);
3521 mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3522 reply.readException();
3523 int res = reply.readInt();
3524 ContentProviderHolder cph = null;
3525 if (res != 0) {
3526 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3527 }
3528 data.recycle();
3529 reply.recycle();
3530 return cph;
3531 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003532 public void publishContentProviders(IApplicationThread caller,
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003533 List<ContentProviderHolder> providers) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003534 {
3535 Parcel data = Parcel.obtain();
3536 Parcel reply = Parcel.obtain();
3537 data.writeInterfaceToken(IActivityManager.descriptor);
3538 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3539 data.writeTypedList(providers);
3540 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
3541 reply.readException();
3542 data.recycle();
3543 reply.recycle();
3544 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003545 public boolean refContentProvider(IBinder connection, int stable, int unstable)
3546 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003547 Parcel data = Parcel.obtain();
3548 Parcel reply = Parcel.obtain();
3549 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003550 data.writeStrongBinder(connection);
3551 data.writeInt(stable);
3552 data.writeInt(unstable);
3553 mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3554 reply.readException();
3555 boolean res = reply.readInt() != 0;
3556 data.recycle();
3557 reply.recycle();
3558 return res;
3559 }
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003560
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003561 public void unstableProviderDied(IBinder connection) throws RemoteException {
3562 Parcel data = Parcel.obtain();
3563 Parcel reply = Parcel.obtain();
3564 data.writeInterfaceToken(IActivityManager.descriptor);
3565 data.writeStrongBinder(connection);
3566 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0);
3567 reply.readException();
3568 data.recycle();
3569 reply.recycle();
3570 }
3571
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003572 @Override
3573 public void appNotRespondingViaProvider(IBinder connection) throws RemoteException {
3574 Parcel data = Parcel.obtain();
3575 Parcel reply = Parcel.obtain();
3576 data.writeInterfaceToken(IActivityManager.descriptor);
3577 data.writeStrongBinder(connection);
3578 mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0);
3579 reply.readException();
3580 data.recycle();
3581 reply.recycle();
3582 }
3583
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003584 public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException {
3585 Parcel data = Parcel.obtain();
3586 Parcel reply = Parcel.obtain();
3587 data.writeInterfaceToken(IActivityManager.descriptor);
3588 data.writeStrongBinder(connection);
3589 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003590 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3591 reply.readException();
3592 data.recycle();
3593 reply.recycle();
3594 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003595
3596 public void removeContentProviderExternal(String name, IBinder token) throws RemoteException {
3597 Parcel data = Parcel.obtain();
3598 Parcel reply = Parcel.obtain();
3599 data.writeInterfaceToken(IActivityManager.descriptor);
3600 data.writeString(name);
3601 data.writeStrongBinder(token);
3602 mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3603 reply.readException();
3604 data.recycle();
3605 reply.recycle();
3606 }
3607
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07003608 public PendingIntent getRunningServiceControlPanel(ComponentName service)
3609 throws RemoteException
3610 {
3611 Parcel data = Parcel.obtain();
3612 Parcel reply = Parcel.obtain();
3613 data.writeInterfaceToken(IActivityManager.descriptor);
3614 service.writeToParcel(data, 0);
3615 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
3616 reply.readException();
3617 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
3618 data.recycle();
3619 reply.recycle();
3620 return res;
3621 }
3622
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003623 public ComponentName startService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003624 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003625 {
3626 Parcel data = Parcel.obtain();
3627 Parcel reply = Parcel.obtain();
3628 data.writeInterfaceToken(IActivityManager.descriptor);
3629 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3630 service.writeToParcel(data, 0);
3631 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003632 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003633 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
3634 reply.readException();
3635 ComponentName res = ComponentName.readFromParcel(reply);
3636 data.recycle();
3637 reply.recycle();
3638 return res;
3639 }
3640 public int stopService(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(STOP_SERVICE_TRANSACTION, data, reply, 0);
3651 reply.readException();
3652 int res = reply.readInt();
3653 reply.recycle();
3654 data.recycle();
3655 return res;
3656 }
3657 public boolean stopServiceToken(ComponentName className, IBinder token,
3658 int startId) throws RemoteException {
3659 Parcel data = Parcel.obtain();
3660 Parcel reply = Parcel.obtain();
3661 data.writeInterfaceToken(IActivityManager.descriptor);
3662 ComponentName.writeToParcel(className, data);
3663 data.writeStrongBinder(token);
3664 data.writeInt(startId);
3665 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
3666 reply.readException();
3667 boolean res = reply.readInt() != 0;
3668 data.recycle();
3669 reply.recycle();
3670 return res;
3671 }
3672 public void setServiceForeground(ComponentName className, IBinder token,
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003673 int id, Notification notification, boolean removeNotification) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003674 Parcel data = Parcel.obtain();
3675 Parcel reply = Parcel.obtain();
3676 data.writeInterfaceToken(IActivityManager.descriptor);
3677 ComponentName.writeToParcel(className, data);
3678 data.writeStrongBinder(token);
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003679 data.writeInt(id);
3680 if (notification != null) {
3681 data.writeInt(1);
3682 notification.writeToParcel(data, 0);
3683 } else {
3684 data.writeInt(0);
3685 }
3686 data.writeInt(removeNotification ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003687 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
3688 reply.readException();
3689 data.recycle();
3690 reply.recycle();
3691 }
3692 public int bindService(IApplicationThread caller, IBinder token,
3693 Intent service, String resolvedType, IServiceConnection connection,
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003694 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003695 Parcel data = Parcel.obtain();
3696 Parcel reply = Parcel.obtain();
3697 data.writeInterfaceToken(IActivityManager.descriptor);
3698 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3699 data.writeStrongBinder(token);
3700 service.writeToParcel(data, 0);
3701 data.writeString(resolvedType);
3702 data.writeStrongBinder(connection.asBinder());
3703 data.writeInt(flags);
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003704 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003705 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
3706 reply.readException();
3707 int res = reply.readInt();
3708 data.recycle();
3709 reply.recycle();
3710 return res;
3711 }
3712 public boolean unbindService(IServiceConnection connection) throws RemoteException
3713 {
3714 Parcel data = Parcel.obtain();
3715 Parcel reply = Parcel.obtain();
3716 data.writeInterfaceToken(IActivityManager.descriptor);
3717 data.writeStrongBinder(connection.asBinder());
3718 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
3719 reply.readException();
3720 boolean res = reply.readInt() != 0;
3721 data.recycle();
3722 reply.recycle();
3723 return res;
3724 }
3725
3726 public void publishService(IBinder token,
3727 Intent intent, IBinder service) throws RemoteException {
3728 Parcel data = Parcel.obtain();
3729 Parcel reply = Parcel.obtain();
3730 data.writeInterfaceToken(IActivityManager.descriptor);
3731 data.writeStrongBinder(token);
3732 intent.writeToParcel(data, 0);
3733 data.writeStrongBinder(service);
3734 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
3735 reply.readException();
3736 data.recycle();
3737 reply.recycle();
3738 }
3739
3740 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
3741 throws RemoteException {
3742 Parcel data = Parcel.obtain();
3743 Parcel reply = Parcel.obtain();
3744 data.writeInterfaceToken(IActivityManager.descriptor);
3745 data.writeStrongBinder(token);
3746 intent.writeToParcel(data, 0);
3747 data.writeInt(doRebind ? 1 : 0);
3748 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
3749 reply.readException();
3750 data.recycle();
3751 reply.recycle();
3752 }
3753
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003754 public void serviceDoneExecuting(IBinder token, int type, int startId,
3755 int res) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003756 Parcel data = Parcel.obtain();
3757 Parcel reply = Parcel.obtain();
3758 data.writeInterfaceToken(IActivityManager.descriptor);
3759 data.writeStrongBinder(token);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003760 data.writeInt(type);
3761 data.writeInt(startId);
3762 data.writeInt(res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003763 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3764 reply.readException();
3765 data.recycle();
3766 reply.recycle();
3767 }
3768
3769 public IBinder peekService(Intent service, String resolvedType) throws RemoteException {
3770 Parcel data = Parcel.obtain();
3771 Parcel reply = Parcel.obtain();
3772 data.writeInterfaceToken(IActivityManager.descriptor);
3773 service.writeToParcel(data, 0);
3774 data.writeString(resolvedType);
3775 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
3776 reply.readException();
3777 IBinder binder = reply.readStrongBinder();
3778 reply.recycle();
3779 data.recycle();
3780 return binder;
3781 }
3782
Christopher Tate181fafa2009-05-14 11:12:14 -07003783 public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
3784 throws RemoteException {
3785 Parcel data = Parcel.obtain();
3786 Parcel reply = Parcel.obtain();
3787 data.writeInterfaceToken(IActivityManager.descriptor);
3788 app.writeToParcel(data, 0);
3789 data.writeInt(backupRestoreMode);
3790 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3791 reply.readException();
3792 boolean success = reply.readInt() != 0;
3793 reply.recycle();
3794 data.recycle();
3795 return success;
3796 }
3797
Christopher Tate346acb12012-10-15 19:20:25 -07003798 public void clearPendingBackup() throws RemoteException {
3799 Parcel data = Parcel.obtain();
3800 Parcel reply = Parcel.obtain();
3801 data.writeInterfaceToken(IActivityManager.descriptor);
3802 mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0);
3803 reply.recycle();
3804 data.recycle();
3805 }
3806
Christopher Tate181fafa2009-05-14 11:12:14 -07003807 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
3808 Parcel data = Parcel.obtain();
3809 Parcel reply = Parcel.obtain();
3810 data.writeInterfaceToken(IActivityManager.descriptor);
3811 data.writeString(packageName);
3812 data.writeStrongBinder(agent);
3813 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
3814 reply.recycle();
3815 data.recycle();
3816 }
3817
3818 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
3819 Parcel data = Parcel.obtain();
3820 Parcel reply = Parcel.obtain();
3821 data.writeInterfaceToken(IActivityManager.descriptor);
3822 app.writeToParcel(data, 0);
3823 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
3824 reply.readException();
3825 reply.recycle();
3826 data.recycle();
3827 }
3828
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003829 public boolean startInstrumentation(ComponentName className, String profileFile,
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003830 int flags, Bundle arguments, IInstrumentationWatcher watcher,
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01003831 IUiAutomationConnection connection, int userId, String instructionSet)
3832 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003833 Parcel data = Parcel.obtain();
3834 Parcel reply = Parcel.obtain();
3835 data.writeInterfaceToken(IActivityManager.descriptor);
3836 ComponentName.writeToParcel(className, data);
3837 data.writeString(profileFile);
3838 data.writeInt(flags);
3839 data.writeBundle(arguments);
3840 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08003841 data.writeStrongBinder(connection != null ? connection.asBinder() : null);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07003842 data.writeInt(userId);
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01003843 data.writeString(instructionSet);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003844 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3845 reply.readException();
3846 boolean res = reply.readInt() != 0;
3847 reply.recycle();
3848 data.recycle();
3849 return res;
3850 }
3851
3852 public void finishInstrumentation(IApplicationThread target,
3853 int resultCode, Bundle results) throws RemoteException {
3854 Parcel data = Parcel.obtain();
3855 Parcel reply = Parcel.obtain();
3856 data.writeInterfaceToken(IActivityManager.descriptor);
3857 data.writeStrongBinder(target != null ? target.asBinder() : null);
3858 data.writeInt(resultCode);
3859 data.writeBundle(results);
3860 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
3861 reply.readException();
3862 data.recycle();
3863 reply.recycle();
3864 }
3865 public Configuration getConfiguration() throws RemoteException
3866 {
3867 Parcel data = Parcel.obtain();
3868 Parcel reply = Parcel.obtain();
3869 data.writeInterfaceToken(IActivityManager.descriptor);
3870 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
3871 reply.readException();
3872 Configuration res = Configuration.CREATOR.createFromParcel(reply);
3873 reply.recycle();
3874 data.recycle();
3875 return res;
3876 }
3877 public void updateConfiguration(Configuration values) throws RemoteException
3878 {
3879 Parcel data = Parcel.obtain();
3880 Parcel reply = Parcel.obtain();
3881 data.writeInterfaceToken(IActivityManager.descriptor);
3882 values.writeToParcel(data, 0);
3883 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
3884 reply.readException();
3885 data.recycle();
3886 reply.recycle();
3887 }
3888 public void setRequestedOrientation(IBinder token, int requestedOrientation)
3889 throws RemoteException {
3890 Parcel data = Parcel.obtain();
3891 Parcel reply = Parcel.obtain();
3892 data.writeInterfaceToken(IActivityManager.descriptor);
3893 data.writeStrongBinder(token);
3894 data.writeInt(requestedOrientation);
3895 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3896 reply.readException();
3897 data.recycle();
3898 reply.recycle();
3899 }
3900 public int getRequestedOrientation(IBinder token) throws RemoteException {
3901 Parcel data = Parcel.obtain();
3902 Parcel reply = Parcel.obtain();
3903 data.writeInterfaceToken(IActivityManager.descriptor);
3904 data.writeStrongBinder(token);
3905 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
3906 reply.readException();
3907 int res = reply.readInt();
3908 data.recycle();
3909 reply.recycle();
3910 return res;
3911 }
3912 public ComponentName getActivityClassForToken(IBinder token)
3913 throws RemoteException {
3914 Parcel data = Parcel.obtain();
3915 Parcel reply = Parcel.obtain();
3916 data.writeInterfaceToken(IActivityManager.descriptor);
3917 data.writeStrongBinder(token);
3918 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
3919 reply.readException();
3920 ComponentName res = ComponentName.readFromParcel(reply);
3921 data.recycle();
3922 reply.recycle();
3923 return res;
3924 }
3925 public String getPackageForToken(IBinder token) throws RemoteException
3926 {
3927 Parcel data = Parcel.obtain();
3928 Parcel reply = Parcel.obtain();
3929 data.writeInterfaceToken(IActivityManager.descriptor);
3930 data.writeStrongBinder(token);
3931 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
3932 reply.readException();
3933 String res = reply.readString();
3934 data.recycle();
3935 reply.recycle();
3936 return res;
3937 }
3938 public IIntentSender getIntentSender(int type,
3939 String packageName, IBinder token, String resultWho,
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003940 int requestCode, Intent[] intents, String[] resolvedTypes, int flags,
Dianne Hackborn41203752012-08-31 14:05:51 -07003941 Bundle options, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003942 Parcel data = Parcel.obtain();
3943 Parcel reply = Parcel.obtain();
3944 data.writeInterfaceToken(IActivityManager.descriptor);
3945 data.writeInt(type);
3946 data.writeString(packageName);
3947 data.writeStrongBinder(token);
3948 data.writeString(resultWho);
3949 data.writeInt(requestCode);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003950 if (intents != null) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003951 data.writeInt(1);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003952 data.writeTypedArray(intents, 0);
3953 data.writeStringArray(resolvedTypes);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003954 } else {
3955 data.writeInt(0);
3956 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003957 data.writeInt(flags);
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07003958 if (options != null) {
3959 data.writeInt(1);
3960 options.writeToParcel(data, 0);
3961 } else {
3962 data.writeInt(0);
3963 }
Dianne Hackborn41203752012-08-31 14:05:51 -07003964 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003965 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
3966 reply.readException();
3967 IIntentSender res = IIntentSender.Stub.asInterface(
Dianne Hackbornff170242014-11-19 10:59:01 -08003968 reply.readStrongBinder());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003969 data.recycle();
3970 reply.recycle();
3971 return res;
3972 }
3973 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
3974 Parcel data = Parcel.obtain();
3975 Parcel reply = Parcel.obtain();
3976 data.writeInterfaceToken(IActivityManager.descriptor);
3977 data.writeStrongBinder(sender.asBinder());
3978 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
3979 reply.readException();
3980 data.recycle();
3981 reply.recycle();
3982 }
3983 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
3984 Parcel data = Parcel.obtain();
3985 Parcel reply = Parcel.obtain();
3986 data.writeInterfaceToken(IActivityManager.descriptor);
3987 data.writeStrongBinder(sender.asBinder());
3988 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
3989 reply.readException();
3990 String res = reply.readString();
3991 data.recycle();
3992 reply.recycle();
3993 return res;
3994 }
Christopher Tatec4a07d12012-04-06 14:19:13 -07003995 public int getUidForIntentSender(IIntentSender sender) throws RemoteException {
3996 Parcel data = Parcel.obtain();
3997 Parcel reply = Parcel.obtain();
3998 data.writeInterfaceToken(IActivityManager.descriptor);
3999 data.writeStrongBinder(sender.asBinder());
4000 mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4001 reply.readException();
4002 int res = reply.readInt();
4003 data.recycle();
4004 reply.recycle();
4005 return res;
4006 }
Dianne Hackborn41203752012-08-31 14:05:51 -07004007 public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
4008 boolean requireFull, String name, String callerPackage) throws RemoteException {
4009 Parcel data = Parcel.obtain();
4010 Parcel reply = Parcel.obtain();
4011 data.writeInterfaceToken(IActivityManager.descriptor);
4012 data.writeInt(callingPid);
4013 data.writeInt(callingUid);
4014 data.writeInt(userId);
4015 data.writeInt(allowAll ? 1 : 0);
4016 data.writeInt(requireFull ? 1 : 0);
4017 data.writeString(name);
4018 data.writeString(callerPackage);
4019 mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0);
4020 reply.readException();
4021 int res = reply.readInt();
4022 data.recycle();
4023 reply.recycle();
4024 return res;
4025 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004026 public void setProcessLimit(int max) throws RemoteException
4027 {
4028 Parcel data = Parcel.obtain();
4029 Parcel reply = Parcel.obtain();
4030 data.writeInterfaceToken(IActivityManager.descriptor);
4031 data.writeInt(max);
4032 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4033 reply.readException();
4034 data.recycle();
4035 reply.recycle();
4036 }
4037 public int getProcessLimit() throws RemoteException
4038 {
4039 Parcel data = Parcel.obtain();
4040 Parcel reply = Parcel.obtain();
4041 data.writeInterfaceToken(IActivityManager.descriptor);
4042 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4043 reply.readException();
4044 int res = reply.readInt();
4045 data.recycle();
4046 reply.recycle();
4047 return res;
4048 }
4049 public void setProcessForeground(IBinder token, int pid,
4050 boolean isForeground) throws RemoteException {
4051 Parcel data = Parcel.obtain();
4052 Parcel reply = Parcel.obtain();
4053 data.writeInterfaceToken(IActivityManager.descriptor);
4054 data.writeStrongBinder(token);
4055 data.writeInt(pid);
4056 data.writeInt(isForeground ? 1 : 0);
4057 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
4058 reply.readException();
4059 data.recycle();
4060 reply.recycle();
4061 }
4062 public int checkPermission(String permission, int pid, int uid)
4063 throws RemoteException {
4064 Parcel data = Parcel.obtain();
4065 Parcel reply = Parcel.obtain();
4066 data.writeInterfaceToken(IActivityManager.descriptor);
4067 data.writeString(permission);
4068 data.writeInt(pid);
4069 data.writeInt(uid);
4070 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
4071 reply.readException();
4072 int res = reply.readInt();
4073 data.recycle();
4074 reply.recycle();
4075 return res;
4076 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004077 public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken)
4078 throws RemoteException {
4079 Parcel data = Parcel.obtain();
4080 Parcel reply = Parcel.obtain();
4081 data.writeInterfaceToken(IActivityManager.descriptor);
4082 data.writeString(permission);
4083 data.writeInt(pid);
4084 data.writeInt(uid);
4085 data.writeStrongBinder(callerToken);
4086 mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0);
4087 reply.readException();
4088 int res = reply.readInt();
4089 data.recycle();
4090 reply.recycle();
4091 return res;
4092 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004093 public boolean clearApplicationUserData(final String packageName,
Amith Yamasani742a6712011-05-04 14:49:28 -07004094 final IPackageDataObserver observer, final int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004095 Parcel data = Parcel.obtain();
4096 Parcel reply = Parcel.obtain();
4097 data.writeInterfaceToken(IActivityManager.descriptor);
4098 data.writeString(packageName);
Christopher Tate31b65f92013-09-09 14:17:27 -07004099 data.writeStrongBinder((observer != null) ? observer.asBinder() : null);
Amith Yamasani742a6712011-05-04 14:49:28 -07004100 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004101 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
4102 reply.readException();
4103 boolean res = reply.readInt() != 0;
4104 data.recycle();
4105 reply.recycle();
4106 return res;
4107 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004108 public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId,
4109 IBinder callerToken) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004110 Parcel data = Parcel.obtain();
4111 Parcel reply = Parcel.obtain();
4112 data.writeInterfaceToken(IActivityManager.descriptor);
4113 uri.writeToParcel(data, 0);
4114 data.writeInt(pid);
4115 data.writeInt(uid);
4116 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004117 data.writeInt(userId);
Dianne Hackbornff170242014-11-19 10:59:01 -08004118 data.writeStrongBinder(callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004119 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
4120 reply.readException();
4121 int res = reply.readInt();
4122 data.recycle();
4123 reply.recycle();
4124 return res;
4125 }
4126 public void grantUriPermission(IApplicationThread caller, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004127 Uri uri, int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004128 Parcel data = Parcel.obtain();
4129 Parcel reply = Parcel.obtain();
4130 data.writeInterfaceToken(IActivityManager.descriptor);
4131 data.writeStrongBinder(caller.asBinder());
4132 data.writeString(targetPkg);
4133 uri.writeToParcel(data, 0);
4134 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004135 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004136 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4137 reply.readException();
4138 data.recycle();
4139 reply.recycle();
4140 }
4141 public void revokeUriPermission(IApplicationThread caller, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004142 int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004143 Parcel data = Parcel.obtain();
4144 Parcel reply = Parcel.obtain();
4145 data.writeInterfaceToken(IActivityManager.descriptor);
4146 data.writeStrongBinder(caller.asBinder());
4147 uri.writeToParcel(data, 0);
4148 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004149 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004150 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4151 reply.readException();
4152 data.recycle();
4153 reply.recycle();
4154 }
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004155
4156 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004157 public void takePersistableUriPermission(Uri uri, int mode, int userId)
4158 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004159 Parcel data = Parcel.obtain();
4160 Parcel reply = Parcel.obtain();
4161 data.writeInterfaceToken(IActivityManager.descriptor);
4162 uri.writeToParcel(data, 0);
4163 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004164 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004165 mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4166 reply.readException();
4167 data.recycle();
4168 reply.recycle();
4169 }
4170
4171 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004172 public void releasePersistableUriPermission(Uri uri, int mode, int userId)
4173 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004174 Parcel data = Parcel.obtain();
4175 Parcel reply = Parcel.obtain();
4176 data.writeInterfaceToken(IActivityManager.descriptor);
4177 uri.writeToParcel(data, 0);
4178 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004179 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004180 mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4181 reply.readException();
4182 data.recycle();
4183 reply.recycle();
4184 }
4185
4186 @Override
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004187 public ParceledListSlice<UriPermission> getPersistedUriPermissions(
4188 String packageName, boolean incoming) throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004189 Parcel data = Parcel.obtain();
4190 Parcel reply = Parcel.obtain();
4191 data.writeInterfaceToken(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004192 data.writeString(packageName);
4193 data.writeInt(incoming ? 1 : 0);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004194 mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
4195 reply.readException();
4196 final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel(
4197 reply);
4198 data.recycle();
4199 reply.recycle();
4200 return perms;
4201 }
4202
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004203 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
4204 throws RemoteException {
4205 Parcel data = Parcel.obtain();
4206 Parcel reply = Parcel.obtain();
4207 data.writeInterfaceToken(IActivityManager.descriptor);
4208 data.writeStrongBinder(who.asBinder());
4209 data.writeInt(waiting ? 1 : 0);
4210 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
4211 reply.readException();
4212 data.recycle();
4213 reply.recycle();
4214 }
4215 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
4216 Parcel data = Parcel.obtain();
4217 Parcel reply = Parcel.obtain();
4218 data.writeInterfaceToken(IActivityManager.descriptor);
4219 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
4220 reply.readException();
4221 outInfo.readFromParcel(reply);
4222 data.recycle();
4223 reply.recycle();
4224 }
4225 public void unhandledBack() throws RemoteException
4226 {
4227 Parcel data = Parcel.obtain();
4228 Parcel reply = Parcel.obtain();
4229 data.writeInterfaceToken(IActivityManager.descriptor);
4230 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
4231 reply.readException();
4232 data.recycle();
4233 reply.recycle();
4234 }
4235 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
4236 {
4237 Parcel data = Parcel.obtain();
4238 Parcel reply = Parcel.obtain();
4239 data.writeInterfaceToken(IActivityManager.descriptor);
4240 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
4241 reply.readException();
4242 ParcelFileDescriptor pfd = null;
4243 if (reply.readInt() != 0) {
4244 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
4245 }
4246 data.recycle();
4247 reply.recycle();
4248 return pfd;
4249 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07004250 public void setLockScreenShown(boolean shown) throws RemoteException
4251 {
4252 Parcel data = Parcel.obtain();
4253 Parcel reply = Parcel.obtain();
4254 data.writeInterfaceToken(IActivityManager.descriptor);
4255 data.writeInt(shown ? 1 : 0);
4256 mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0);
4257 reply.readException();
4258 data.recycle();
4259 reply.recycle();
4260 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004261 public void setDebugApp(
4262 String packageName, boolean waitForDebugger, boolean persistent)
4263 throws RemoteException
4264 {
4265 Parcel data = Parcel.obtain();
4266 Parcel reply = Parcel.obtain();
4267 data.writeInterfaceToken(IActivityManager.descriptor);
4268 data.writeString(packageName);
4269 data.writeInt(waitForDebugger ? 1 : 0);
4270 data.writeInt(persistent ? 1 : 0);
4271 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
4272 reply.readException();
4273 data.recycle();
4274 reply.recycle();
4275 }
4276 public void setAlwaysFinish(boolean enabled) throws RemoteException
4277 {
4278 Parcel data = Parcel.obtain();
4279 Parcel reply = Parcel.obtain();
4280 data.writeInterfaceToken(IActivityManager.descriptor);
4281 data.writeInt(enabled ? 1 : 0);
4282 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
4283 reply.readException();
4284 data.recycle();
4285 reply.recycle();
4286 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004287 public void setActivityController(IActivityController watcher) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004288 {
4289 Parcel data = Parcel.obtain();
4290 Parcel reply = Parcel.obtain();
4291 data.writeInterfaceToken(IActivityManager.descriptor);
4292 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004293 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004294 reply.readException();
4295 data.recycle();
4296 reply.recycle();
4297 }
4298 public void enterSafeMode() throws RemoteException {
4299 Parcel data = Parcel.obtain();
4300 data.writeInterfaceToken(IActivityManager.descriptor);
4301 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
4302 data.recycle();
4303 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07004304 public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag)
Dianne Hackborn099bc622014-01-22 13:39:16 -08004305 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004306 Parcel data = Parcel.obtain();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004307 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn099bc622014-01-22 13:39:16 -08004308 data.writeStrongBinder(sender.asBinder());
4309 data.writeInt(sourceUid);
4310 data.writeString(sourcePkg);
Dianne Hackborn1e383822015-04-10 14:02:33 -07004311 data.writeString(tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004312 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
4313 data.recycle();
4314 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07004315 public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag)
4316 throws RemoteException {
4317 Parcel data = Parcel.obtain();
4318 data.writeInterfaceToken(IActivityManager.descriptor);
4319 data.writeStrongBinder(sender.asBinder());
4320 data.writeInt(sourceUid);
4321 data.writeString(tag);
4322 mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0);
4323 data.recycle();
4324 }
4325 public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag)
4326 throws RemoteException {
4327 Parcel data = Parcel.obtain();
4328 data.writeInterfaceToken(IActivityManager.descriptor);
4329 data.writeStrongBinder(sender.asBinder());
4330 data.writeInt(sourceUid);
4331 data.writeString(tag);
4332 mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0);
4333 data.recycle();
4334 }
Dianne Hackborn64825172011-03-02 21:32:58 -08004335 public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004336 Parcel data = Parcel.obtain();
4337 Parcel reply = Parcel.obtain();
4338 data.writeInterfaceToken(IActivityManager.descriptor);
4339 data.writeIntArray(pids);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004340 data.writeString(reason);
Dianne Hackborn64825172011-03-02 21:32:58 -08004341 data.writeInt(secure ? 1 : 0);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004342 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07004343 reply.readException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004344 boolean res = reply.readInt() != 0;
4345 data.recycle();
4346 reply.recycle();
4347 return res;
4348 }
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07004349 @Override
4350 public boolean killProcessesBelowForeground(String reason) throws RemoteException {
4351 Parcel data = Parcel.obtain();
4352 Parcel reply = Parcel.obtain();
4353 data.writeInterfaceToken(IActivityManager.descriptor);
4354 data.writeString(reason);
4355 mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0);
4356 boolean res = reply.readInt() != 0;
4357 data.recycle();
4358 reply.recycle();
4359 return res;
4360 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004361 public boolean testIsSystemReady()
4362 {
4363 /* this base class version is never called */
4364 return true;
4365 }
Dan Egnor60d87622009-12-16 16:32:58 -08004366 public void handleApplicationCrash(IBinder app,
4367 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
4368 {
4369 Parcel data = Parcel.obtain();
4370 Parcel reply = Parcel.obtain();
4371 data.writeInterfaceToken(IActivityManager.descriptor);
4372 data.writeStrongBinder(app);
4373 crashInfo.writeToParcel(data, 0);
4374 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
4375 reply.readException();
4376 reply.recycle();
4377 data.recycle();
4378 }
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004379
Dianne Hackborn52322712014-08-26 22:47:26 -07004380 public boolean handleApplicationWtf(IBinder app, String tag, boolean system,
Dan Egnorb7f03672009-12-09 16:22:32 -08004381 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004382 {
4383 Parcel data = Parcel.obtain();
4384 Parcel reply = Parcel.obtain();
4385 data.writeInterfaceToken(IActivityManager.descriptor);
4386 data.writeStrongBinder(app);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004387 data.writeString(tag);
Dianne Hackborn52322712014-08-26 22:47:26 -07004388 data.writeInt(system ? 1 : 0);
Dan Egnorb7f03672009-12-09 16:22:32 -08004389 crashInfo.writeToParcel(data, 0);
Dan Egnor60d87622009-12-16 16:32:58 -08004390 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004391 reply.readException();
Dan Egnor60d87622009-12-16 16:32:58 -08004392 boolean res = reply.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004393 reply.recycle();
4394 data.recycle();
Dan Egnor60d87622009-12-16 16:32:58 -08004395 return res;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004396 }
Dan Egnorb7f03672009-12-09 16:22:32 -08004397
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004398 public void handleApplicationStrictModeViolation(IBinder app,
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004399 int violationMask,
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004400 StrictMode.ViolationInfo info) throws RemoteException
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004401 {
4402 Parcel data = Parcel.obtain();
4403 Parcel reply = Parcel.obtain();
4404 data.writeInterfaceToken(IActivityManager.descriptor);
4405 data.writeStrongBinder(app);
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004406 data.writeInt(violationMask);
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004407 info.writeToParcel(data, 0);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004408 mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0);
4409 reply.readException();
4410 reply.recycle();
4411 data.recycle();
4412 }
4413
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004414 public void signalPersistentProcesses(int sig) throws RemoteException {
4415 Parcel data = Parcel.obtain();
4416 Parcel reply = Parcel.obtain();
4417 data.writeInterfaceToken(IActivityManager.descriptor);
4418 data.writeInt(sig);
4419 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
4420 reply.readException();
4421 data.recycle();
4422 reply.recycle();
4423 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004424
Dianne Hackborn1676c852012-09-10 14:52:30 -07004425 public void killBackgroundProcesses(String packageName, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004426 Parcel data = Parcel.obtain();
4427 Parcel reply = Parcel.obtain();
4428 data.writeInterfaceToken(IActivityManager.descriptor);
4429 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004430 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004431 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4432 reply.readException();
4433 data.recycle();
4434 reply.recycle();
4435 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004436
4437 public void killAllBackgroundProcesses() throws RemoteException {
4438 Parcel data = Parcel.obtain();
4439 Parcel reply = Parcel.obtain();
4440 data.writeInterfaceToken(IActivityManager.descriptor);
4441 mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4442 reply.readException();
4443 data.recycle();
4444 reply.recycle();
4445 }
4446
Dianne Hackborn1676c852012-09-10 14:52:30 -07004447 public void forceStopPackage(String packageName, int userId) throws RemoteException {
Dianne Hackborn03abb812010-01-04 18:43:19 -08004448 Parcel data = Parcel.obtain();
4449 Parcel reply = Parcel.obtain();
4450 data.writeInterfaceToken(IActivityManager.descriptor);
4451 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004452 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004453 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004454 reply.readException();
4455 data.recycle();
4456 reply.recycle();
4457 }
4458
Dianne Hackborn27ff9132012-03-06 14:57:58 -08004459 public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
4460 throws RemoteException
4461 {
4462 Parcel data = Parcel.obtain();
4463 Parcel reply = Parcel.obtain();
4464 data.writeInterfaceToken(IActivityManager.descriptor);
4465 mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0);
4466 reply.readException();
4467 outInfo.readFromParcel(reply);
4468 reply.recycle();
4469 data.recycle();
4470 }
4471
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004472 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
4473 {
4474 Parcel data = Parcel.obtain();
4475 Parcel reply = Parcel.obtain();
4476 data.writeInterfaceToken(IActivityManager.descriptor);
4477 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
4478 reply.readException();
4479 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
4480 reply.recycle();
4481 data.recycle();
4482 return res;
4483 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004484
Dianne Hackborn1676c852012-09-10 14:52:30 -07004485 public boolean profileControl(String process, int userId, boolean start,
Jeff Hao1b012d32014-08-20 10:35:34 -07004486 ProfilerInfo profilerInfo, int profileType) throws RemoteException
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004487 {
4488 Parcel data = Parcel.obtain();
4489 Parcel reply = Parcel.obtain();
4490 data.writeInterfaceToken(IActivityManager.descriptor);
4491 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004492 data.writeInt(userId);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004493 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07004494 data.writeInt(profileType);
Jeff Hao1b012d32014-08-20 10:35:34 -07004495 if (profilerInfo != null) {
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004496 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07004497 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004498 } else {
4499 data.writeInt(0);
4500 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004501 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
4502 reply.readException();
4503 boolean res = reply.readInt() != 0;
4504 reply.recycle();
4505 data.recycle();
4506 return res;
4507 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004508
Dianne Hackborn55280a92009-05-07 15:53:46 -07004509 public boolean shutdown(int timeout) throws RemoteException
4510 {
4511 Parcel data = Parcel.obtain();
4512 Parcel reply = Parcel.obtain();
4513 data.writeInterfaceToken(IActivityManager.descriptor);
4514 data.writeInt(timeout);
4515 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
4516 reply.readException();
4517 boolean res = reply.readInt() != 0;
4518 reply.recycle();
4519 data.recycle();
4520 return res;
4521 }
4522
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07004523 public void stopAppSwitches() throws RemoteException {
4524 Parcel data = Parcel.obtain();
4525 Parcel reply = Parcel.obtain();
4526 data.writeInterfaceToken(IActivityManager.descriptor);
4527 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
4528 reply.readException();
4529 reply.recycle();
4530 data.recycle();
4531 }
4532
4533 public void resumeAppSwitches() throws RemoteException {
4534 Parcel data = Parcel.obtain();
4535 Parcel reply = Parcel.obtain();
4536 data.writeInterfaceToken(IActivityManager.descriptor);
4537 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
4538 reply.readException();
4539 reply.recycle();
4540 data.recycle();
4541 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07004542
4543 public void addPackageDependency(String packageName) throws RemoteException {
4544 Parcel data = Parcel.obtain();
4545 Parcel reply = Parcel.obtain();
4546 data.writeInterfaceToken(IActivityManager.descriptor);
4547 data.writeString(packageName);
4548 mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0);
4549 reply.readException();
4550 data.recycle();
4551 reply.recycle();
4552 }
4553
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004554 public void killApplicationWithAppId(String pkg, int appid, String reason)
4555 throws RemoteException {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004556 Parcel data = Parcel.obtain();
4557 Parcel reply = Parcel.obtain();
4558 data.writeInterfaceToken(IActivityManager.descriptor);
4559 data.writeString(pkg);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004560 data.writeInt(appid);
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004561 data.writeString(reason);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004562 mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004563 reply.readException();
4564 data.recycle();
4565 reply.recycle();
4566 }
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07004567
4568 public void closeSystemDialogs(String reason) throws RemoteException {
4569 Parcel data = Parcel.obtain();
4570 Parcel reply = Parcel.obtain();
4571 data.writeInterfaceToken(IActivityManager.descriptor);
4572 data.writeString(reason);
4573 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
4574 reply.readException();
4575 data.recycle();
4576 reply.recycle();
4577 }
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004578
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004579 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004580 throws RemoteException {
4581 Parcel data = Parcel.obtain();
4582 Parcel reply = Parcel.obtain();
4583 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004584 data.writeIntArray(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004585 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
4586 reply.readException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004587 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004588 data.recycle();
4589 reply.recycle();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004590 return res;
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004591 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07004592
4593 public void killApplicationProcess(String processName, int uid) throws RemoteException {
4594 Parcel data = Parcel.obtain();
4595 Parcel reply = Parcel.obtain();
4596 data.writeInterfaceToken(IActivityManager.descriptor);
4597 data.writeString(processName);
4598 data.writeInt(uid);
4599 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
4600 reply.readException();
4601 data.recycle();
4602 reply.recycle();
4603 }
4604
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07004605 public void overridePendingTransition(IBinder token, String packageName,
4606 int enterAnim, int exitAnim) throws RemoteException {
4607 Parcel data = Parcel.obtain();
4608 Parcel reply = Parcel.obtain();
4609 data.writeInterfaceToken(IActivityManager.descriptor);
4610 data.writeStrongBinder(token);
4611 data.writeString(packageName);
4612 data.writeInt(enterAnim);
4613 data.writeInt(exitAnim);
4614 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
4615 reply.readException();
4616 data.recycle();
4617 reply.recycle();
4618 }
4619
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08004620 public boolean isUserAMonkey() throws RemoteException {
4621 Parcel data = Parcel.obtain();
4622 Parcel reply = Parcel.obtain();
4623 data.writeInterfaceToken(IActivityManager.descriptor);
4624 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
4625 reply.readException();
4626 boolean res = reply.readInt() != 0;
4627 data.recycle();
4628 reply.recycle();
4629 return res;
4630 }
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07004631
4632 public void setUserIsMonkey(boolean monkey) throws RemoteException {
4633 Parcel data = Parcel.obtain();
4634 Parcel reply = Parcel.obtain();
4635 data.writeInterfaceToken(IActivityManager.descriptor);
4636 data.writeInt(monkey ? 1 : 0);
4637 mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0);
4638 reply.readException();
4639 data.recycle();
4640 reply.recycle();
4641 }
4642
Dianne Hackborn860755f2010-06-03 18:47:52 -07004643 public void finishHeavyWeightApp() throws RemoteException {
4644 Parcel data = Parcel.obtain();
4645 Parcel reply = Parcel.obtain();
4646 data.writeInterfaceToken(IActivityManager.descriptor);
4647 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
4648 reply.readException();
4649 data.recycle();
4650 reply.recycle();
4651 }
Craig Mautner4addfc52013-06-25 08:05:45 -07004652
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004653 public boolean convertFromTranslucent(IBinder token)
Craig Mautner4addfc52013-06-25 08:05:45 -07004654 throws RemoteException {
4655 Parcel data = Parcel.obtain();
4656 Parcel reply = Parcel.obtain();
4657 data.writeInterfaceToken(IActivityManager.descriptor);
4658 data.writeStrongBinder(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07004659 mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0);
4660 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004661 boolean res = reply.readInt() != 0;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004662 data.recycle();
4663 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004664 return res;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004665 }
4666
Craig Mautner233ceee2014-05-09 17:05:11 -07004667 public boolean convertToTranslucent(IBinder token, ActivityOptions options)
Craig Mautner5eda9b32013-07-02 11:58:16 -07004668 throws RemoteException {
4669 Parcel data = Parcel.obtain();
4670 Parcel reply = Parcel.obtain();
4671 data.writeInterfaceToken(IActivityManager.descriptor);
4672 data.writeStrongBinder(token);
Craig Mautner233ceee2014-05-09 17:05:11 -07004673 if (options == null) {
4674 data.writeInt(0);
4675 } else {
4676 data.writeInt(1);
4677 data.writeBundle(options.toBundle());
4678 }
Craig Mautner5eda9b32013-07-02 11:58:16 -07004679 mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07004680 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004681 boolean res = reply.readInt() != 0;
Craig Mautner4addfc52013-06-25 08:05:45 -07004682 data.recycle();
4683 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004684 return res;
Craig Mautner4addfc52013-06-25 08:05:45 -07004685 }
4686
Craig Mautner233ceee2014-05-09 17:05:11 -07004687 public ActivityOptions getActivityOptions(IBinder token) throws RemoteException {
4688 Parcel data = Parcel.obtain();
4689 Parcel reply = Parcel.obtain();
4690 data.writeInterfaceToken(IActivityManager.descriptor);
4691 data.writeStrongBinder(token);
4692 mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0);
4693 reply.readException();
4694 Bundle bundle = reply.readBundle();
4695 ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
4696 data.recycle();
4697 reply.recycle();
4698 return options;
4699 }
4700
Daniel Sandler69a48172010-06-23 16:29:36 -04004701 public void setImmersive(IBinder token, boolean immersive)
4702 throws RemoteException {
4703 Parcel data = Parcel.obtain();
4704 Parcel reply = Parcel.obtain();
4705 data.writeInterfaceToken(IActivityManager.descriptor);
4706 data.writeStrongBinder(token);
4707 data.writeInt(immersive ? 1 : 0);
4708 mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
4709 reply.readException();
4710 data.recycle();
4711 reply.recycle();
4712 }
4713
4714 public boolean isImmersive(IBinder token)
4715 throws RemoteException {
4716 Parcel data = Parcel.obtain();
4717 Parcel reply = Parcel.obtain();
4718 data.writeInterfaceToken(IActivityManager.descriptor);
4719 data.writeStrongBinder(token);
4720 mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004721 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004722 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004723 data.recycle();
4724 reply.recycle();
4725 return res;
4726 }
4727
Craig Mautnerd61dc202014-07-07 11:09:11 -07004728 public boolean isTopOfTask(IBinder token) throws RemoteException {
4729 Parcel data = Parcel.obtain();
4730 Parcel reply = Parcel.obtain();
4731 data.writeInterfaceToken(IActivityManager.descriptor);
4732 data.writeStrongBinder(token);
4733 mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0);
4734 reply.readException();
4735 boolean res = reply.readInt() == 1;
4736 data.recycle();
4737 reply.recycle();
4738 return res;
4739 }
4740
Daniel Sandler69a48172010-06-23 16:29:36 -04004741 public boolean isTopActivityImmersive()
4742 throws RemoteException {
4743 Parcel data = Parcel.obtain();
4744 Parcel reply = Parcel.obtain();
4745 data.writeInterfaceToken(IActivityManager.descriptor);
4746 mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004747 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004748 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004749 data.recycle();
4750 reply.recycle();
4751 return res;
4752 }
4753
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004754 public void crashApplication(int uid, int initialPid, String packageName,
4755 String message) throws RemoteException {
4756 Parcel data = Parcel.obtain();
4757 Parcel reply = Parcel.obtain();
4758 data.writeInterfaceToken(IActivityManager.descriptor);
4759 data.writeInt(uid);
4760 data.writeInt(initialPid);
4761 data.writeString(packageName);
4762 data.writeString(message);
4763 mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0);
4764 reply.readException();
4765 data.recycle();
4766 reply.recycle();
4767 }
Andy McFadden824c5102010-07-09 16:26:57 -07004768
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004769 public String getProviderMimeType(Uri uri, int userId) throws RemoteException {
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004770 Parcel data = Parcel.obtain();
4771 Parcel reply = Parcel.obtain();
4772 data.writeInterfaceToken(IActivityManager.descriptor);
4773 uri.writeToParcel(data, 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004774 data.writeInt(userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07004775 mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0);
4776 reply.readException();
4777 String res = reply.readString();
4778 data.recycle();
4779 reply.recycle();
4780 return res;
4781 }
4782
Dianne Hackborn7e269642010-08-25 19:50:20 -07004783 public IBinder newUriPermissionOwner(String name)
4784 throws RemoteException {
4785 Parcel data = Parcel.obtain();
4786 Parcel reply = Parcel.obtain();
4787 data.writeInterfaceToken(IActivityManager.descriptor);
4788 data.writeString(name);
4789 mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
4790 reply.readException();
4791 IBinder res = reply.readStrongBinder();
4792 data.recycle();
4793 reply.recycle();
4794 return res;
4795 }
4796
4797 public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
Nicolas Prevotf1939902014-06-25 09:29:02 +01004798 Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07004799 Parcel data = Parcel.obtain();
4800 Parcel reply = Parcel.obtain();
4801 data.writeInterfaceToken(IActivityManager.descriptor);
4802 data.writeStrongBinder(owner);
4803 data.writeInt(fromUid);
4804 data.writeString(targetPkg);
4805 uri.writeToParcel(data, 0);
4806 data.writeInt(mode);
Nicolas Prevotf1939902014-06-25 09:29:02 +01004807 data.writeInt(sourceUserId);
4808 data.writeInt(targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07004809 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4810 reply.readException();
4811 data.recycle();
4812 reply.recycle();
4813 }
4814
4815 public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004816 int mode, int userId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07004817 Parcel data = Parcel.obtain();
4818 Parcel reply = Parcel.obtain();
4819 data.writeInterfaceToken(IActivityManager.descriptor);
4820 data.writeStrongBinder(owner);
4821 if (uri != null) {
4822 data.writeInt(1);
4823 uri.writeToParcel(data, 0);
4824 } else {
4825 data.writeInt(0);
4826 }
4827 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004828 data.writeInt(userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07004829 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4830 reply.readException();
4831 data.recycle();
4832 reply.recycle();
4833 }
Dianne Hackbornc8f84972010-08-25 23:14:44 -07004834
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004835 public int checkGrantUriPermission(int callingUid, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004836 Uri uri, int modeFlags, int userId) throws RemoteException {
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004837 Parcel data = Parcel.obtain();
4838 Parcel reply = Parcel.obtain();
4839 data.writeInterfaceToken(IActivityManager.descriptor);
4840 data.writeInt(callingUid);
4841 data.writeString(targetPkg);
4842 uri.writeToParcel(data, 0);
4843 data.writeInt(modeFlags);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004844 data.writeInt(userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07004845 mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4846 reply.readException();
4847 int res = reply.readInt();
4848 data.recycle();
4849 reply.recycle();
4850 return res;
4851 }
4852
Dianne Hackborn1676c852012-09-10 14:52:30 -07004853 public boolean dumpHeap(String process, int userId, boolean managed,
Andy McFadden824c5102010-07-09 16:26:57 -07004854 String path, ParcelFileDescriptor fd) throws RemoteException {
4855 Parcel data = Parcel.obtain();
4856 Parcel reply = Parcel.obtain();
4857 data.writeInterfaceToken(IActivityManager.descriptor);
4858 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004859 data.writeInt(userId);
Andy McFadden824c5102010-07-09 16:26:57 -07004860 data.writeInt(managed ? 1 : 0);
4861 data.writeString(path);
4862 if (fd != null) {
4863 data.writeInt(1);
4864 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
4865 } else {
4866 data.writeInt(0);
4867 }
4868 mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
4869 reply.readException();
4870 boolean res = reply.readInt() != 0;
4871 reply.recycle();
4872 data.recycle();
4873 return res;
4874 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004875
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004876 public int startActivities(IApplicationThread caller, String callingPackage,
Dianne Hackborna4972e92012-03-14 10:38:05 -07004877 Intent[] intents, String[] resolvedTypes, IBinder resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004878 Bundle options, int userId) throws RemoteException {
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004879 Parcel data = Parcel.obtain();
4880 Parcel reply = Parcel.obtain();
4881 data.writeInterfaceToken(IActivityManager.descriptor);
4882 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08004883 data.writeString(callingPackage);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004884 data.writeTypedArray(intents, 0);
4885 data.writeStringArray(resolvedTypes);
4886 data.writeStrongBinder(resultTo);
Dianne Hackborna4972e92012-03-14 10:38:05 -07004887 if (options != null) {
4888 data.writeInt(1);
4889 options.writeToParcel(data, 0);
4890 } else {
4891 data.writeInt(0);
4892 }
Amith Yamasaniea7e9152012-09-24 16:11:18 -07004893 data.writeInt(userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004894 mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0);
4895 reply.readException();
4896 int result = reply.readInt();
4897 reply.recycle();
4898 data.recycle();
4899 return result;
4900 }
4901
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004902 public int getFrontActivityScreenCompatMode() throws RemoteException {
4903 Parcel data = Parcel.obtain();
4904 Parcel reply = Parcel.obtain();
4905 data.writeInterfaceToken(IActivityManager.descriptor);
4906 mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4907 reply.readException();
4908 int mode = reply.readInt();
4909 reply.recycle();
4910 data.recycle();
4911 return mode;
4912 }
4913
4914 public void setFrontActivityScreenCompatMode(int mode) throws RemoteException {
4915 Parcel data = Parcel.obtain();
4916 Parcel reply = Parcel.obtain();
4917 data.writeInterfaceToken(IActivityManager.descriptor);
4918 data.writeInt(mode);
4919 mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4920 reply.readException();
4921 reply.recycle();
4922 data.recycle();
4923 }
4924
4925 public int getPackageScreenCompatMode(String packageName) throws RemoteException {
4926 Parcel data = Parcel.obtain();
4927 Parcel reply = Parcel.obtain();
4928 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004929 data.writeString(packageName);
4930 mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004931 reply.readException();
4932 int mode = reply.readInt();
4933 reply.recycle();
4934 data.recycle();
4935 return mode;
4936 }
4937
4938 public void setPackageScreenCompatMode(String packageName, int mode)
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004939 throws RemoteException {
4940 Parcel data = Parcel.obtain();
4941 Parcel reply = Parcel.obtain();
4942 data.writeInterfaceToken(IActivityManager.descriptor);
4943 data.writeString(packageName);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07004944 data.writeInt(mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04004945 mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
4946 reply.readException();
4947 reply.recycle();
4948 data.recycle();
4949 }
4950
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07004951 public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
4952 Parcel data = Parcel.obtain();
4953 Parcel reply = Parcel.obtain();
4954 data.writeInterfaceToken(IActivityManager.descriptor);
4955 data.writeString(packageName);
4956 mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4957 reply.readException();
4958 boolean ask = reply.readInt() != 0;
4959 reply.recycle();
4960 data.recycle();
4961 return ask;
4962 }
4963
4964 public void setPackageAskScreenCompat(String packageName, boolean ask)
4965 throws RemoteException {
4966 Parcel data = Parcel.obtain();
4967 Parcel reply = Parcel.obtain();
4968 data.writeInterfaceToken(IActivityManager.descriptor);
4969 data.writeString(packageName);
4970 data.writeInt(ask ? 1 : 0);
4971 mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
4972 reply.readException();
4973 reply.recycle();
4974 data.recycle();
4975 }
4976
Amith Yamasani4b2e9342011-03-31 12:38:53 -07004977 public boolean switchUser(int userid) throws RemoteException {
4978 Parcel data = Parcel.obtain();
4979 Parcel reply = Parcel.obtain();
4980 data.writeInterfaceToken(IActivityManager.descriptor);
4981 data.writeInt(userid);
4982 mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0);
4983 reply.readException();
4984 boolean result = reply.readInt() != 0;
4985 reply.recycle();
4986 data.recycle();
4987 return result;
4988 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07004989
Kenny Guy08488bf2014-02-21 17:40:37 +00004990 public boolean startUserInBackground(int userid) throws RemoteException {
4991 Parcel data = Parcel.obtain();
4992 Parcel reply = Parcel.obtain();
4993 data.writeInterfaceToken(IActivityManager.descriptor);
4994 data.writeInt(userid);
4995 mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0);
4996 reply.readException();
4997 boolean result = reply.readInt() != 0;
4998 reply.recycle();
4999 data.recycle();
5000 return result;
5001 }
5002
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005003 public int stopUser(int userid, IStopUserCallback callback) throws RemoteException {
5004 Parcel data = Parcel.obtain();
5005 Parcel reply = Parcel.obtain();
5006 data.writeInterfaceToken(IActivityManager.descriptor);
5007 data.writeInt(userid);
5008 data.writeStrongInterface(callback);
5009 mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0);
5010 reply.readException();
5011 int result = reply.readInt();
5012 reply.recycle();
5013 data.recycle();
5014 return result;
5015 }
5016
Amith Yamasani52f1d752012-03-28 18:19:29 -07005017 public UserInfo getCurrentUser() throws RemoteException {
5018 Parcel data = Parcel.obtain();
5019 Parcel reply = Parcel.obtain();
5020 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005021 mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0);
Amith Yamasani52f1d752012-03-28 18:19:29 -07005022 reply.readException();
5023 UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply);
5024 reply.recycle();
5025 data.recycle();
5026 return userInfo;
5027 }
5028
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07005029 public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException {
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005030 Parcel data = Parcel.obtain();
5031 Parcel reply = Parcel.obtain();
5032 data.writeInterfaceToken(IActivityManager.descriptor);
5033 data.writeInt(userid);
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07005034 data.writeInt(orStopping ? 1 : 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005035 mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0);
5036 reply.readException();
5037 boolean result = reply.readInt() != 0;
5038 reply.recycle();
5039 data.recycle();
5040 return result;
5041 }
5042
Dianne Hackbornc72fc672012-09-20 13:12:03 -07005043 public int[] getRunningUserIds() throws RemoteException {
5044 Parcel data = Parcel.obtain();
5045 Parcel reply = Parcel.obtain();
5046 data.writeInterfaceToken(IActivityManager.descriptor);
5047 mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0);
5048 reply.readException();
5049 int[] result = reply.createIntArray();
5050 reply.recycle();
5051 data.recycle();
5052 return result;
5053 }
5054
Wale Ogunwaled54b5782014-10-23 15:55:23 -07005055 public boolean removeTask(int taskId) throws RemoteException {
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005056 Parcel data = Parcel.obtain();
5057 Parcel reply = Parcel.obtain();
5058 data.writeInterfaceToken(IActivityManager.descriptor);
5059 data.writeInt(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005060 mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
5061 reply.readException();
5062 boolean result = reply.readInt() != 0;
5063 reply.recycle();
5064 data.recycle();
5065 return result;
5066 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07005067
Jeff Sharkeya4620792011-05-20 15:29:23 -07005068 public void registerProcessObserver(IProcessObserver observer) throws RemoteException {
5069 Parcel data = Parcel.obtain();
5070 Parcel reply = Parcel.obtain();
5071 data.writeInterfaceToken(IActivityManager.descriptor);
5072 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5073 mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5074 reply.readException();
5075 data.recycle();
5076 reply.recycle();
5077 }
5078
5079 public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException {
5080 Parcel data = Parcel.obtain();
5081 Parcel reply = Parcel.obtain();
5082 data.writeInterfaceToken(IActivityManager.descriptor);
5083 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5084 mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5085 reply.readException();
5086 data.recycle();
5087 reply.recycle();
5088 }
5089
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07005090 public void registerUidObserver(IUidObserver observer) throws RemoteException {
5091 Parcel data = Parcel.obtain();
5092 Parcel reply = Parcel.obtain();
5093 data.writeInterfaceToken(IActivityManager.descriptor);
5094 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5095 mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0);
5096 reply.readException();
5097 data.recycle();
5098 reply.recycle();
5099 }
5100
5101 public void unregisterUidObserver(IUidObserver observer) throws RemoteException {
5102 Parcel data = Parcel.obtain();
5103 Parcel reply = Parcel.obtain();
5104 data.writeInterfaceToken(IActivityManager.descriptor);
5105 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5106 mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0);
5107 reply.readException();
5108 data.recycle();
5109 reply.recycle();
5110 }
5111
Dianne Hackborn6c418d52011-06-29 14:05:33 -07005112 public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException {
5113 Parcel data = Parcel.obtain();
5114 Parcel reply = Parcel.obtain();
5115 data.writeInterfaceToken(IActivityManager.descriptor);
5116 data.writeStrongBinder(sender.asBinder());
5117 mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0);
5118 reply.readException();
5119 boolean res = reply.readInt() != 0;
5120 data.recycle();
5121 reply.recycle();
5122 return res;
5123 }
5124
Dianne Hackborn1927ae82012-06-22 15:21:36 -07005125 public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException {
5126 Parcel data = Parcel.obtain();
5127 Parcel reply = Parcel.obtain();
5128 data.writeInterfaceToken(IActivityManager.descriptor);
5129 data.writeStrongBinder(sender.asBinder());
5130 mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0);
5131 reply.readException();
5132 boolean res = reply.readInt() != 0;
5133 data.recycle();
5134 reply.recycle();
5135 return res;
5136 }
5137
Dianne Hackborn81038902012-11-26 17:04:09 -08005138 public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException {
5139 Parcel data = Parcel.obtain();
5140 Parcel reply = Parcel.obtain();
5141 data.writeInterfaceToken(IActivityManager.descriptor);
5142 data.writeStrongBinder(sender.asBinder());
5143 mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5144 reply.readException();
5145 Intent res = reply.readInt() != 0
5146 ? Intent.CREATOR.createFromParcel(reply) : null;
5147 data.recycle();
5148 reply.recycle();
5149 return res;
5150 }
5151
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08005152 public String getTagForIntentSender(IIntentSender sender, String prefix)
5153 throws RemoteException {
5154 Parcel data = Parcel.obtain();
5155 Parcel reply = Parcel.obtain();
5156 data.writeInterfaceToken(IActivityManager.descriptor);
5157 data.writeStrongBinder(sender.asBinder());
5158 data.writeString(prefix);
5159 mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5160 reply.readException();
5161 String res = reply.readString();
5162 data.recycle();
5163 reply.recycle();
5164 return res;
5165 }
5166
Dianne Hackborn31ca8542011-07-19 14:58:28 -07005167 public void updatePersistentConfiguration(Configuration values) throws RemoteException
5168 {
5169 Parcel data = Parcel.obtain();
5170 Parcel reply = Parcel.obtain();
5171 data.writeInterfaceToken(IActivityManager.descriptor);
5172 values.writeToParcel(data, 0);
5173 mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0);
5174 reply.readException();
5175 data.recycle();
5176 reply.recycle();
5177 }
5178
Dianne Hackbornb437e092011-08-05 17:50:29 -07005179 public long[] getProcessPss(int[] pids) throws RemoteException {
5180 Parcel data = Parcel.obtain();
5181 Parcel reply = Parcel.obtain();
5182 data.writeInterfaceToken(IActivityManager.descriptor);
5183 data.writeIntArray(pids);
5184 mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0);
5185 reply.readException();
5186 long[] res = reply.createLongArray();
5187 data.recycle();
5188 reply.recycle();
5189 return res;
5190 }
5191
Dianne Hackborn661cd522011-08-22 00:26:20 -07005192 public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
5193 Parcel data = Parcel.obtain();
5194 Parcel reply = Parcel.obtain();
5195 data.writeInterfaceToken(IActivityManager.descriptor);
5196 TextUtils.writeToParcel(msg, data, 0);
5197 data.writeInt(always ? 1 : 0);
5198 mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
5199 reply.readException();
5200 data.recycle();
5201 reply.recycle();
5202 }
5203
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02005204 public void keyguardWaitingForActivityDrawn() throws RemoteException {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07005205 Parcel data = Parcel.obtain();
5206 Parcel reply = Parcel.obtain();
5207 data.writeInterfaceToken(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02005208 mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
Dianne Hackborn90c52de2011-09-23 12:57:44 -07005209 reply.readException();
5210 data.recycle();
5211 reply.recycle();
5212 }
5213
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07005214 public void keyguardGoingAway(boolean disableWindowAnimations,
5215 boolean keyguardGoingToNotificationShade) throws RemoteException {
5216 Parcel data = Parcel.obtain();
5217 Parcel reply = Parcel.obtain();
5218 data.writeInterfaceToken(IActivityManager.descriptor);
5219 data.writeInt(disableWindowAnimations ? 1 : 0);
5220 data.writeInt(keyguardGoingToNotificationShade ? 1 : 0);
5221 mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0);
5222 reply.readException();
5223 data.recycle();
5224 reply.recycle();
5225 }
5226
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07005227 public boolean shouldUpRecreateTask(IBinder token, String destAffinity)
Adam Powelldd8fab22012-03-22 17:47:27 -07005228 throws RemoteException {
5229 Parcel data = Parcel.obtain();
5230 Parcel reply = Parcel.obtain();
5231 data.writeInterfaceToken(IActivityManager.descriptor);
5232 data.writeStrongBinder(token);
5233 data.writeString(destAffinity);
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07005234 mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0);
Adam Powelldd8fab22012-03-22 17:47:27 -07005235 reply.readException();
5236 boolean result = reply.readInt() != 0;
5237 data.recycle();
5238 reply.recycle();
5239 return result;
5240 }
5241
5242 public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData)
5243 throws RemoteException {
5244 Parcel data = Parcel.obtain();
5245 Parcel reply = Parcel.obtain();
5246 data.writeInterfaceToken(IActivityManager.descriptor);
5247 data.writeStrongBinder(token);
5248 target.writeToParcel(data, 0);
5249 data.writeInt(resultCode);
5250 if (resultData != null) {
5251 data.writeInt(1);
5252 resultData.writeToParcel(data, 0);
5253 } else {
5254 data.writeInt(0);
5255 }
5256 mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0);
5257 reply.readException();
5258 boolean result = reply.readInt() != 0;
5259 data.recycle();
5260 reply.recycle();
5261 return result;
5262 }
5263
Dianne Hackborn5320eb82012-05-18 12:05:04 -07005264 public int getLaunchedFromUid(IBinder activityToken) throws RemoteException {
5265 Parcel data = Parcel.obtain();
5266 Parcel reply = Parcel.obtain();
5267 data.writeInterfaceToken(IActivityManager.descriptor);
5268 data.writeStrongBinder(activityToken);
5269 mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0);
5270 reply.readException();
5271 int result = reply.readInt();
5272 data.recycle();
5273 reply.recycle();
5274 return result;
5275 }
5276
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005277 public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException {
5278 Parcel data = Parcel.obtain();
5279 Parcel reply = Parcel.obtain();
5280 data.writeInterfaceToken(IActivityManager.descriptor);
5281 data.writeStrongBinder(activityToken);
5282 mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0);
5283 reply.readException();
5284 String result = reply.readString();
5285 data.recycle();
5286 reply.recycle();
5287 return result;
5288 }
5289
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07005290 public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5291 Parcel data = Parcel.obtain();
5292 Parcel reply = Parcel.obtain();
5293 data.writeInterfaceToken(IActivityManager.descriptor);
5294 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5295 mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5296 reply.readException();
5297 data.recycle();
5298 reply.recycle();
5299 }
5300
5301 public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5302 Parcel data = Parcel.obtain();
5303 Parcel reply = Parcel.obtain();
5304 data.writeInterfaceToken(IActivityManager.descriptor);
5305 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5306 mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5307 reply.readException();
5308 data.recycle();
5309 reply.recycle();
5310 }
5311
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07005312 public void requestBugReport() throws RemoteException {
5313 Parcel data = Parcel.obtain();
5314 Parcel reply = Parcel.obtain();
5315 data.writeInterfaceToken(IActivityManager.descriptor);
5316 mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0);
5317 reply.readException();
5318 data.recycle();
5319 reply.recycle();
5320 }
5321
Jeff Brownbd181bb2013-09-10 16:44:24 -07005322 public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason)
5323 throws RemoteException {
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005324 Parcel data = Parcel.obtain();
5325 Parcel reply = Parcel.obtain();
5326 data.writeInterfaceToken(IActivityManager.descriptor);
5327 data.writeInt(pid);
5328 data.writeInt(aboveSystem ? 1 : 0);
Jeff Brownbd181bb2013-09-10 16:44:24 -07005329 data.writeString(reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005330 mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0);
5331 reply.readException();
5332 long res = reply.readInt();
5333 data.recycle();
5334 reply.recycle();
5335 return res;
5336 }
5337
Adam Skorydfc7fd72013-08-05 19:23:41 -07005338 public Bundle getAssistContextExtras(int requestType) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005339 Parcel data = Parcel.obtain();
5340 Parcel reply = Parcel.obtain();
5341 data.writeInterfaceToken(IActivityManager.descriptor);
5342 data.writeInt(requestType);
Adam Skorydfc7fd72013-08-05 19:23:41 -07005343 mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005344 reply.readException();
5345 Bundle res = reply.readBundle();
5346 data.recycle();
5347 reply.recycle();
5348 return res;
5349 }
5350
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005351 public void requestAssistContextExtras(int requestType, IResultReceiver receiver)
5352 throws RemoteException {
5353 Parcel data = Parcel.obtain();
5354 Parcel reply = Parcel.obtain();
5355 data.writeInterfaceToken(IActivityManager.descriptor);
5356 data.writeInt(requestType);
5357 data.writeStrongBinder(receiver.asBinder());
5358 mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
5359 reply.readException();
5360 data.recycle();
5361 reply.recycle();
5362 }
5363
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07005364 public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure,
5365 AssistContent content) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005366 Parcel data = Parcel.obtain();
5367 Parcel reply = Parcel.obtain();
5368 data.writeInterfaceToken(IActivityManager.descriptor);
5369 data.writeStrongBinder(token);
5370 data.writeBundle(extras);
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07005371 structure.writeToParcel(data, 0);
5372 content.writeToParcel(data, 0);
Adam Skorydfc7fd72013-08-05 19:23:41 -07005373 mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005374 reply.readException();
5375 data.recycle();
5376 reply.recycle();
5377 }
5378
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07005379 public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle)
5380 throws RemoteException {
5381 Parcel data = Parcel.obtain();
5382 Parcel reply = Parcel.obtain();
5383 data.writeInterfaceToken(IActivityManager.descriptor);
5384 intent.writeToParcel(data, 0);
5385 data.writeInt(requestType);
5386 data.writeString(hint);
5387 data.writeInt(userHandle);
5388 mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0);
5389 reply.readException();
5390 boolean res = reply.readInt() != 0;
5391 data.recycle();
5392 reply.recycle();
5393 return res;
5394 }
5395
Dianne Hackbornf1b78242013-04-08 22:28:59 -07005396 public void killUid(int uid, String reason) throws RemoteException {
5397 Parcel data = Parcel.obtain();
5398 Parcel reply = Parcel.obtain();
5399 data.writeInterfaceToken(IActivityManager.descriptor);
5400 data.writeInt(uid);
5401 data.writeString(reason);
5402 mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0);
5403 reply.readException();
5404 data.recycle();
5405 reply.recycle();
5406 }
5407
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07005408 public void hang(IBinder who, boolean allowRestart) throws RemoteException {
5409 Parcel data = Parcel.obtain();
5410 Parcel reply = Parcel.obtain();
5411 data.writeInterfaceToken(IActivityManager.descriptor);
5412 data.writeStrongBinder(who);
5413 data.writeInt(allowRestart ? 1 : 0);
5414 mRemote.transact(HANG_TRANSACTION, data, reply, 0);
5415 reply.readException();
5416 data.recycle();
5417 reply.recycle();
5418 }
5419
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07005420 public void reportActivityFullyDrawn(IBinder token) throws RemoteException {
5421 Parcel data = Parcel.obtain();
5422 Parcel reply = Parcel.obtain();
5423 data.writeInterfaceToken(IActivityManager.descriptor);
5424 data.writeStrongBinder(token);
5425 mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0);
5426 reply.readException();
5427 data.recycle();
5428 reply.recycle();
5429 }
5430
Craig Mautner5eda9b32013-07-02 11:58:16 -07005431 public void notifyActivityDrawn(IBinder token) throws RemoteException {
5432 Parcel data = Parcel.obtain();
5433 Parcel reply = Parcel.obtain();
5434 data.writeInterfaceToken(IActivityManager.descriptor);
5435 data.writeStrongBinder(token);
5436 mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
5437 reply.readException();
5438 data.recycle();
5439 reply.recycle();
5440 }
5441
Dianne Hackborn57a7f592013-07-22 18:21:32 -07005442 public void restart() throws RemoteException {
5443 Parcel data = Parcel.obtain();
5444 Parcel reply = Parcel.obtain();
5445 data.writeInterfaceToken(IActivityManager.descriptor);
5446 mRemote.transact(RESTART_TRANSACTION, data, reply, 0);
5447 reply.readException();
5448 data.recycle();
5449 reply.recycle();
5450 }
5451
Dianne Hackborn35f72be2013-09-16 10:57:39 -07005452 public void performIdleMaintenance() throws RemoteException {
5453 Parcel data = Parcel.obtain();
5454 Parcel reply = Parcel.obtain();
5455 data.writeInterfaceToken(IActivityManager.descriptor);
5456 mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0);
5457 reply.readException();
5458 data.recycle();
5459 reply.recycle();
5460 }
5461
Todd Kennedyca4d8422015-01-15 15:19:22 -08005462 public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken,
Craig Mautner4a1cb222013-12-04 16:14:06 -08005463 IActivityContainerCallback callback) throws RemoteException {
5464 Parcel data = Parcel.obtain();
5465 Parcel reply = Parcel.obtain();
5466 data.writeInterfaceToken(IActivityManager.descriptor);
5467 data.writeStrongBinder(parentActivityToken);
Craig Mautnere3a00d72014-04-16 08:31:19 -07005468 data.writeStrongBinder(callback == null ? null : callback.asBinder());
Todd Kennedyca4d8422015-01-15 15:19:22 -08005469 mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
Craig Mautner4a1cb222013-12-04 16:14:06 -08005470 reply.readException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08005471 final int result = reply.readInt();
5472 final IActivityContainer res;
5473 if (result == 1) {
5474 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5475 } else {
5476 res = null;
5477 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08005478 data.recycle();
5479 reply.recycle();
5480 return res;
5481 }
5482
Craig Mautner95da1082014-02-24 17:54:35 -08005483 public void deleteActivityContainer(IActivityContainer activityContainer)
5484 throws RemoteException {
5485 Parcel data = Parcel.obtain();
5486 Parcel reply = Parcel.obtain();
5487 data.writeInterfaceToken(IActivityManager.descriptor);
5488 data.writeStrongBinder(activityContainer.asBinder());
5489 mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
5490 reply.readException();
5491 data.recycle();
5492 reply.recycle();
5493 }
5494
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005495 @Override
Todd Kennedy4900bf92015-01-16 16:05:14 -08005496 public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException {
5497 Parcel data = Parcel.obtain();
5498 Parcel reply = Parcel.obtain();
5499 data.writeInterfaceToken(IActivityManager.descriptor);
5500 data.writeInt(displayId);
5501 mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0);
5502 reply.readException();
5503 final int result = reply.readInt();
5504 final IActivityContainer res;
5505 if (result == 1) {
5506 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5507 } else {
5508 res = null;
5509 }
5510 data.recycle();
5511 reply.recycle();
5512 return res;
5513 }
5514
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005515 @Override
5516 public int getActivityDisplayId(IBinder activityToken)
Craig Mautnere0a38842013-12-16 16:14:02 -08005517 throws RemoteException {
5518 Parcel data = Parcel.obtain();
5519 Parcel reply = Parcel.obtain();
5520 data.writeInterfaceToken(IActivityManager.descriptor);
5521 data.writeStrongBinder(activityToken);
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005522 mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0);
Craig Mautnere0a38842013-12-16 16:14:02 -08005523 reply.readException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005524 final int displayId = reply.readInt();
Craig Mautnere0a38842013-12-16 16:14:02 -08005525 data.recycle();
5526 reply.recycle();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005527 return displayId;
Craig Mautnere0a38842013-12-16 16:14:02 -08005528 }
5529
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005530 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005531 public void startLockTaskMode(int taskId) throws RemoteException {
5532 Parcel data = Parcel.obtain();
5533 Parcel reply = Parcel.obtain();
5534 data.writeInterfaceToken(IActivityManager.descriptor);
5535 data.writeInt(taskId);
5536 mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0);
5537 reply.readException();
5538 data.recycle();
5539 reply.recycle();
5540 }
5541
5542 @Override
5543 public void startLockTaskMode(IBinder token) throws RemoteException {
5544 Parcel data = Parcel.obtain();
5545 Parcel reply = Parcel.obtain();
5546 data.writeInterfaceToken(IActivityManager.descriptor);
5547 data.writeStrongBinder(token);
5548 mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0);
5549 reply.readException();
5550 data.recycle();
5551 reply.recycle();
5552 }
5553
5554 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005555 public void startLockTaskModeOnCurrent() throws RemoteException {
5556 Parcel data = Parcel.obtain();
5557 Parcel reply = Parcel.obtain();
5558 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005559 mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005560 reply.readException();
5561 data.recycle();
5562 reply.recycle();
5563 }
5564
5565 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005566 public void stopLockTaskMode() throws RemoteException {
5567 Parcel data = Parcel.obtain();
5568 Parcel reply = Parcel.obtain();
5569 data.writeInterfaceToken(IActivityManager.descriptor);
5570 mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5571 reply.readException();
5572 data.recycle();
5573 reply.recycle();
5574 }
5575
5576 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005577 public void stopLockTaskModeOnCurrent() throws RemoteException {
5578 Parcel data = Parcel.obtain();
5579 Parcel reply = Parcel.obtain();
5580 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005581 mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005582 reply.readException();
5583 data.recycle();
5584 reply.recycle();
5585 }
5586
5587 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005588 public boolean isInLockTaskMode() throws RemoteException {
5589 Parcel data = Parcel.obtain();
5590 Parcel reply = Parcel.obtain();
5591 data.writeInterfaceToken(IActivityManager.descriptor);
5592 mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5593 reply.readException();
5594 boolean isInLockTaskMode = reply.readInt() == 1;
5595 data.recycle();
5596 reply.recycle();
5597 return isInLockTaskMode;
5598 }
5599
Craig Mautner688b5102014-03-27 16:55:03 -07005600 @Override
Benjamin Franz43261142015-02-11 15:59:44 +00005601 public int getLockTaskModeState() throws RemoteException {
5602 Parcel data = Parcel.obtain();
5603 Parcel reply = Parcel.obtain();
5604 data.writeInterfaceToken(IActivityManager.descriptor);
5605 mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0);
5606 reply.readException();
5607 int lockTaskModeState = reply.readInt();
5608 data.recycle();
5609 reply.recycle();
5610 return lockTaskModeState;
5611 }
5612
5613 @Override
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07005614 public void showLockTaskEscapeMessage(IBinder token) throws RemoteException {
5615 Parcel data = Parcel.obtain();
5616 Parcel reply = Parcel.obtain();
5617 data.writeInterfaceToken(IActivityManager.descriptor);
5618 data.writeStrongBinder(token);
5619 mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply,
5620 IBinder.FLAG_ONEWAY);
5621 reply.readException();
5622 data.recycle();
5623 reply.recycle();
5624 }
5625
5626 @Override
Winson Chunga449dc02014-05-16 11:15:04 -07005627 public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values)
Winson Chung03a9bae2014-05-02 09:56:12 -07005628 throws RemoteException {
Craig Mautner2fbd7542014-03-21 09:34:07 -07005629 Parcel data = Parcel.obtain();
5630 Parcel reply = Parcel.obtain();
5631 data.writeInterfaceToken(IActivityManager.descriptor);
5632 data.writeStrongBinder(token);
Winson Chung03a9bae2014-05-02 09:56:12 -07005633 values.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005634 mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0);
Craig Mautner2fbd7542014-03-21 09:34:07 -07005635 reply.readException();
5636 data.recycle();
5637 reply.recycle();
5638 }
5639
Craig Mautneree2e45a2014-06-27 12:10:03 -07005640 @Override
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08005641 public void setTaskResizeable(int taskId, boolean resizeable) throws RemoteException {
5642 Parcel data = Parcel.obtain();
5643 Parcel reply = Parcel.obtain();
5644 data.writeInterfaceToken(IActivityManager.descriptor);
5645 data.writeInt(taskId);
5646 data.writeInt(resizeable ? 1 : 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005647 mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0);
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08005648 reply.readException();
5649 data.recycle();
5650 reply.recycle();
5651 }
5652
5653 @Override
Wale Ogunwale53a29a92015-02-23 15:42:52 -08005654 public void resizeTask(int taskId, Rect r) throws RemoteException
5655 {
5656 Parcel data = Parcel.obtain();
5657 Parcel reply = Parcel.obtain();
5658 data.writeInterfaceToken(IActivityManager.descriptor);
5659 data.writeInt(taskId);
5660 r.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005661 mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08005662 reply.readException();
5663 data.recycle();
5664 reply.recycle();
5665 }
5666
5667 @Override
Craig Mautner648f69b2014-09-18 14:16:26 -07005668 public Bitmap getTaskDescriptionIcon(String filename) throws RemoteException {
5669 Parcel data = Parcel.obtain();
5670 Parcel reply = Parcel.obtain();
5671 data.writeInterfaceToken(IActivityManager.descriptor);
5672 data.writeString(filename);
5673 mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0);
5674 reply.readException();
5675 final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply);
5676 data.recycle();
5677 reply.recycle();
5678 return icon;
5679 }
5680
5681 @Override
Winson Chung044d5292014-11-06 11:05:19 -08005682 public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options)
5683 throws RemoteException {
5684 Parcel data = Parcel.obtain();
5685 Parcel reply = Parcel.obtain();
5686 data.writeInterfaceToken(IActivityManager.descriptor);
5687 if (options == null) {
5688 data.writeInt(0);
5689 } else {
5690 data.writeInt(1);
5691 data.writeBundle(options.toBundle());
5692 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07005693 mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0);
Winson Chung044d5292014-11-06 11:05:19 -08005694 reply.readException();
5695 data.recycle();
5696 reply.recycle();
5697 }
5698
5699 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005700 public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005701 Parcel data = Parcel.obtain();
5702 Parcel reply = Parcel.obtain();
5703 data.writeInterfaceToken(IActivityManager.descriptor);
5704 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07005705 data.writeInt(visible ? 1 : 0);
5706 mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005707 reply.readException();
5708 boolean success = reply.readInt() > 0;
5709 data.recycle();
5710 reply.recycle();
5711 return success;
5712 }
5713
5714 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005715 public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005716 Parcel data = Parcel.obtain();
5717 Parcel reply = Parcel.obtain();
5718 data.writeInterfaceToken(IActivityManager.descriptor);
5719 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07005720 mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005721 reply.readException();
Jose Lima4b6c6692014-08-12 17:41:12 -07005722 final boolean visible = reply.readInt() > 0;
Craig Mautneree2e45a2014-06-27 12:10:03 -07005723 data.recycle();
5724 reply.recycle();
Jose Lima4b6c6692014-08-12 17:41:12 -07005725 return visible;
Craig Mautneree2e45a2014-06-27 12:10:03 -07005726 }
5727
5728 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07005729 public void backgroundResourcesReleased(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07005730 Parcel data = Parcel.obtain();
5731 Parcel reply = Parcel.obtain();
5732 data.writeInterfaceToken(IActivityManager.descriptor);
5733 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005734 mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0);
Craig Mautnerbb742462014-07-07 15:28:55 -07005735 reply.readException();
5736 data.recycle();
5737 reply.recycle();
5738 }
5739
5740 @Override
5741 public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException {
5742 Parcel data = Parcel.obtain();
5743 Parcel reply = Parcel.obtain();
5744 data.writeInterfaceToken(IActivityManager.descriptor);
5745 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005746 mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07005747 reply.readException();
5748 data.recycle();
5749 reply.recycle();
5750 }
5751
Craig Mautner8746a472014-07-24 15:12:54 -07005752 @Override
5753 public void notifyEnterAnimationComplete(IBinder token) throws RemoteException {
5754 Parcel data = Parcel.obtain();
5755 Parcel reply = Parcel.obtain();
5756 data.writeInterfaceToken(IActivityManager.descriptor);
5757 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005758 mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautner8746a472014-07-24 15:12:54 -07005759 reply.readException();
5760 data.recycle();
5761 reply.recycle();
5762 }
5763
Craig Mautner6e2f3952014-09-09 14:26:41 -07005764 @Override
5765 public void bootAnimationComplete() throws RemoteException {
5766 Parcel data = Parcel.obtain();
5767 Parcel reply = Parcel.obtain();
5768 data.writeInterfaceToken(IActivityManager.descriptor);
5769 mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
5770 reply.readException();
5771 data.recycle();
5772 reply.recycle();
5773 }
5774
Wale Ogunwale18795a22014-12-03 11:38:33 -08005775 @Override
Jeff Sharkey605eb792014-11-04 13:34:06 -08005776 public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException {
5777 Parcel data = Parcel.obtain();
5778 Parcel reply = Parcel.obtain();
5779 data.writeInterfaceToken(IActivityManager.descriptor);
5780 data.writeInt(uid);
5781 data.writeByteArray(firstPacket);
5782 mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0);
5783 reply.readException();
5784 data.recycle();
5785 reply.recycle();
5786 }
5787
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005788 @Override
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07005789 public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize,
5790 String reportPackage) throws RemoteException {
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005791 Parcel data = Parcel.obtain();
5792 Parcel reply = Parcel.obtain();
5793 data.writeInterfaceToken(IActivityManager.descriptor);
5794 data.writeString(processName);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07005795 data.writeInt(uid);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005796 data.writeLong(maxMemSize);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07005797 data.writeString(reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08005798 mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0);
5799 reply.readException();
5800 data.recycle();
5801 reply.recycle();
5802 }
5803
5804 @Override
5805 public void dumpHeapFinished(String path) throws RemoteException {
5806 Parcel data = Parcel.obtain();
5807 Parcel reply = Parcel.obtain();
5808 data.writeInterfaceToken(IActivityManager.descriptor);
5809 data.writeString(path);
5810 mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0);
5811 reply.readException();
5812 data.recycle();
5813 reply.recycle();
5814 }
5815
Dianne Hackborn3d07c942015-03-13 18:02:54 -07005816 @Override
5817 public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake)
5818 throws RemoteException {
5819 Parcel data = Parcel.obtain();
5820 Parcel reply = Parcel.obtain();
5821 data.writeInterfaceToken(IActivityManager.descriptor);
5822 data.writeStrongBinder(session.asBinder());
5823 data.writeInt(keepAwake ? 1 : 0);
5824 mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0);
5825 reply.readException();
5826 data.recycle();
5827 reply.recycle();
5828 }
5829
Craig Mautnere5600772015-04-03 21:36:37 -07005830 @Override
5831 public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException {
5832 Parcel data = Parcel.obtain();
5833 Parcel reply = Parcel.obtain();
5834 data.writeInterfaceToken(IActivityManager.descriptor);
5835 data.writeInt(userId);
5836 data.writeStringArray(packages);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005837 mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0);
Craig Mautnere5600772015-04-03 21:36:37 -07005838 reply.readException();
5839 data.recycle();
5840 reply.recycle();
5841 }
5842
Dianne Hackborn1e383822015-04-10 14:02:33 -07005843 @Override
Craig Mautner015c5e52015-04-23 10:39:39 -07005844 public void updateDeviceOwner(String packageName) throws RemoteException {
5845 Parcel data = Parcel.obtain();
5846 Parcel reply = Parcel.obtain();
5847 data.writeInterfaceToken(IActivityManager.descriptor);
5848 data.writeString(packageName);
5849 mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0);
5850 reply.readException();
5851 data.recycle();
5852 reply.recycle();
5853 }
5854
5855 @Override
Julia Reynolds13c58ba2015-04-20 16:42:54 -04005856 public void updatePreferredSetupActivity(ComponentName preferredActivity, int userId)
5857 throws RemoteException {
5858 Parcel data = Parcel.obtain();
5859 Parcel reply = Parcel.obtain();
5860 data.writeInterfaceToken(IActivityManager.descriptor);
5861 ComponentName.writeToParcel(preferredActivity, data);
5862 data.writeInt(userId);
5863 mRemote.transact(UPDATE_PREFERRED_SETUP_ACTIVITY_TRANSACTION, data, reply, 0);
5864 reply.readException();
5865 data.recycle();
5866 reply.recycle();
5867 }
5868
5869 @Override
Dianne Hackborn1e383822015-04-10 14:02:33 -07005870 public int getPackageProcessState(String packageName) throws RemoteException {
5871 Parcel data = Parcel.obtain();
5872 Parcel reply = Parcel.obtain();
5873 data.writeInterfaceToken(IActivityManager.descriptor);
5874 data.writeString(packageName);
5875 mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0);
5876 reply.readException();
5877 int res = reply.readInt();
5878 data.recycle();
5879 reply.recycle();
5880 return res;
5881 }
5882
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005883 private IBinder mRemote;
5884}