blob: 19d9fc2a676e0908e8d25a7f65c954f1f648fcb7 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.app;
18
Craig Mautnerbdc748af2013-12-02 14:08:25 -080019import android.app.ActivityManager.StackInfo;
Dianne Hackborn69c6adc2015-06-02 10:52:59 -070020import android.app.assist.AssistContent;
21import android.app.assist.AssistStructure;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080022import android.content.ComponentName;
Adam Powelldd8fab22012-03-22 17:47:27 -070023import android.content.IIntentReceiver;
24import android.content.IIntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080025import android.content.Intent;
26import android.content.IntentFilter;
Dianne Hackbornfa82f222009-09-17 15:14:12 -070027import android.content.IntentSender;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070028import android.content.UriPermission;
Christopher Tate181fafa2009-05-14 11:12:14 -070029import android.content.pm.ApplicationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080030import android.content.pm.ConfigurationInfo;
31import android.content.pm.IPackageDataObserver;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070032import android.content.pm.ParceledListSlice;
Amith Yamasani52f1d752012-03-28 18:19:29 -070033import android.content.pm.UserInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080034import android.content.res.Configuration;
Dianne Hackbornaec68bb2014-08-20 15:25:13 -070035import android.graphics.Bitmap;
36import android.graphics.Point;
Craig Mautnerbdc748af2013-12-02 14:08:25 -080037import android.graphics.Rect;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080038import android.net.Uri;
39import android.os.Binder;
40import android.os.Bundle;
Dianne Hackborn3025ef32009-08-31 21:31:47 -070041import android.os.Debug;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080042import android.os.IBinder;
43import android.os.Parcel;
Adam Powelldd8fab22012-03-22 17:47:27 -070044import android.os.ParcelFileDescriptor;
45import android.os.Parcelable;
Craig Mautnera0026042014-04-23 11:45:37 -070046import android.os.PersistableBundle;
Adam Powelldd8fab22012-03-22 17:47:27 -070047import android.os.RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080048import android.os.ServiceManager;
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -070049import android.os.StrictMode;
Dianne Hackborn91097de2014-04-04 18:02:06 -070050import android.service.voice.IVoiceInteractionSession;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080051import android.text.TextUtils;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080052import android.util.Log;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080053import android.util.Singleton;
Dianne Hackborn91097de2014-04-04 18:02:06 -070054import com.android.internal.app.IVoiceInteractor;
Dianne Hackbornae6688b2015-02-11 17:02:41 -080055import com.android.internal.os.IResultReceiver;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080056
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080057import java.util.ArrayList;
58import java.util.List;
59
60/** {@hide} */
61public abstract class ActivityManagerNative extends Binder implements IActivityManager
62{
63 /**
64 * Cast a Binder object into an activity manager interface, generating
65 * a proxy if needed.
66 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080067 static public IActivityManager asInterface(IBinder obj) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080068 if (obj == null) {
69 return null;
70 }
71 IActivityManager in =
72 (IActivityManager)obj.queryLocalInterface(descriptor);
73 if (in != null) {
74 return in;
75 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080076
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080077 return new ActivityManagerProxy(obj);
78 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080079
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080080 /**
81 * Retrieve the system's default/global activity manager.
82 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080083 static public IActivityManager getDefault() {
84 return gDefault.get();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080085 }
86
87 /**
88 * Convenience for checking whether the system is ready. For internal use only.
89 */
90 static public boolean isSystemReady() {
91 if (!sSystemReady) {
92 sSystemReady = getDefault().testIsSystemReady();
93 }
94 return sSystemReady;
95 }
96 static boolean sSystemReady = false;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080097
Svet Ganov16a16892015-04-16 10:32:04 -070098 static public void broadcastStickyIntent(Intent intent, String permission, int userId) {
99 broadcastStickyIntent(intent, permission, AppOpsManager.OP_NONE, userId);
100 }
101
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800102 /**
103 * Convenience for sending a sticky broadcast. For internal use only.
104 * If you don't care about permission, use null.
105 */
Svet Ganov16a16892015-04-16 10:32:04 -0700106 static public void broadcastStickyIntent(Intent intent, String permission, int appOp,
107 int userId) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800108 try {
109 getDefault().broadcastIntent(
Filip Gruszczynski23493322015-07-29 17:02:59 -0700110 null, intent, null, null, Activity.RESULT_OK, null, null,
111 null /*permission*/, appOp, null, false, true, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800112 } catch (RemoteException ex) {
113 }
114 }
115
Dianne Hackborn1e383822015-04-10 14:02:33 -0700116 static public void noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg,
117 String tag) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800118 try {
Christopher Tate14a7bb02015-10-01 10:24:31 -0700119 getDefault().noteWakeupAlarm((ps != null) ? ps.getTarget() : null,
120 sourceUid, sourcePkg, tag);
Dianne Hackborn1e383822015-04-10 14:02:33 -0700121 } catch (RemoteException ex) {
122 }
123 }
124
125 static public void noteAlarmStart(PendingIntent ps, int sourceUid, String tag) {
126 try {
Christopher Tate14a7bb02015-10-01 10:24:31 -0700127 getDefault().noteAlarmStart((ps != null) ? ps.getTarget() : null, sourceUid, tag);
Dianne Hackborn1e383822015-04-10 14:02:33 -0700128 } catch (RemoteException ex) {
129 }
130 }
131
132 static public void noteAlarmFinish(PendingIntent ps, int sourceUid, String tag) {
133 try {
Christopher Tate14a7bb02015-10-01 10:24:31 -0700134 getDefault().noteAlarmFinish((ps != null) ? ps.getTarget() : null, sourceUid, tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800135 } catch (RemoteException ex) {
136 }
137 }
138
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -0800139 public ActivityManagerNative() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800140 attachInterface(this, descriptor);
141 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700142
143 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800144 public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
145 throws RemoteException {
146 switch (code) {
147 case START_ACTIVITY_TRANSACTION:
148 {
149 data.enforceInterface(IActivityManager.descriptor);
150 IBinder b = data.readStrongBinder();
151 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800152 String callingPackage = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800153 Intent intent = Intent.CREATOR.createFromParcel(data);
154 String resolvedType = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800155 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800156 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800157 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700158 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700159 ProfilerInfo profilerInfo = data.readInt() != 0
160 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700161 Bundle options = data.readInt() != 0
162 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800163 int result = startActivity(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700164 resultTo, resultWho, requestCode, startFlags, profilerInfo, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800165 reply.writeNoException();
166 reply.writeInt(result);
167 return true;
168 }
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700169
Amith Yamasani82644082012-08-03 13:09:11 -0700170 case START_ACTIVITY_AS_USER_TRANSACTION:
171 {
172 data.enforceInterface(IActivityManager.descriptor);
173 IBinder b = data.readStrongBinder();
174 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800175 String callingPackage = data.readString();
Amith Yamasani82644082012-08-03 13:09:11 -0700176 Intent intent = Intent.CREATOR.createFromParcel(data);
177 String resolvedType = data.readString();
178 IBinder resultTo = data.readStrongBinder();
179 String resultWho = data.readString();
180 int requestCode = data.readInt();
181 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700182 ProfilerInfo profilerInfo = data.readInt() != 0
183 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Amith Yamasani82644082012-08-03 13:09:11 -0700184 Bundle options = data.readInt() != 0
185 ? Bundle.CREATOR.createFromParcel(data) : null;
186 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800187 int result = startActivityAsUser(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700188 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Amith Yamasani82644082012-08-03 13:09:11 -0700189 reply.writeNoException();
190 reply.writeInt(result);
191 return true;
192 }
193
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700194 case START_ACTIVITY_AS_CALLER_TRANSACTION:
195 {
196 data.enforceInterface(IActivityManager.descriptor);
197 IBinder b = data.readStrongBinder();
198 IApplicationThread app = ApplicationThreadNative.asInterface(b);
199 String callingPackage = data.readString();
200 Intent intent = Intent.CREATOR.createFromParcel(data);
201 String resolvedType = data.readString();
202 IBinder resultTo = data.readStrongBinder();
203 String resultWho = data.readString();
204 int requestCode = data.readInt();
205 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700206 ProfilerInfo profilerInfo = data.readInt() != 0
207 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700208 Bundle options = data.readInt() != 0
209 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborna7cfbe02015-07-16 10:52:52 -0700210 boolean ignoreTargetSecurity = data.readInt() != 0;
Jeff Sharkey97978802014-10-14 10:48:18 -0700211 int userId = data.readInt();
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700212 int result = startActivityAsCaller(app, callingPackage, intent, resolvedType,
Dianne Hackborna7cfbe02015-07-16 10:52:52 -0700213 resultTo, resultWho, requestCode, startFlags, profilerInfo, options,
214 ignoreTargetSecurity, userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700215 reply.writeNoException();
216 reply.writeInt(result);
217 return true;
218 }
219
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800220 case START_ACTIVITY_AND_WAIT_TRANSACTION:
221 {
222 data.enforceInterface(IActivityManager.descriptor);
223 IBinder b = data.readStrongBinder();
224 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800225 String callingPackage = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800226 Intent intent = Intent.CREATOR.createFromParcel(data);
227 String resolvedType = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800228 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800229 String resultWho = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800230 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700231 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700232 ProfilerInfo profilerInfo = data.readInt() != 0
233 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700234 Bundle options = data.readInt() != 0
235 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -0700236 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800237 WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700238 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800239 reply.writeNoException();
240 result.writeToParcel(reply, 0);
241 return true;
242 }
243
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700244 case START_ACTIVITY_WITH_CONFIG_TRANSACTION:
245 {
246 data.enforceInterface(IActivityManager.descriptor);
247 IBinder b = data.readStrongBinder();
248 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800249 String callingPackage = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700250 Intent intent = Intent.CREATOR.createFromParcel(data);
251 String resolvedType = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700252 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700253 String resultWho = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700254 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700255 int startFlags = data.readInt();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700256 Configuration config = Configuration.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700257 Bundle options = data.readInt() != 0
258 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -0700259 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800260 int result = startActivityWithConfig(app, callingPackage, intent, resolvedType,
Dianne Hackborn41203752012-08-31 14:05:51 -0700261 resultTo, resultWho, requestCode, startFlags, config, options, userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700262 reply.writeNoException();
263 reply.writeInt(result);
264 return true;
265 }
266
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700267 case START_ACTIVITY_INTENT_SENDER_TRANSACTION:
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700268 {
269 data.enforceInterface(IActivityManager.descriptor);
270 IBinder b = data.readStrongBinder();
271 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700272 IntentSender intent = IntentSender.CREATOR.createFromParcel(data);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700273 Intent fillInIntent = null;
274 if (data.readInt() != 0) {
275 fillInIntent = Intent.CREATOR.createFromParcel(data);
276 }
277 String resolvedType = data.readString();
278 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700279 String resultWho = data.readString();
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700280 int requestCode = data.readInt();
281 int flagsMask = data.readInt();
282 int flagsValues = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700283 Bundle options = data.readInt() != 0
284 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700285 int result = startActivityIntentSender(app, intent,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700286 fillInIntent, resolvedType, resultTo, resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700287 requestCode, flagsMask, flagsValues, options);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700288 reply.writeNoException();
289 reply.writeInt(result);
290 return true;
291 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700292
Dianne Hackborn91097de2014-04-04 18:02:06 -0700293 case START_VOICE_ACTIVITY_TRANSACTION:
294 {
295 data.enforceInterface(IActivityManager.descriptor);
296 String callingPackage = data.readString();
297 int callingPid = data.readInt();
298 int callingUid = data.readInt();
299 Intent intent = Intent.CREATOR.createFromParcel(data);
300 String resolvedType = data.readString();
301 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
302 data.readStrongBinder());
303 IVoiceInteractor interactor = IVoiceInteractor.Stub.asInterface(
304 data.readStrongBinder());
305 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700306 ProfilerInfo profilerInfo = data.readInt() != 0
307 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborn91097de2014-04-04 18:02:06 -0700308 Bundle options = data.readInt() != 0
309 ? Bundle.CREATOR.createFromParcel(data) : null;
310 int userId = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700311 int result = startVoiceActivity(callingPackage, callingPid, callingUid, intent,
312 resolvedType, session, interactor, startFlags, profilerInfo, options, userId);
Dianne Hackborn91097de2014-04-04 18:02:06 -0700313 reply.writeNoException();
314 reply.writeInt(result);
315 return true;
316 }
317
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800318 case START_NEXT_MATCHING_ACTIVITY_TRANSACTION:
319 {
320 data.enforceInterface(IActivityManager.descriptor);
321 IBinder callingActivity = data.readStrongBinder();
322 Intent intent = Intent.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700323 Bundle options = data.readInt() != 0
324 ? Bundle.CREATOR.createFromParcel(data) : null;
325 boolean result = startNextMatchingActivity(callingActivity, intent, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800326 reply.writeNoException();
327 reply.writeInt(result ? 1 : 0);
328 return true;
329 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700330
Craig Mautnerdc00cbe2014-07-20 17:48:47 -0700331 case START_ACTIVITY_FROM_RECENTS_TRANSACTION:
332 {
333 data.enforceInterface(IActivityManager.descriptor);
Wale Ogunwale7e8184b2015-10-05 14:37:03 -0700334 final int taskId = data.readInt();
335 final int launchStackId = data.readInt();
336 final Bundle options =
337 data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data);
338 final int result = startActivityFromRecents(taskId, launchStackId, options);
Craig Mautnerdc00cbe2014-07-20 17:48:47 -0700339 reply.writeNoException();
340 reply.writeInt(result);
341 return true;
342 }
343
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800344 case FINISH_ACTIVITY_TRANSACTION: {
345 data.enforceInterface(IActivityManager.descriptor);
346 IBinder token = data.readStrongBinder();
347 Intent resultData = null;
348 int resultCode = data.readInt();
349 if (data.readInt() != 0) {
350 resultData = Intent.CREATOR.createFromParcel(data);
351 }
Wale Ogunwaleba7881c2015-08-01 19:28:29 -0700352 int finishTask = data.readInt();
Winson Chung3b3f4642014-04-22 10:08:18 -0700353 boolean res = finishActivity(token, resultCode, resultData, finishTask);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800354 reply.writeNoException();
355 reply.writeInt(res ? 1 : 0);
356 return true;
357 }
358
359 case FINISH_SUB_ACTIVITY_TRANSACTION: {
360 data.enforceInterface(IActivityManager.descriptor);
361 IBinder token = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700362 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800363 int requestCode = data.readInt();
364 finishSubActivity(token, resultWho, requestCode);
365 reply.writeNoException();
366 return true;
367 }
368
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700369 case FINISH_ACTIVITY_AFFINITY_TRANSACTION: {
370 data.enforceInterface(IActivityManager.descriptor);
371 IBinder token = data.readStrongBinder();
372 boolean res = finishActivityAffinity(token);
373 reply.writeNoException();
374 reply.writeInt(res ? 1 : 0);
375 return true;
376 }
377
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -0700378 case FINISH_VOICE_TASK_TRANSACTION: {
379 data.enforceInterface(IActivityManager.descriptor);
380 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
381 data.readStrongBinder());
382 finishVoiceTask(session);
383 reply.writeNoException();
384 return true;
385 }
386
Dianne Hackborn89ad4562014-08-24 16:45:38 -0700387 case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: {
388 data.enforceInterface(IActivityManager.descriptor);
389 IBinder token = data.readStrongBinder();
390 boolean res = releaseActivityInstance(token);
391 reply.writeNoException();
392 reply.writeInt(res ? 1 : 0);
393 return true;
394 }
395
396 case RELEASE_SOME_ACTIVITIES_TRANSACTION: {
397 data.enforceInterface(IActivityManager.descriptor);
398 IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder());
399 releaseSomeActivities(app);
400 reply.writeNoException();
401 return true;
402 }
403
Dianne Hackborn061d58a2010-03-12 15:07:06 -0800404 case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: {
405 data.enforceInterface(IActivityManager.descriptor);
406 IBinder token = data.readStrongBinder();
407 boolean res = willActivityBeVisible(token);
408 reply.writeNoException();
409 reply.writeInt(res ? 1 : 0);
410 return true;
411 }
412
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800413 case REGISTER_RECEIVER_TRANSACTION:
414 {
415 data.enforceInterface(IActivityManager.descriptor);
416 IBinder b = data.readStrongBinder();
417 IApplicationThread app =
418 b != null ? ApplicationThreadNative.asInterface(b) : null;
Dianne Hackborn6c418d52011-06-29 14:05:33 -0700419 String packageName = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800420 b = data.readStrongBinder();
421 IIntentReceiver rec
422 = b != null ? IIntentReceiver.Stub.asInterface(b) : null;
423 IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data);
424 String perm = data.readString();
Dianne Hackborn20e80982012-08-31 19:00:44 -0700425 int userId = data.readInt();
426 Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800427 reply.writeNoException();
428 if (intent != null) {
429 reply.writeInt(1);
430 intent.writeToParcel(reply, 0);
431 } else {
432 reply.writeInt(0);
433 }
434 return true;
435 }
436
437 case UNREGISTER_RECEIVER_TRANSACTION:
438 {
439 data.enforceInterface(IActivityManager.descriptor);
440 IBinder b = data.readStrongBinder();
441 if (b == null) {
442 return true;
443 }
444 IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b);
445 unregisterReceiver(rec);
446 reply.writeNoException();
447 return true;
448 }
449
450 case BROADCAST_INTENT_TRANSACTION:
451 {
452 data.enforceInterface(IActivityManager.descriptor);
453 IBinder b = data.readStrongBinder();
454 IApplicationThread app =
455 b != null ? ApplicationThreadNative.asInterface(b) : null;
456 Intent intent = Intent.CREATOR.createFromParcel(data);
457 String resolvedType = data.readString();
458 b = data.readStrongBinder();
459 IIntentReceiver resultTo =
460 b != null ? IIntentReceiver.Stub.asInterface(b) : null;
461 int resultCode = data.readInt();
462 String resultData = data.readString();
463 Bundle resultExtras = data.readBundle();
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -0700464 String[] perms = data.readStringArray();
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800465 int appOp = data.readInt();
Dianne Hackborna750a632015-06-16 17:18:23 -0700466 Bundle options = data.readBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800467 boolean serialized = data.readInt() != 0;
468 boolean sticky = data.readInt() != 0;
Amith Yamasani742a6712011-05-04 14:49:28 -0700469 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800470 int res = broadcastIntent(app, intent, resolvedType, resultTo,
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -0700471 resultCode, resultData, resultExtras, perms, appOp,
Dianne Hackborna750a632015-06-16 17:18:23 -0700472 options, serialized, sticky, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800473 reply.writeNoException();
474 reply.writeInt(res);
475 return true;
476 }
477
478 case UNBROADCAST_INTENT_TRANSACTION:
479 {
480 data.enforceInterface(IActivityManager.descriptor);
481 IBinder b = data.readStrongBinder();
482 IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null;
483 Intent intent = Intent.CREATOR.createFromParcel(data);
Amith Yamasani742a6712011-05-04 14:49:28 -0700484 int userId = data.readInt();
485 unbroadcastIntent(app, intent, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800486 reply.writeNoException();
487 return true;
488 }
489
490 case FINISH_RECEIVER_TRANSACTION: {
491 data.enforceInterface(IActivityManager.descriptor);
492 IBinder who = data.readStrongBinder();
493 int resultCode = data.readInt();
494 String resultData = data.readString();
495 Bundle resultExtras = data.readBundle();
496 boolean resultAbort = data.readInt() != 0;
riddle_hsu1f5ac4d2015-01-03 15:38:21 +0800497 int intentFlags = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800498 if (who != null) {
riddle_hsu1f5ac4d2015-01-03 15:38:21 +0800499 finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800500 }
501 reply.writeNoException();
502 return true;
503 }
504
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800505 case ATTACH_APPLICATION_TRANSACTION: {
506 data.enforceInterface(IActivityManager.descriptor);
507 IApplicationThread app = ApplicationThreadNative.asInterface(
508 data.readStrongBinder());
509 if (app != null) {
510 attachApplication(app);
511 }
512 reply.writeNoException();
513 return true;
514 }
515
516 case ACTIVITY_IDLE_TRANSACTION: {
517 data.enforceInterface(IActivityManager.descriptor);
518 IBinder token = data.readStrongBinder();
Dianne Hackborne88846e2009-09-30 21:34:25 -0700519 Configuration config = null;
520 if (data.readInt() != 0) {
521 config = Configuration.CREATOR.createFromParcel(data);
522 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700523 boolean stopProfiling = data.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800524 if (token != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700525 activityIdle(token, config, stopProfiling);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800526 }
527 reply.writeNoException();
528 return true;
529 }
530
Dianne Hackbornad9b32112012-09-17 15:35:01 -0700531 case ACTIVITY_RESUMED_TRANSACTION: {
532 data.enforceInterface(IActivityManager.descriptor);
533 IBinder token = data.readStrongBinder();
534 activityResumed(token);
535 reply.writeNoException();
536 return true;
537 }
538
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800539 case ACTIVITY_PAUSED_TRANSACTION: {
540 data.enforceInterface(IActivityManager.descriptor);
541 IBinder token = data.readStrongBinder();
Dianne Hackborna4e102e2014-09-04 22:52:27 -0700542 activityPaused(token);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800543 reply.writeNoException();
544 return true;
545 }
546
547 case ACTIVITY_STOPPED_TRANSACTION: {
548 data.enforceInterface(IActivityManager.descriptor);
549 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800550 Bundle map = data.readBundle();
Craig Mautnera0026042014-04-23 11:45:37 -0700551 PersistableBundle persistentState = data.readPersistableBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800552 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
Craig Mautnera0026042014-04-23 11:45:37 -0700553 activityStopped(token, map, persistentState, description);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800554 reply.writeNoException();
555 return true;
556 }
557
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800558 case ACTIVITY_SLEPT_TRANSACTION: {
559 data.enforceInterface(IActivityManager.descriptor);
560 IBinder token = data.readStrongBinder();
561 activitySlept(token);
562 reply.writeNoException();
563 return true;
564 }
565
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800566 case ACTIVITY_DESTROYED_TRANSACTION: {
567 data.enforceInterface(IActivityManager.descriptor);
568 IBinder token = data.readStrongBinder();
569 activityDestroyed(token);
570 reply.writeNoException();
571 return true;
572 }
573
574 case GET_CALLING_PACKAGE_TRANSACTION: {
575 data.enforceInterface(IActivityManager.descriptor);
576 IBinder token = data.readStrongBinder();
577 String res = token != null ? getCallingPackage(token) : null;
578 reply.writeNoException();
579 reply.writeString(res);
580 return true;
581 }
582
583 case GET_CALLING_ACTIVITY_TRANSACTION: {
584 data.enforceInterface(IActivityManager.descriptor);
585 IBinder token = data.readStrongBinder();
586 ComponentName cn = getCallingActivity(token);
587 reply.writeNoException();
588 ComponentName.writeToParcel(cn, reply);
589 return true;
590 }
591
Winson Chung1147c402014-05-14 11:05:00 -0700592 case GET_APP_TASKS_TRANSACTION: {
593 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -0700594 String callingPackage = data.readString();
595 List<IAppTask> list = getAppTasks(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -0700596 reply.writeNoException();
597 int N = list != null ? list.size() : -1;
598 reply.writeInt(N);
599 int i;
600 for (i=0; i<N; i++) {
601 IAppTask task = list.get(i);
602 reply.writeStrongBinder(task.asBinder());
603 }
604 return true;
605 }
606
Dianne Hackbornaec68bb2014-08-20 15:25:13 -0700607 case ADD_APP_TASK_TRANSACTION: {
608 data.enforceInterface(IActivityManager.descriptor);
609 IBinder activityToken = data.readStrongBinder();
610 Intent intent = Intent.CREATOR.createFromParcel(data);
611 ActivityManager.TaskDescription descr
612 = ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
613 Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data);
614 int res = addAppTask(activityToken, intent, descr, thumbnail);
615 reply.writeNoException();
616 reply.writeInt(res);
617 return true;
618 }
619
620 case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: {
621 data.enforceInterface(IActivityManager.descriptor);
622 Point size = getAppTaskThumbnailSize();
623 reply.writeNoException();
624 size.writeToParcel(reply, 0);
625 return true;
626 }
627
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800628 case GET_TASKS_TRANSACTION: {
629 data.enforceInterface(IActivityManager.descriptor);
630 int maxNum = data.readInt();
631 int fl = data.readInt();
Dianne Hackborn09233282014-04-30 11:33:59 -0700632 List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800633 reply.writeNoException();
634 int N = list != null ? list.size() : -1;
635 reply.writeInt(N);
636 int i;
637 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700638 ActivityManager.RunningTaskInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800639 info.writeToParcel(reply, 0);
640 }
641 return true;
642 }
643
644 case GET_RECENT_TASKS_TRANSACTION: {
645 data.enforceInterface(IActivityManager.descriptor);
646 int maxNum = data.readInt();
647 int fl = data.readInt();
Amith Yamasani82644082012-08-03 13:09:11 -0700648 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800649 List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -0700650 fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800651 reply.writeNoException();
652 reply.writeTypedList(list);
653 return true;
654 }
Dianne Hackborn15491c62012-09-19 10:59:14 -0700655
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700656 case GET_TASK_THUMBNAIL_TRANSACTION: {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800657 data.enforceInterface(IActivityManager.descriptor);
658 int id = data.readInt();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700659 ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id);
Dianne Hackbornd94df452011-02-16 18:53:31 -0800660 reply.writeNoException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700661 if (taskThumbnail != null) {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800662 reply.writeInt(1);
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700663 taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn15491c62012-09-19 10:59:14 -0700664 } else {
665 reply.writeInt(0);
666 }
667 return true;
668 }
669
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800670 case GET_SERVICES_TRANSACTION: {
671 data.enforceInterface(IActivityManager.descriptor);
672 int maxNum = data.readInt();
673 int fl = data.readInt();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700674 List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800675 reply.writeNoException();
676 int N = list != null ? list.size() : -1;
677 reply.writeInt(N);
678 int i;
679 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700680 ActivityManager.RunningServiceInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800681 info.writeToParcel(reply, 0);
682 }
683 return true;
684 }
685
686 case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: {
687 data.enforceInterface(IActivityManager.descriptor);
688 List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState();
689 reply.writeNoException();
690 reply.writeTypedList(list);
691 return true;
692 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700693
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800694 case GET_RUNNING_APP_PROCESSES_TRANSACTION: {
695 data.enforceInterface(IActivityManager.descriptor);
696 List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses();
697 reply.writeNoException();
698 reply.writeTypedList(list);
699 return true;
700 }
701
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -0700702 case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: {
703 data.enforceInterface(IActivityManager.descriptor);
704 List<ApplicationInfo> list = getRunningExternalApplications();
705 reply.writeNoException();
706 reply.writeTypedList(list);
707 return true;
708 }
709
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800710 case MOVE_TASK_TO_FRONT_TRANSACTION: {
711 data.enforceInterface(IActivityManager.descriptor);
712 int task = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800713 int fl = data.readInt();
Dianne Hackborn8078d8c2012-03-20 11:11:26 -0700714 Bundle options = data.readInt() != 0
715 ? Bundle.CREATOR.createFromParcel(data) : null;
716 moveTaskToFront(task, fl, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800717 reply.writeNoException();
718 return true;
719 }
720
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800721 case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: {
722 data.enforceInterface(IActivityManager.descriptor);
723 IBinder token = data.readStrongBinder();
724 boolean nonRoot = data.readInt() != 0;
725 boolean res = moveActivityTaskToBack(token, nonRoot);
726 reply.writeNoException();
727 reply.writeInt(res ? 1 : 0);
728 return true;
729 }
730
731 case MOVE_TASK_BACKWARDS_TRANSACTION: {
732 data.enforceInterface(IActivityManager.descriptor);
733 int task = data.readInt();
734 moveTaskBackwards(task);
735 reply.writeNoException();
736 return true;
737 }
738
Craig Mautnerc00204b2013-03-05 15:02:14 -0800739 case MOVE_TASK_TO_STACK_TRANSACTION: {
740 data.enforceInterface(IActivityManager.descriptor);
741 int taskId = data.readInt();
742 int stackId = data.readInt();
743 boolean toTop = data.readInt() != 0;
744 moveTaskToStack(taskId, stackId, toTop);
745 reply.writeNoException();
746 return true;
747 }
748
Wale Ogunwale59a73ca2015-09-14 12:54:50 -0700749 case MOVE_TASK_TO_DOCKED_STACK_TRANSACTION: {
750 data.enforceInterface(IActivityManager.descriptor);
751 int taskId = data.readInt();
752 int createMode = data.readInt();
753 boolean toTop = data.readInt() != 0;
Jorim Jaggi030979c2015-11-20 15:14:43 -0800754 boolean animate = data.readInt() != 0;
Jorim Jaggi9ea2f7b2015-11-23 18:08:28 -0800755 Rect bounds = null;
756 boolean hasBounds = data.readInt() != 0;
757 if (hasBounds) {
758 bounds = Rect.CREATOR.createFromParcel(data);
759 }
760 moveTaskToDockedStack(taskId, createMode, toTop, animate, bounds);
Wale Ogunwale59a73ca2015-09-14 12:54:50 -0700761 reply.writeNoException();
762 return true;
763 }
764
Dianne Hackbornbef28fe2015-10-29 17:57:11 -0700765 case MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION: {
Wale Ogunwale079a0042015-10-24 11:44:07 -0700766 data.enforceInterface(IActivityManager.descriptor);
767 final int stackId = data.readInt();
768 final Rect r = Rect.CREATOR.createFromParcel(data);
769 final boolean res = moveTopActivityToPinnedStack(stackId, r);
770 reply.writeNoException();
771 reply.writeInt(res ? 1 : 0);
772 return true;
773 }
774
Craig Mautnerc00204b2013-03-05 15:02:14 -0800775 case RESIZE_STACK_TRANSACTION: {
776 data.enforceInterface(IActivityManager.descriptor);
Wale Ogunwaleffc11bb2015-10-10 13:05:45 -0700777 final int stackId = data.readInt();
Jorim Jaggi61f39a72015-10-29 16:54:18 +0100778 final boolean hasRect = data.readInt() != 0;
779 Rect r = null;
780 if (hasRect) {
781 r = Rect.CREATOR.createFromParcel(data);
782 }
Wale Ogunwaleffc11bb2015-10-10 13:05:45 -0700783 final boolean allowResizeInDockedMode = data.readInt() == 1;
784 resizeStack(stackId, r, allowResizeInDockedMode);
Craig Mautnerc00204b2013-03-05 15:02:14 -0800785 reply.writeNoException();
786 return true;
787 }
788
Wale Ogunwaleddc1cb22015-07-25 19:23:04 -0700789 case POSITION_TASK_IN_STACK_TRANSACTION: {
790 data.enforceInterface(IActivityManager.descriptor);
791 int taskId = data.readInt();
792 int stackId = data.readInt();
793 int position = data.readInt();
794 positionTaskInStack(taskId, stackId, position);
795 reply.writeNoException();
796 return true;
797 }
798
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800799 case GET_ALL_STACK_INFOS_TRANSACTION: {
Craig Mautner5ff12102013-05-24 12:50:15 -0700800 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800801 List<StackInfo> list = getAllStackInfos();
Craig Mautner5ff12102013-05-24 12:50:15 -0700802 reply.writeNoException();
803 reply.writeTypedList(list);
804 return true;
805 }
806
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800807 case GET_STACK_INFO_TRANSACTION: {
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700808 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800809 int stackId = data.readInt();
810 StackInfo info = getStackInfo(stackId);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700811 reply.writeNoException();
812 if (info != null) {
813 reply.writeInt(1);
814 info.writeToParcel(reply, 0);
815 } else {
816 reply.writeInt(0);
817 }
818 return true;
819 }
820
Winson Chung303e1ff2014-03-07 15:06:19 -0800821 case IS_IN_HOME_STACK_TRANSACTION: {
822 data.enforceInterface(IActivityManager.descriptor);
823 int taskId = data.readInt();
824 boolean isInHomeStack = isInHomeStack(taskId);
825 reply.writeNoException();
826 reply.writeInt(isInHomeStack ? 1 : 0);
827 return true;
828 }
829
Craig Mautnercf910b02013-04-23 11:23:27 -0700830 case SET_FOCUSED_STACK_TRANSACTION: {
831 data.enforceInterface(IActivityManager.descriptor);
832 int stackId = data.readInt();
833 setFocusedStack(stackId);
834 reply.writeNoException();
835 return true;
836 }
837
Winson Chungd16c5652015-01-26 16:11:07 -0800838 case GET_FOCUSED_STACK_ID_TRANSACTION: {
839 data.enforceInterface(IActivityManager.descriptor);
840 int focusedStackId = getFocusedStackId();
841 reply.writeNoException();
842 reply.writeInt(focusedStackId);
843 return true;
844 }
845
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700846 case SET_FOCUSED_TASK_TRANSACTION: {
847 data.enforceInterface(IActivityManager.descriptor);
848 int taskId = data.readInt();
Skuhnef36bb0c2015-08-26 14:26:17 -0700849 setFocusedTask(taskId);
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700850 reply.writeNoException();
851 return true;
852 }
853
Winson Chung740c3ac2014-11-12 16:14:38 -0800854 case REGISTER_TASK_STACK_LISTENER_TRANSACTION: {
855 data.enforceInterface(IActivityManager.descriptor);
856 IBinder token = data.readStrongBinder();
857 registerTaskStackListener(ITaskStackListener.Stub.asInterface(token));
858 reply.writeNoException();
859 return true;
860 }
861
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800862 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
863 data.enforceInterface(IActivityManager.descriptor);
864 IBinder token = data.readStrongBinder();
865 boolean onlyRoot = data.readInt() != 0;
866 int res = token != null
867 ? getTaskForActivity(token, onlyRoot) : -1;
868 reply.writeNoException();
869 reply.writeInt(res);
870 return true;
871 }
872
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800873 case GET_CONTENT_PROVIDER_TRANSACTION: {
874 data.enforceInterface(IActivityManager.descriptor);
875 IBinder b = data.readStrongBinder();
876 IApplicationThread app = ApplicationThreadNative.asInterface(b);
877 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700878 int userId = data.readInt();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700879 boolean stable = data.readInt() != 0;
Jeff Sharkey6d515712012-09-20 16:06:08 -0700880 ContentProviderHolder cph = getContentProvider(app, name, userId, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800881 reply.writeNoException();
882 if (cph != null) {
883 reply.writeInt(1);
884 cph.writeToParcel(reply, 0);
885 } else {
886 reply.writeInt(0);
887 }
888 return true;
889 }
890
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800891 case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
892 data.enforceInterface(IActivityManager.descriptor);
893 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700894 int userId = data.readInt();
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800895 IBinder token = data.readStrongBinder();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700896 ContentProviderHolder cph = getContentProviderExternal(name, userId, token);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800897 reply.writeNoException();
898 if (cph != null) {
899 reply.writeInt(1);
900 cph.writeToParcel(reply, 0);
901 } else {
902 reply.writeInt(0);
903 }
904 return true;
905 }
906
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800907 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
908 data.enforceInterface(IActivityManager.descriptor);
909 IBinder b = data.readStrongBinder();
910 IApplicationThread app = ApplicationThreadNative.asInterface(b);
911 ArrayList<ContentProviderHolder> providers =
912 data.createTypedArrayList(ContentProviderHolder.CREATOR);
913 publishContentProviders(app, providers);
914 reply.writeNoException();
915 return true;
916 }
917
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700918 case REF_CONTENT_PROVIDER_TRANSACTION: {
919 data.enforceInterface(IActivityManager.descriptor);
920 IBinder b = data.readStrongBinder();
921 int stable = data.readInt();
922 int unstable = data.readInt();
923 boolean res = refContentProvider(b, stable, unstable);
924 reply.writeNoException();
925 reply.writeInt(res ? 1 : 0);
926 return true;
927 }
928
929 case UNSTABLE_PROVIDER_DIED_TRANSACTION: {
930 data.enforceInterface(IActivityManager.descriptor);
931 IBinder b = data.readStrongBinder();
932 unstableProviderDied(b);
933 reply.writeNoException();
934 return true;
935 }
936
Jeff Sharkey7aa76012013-09-30 14:26:27 -0700937 case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: {
938 data.enforceInterface(IActivityManager.descriptor);
939 IBinder b = data.readStrongBinder();
940 appNotRespondingViaProvider(b);
941 reply.writeNoException();
942 return true;
943 }
944
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800945 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
946 data.enforceInterface(IActivityManager.descriptor);
947 IBinder b = data.readStrongBinder();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700948 boolean stable = data.readInt() != 0;
949 removeContentProvider(b, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800950 reply.writeNoException();
951 return true;
952 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800953
954 case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
955 data.enforceInterface(IActivityManager.descriptor);
956 String name = data.readString();
957 IBinder token = data.readStrongBinder();
958 removeContentProviderExternal(name, token);
959 reply.writeNoException();
960 return true;
961 }
962
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700963 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
964 data.enforceInterface(IActivityManager.descriptor);
965 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
966 PendingIntent pi = getRunningServiceControlPanel(comp);
967 reply.writeNoException();
968 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
969 return true;
970 }
971
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800972 case START_SERVICE_TRANSACTION: {
973 data.enforceInterface(IActivityManager.descriptor);
974 IBinder b = data.readStrongBinder();
975 IApplicationThread app = ApplicationThreadNative.asInterface(b);
976 Intent service = Intent.CREATOR.createFromParcel(data);
977 String resolvedType = data.readString();
Svet Ganov99b60432015-06-27 13:15:22 -0700978 String callingPackage = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700979 int userId = data.readInt();
Svet Ganov99b60432015-06-27 13:15:22 -0700980 ComponentName cn = startService(app, service, resolvedType, callingPackage, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800981 reply.writeNoException();
982 ComponentName.writeToParcel(cn, reply);
983 return true;
984 }
985
986 case STOP_SERVICE_TRANSACTION: {
987 data.enforceInterface(IActivityManager.descriptor);
988 IBinder b = data.readStrongBinder();
989 IApplicationThread app = ApplicationThreadNative.asInterface(b);
990 Intent service = Intent.CREATOR.createFromParcel(data);
991 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700992 int userId = data.readInt();
993 int res = stopService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800994 reply.writeNoException();
995 reply.writeInt(res);
996 return true;
997 }
998
999 case STOP_SERVICE_TOKEN_TRANSACTION: {
1000 data.enforceInterface(IActivityManager.descriptor);
1001 ComponentName className = ComponentName.readFromParcel(data);
1002 IBinder token = data.readStrongBinder();
1003 int startId = data.readInt();
1004 boolean res = stopServiceToken(className, token, startId);
1005 reply.writeNoException();
1006 reply.writeInt(res ? 1 : 0);
1007 return true;
1008 }
1009
1010 case SET_SERVICE_FOREGROUND_TRANSACTION: {
1011 data.enforceInterface(IActivityManager.descriptor);
1012 ComponentName className = ComponentName.readFromParcel(data);
1013 IBinder token = data.readStrongBinder();
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07001014 int id = data.readInt();
1015 Notification notification = null;
1016 if (data.readInt() != 0) {
1017 notification = Notification.CREATOR.createFromParcel(data);
1018 }
1019 boolean removeNotification = data.readInt() != 0;
1020 setServiceForeground(className, token, id, notification, removeNotification);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001021 reply.writeNoException();
1022 return true;
1023 }
1024
1025 case BIND_SERVICE_TRANSACTION: {
1026 data.enforceInterface(IActivityManager.descriptor);
1027 IBinder b = data.readStrongBinder();
1028 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1029 IBinder token = data.readStrongBinder();
1030 Intent service = Intent.CREATOR.createFromParcel(data);
1031 String resolvedType = data.readString();
1032 b = data.readStrongBinder();
1033 int fl = data.readInt();
Svet Ganov99b60432015-06-27 13:15:22 -07001034 String callingPackage = data.readString();
Amith Yamasani37ce3a82012-02-06 12:04:42 -08001035 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001036 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
Svet Ganov99b60432015-06-27 13:15:22 -07001037 int res = bindService(app, token, service, resolvedType, conn, fl,
1038 callingPackage, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001039 reply.writeNoException();
1040 reply.writeInt(res);
1041 return true;
1042 }
1043
1044 case UNBIND_SERVICE_TRANSACTION: {
1045 data.enforceInterface(IActivityManager.descriptor);
1046 IBinder b = data.readStrongBinder();
1047 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
1048 boolean res = unbindService(conn);
1049 reply.writeNoException();
1050 reply.writeInt(res ? 1 : 0);
1051 return true;
1052 }
1053
1054 case PUBLISH_SERVICE_TRANSACTION: {
1055 data.enforceInterface(IActivityManager.descriptor);
1056 IBinder token = data.readStrongBinder();
1057 Intent intent = Intent.CREATOR.createFromParcel(data);
1058 IBinder service = data.readStrongBinder();
1059 publishService(token, intent, service);
1060 reply.writeNoException();
1061 return true;
1062 }
1063
1064 case UNBIND_FINISHED_TRANSACTION: {
1065 data.enforceInterface(IActivityManager.descriptor);
1066 IBinder token = data.readStrongBinder();
1067 Intent intent = Intent.CREATOR.createFromParcel(data);
1068 boolean doRebind = data.readInt() != 0;
1069 unbindFinished(token, intent, doRebind);
1070 reply.writeNoException();
1071 return true;
1072 }
1073
1074 case SERVICE_DONE_EXECUTING_TRANSACTION: {
1075 data.enforceInterface(IActivityManager.descriptor);
1076 IBinder token = data.readStrongBinder();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07001077 int type = data.readInt();
1078 int startId = data.readInt();
1079 int res = data.readInt();
1080 serviceDoneExecuting(token, type, startId, res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001081 reply.writeNoException();
1082 return true;
1083 }
1084
1085 case START_INSTRUMENTATION_TRANSACTION: {
1086 data.enforceInterface(IActivityManager.descriptor);
1087 ComponentName className = ComponentName.readFromParcel(data);
1088 String profileFile = data.readString();
1089 int fl = data.readInt();
1090 Bundle arguments = data.readBundle();
1091 IBinder b = data.readStrongBinder();
1092 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08001093 b = data.readStrongBinder();
1094 IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001095 int userId = data.readInt();
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01001096 String abiOverride = data.readString();
1097 boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId,
1098 abiOverride);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001099 reply.writeNoException();
1100 reply.writeInt(res ? 1 : 0);
1101 return true;
1102 }
1103
1104
1105 case FINISH_INSTRUMENTATION_TRANSACTION: {
1106 data.enforceInterface(IActivityManager.descriptor);
1107 IBinder b = data.readStrongBinder();
1108 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1109 int resultCode = data.readInt();
1110 Bundle results = data.readBundle();
1111 finishInstrumentation(app, resultCode, results);
1112 reply.writeNoException();
1113 return true;
1114 }
1115
1116 case GET_CONFIGURATION_TRANSACTION: {
1117 data.enforceInterface(IActivityManager.descriptor);
1118 Configuration config = getConfiguration();
1119 reply.writeNoException();
1120 config.writeToParcel(reply, 0);
1121 return true;
1122 }
1123
1124 case UPDATE_CONFIGURATION_TRANSACTION: {
1125 data.enforceInterface(IActivityManager.descriptor);
1126 Configuration config = Configuration.CREATOR.createFromParcel(data);
1127 updateConfiguration(config);
1128 reply.writeNoException();
1129 return true;
1130 }
1131
1132 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
1133 data.enforceInterface(IActivityManager.descriptor);
1134 IBinder token = data.readStrongBinder();
1135 int requestedOrientation = data.readInt();
1136 setRequestedOrientation(token, requestedOrientation);
1137 reply.writeNoException();
1138 return true;
1139 }
1140
1141 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
1142 data.enforceInterface(IActivityManager.descriptor);
1143 IBinder token = data.readStrongBinder();
1144 int req = getRequestedOrientation(token);
1145 reply.writeNoException();
1146 reply.writeInt(req);
1147 return true;
1148 }
1149
1150 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
1151 data.enforceInterface(IActivityManager.descriptor);
1152 IBinder token = data.readStrongBinder();
1153 ComponentName cn = getActivityClassForToken(token);
1154 reply.writeNoException();
1155 ComponentName.writeToParcel(cn, reply);
1156 return true;
1157 }
1158
1159 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
1160 data.enforceInterface(IActivityManager.descriptor);
1161 IBinder token = data.readStrongBinder();
1162 reply.writeNoException();
1163 reply.writeString(getPackageForToken(token));
1164 return true;
1165 }
1166
1167 case GET_INTENT_SENDER_TRANSACTION: {
1168 data.enforceInterface(IActivityManager.descriptor);
1169 int type = data.readInt();
1170 String packageName = data.readString();
1171 IBinder token = data.readStrongBinder();
1172 String resultWho = data.readString();
1173 int requestCode = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001174 Intent[] requestIntents;
1175 String[] requestResolvedTypes;
1176 if (data.readInt() != 0) {
1177 requestIntents = data.createTypedArray(Intent.CREATOR);
1178 requestResolvedTypes = data.createStringArray();
1179 } else {
1180 requestIntents = null;
1181 requestResolvedTypes = null;
1182 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001183 int fl = data.readInt();
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07001184 Bundle options = data.readInt() != 0
1185 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -07001186 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001187 IIntentSender res = getIntentSender(type, packageName, token,
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001188 resultWho, requestCode, requestIntents,
Dianne Hackborn41203752012-08-31 14:05:51 -07001189 requestResolvedTypes, fl, options, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001190 reply.writeNoException();
1191 reply.writeStrongBinder(res != null ? res.asBinder() : null);
1192 return true;
1193 }
1194
1195 case CANCEL_INTENT_SENDER_TRANSACTION: {
1196 data.enforceInterface(IActivityManager.descriptor);
1197 IIntentSender r = IIntentSender.Stub.asInterface(
1198 data.readStrongBinder());
1199 cancelIntentSender(r);
1200 reply.writeNoException();
1201 return true;
1202 }
1203
1204 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
1205 data.enforceInterface(IActivityManager.descriptor);
1206 IIntentSender r = IIntentSender.Stub.asInterface(
1207 data.readStrongBinder());
1208 String res = getPackageForIntentSender(r);
1209 reply.writeNoException();
1210 reply.writeString(res);
1211 return true;
1212 }
1213
Christopher Tatec4a07d12012-04-06 14:19:13 -07001214 case GET_UID_FOR_INTENT_SENDER_TRANSACTION: {
1215 data.enforceInterface(IActivityManager.descriptor);
1216 IIntentSender r = IIntentSender.Stub.asInterface(
1217 data.readStrongBinder());
1218 int res = getUidForIntentSender(r);
1219 reply.writeNoException();
1220 reply.writeInt(res);
1221 return true;
1222 }
1223
Dianne Hackborn41203752012-08-31 14:05:51 -07001224 case HANDLE_INCOMING_USER_TRANSACTION: {
1225 data.enforceInterface(IActivityManager.descriptor);
1226 int callingPid = data.readInt();
1227 int callingUid = data.readInt();
1228 int userId = data.readInt();
1229 boolean allowAll = data.readInt() != 0 ;
1230 boolean requireFull = data.readInt() != 0;
1231 String name = data.readString();
1232 String callerPackage = data.readString();
1233 int res = handleIncomingUser(callingPid, callingUid, userId, allowAll,
1234 requireFull, name, callerPackage);
1235 reply.writeNoException();
1236 reply.writeInt(res);
1237 return true;
1238 }
1239
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001240 case SET_PROCESS_LIMIT_TRANSACTION: {
1241 data.enforceInterface(IActivityManager.descriptor);
1242 int max = data.readInt();
1243 setProcessLimit(max);
1244 reply.writeNoException();
1245 return true;
1246 }
1247
1248 case GET_PROCESS_LIMIT_TRANSACTION: {
1249 data.enforceInterface(IActivityManager.descriptor);
1250 int limit = getProcessLimit();
1251 reply.writeNoException();
1252 reply.writeInt(limit);
1253 return true;
1254 }
1255
1256 case SET_PROCESS_FOREGROUND_TRANSACTION: {
1257 data.enforceInterface(IActivityManager.descriptor);
1258 IBinder token = data.readStrongBinder();
1259 int pid = data.readInt();
1260 boolean isForeground = data.readInt() != 0;
1261 setProcessForeground(token, pid, isForeground);
1262 reply.writeNoException();
1263 return true;
1264 }
1265
1266 case CHECK_PERMISSION_TRANSACTION: {
1267 data.enforceInterface(IActivityManager.descriptor);
1268 String perm = data.readString();
1269 int pid = data.readInt();
1270 int uid = data.readInt();
1271 int res = checkPermission(perm, pid, uid);
1272 reply.writeNoException();
1273 reply.writeInt(res);
1274 return true;
1275 }
1276
Dianne Hackbornff170242014-11-19 10:59:01 -08001277 case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: {
1278 data.enforceInterface(IActivityManager.descriptor);
1279 String perm = data.readString();
1280 int pid = data.readInt();
1281 int uid = data.readInt();
1282 IBinder token = data.readStrongBinder();
1283 int res = checkPermissionWithToken(perm, pid, uid, token);
1284 reply.writeNoException();
1285 reply.writeInt(res);
1286 return true;
1287 }
1288
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001289 case CHECK_URI_PERMISSION_TRANSACTION: {
1290 data.enforceInterface(IActivityManager.descriptor);
1291 Uri uri = Uri.CREATOR.createFromParcel(data);
1292 int pid = data.readInt();
1293 int uid = data.readInt();
1294 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001295 int userId = data.readInt();
Dianne Hackbornff170242014-11-19 10:59:01 -08001296 IBinder callerToken = data.readStrongBinder();
1297 int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001298 reply.writeNoException();
1299 reply.writeInt(res);
1300 return true;
1301 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001302
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001303 case CLEAR_APP_DATA_TRANSACTION: {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001304 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001305 String packageName = data.readString();
1306 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
1307 data.readStrongBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -07001308 int userId = data.readInt();
1309 boolean res = clearApplicationUserData(packageName, observer, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001310 reply.writeNoException();
1311 reply.writeInt(res ? 1 : 0);
1312 return true;
1313 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001314
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001315 case GRANT_URI_PERMISSION_TRANSACTION: {
1316 data.enforceInterface(IActivityManager.descriptor);
1317 IBinder b = data.readStrongBinder();
1318 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1319 String targetPkg = data.readString();
1320 Uri uri = Uri.CREATOR.createFromParcel(data);
1321 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001322 int userId = data.readInt();
1323 grantUriPermission(app, targetPkg, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001324 reply.writeNoException();
1325 return true;
1326 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001327
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001328 case REVOKE_URI_PERMISSION_TRANSACTION: {
1329 data.enforceInterface(IActivityManager.descriptor);
1330 IBinder b = data.readStrongBinder();
1331 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1332 Uri uri = Uri.CREATOR.createFromParcel(data);
1333 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001334 int userId = data.readInt();
1335 revokeUriPermission(app, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001336 reply.writeNoException();
1337 return true;
1338 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001339
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001340 case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1341 data.enforceInterface(IActivityManager.descriptor);
1342 Uri uri = Uri.CREATOR.createFromParcel(data);
1343 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001344 int userId = data.readInt();
1345 takePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001346 reply.writeNoException();
1347 return true;
1348 }
1349
1350 case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1351 data.enforceInterface(IActivityManager.descriptor);
1352 Uri uri = Uri.CREATOR.createFromParcel(data);
1353 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001354 int userId = data.readInt();
1355 releasePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001356 reply.writeNoException();
1357 return true;
1358 }
1359
1360 case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: {
1361 data.enforceInterface(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07001362 final String packageName = data.readString();
1363 final boolean incoming = data.readInt() != 0;
1364 final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions(
1365 packageName, incoming);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001366 reply.writeNoException();
1367 perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1368 return true;
1369 }
1370
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001371 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
1372 data.enforceInterface(IActivityManager.descriptor);
1373 IBinder b = data.readStrongBinder();
1374 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1375 boolean waiting = data.readInt() != 0;
1376 showWaitingForDebugger(app, waiting);
1377 reply.writeNoException();
1378 return true;
1379 }
1380
1381 case GET_MEMORY_INFO_TRANSACTION: {
1382 data.enforceInterface(IActivityManager.descriptor);
1383 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
1384 getMemoryInfo(mi);
1385 reply.writeNoException();
1386 mi.writeToParcel(reply, 0);
1387 return true;
1388 }
1389
1390 case UNHANDLED_BACK_TRANSACTION: {
1391 data.enforceInterface(IActivityManager.descriptor);
1392 unhandledBack();
1393 reply.writeNoException();
1394 return true;
1395 }
1396
1397 case OPEN_CONTENT_URI_TRANSACTION: {
1398 data.enforceInterface(IActivityManager.descriptor);
1399 Uri uri = Uri.parse(data.readString());
1400 ParcelFileDescriptor pfd = openContentUri(uri);
1401 reply.writeNoException();
1402 if (pfd != null) {
1403 reply.writeInt(1);
1404 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1405 } else {
1406 reply.writeInt(0);
1407 }
1408 return true;
1409 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001410
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001411 case SET_LOCK_SCREEN_SHOWN_TRANSACTION: {
1412 data.enforceInterface(IActivityManager.descriptor);
1413 setLockScreenShown(data.readInt() != 0);
1414 reply.writeNoException();
1415 return true;
1416 }
1417
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001418 case SET_DEBUG_APP_TRANSACTION: {
1419 data.enforceInterface(IActivityManager.descriptor);
1420 String pn = data.readString();
1421 boolean wfd = data.readInt() != 0;
1422 boolean per = data.readInt() != 0;
1423 setDebugApp(pn, wfd, per);
1424 reply.writeNoException();
1425 return true;
1426 }
1427
1428 case SET_ALWAYS_FINISH_TRANSACTION: {
1429 data.enforceInterface(IActivityManager.descriptor);
1430 boolean enabled = data.readInt() != 0;
1431 setAlwaysFinish(enabled);
1432 reply.writeNoException();
1433 return true;
1434 }
1435
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001436 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001437 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001438 IActivityController watcher = IActivityController.Stub.asInterface(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001439 data.readStrongBinder());
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001440 setActivityController(watcher);
Sungmin Choicdb86bb2012-12-20 14:08:59 +09001441 reply.writeNoException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001442 return true;
1443 }
1444
1445 case ENTER_SAFE_MODE_TRANSACTION: {
1446 data.enforceInterface(IActivityManager.descriptor);
1447 enterSafeMode();
1448 reply.writeNoException();
1449 return true;
1450 }
1451
1452 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1453 data.enforceInterface(IActivityManager.descriptor);
1454 IIntentSender is = IIntentSender.Stub.asInterface(
1455 data.readStrongBinder());
Dianne Hackborn099bc622014-01-22 13:39:16 -08001456 int sourceUid = data.readInt();
1457 String sourcePkg = data.readString();
Dianne Hackborn1e383822015-04-10 14:02:33 -07001458 String tag = data.readString();
1459 noteWakeupAlarm(is, sourceUid, sourcePkg, tag);
1460 reply.writeNoException();
1461 return true;
1462 }
1463
1464 case NOTE_ALARM_START_TRANSACTION: {
1465 data.enforceInterface(IActivityManager.descriptor);
1466 IIntentSender is = IIntentSender.Stub.asInterface(
1467 data.readStrongBinder());
1468 int sourceUid = data.readInt();
1469 String tag = data.readString();
1470 noteAlarmStart(is, sourceUid, tag);
1471 reply.writeNoException();
1472 return true;
1473 }
1474
1475 case NOTE_ALARM_FINISH_TRANSACTION: {
1476 data.enforceInterface(IActivityManager.descriptor);
1477 IIntentSender is = IIntentSender.Stub.asInterface(
1478 data.readStrongBinder());
1479 int sourceUid = data.readInt();
1480 String tag = data.readString();
1481 noteAlarmFinish(is, sourceUid, tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001482 reply.writeNoException();
1483 return true;
1484 }
1485
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001486 case KILL_PIDS_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001487 data.enforceInterface(IActivityManager.descriptor);
1488 int[] pids = data.createIntArray();
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001489 String reason = data.readString();
Dianne Hackborn64825172011-03-02 21:32:58 -08001490 boolean secure = data.readInt() != 0;
1491 boolean res = killPids(pids, reason, secure);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001492 reply.writeNoException();
1493 reply.writeInt(res ? 1 : 0);
1494 return true;
1495 }
1496
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07001497 case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: {
1498 data.enforceInterface(IActivityManager.descriptor);
1499 String reason = data.readString();
1500 boolean res = killProcessesBelowForeground(reason);
1501 reply.writeNoException();
1502 reply.writeInt(res ? 1 : 0);
1503 return true;
1504 }
1505
Dan Egnor60d87622009-12-16 16:32:58 -08001506 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1507 data.enforceInterface(IActivityManager.descriptor);
1508 IBinder app = data.readStrongBinder();
1509 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1510 handleApplicationCrash(app, ci);
1511 reply.writeNoException();
1512 return true;
1513 }
1514
1515 case HANDLE_APPLICATION_WTF_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001516 data.enforceInterface(IActivityManager.descriptor);
1517 IBinder app = data.readStrongBinder();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001518 String tag = data.readString();
Dianne Hackborn52322712014-08-26 22:47:26 -07001519 boolean system = data.readInt() != 0;
Dan Egnorb7f03672009-12-09 16:22:32 -08001520 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
Dianne Hackborn52322712014-08-26 22:47:26 -07001521 boolean res = handleApplicationWtf(app, tag, system, ci);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001522 reply.writeNoException();
Dan Egnor60d87622009-12-16 16:32:58 -08001523 reply.writeInt(res ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001524 return true;
1525 }
Dan Egnorb7f03672009-12-09 16:22:32 -08001526
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001527 case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: {
1528 data.enforceInterface(IActivityManager.descriptor);
1529 IBinder app = data.readStrongBinder();
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07001530 int violationMask = data.readInt();
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07001531 StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data);
1532 handleApplicationStrictModeViolation(app, violationMask, info);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001533 reply.writeNoException();
1534 return true;
1535 }
1536
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001537 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1538 data.enforceInterface(IActivityManager.descriptor);
1539 int sig = data.readInt();
1540 signalPersistentProcesses(sig);
1541 reply.writeNoException();
1542 return true;
1543 }
1544
Dianne Hackborn03abb812010-01-04 18:43:19 -08001545 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1546 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001547 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001548 int userId = data.readInt();
1549 killBackgroundProcesses(packageName, userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08001550 reply.writeNoException();
1551 return true;
1552 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08001553
1554 case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
1555 data.enforceInterface(IActivityManager.descriptor);
1556 killAllBackgroundProcesses();
1557 reply.writeNoException();
1558 return true;
1559 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001560
Dianne Hackborn03abb812010-01-04 18:43:19 -08001561 case FORCE_STOP_PACKAGE_TRANSACTION: {
1562 data.enforceInterface(IActivityManager.descriptor);
1563 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001564 int userId = data.readInt();
1565 forceStopPackage(packageName, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001566 reply.writeNoException();
1567 return true;
1568 }
Dianne Hackborn27ff9132012-03-06 14:57:58 -08001569
1570 case GET_MY_MEMORY_STATE_TRANSACTION: {
1571 data.enforceInterface(IActivityManager.descriptor);
1572 ActivityManager.RunningAppProcessInfo info =
1573 new ActivityManager.RunningAppProcessInfo();
1574 getMyMemoryState(info);
1575 reply.writeNoException();
1576 info.writeToParcel(reply, 0);
1577 return true;
1578 }
1579
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001580 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1581 data.enforceInterface(IActivityManager.descriptor);
1582 ConfigurationInfo config = getDeviceConfigurationInfo();
1583 reply.writeNoException();
1584 config.writeToParcel(reply, 0);
1585 return true;
1586 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001587
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001588 case PROFILE_CONTROL_TRANSACTION: {
1589 data.enforceInterface(IActivityManager.descriptor);
1590 String process = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001591 int userId = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001592 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001593 int profileType = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -07001594 ProfilerInfo profilerInfo = data.readInt() != 0
1595 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
1596 boolean res = profileControl(process, userId, start, profilerInfo, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001597 reply.writeNoException();
1598 reply.writeInt(res ? 1 : 0);
1599 return true;
1600 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001601
Dianne Hackborn55280a92009-05-07 15:53:46 -07001602 case SHUTDOWN_TRANSACTION: {
1603 data.enforceInterface(IActivityManager.descriptor);
1604 boolean res = shutdown(data.readInt());
1605 reply.writeNoException();
1606 reply.writeInt(res ? 1 : 0);
1607 return true;
1608 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001609
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001610 case STOP_APP_SWITCHES_TRANSACTION: {
1611 data.enforceInterface(IActivityManager.descriptor);
1612 stopAppSwitches();
1613 reply.writeNoException();
1614 return true;
1615 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001616
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001617 case RESUME_APP_SWITCHES_TRANSACTION: {
1618 data.enforceInterface(IActivityManager.descriptor);
1619 resumeAppSwitches();
1620 reply.writeNoException();
1621 return true;
1622 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001623
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001624 case PEEK_SERVICE_TRANSACTION: {
1625 data.enforceInterface(IActivityManager.descriptor);
1626 Intent service = Intent.CREATOR.createFromParcel(data);
1627 String resolvedType = data.readString();
Svet Ganov99b60432015-06-27 13:15:22 -07001628 String callingPackage = data.readString();
1629 IBinder binder = peekService(service, resolvedType, callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001630 reply.writeNoException();
1631 reply.writeStrongBinder(binder);
1632 return true;
1633 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001634
Christopher Tate181fafa2009-05-14 11:12:14 -07001635 case START_BACKUP_AGENT_TRANSACTION: {
1636 data.enforceInterface(IActivityManager.descriptor);
1637 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1638 int backupRestoreMode = data.readInt();
1639 boolean success = bindBackupAgent(info, backupRestoreMode);
1640 reply.writeNoException();
1641 reply.writeInt(success ? 1 : 0);
1642 return true;
1643 }
1644
1645 case BACKUP_AGENT_CREATED_TRANSACTION: {
1646 data.enforceInterface(IActivityManager.descriptor);
1647 String packageName = data.readString();
1648 IBinder agent = data.readStrongBinder();
1649 backupAgentCreated(packageName, agent);
1650 reply.writeNoException();
1651 return true;
1652 }
1653
1654 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1655 data.enforceInterface(IActivityManager.descriptor);
1656 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1657 unbindBackupAgent(info);
1658 reply.writeNoException();
1659 return true;
1660 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001661
1662 case ADD_PACKAGE_DEPENDENCY_TRANSACTION: {
1663 data.enforceInterface(IActivityManager.descriptor);
1664 String packageName = data.readString();
1665 addPackageDependency(packageName);
1666 reply.writeNoException();
1667 return true;
1668 }
1669
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001670 case KILL_APPLICATION_WITH_APPID_TRANSACTION: {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001671 data.enforceInterface(IActivityManager.descriptor);
1672 String pkg = data.readString();
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001673 int appid = data.readInt();
Dianne Hackborn21d9b562013-05-28 17:46:59 -07001674 String reason = data.readString();
1675 killApplicationWithAppId(pkg, appid, reason);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001676 reply.writeNoException();
1677 return true;
1678 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001679
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001680 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1681 data.enforceInterface(IActivityManager.descriptor);
1682 String reason = data.readString();
1683 closeSystemDialogs(reason);
1684 reply.writeNoException();
1685 return true;
1686 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001687
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001688 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1689 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001690 int[] pids = data.createIntArray();
1691 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001692 reply.writeNoException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001693 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001694 return true;
1695 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001696
1697 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1698 data.enforceInterface(IActivityManager.descriptor);
1699 String processName = data.readString();
1700 int uid = data.readInt();
1701 killApplicationProcess(processName, uid);
1702 reply.writeNoException();
1703 return true;
1704 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001705
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001706 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1707 data.enforceInterface(IActivityManager.descriptor);
1708 IBinder token = data.readStrongBinder();
1709 String packageName = data.readString();
1710 int enterAnim = data.readInt();
1711 int exitAnim = data.readInt();
1712 overridePendingTransition(token, packageName, enterAnim, exitAnim);
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001713 reply.writeNoException();
1714 return true;
1715 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001716
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001717 case IS_USER_A_MONKEY_TRANSACTION: {
1718 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001719 boolean areThey = isUserAMonkey();
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001720 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001721 reply.writeInt(areThey ? 1 : 0);
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001722 return true;
1723 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001724
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07001725 case SET_USER_IS_MONKEY_TRANSACTION: {
1726 data.enforceInterface(IActivityManager.descriptor);
1727 final boolean monkey = (data.readInt() == 1);
1728 setUserIsMonkey(monkey);
1729 reply.writeNoException();
1730 return true;
1731 }
1732
Dianne Hackborn860755f2010-06-03 18:47:52 -07001733 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1734 data.enforceInterface(IActivityManager.descriptor);
1735 finishHeavyWeightApp();
1736 reply.writeNoException();
1737 return true;
1738 }
Daniel Sandler69a48172010-06-23 16:29:36 -04001739
1740 case IS_IMMERSIVE_TRANSACTION: {
1741 data.enforceInterface(IActivityManager.descriptor);
1742 IBinder token = data.readStrongBinder();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001743 boolean isit = isImmersive(token);
Daniel Sandler69a48172010-06-23 16:29:36 -04001744 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001745 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001746 return true;
1747 }
1748
Craig Mautnerd61dc202014-07-07 11:09:11 -07001749 case IS_TOP_OF_TASK_TRANSACTION: {
1750 data.enforceInterface(IActivityManager.descriptor);
1751 IBinder token = data.readStrongBinder();
1752 final boolean isTopOfTask = isTopOfTask(token);
1753 reply.writeNoException();
1754 reply.writeInt(isTopOfTask ? 1 : 0);
1755 return true;
1756 }
1757
Craig Mautner5eda9b32013-07-02 11:58:16 -07001758 case CONVERT_FROM_TRANSLUCENT_TRANSACTION: {
Craig Mautner4addfc52013-06-25 08:05:45 -07001759 data.enforceInterface(IActivityManager.descriptor);
1760 IBinder token = data.readStrongBinder();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001761 boolean converted = convertFromTranslucent(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001762 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001763 reply.writeInt(converted ? 1 : 0);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001764 return true;
1765 }
1766
1767 case CONVERT_TO_TRANSLUCENT_TRANSACTION: {
1768 data.enforceInterface(IActivityManager.descriptor);
1769 IBinder token = data.readStrongBinder();
Craig Mautner233ceee2014-05-09 17:05:11 -07001770 final Bundle bundle;
1771 if (data.readInt() == 0) {
1772 bundle = null;
1773 } else {
1774 bundle = data.readBundle();
1775 }
Chong Zhang280d3322015-11-03 17:27:26 -08001776 final ActivityOptions options = ActivityOptions.fromBundle(bundle);
Craig Mautner233ceee2014-05-09 17:05:11 -07001777 boolean converted = convertToTranslucent(token, options);
Craig Mautner4addfc52013-06-25 08:05:45 -07001778 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001779 reply.writeInt(converted ? 1 : 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07001780 return true;
1781 }
1782
Craig Mautner233ceee2014-05-09 17:05:11 -07001783 case GET_ACTIVITY_OPTIONS_TRANSACTION: {
1784 data.enforceInterface(IActivityManager.descriptor);
1785 IBinder token = data.readStrongBinder();
1786 final ActivityOptions options = getActivityOptions(token);
1787 reply.writeNoException();
1788 reply.writeBundle(options == null ? null : options.toBundle());
1789 return true;
1790 }
1791
Daniel Sandler69a48172010-06-23 16:29:36 -04001792 case SET_IMMERSIVE_TRANSACTION: {
1793 data.enforceInterface(IActivityManager.descriptor);
1794 IBinder token = data.readStrongBinder();
1795 boolean imm = data.readInt() == 1;
1796 setImmersive(token, imm);
1797 reply.writeNoException();
1798 return true;
1799 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001800
Daniel Sandler69a48172010-06-23 16:29:36 -04001801 case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
1802 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001803 boolean isit = isTopActivityImmersive();
Daniel Sandler69a48172010-06-23 16:29:36 -04001804 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001805 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001806 return true;
1807 }
1808
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001809 case CRASH_APPLICATION_TRANSACTION: {
1810 data.enforceInterface(IActivityManager.descriptor);
1811 int uid = data.readInt();
1812 int initialPid = data.readInt();
1813 String packageName = data.readString();
1814 String message = data.readString();
1815 crashApplication(uid, initialPid, packageName, message);
1816 reply.writeNoException();
1817 return true;
1818 }
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001819
1820 case GET_PROVIDER_MIME_TYPE_TRANSACTION: {
1821 data.enforceInterface(IActivityManager.descriptor);
1822 Uri uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001823 int userId = data.readInt();
1824 String type = getProviderMimeType(uri, userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001825 reply.writeNoException();
1826 reply.writeString(type);
1827 return true;
1828 }
1829
Dianne Hackborn7e269642010-08-25 19:50:20 -07001830 case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
1831 data.enforceInterface(IActivityManager.descriptor);
1832 String name = data.readString();
1833 IBinder perm = newUriPermissionOwner(name);
1834 reply.writeNoException();
1835 reply.writeStrongBinder(perm);
1836 return true;
1837 }
1838
1839 case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1840 data.enforceInterface(IActivityManager.descriptor);
1841 IBinder owner = data.readStrongBinder();
1842 int fromUid = data.readInt();
1843 String targetPkg = data.readString();
1844 Uri uri = Uri.CREATOR.createFromParcel(data);
1845 int mode = data.readInt();
Nicolas Prevotf1939902014-06-25 09:29:02 +01001846 int sourceUserId = data.readInt();
1847 int targetUserId = data.readInt();
1848 grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId,
1849 targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001850 reply.writeNoException();
1851 return true;
1852 }
1853
1854 case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1855 data.enforceInterface(IActivityManager.descriptor);
1856 IBinder owner = data.readStrongBinder();
1857 Uri uri = null;
1858 if (data.readInt() != 0) {
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001859 uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001860 }
1861 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001862 int userId = data.readInt();
1863 revokeUriPermissionFromOwner(owner, uri, mode, userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001864 reply.writeNoException();
1865 return true;
1866 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001867
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001868 case CHECK_GRANT_URI_PERMISSION_TRANSACTION: {
1869 data.enforceInterface(IActivityManager.descriptor);
1870 int callingUid = data.readInt();
1871 String targetPkg = data.readString();
1872 Uri uri = Uri.CREATOR.createFromParcel(data);
1873 int modeFlags = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001874 int userId = data.readInt();
1875 int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001876 reply.writeNoException();
1877 reply.writeInt(res);
1878 return true;
1879 }
1880
Andy McFadden824c5102010-07-09 16:26:57 -07001881 case DUMP_HEAP_TRANSACTION: {
1882 data.enforceInterface(IActivityManager.descriptor);
1883 String process = data.readString();
Dianne Hackbornb12e1352012-09-26 11:39:20 -07001884 int userId = data.readInt();
Andy McFadden824c5102010-07-09 16:26:57 -07001885 boolean managed = data.readInt() != 0;
1886 String path = data.readString();
1887 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -07001888 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborn1676c852012-09-10 14:52:30 -07001889 boolean res = dumpHeap(process, userId, managed, path, fd);
Andy McFadden824c5102010-07-09 16:26:57 -07001890 reply.writeNoException();
1891 reply.writeInt(res ? 1 : 0);
1892 return true;
1893 }
1894
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001895 case START_ACTIVITIES_TRANSACTION:
1896 {
1897 data.enforceInterface(IActivityManager.descriptor);
1898 IBinder b = data.readStrongBinder();
1899 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001900 String callingPackage = data.readString();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001901 Intent[] intents = data.createTypedArray(Intent.CREATOR);
1902 String[] resolvedTypes = data.createStringArray();
1903 IBinder resultTo = data.readStrongBinder();
Dianne Hackborna4972e92012-03-14 10:38:05 -07001904 Bundle options = data.readInt() != 0
1905 ? Bundle.CREATOR.createFromParcel(data) : null;
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001906 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001907 int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001908 options, userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001909 reply.writeNoException();
1910 reply.writeInt(result);
1911 return true;
1912 }
1913
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001914 case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1915 {
1916 data.enforceInterface(IActivityManager.descriptor);
1917 int mode = getFrontActivityScreenCompatMode();
1918 reply.writeNoException();
1919 reply.writeInt(mode);
1920 return true;
1921 }
1922
1923 case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1924 {
1925 data.enforceInterface(IActivityManager.descriptor);
1926 int mode = data.readInt();
1927 setFrontActivityScreenCompatMode(mode);
1928 reply.writeNoException();
1929 reply.writeInt(mode);
1930 return true;
1931 }
1932
1933 case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1934 {
1935 data.enforceInterface(IActivityManager.descriptor);
1936 String pkg = data.readString();
1937 int mode = getPackageScreenCompatMode(pkg);
1938 reply.writeNoException();
1939 reply.writeInt(mode);
1940 return true;
1941 }
1942
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001943 case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1944 {
1945 data.enforceInterface(IActivityManager.descriptor);
1946 String pkg = data.readString();
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001947 int mode = data.readInt();
1948 setPackageScreenCompatMode(pkg, mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001949 reply.writeNoException();
1950 return true;
1951 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001952
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001953 case SWITCH_USER_TRANSACTION: {
1954 data.enforceInterface(IActivityManager.descriptor);
1955 int userid = data.readInt();
1956 boolean result = switchUser(userid);
1957 reply.writeNoException();
1958 reply.writeInt(result ? 1 : 0);
1959 return true;
1960 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07001961
Kenny Guy08488bf2014-02-21 17:40:37 +00001962 case START_USER_IN_BACKGROUND_TRANSACTION: {
1963 data.enforceInterface(IActivityManager.descriptor);
1964 int userid = data.readInt();
1965 boolean result = startUserInBackground(userid);
1966 reply.writeNoException();
1967 reply.writeInt(result ? 1 : 0);
1968 return true;
1969 }
1970
Jeff Sharkeyba512352015-11-12 20:17:45 -08001971 case UNLOCK_USER_TRANSACTION: {
1972 data.enforceInterface(IActivityManager.descriptor);
1973 int userId = data.readInt();
1974 byte[] token = data.createByteArray();
1975 boolean result = unlockUser(userId, token);
1976 reply.writeNoException();
1977 reply.writeInt(result ? 1 : 0);
1978 return true;
1979 }
1980
Dianne Hackborn80a4af22012-08-27 19:18:31 -07001981 case STOP_USER_TRANSACTION: {
1982 data.enforceInterface(IActivityManager.descriptor);
1983 int userid = data.readInt();
1984 IStopUserCallback callback = IStopUserCallback.Stub.asInterface(
1985 data.readStrongBinder());
1986 int result = stopUser(userid, callback);
1987 reply.writeNoException();
1988 reply.writeInt(result);
1989 return true;
1990 }
1991
Amith Yamasani52f1d752012-03-28 18:19:29 -07001992 case GET_CURRENT_USER_TRANSACTION: {
1993 data.enforceInterface(IActivityManager.descriptor);
1994 UserInfo userInfo = getCurrentUser();
1995 reply.writeNoException();
1996 userInfo.writeToParcel(reply, 0);
1997 return true;
1998 }
1999
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002000 case IS_USER_RUNNING_TRANSACTION: {
2001 data.enforceInterface(IActivityManager.descriptor);
2002 int userid = data.readInt();
Jeff Sharkeye17ac152015-11-06 22:40:29 -08002003 int _flags = data.readInt();
2004 boolean result = isUserRunning(userid, _flags);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002005 reply.writeNoException();
2006 reply.writeInt(result ? 1 : 0);
2007 return true;
2008 }
2009
Dianne Hackbornc72fc672012-09-20 13:12:03 -07002010 case GET_RUNNING_USER_IDS_TRANSACTION: {
2011 data.enforceInterface(IActivityManager.descriptor);
2012 int[] result = getRunningUserIds();
2013 reply.writeNoException();
2014 reply.writeIntArray(result);
2015 return true;
2016 }
2017
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07002018 case REMOVE_TASK_TRANSACTION:
2019 {
2020 data.enforceInterface(IActivityManager.descriptor);
2021 int taskId = data.readInt();
Wale Ogunwaled54b5782014-10-23 15:55:23 -07002022 boolean result = removeTask(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07002023 reply.writeNoException();
2024 reply.writeInt(result ? 1 : 0);
2025 return true;
2026 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002027
Jeff Sharkeya4620792011-05-20 15:29:23 -07002028 case REGISTER_PROCESS_OBSERVER_TRANSACTION: {
2029 data.enforceInterface(IActivityManager.descriptor);
2030 IProcessObserver observer = IProcessObserver.Stub.asInterface(
2031 data.readStrongBinder());
2032 registerProcessObserver(observer);
2033 return true;
2034 }
2035
2036 case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: {
2037 data.enforceInterface(IActivityManager.descriptor);
2038 IProcessObserver observer = IProcessObserver.Stub.asInterface(
2039 data.readStrongBinder());
2040 unregisterProcessObserver(observer);
2041 return true;
2042 }
2043
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07002044 case REGISTER_UID_OBSERVER_TRANSACTION: {
2045 data.enforceInterface(IActivityManager.descriptor);
2046 IUidObserver observer = IUidObserver.Stub.asInterface(
2047 data.readStrongBinder());
Dianne Hackbornbef28fe2015-10-29 17:57:11 -07002048 int which = data.readInt();
2049 registerUidObserver(observer, which);
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07002050 return true;
2051 }
2052
2053 case UNREGISTER_UID_OBSERVER_TRANSACTION: {
2054 data.enforceInterface(IActivityManager.descriptor);
2055 IUidObserver observer = IUidObserver.Stub.asInterface(
2056 data.readStrongBinder());
2057 unregisterUidObserver(observer);
2058 return true;
2059 }
2060
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07002061 case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
2062 {
2063 data.enforceInterface(IActivityManager.descriptor);
2064 String pkg = data.readString();
2065 boolean ask = getPackageAskScreenCompat(pkg);
2066 reply.writeNoException();
2067 reply.writeInt(ask ? 1 : 0);
2068 return true;
2069 }
2070
2071 case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
2072 {
2073 data.enforceInterface(IActivityManager.descriptor);
2074 String pkg = data.readString();
2075 boolean ask = data.readInt() != 0;
2076 setPackageAskScreenCompat(pkg, ask);
2077 reply.writeNoException();
2078 return true;
2079 }
2080
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002081 case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: {
2082 data.enforceInterface(IActivityManager.descriptor);
2083 IIntentSender r = IIntentSender.Stub.asInterface(
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002084 data.readStrongBinder());
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002085 boolean res = isIntentSenderTargetedToPackage(r);
2086 reply.writeNoException();
2087 reply.writeInt(res ? 1 : 0);
2088 return true;
2089 }
2090
Dianne Hackborn1927ae82012-06-22 15:21:36 -07002091 case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: {
2092 data.enforceInterface(IActivityManager.descriptor);
2093 IIntentSender r = IIntentSender.Stub.asInterface(
2094 data.readStrongBinder());
2095 boolean res = isIntentSenderAnActivity(r);
2096 reply.writeNoException();
2097 reply.writeInt(res ? 1 : 0);
2098 return true;
2099 }
2100
Dianne Hackborn81038902012-11-26 17:04:09 -08002101 case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: {
2102 data.enforceInterface(IActivityManager.descriptor);
2103 IIntentSender r = IIntentSender.Stub.asInterface(
2104 data.readStrongBinder());
2105 Intent intent = getIntentForIntentSender(r);
2106 reply.writeNoException();
2107 if (intent != null) {
2108 reply.writeInt(1);
2109 intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2110 } else {
2111 reply.writeInt(0);
2112 }
2113 return true;
2114 }
2115
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08002116 case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: {
2117 data.enforceInterface(IActivityManager.descriptor);
2118 IIntentSender r = IIntentSender.Stub.asInterface(
2119 data.readStrongBinder());
2120 String prefix = data.readString();
2121 String tag = getTagForIntentSender(r, prefix);
2122 reply.writeNoException();
2123 reply.writeString(tag);
2124 return true;
2125 }
2126
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002127 case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
2128 data.enforceInterface(IActivityManager.descriptor);
2129 Configuration config = Configuration.CREATOR.createFromParcel(data);
2130 updatePersistentConfiguration(config);
2131 reply.writeNoException();
2132 return true;
2133 }
2134
Dianne Hackbornb437e092011-08-05 17:50:29 -07002135 case GET_PROCESS_PSS_TRANSACTION: {
2136 data.enforceInterface(IActivityManager.descriptor);
2137 int[] pids = data.createIntArray();
2138 long[] pss = getProcessPss(pids);
2139 reply.writeNoException();
2140 reply.writeLongArray(pss);
2141 return true;
2142 }
2143
Dianne Hackborn661cd522011-08-22 00:26:20 -07002144 case SHOW_BOOT_MESSAGE_TRANSACTION: {
2145 data.enforceInterface(IActivityManager.descriptor);
2146 CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
2147 boolean always = data.readInt() != 0;
2148 showBootMessage(msg, always);
2149 reply.writeNoException();
2150 return true;
2151 }
2152
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002153 case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002154 data.enforceInterface(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002155 keyguardWaitingForActivityDrawn();
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002156 reply.writeNoException();
2157 return true;
2158 }
2159
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07002160 case KEYGUARD_GOING_AWAY_TRANSACTION: {
2161 data.enforceInterface(IActivityManager.descriptor);
2162 keyguardGoingAway(data.readInt() != 0, data.readInt() != 0);
2163 reply.writeNoException();
2164 return true;
2165 }
2166
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002167 case SHOULD_UP_RECREATE_TASK_TRANSACTION: {
Adam Powelldd8fab22012-03-22 17:47:27 -07002168 data.enforceInterface(IActivityManager.descriptor);
2169 IBinder token = data.readStrongBinder();
2170 String destAffinity = data.readString();
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002171 boolean res = shouldUpRecreateTask(token, destAffinity);
Adam Powelldd8fab22012-03-22 17:47:27 -07002172 reply.writeNoException();
2173 reply.writeInt(res ? 1 : 0);
2174 return true;
2175 }
2176
2177 case NAVIGATE_UP_TO_TRANSACTION: {
2178 data.enforceInterface(IActivityManager.descriptor);
2179 IBinder token = data.readStrongBinder();
2180 Intent target = Intent.CREATOR.createFromParcel(data);
2181 int resultCode = data.readInt();
2182 Intent resultData = null;
2183 if (data.readInt() != 0) {
2184 resultData = Intent.CREATOR.createFromParcel(data);
2185 }
2186 boolean res = navigateUpTo(token, target, resultCode, resultData);
2187 reply.writeNoException();
2188 reply.writeInt(res ? 1 : 0);
2189 return true;
2190 }
2191
Dianne Hackborn5320eb82012-05-18 12:05:04 -07002192 case GET_LAUNCHED_FROM_UID_TRANSACTION: {
2193 data.enforceInterface(IActivityManager.descriptor);
2194 IBinder token = data.readStrongBinder();
2195 int res = getLaunchedFromUid(token);
2196 reply.writeNoException();
2197 reply.writeInt(res);
2198 return true;
2199 }
2200
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002201 case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: {
2202 data.enforceInterface(IActivityManager.descriptor);
2203 IBinder token = data.readStrongBinder();
2204 String res = getLaunchedFromPackage(token);
2205 reply.writeNoException();
2206 reply.writeString(res);
2207 return true;
2208 }
2209
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002210 case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2211 data.enforceInterface(IActivityManager.descriptor);
2212 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2213 data.readStrongBinder());
2214 registerUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002215 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002216 return true;
2217 }
2218
2219 case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2220 data.enforceInterface(IActivityManager.descriptor);
2221 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2222 data.readStrongBinder());
2223 unregisterUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002224 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002225 return true;
2226 }
2227
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002228 case REQUEST_BUG_REPORT_TRANSACTION: {
2229 data.enforceInterface(IActivityManager.descriptor);
2230 requestBugReport();
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002231 reply.writeNoException();
2232 return true;
2233 }
2234
2235 case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: {
2236 data.enforceInterface(IActivityManager.descriptor);
2237 int pid = data.readInt();
2238 boolean aboveSystem = data.readInt() != 0;
Jeff Brownbd181bb2013-09-10 16:44:24 -07002239 String reason = data.readString();
2240 long res = inputDispatchingTimedOut(pid, aboveSystem, reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002241 reply.writeNoException();
2242 reply.writeLong(res);
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002243 return true;
2244 }
2245
Adam Skorydfc7fd72013-08-05 19:23:41 -07002246 case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002247 data.enforceInterface(IActivityManager.descriptor);
2248 int requestType = data.readInt();
Adam Skorydfc7fd72013-08-05 19:23:41 -07002249 Bundle res = getAssistContextExtras(requestType);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002250 reply.writeNoException();
2251 reply.writeBundle(res);
2252 return true;
2253 }
2254
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002255 case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
2256 data.enforceInterface(IActivityManager.descriptor);
2257 int requestType = data.readInt();
2258 IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder());
Dianne Hackborn17f69352015-07-17 18:04:14 -07002259 IBinder activityToken = data.readStrongBinder();
2260 boolean res = requestAssistContextExtras(requestType, receiver, activityToken);
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002261 reply.writeNoException();
Dianne Hackborn17f69352015-07-17 18:04:14 -07002262 reply.writeInt(res ? 1 : 0);
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002263 return true;
2264 }
2265
Adam Skorydfc7fd72013-08-05 19:23:41 -07002266 case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002267 data.enforceInterface(IActivityManager.descriptor);
2268 IBinder token = data.readStrongBinder();
2269 Bundle extras = data.readBundle();
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07002270 AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data);
2271 AssistContent content = AssistContent.CREATOR.createFromParcel(data);
Dianne Hackborna3acdb32015-06-08 17:07:40 -07002272 Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null;
2273 reportAssistContextExtras(token, extras, structure, content, referrer);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002274 reply.writeNoException();
2275 return true;
2276 }
2277
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002278 case LAUNCH_ASSIST_INTENT_TRANSACTION: {
2279 data.enforceInterface(IActivityManager.descriptor);
2280 Intent intent = Intent.CREATOR.createFromParcel(data);
2281 int requestType = data.readInt();
2282 String hint = data.readString();
2283 int userHandle = data.readInt();
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07002284 Bundle args = data.readBundle();
2285 boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args);
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002286 reply.writeNoException();
2287 reply.writeInt(res ? 1 : 0);
2288 return true;
2289 }
2290
Benjamin Franzc200f442015-06-25 18:20:04 +01002291 case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: {
2292 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn17f69352015-07-17 18:04:14 -07002293 boolean res = isAssistDataAllowedOnCurrentActivity();
2294 reply.writeNoException();
2295 reply.writeInt(res ? 1 : 0);
2296 return true;
2297 }
2298
2299 case SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION: {
2300 data.enforceInterface(IActivityManager.descriptor);
2301 IBinder token = data.readStrongBinder();
2302 Bundle args = data.readBundle();
2303 boolean res = showAssistFromActivity(token, args);
Benjamin Franzc200f442015-06-25 18:20:04 +01002304 reply.writeNoException();
2305 reply.writeInt(res ? 1 : 0);
2306 return true;
2307 }
2308
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002309 case KILL_UID_TRANSACTION: {
2310 data.enforceInterface(IActivityManager.descriptor);
Svetoslavaa41add2015-08-06 15:03:55 -07002311 int appId = data.readInt();
2312 int userId = data.readInt();
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002313 String reason = data.readString();
Svetoslavaa41add2015-08-06 15:03:55 -07002314 killUid(appId, userId, reason);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002315 reply.writeNoException();
2316 return true;
2317 }
2318
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07002319 case HANG_TRANSACTION: {
2320 data.enforceInterface(IActivityManager.descriptor);
2321 IBinder who = data.readStrongBinder();
2322 boolean allowRestart = data.readInt() != 0;
2323 hang(who, allowRestart);
2324 reply.writeNoException();
2325 return true;
2326 }
2327
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07002328 case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: {
2329 data.enforceInterface(IActivityManager.descriptor);
2330 IBinder token = data.readStrongBinder();
2331 reportActivityFullyDrawn(token);
2332 reply.writeNoException();
2333 return true;
2334 }
2335
Craig Mautner5eda9b32013-07-02 11:58:16 -07002336 case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: {
2337 data.enforceInterface(IActivityManager.descriptor);
2338 IBinder token = data.readStrongBinder();
2339 notifyActivityDrawn(token);
2340 reply.writeNoException();
2341 return true;
2342 }
Dianne Hackborn57a7f592013-07-22 18:21:32 -07002343
2344 case RESTART_TRANSACTION: {
2345 data.enforceInterface(IActivityManager.descriptor);
2346 restart();
2347 reply.writeNoException();
2348 return true;
2349 }
Jeff Sharkey08da7a12013-08-11 20:53:18 -07002350
Dianne Hackborn35f72be2013-09-16 10:57:39 -07002351 case PERFORM_IDLE_MAINTENANCE_TRANSACTION: {
2352 data.enforceInterface(IActivityManager.descriptor);
2353 performIdleMaintenance();
2354 reply.writeNoException();
2355 return true;
2356 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002357
Todd Kennedyca4d8422015-01-15 15:19:22 -08002358 case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: {
Craig Mautner4a1cb222013-12-04 16:14:06 -08002359 data.enforceInterface(IActivityManager.descriptor);
2360 IBinder parentActivityToken = data.readStrongBinder();
2361 IActivityContainerCallback callback =
Craig Mautnere3a00d72014-04-16 08:31:19 -07002362 IActivityContainerCallback.Stub.asInterface(data.readStrongBinder());
Craig Mautner4a1cb222013-12-04 16:14:06 -08002363 IActivityContainer activityContainer =
Todd Kennedyca4d8422015-01-15 15:19:22 -08002364 createVirtualActivityContainer(parentActivityToken, callback);
Craig Mautner4a1cb222013-12-04 16:14:06 -08002365 reply.writeNoException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08002366 if (activityContainer != null) {
2367 reply.writeInt(1);
2368 reply.writeStrongBinder(activityContainer.asBinder());
2369 } else {
2370 reply.writeInt(0);
2371 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002372 return true;
2373 }
2374
Craig Mautner95da1082014-02-24 17:54:35 -08002375 case DELETE_ACTIVITY_CONTAINER_TRANSACTION: {
2376 data.enforceInterface(IActivityManager.descriptor);
2377 IActivityContainer activityContainer =
2378 IActivityContainer.Stub.asInterface(data.readStrongBinder());
2379 deleteActivityContainer(activityContainer);
2380 reply.writeNoException();
2381 return true;
2382 }
2383
Todd Kennedy4900bf92015-01-16 16:05:14 -08002384 case CREATE_STACK_ON_DISPLAY: {
2385 data.enforceInterface(IActivityManager.descriptor);
2386 int displayId = data.readInt();
2387 IActivityContainer activityContainer = createStackOnDisplay(displayId);
2388 reply.writeNoException();
2389 if (activityContainer != null) {
2390 reply.writeInt(1);
2391 reply.writeStrongBinder(activityContainer.asBinder());
2392 } else {
2393 reply.writeInt(0);
2394 }
2395 return true;
2396 }
2397
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002398 case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: {
Craig Mautnere0a38842013-12-16 16:14:02 -08002399 data.enforceInterface(IActivityManager.descriptor);
2400 IBinder activityToken = data.readStrongBinder();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002401 int displayId = getActivityDisplayId(activityToken);
Craig Mautnere0a38842013-12-16 16:14:02 -08002402 reply.writeNoException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002403 reply.writeInt(displayId);
Craig Mautnere0a38842013-12-16 16:14:02 -08002404 return true;
2405 }
2406
Craig Mautneraea74a52014-03-08 14:23:10 -08002407 case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: {
2408 data.enforceInterface(IActivityManager.descriptor);
2409 final int taskId = data.readInt();
2410 startLockTaskMode(taskId);
2411 reply.writeNoException();
2412 return true;
2413 }
2414
2415 case START_LOCK_TASK_BY_TOKEN_TRANSACTION: {
2416 data.enforceInterface(IActivityManager.descriptor);
2417 IBinder token = data.readStrongBinder();
2418 startLockTaskMode(token);
2419 reply.writeNoException();
2420 return true;
2421 }
2422
Craig Mautnerd61dc202014-07-07 11:09:11 -07002423 case START_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002424 data.enforceInterface(IActivityManager.descriptor);
2425 startLockTaskModeOnCurrent();
2426 reply.writeNoException();
2427 return true;
2428 }
2429
Craig Mautneraea74a52014-03-08 14:23:10 -08002430 case STOP_LOCK_TASK_MODE_TRANSACTION: {
2431 data.enforceInterface(IActivityManager.descriptor);
2432 stopLockTaskMode();
2433 reply.writeNoException();
2434 return true;
2435 }
2436
Craig Mautnerd61dc202014-07-07 11:09:11 -07002437 case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002438 data.enforceInterface(IActivityManager.descriptor);
2439 stopLockTaskModeOnCurrent();
2440 reply.writeNoException();
2441 return true;
2442 }
2443
Craig Mautneraea74a52014-03-08 14:23:10 -08002444 case IS_IN_LOCK_TASK_MODE_TRANSACTION: {
2445 data.enforceInterface(IActivityManager.descriptor);
2446 final boolean isInLockTaskMode = isInLockTaskMode();
2447 reply.writeNoException();
2448 reply.writeInt(isInLockTaskMode ? 1 : 0);
2449 return true;
2450 }
Craig Mautner2fbd7542014-03-21 09:34:07 -07002451
Benjamin Franz43261142015-02-11 15:59:44 +00002452 case GET_LOCK_TASK_MODE_STATE_TRANSACTION: {
2453 data.enforceInterface(IActivityManager.descriptor);
2454 final int lockTaskModeState = getLockTaskModeState();
2455 reply.writeNoException();
2456 reply.writeInt(lockTaskModeState);
2457 return true;
2458 }
2459
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07002460 case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: {
2461 data.enforceInterface(IActivityManager.descriptor);
2462 final IBinder token = data.readStrongBinder();
2463 showLockTaskEscapeMessage(token);
2464 reply.writeNoException();
2465 return true;
2466 }
2467
Winson Chunga449dc02014-05-16 11:15:04 -07002468 case SET_TASK_DESCRIPTION_TRANSACTION: {
Craig Mautner2fbd7542014-03-21 09:34:07 -07002469 data.enforceInterface(IActivityManager.descriptor);
2470 IBinder token = data.readStrongBinder();
Winson Chunga449dc02014-05-16 11:15:04 -07002471 ActivityManager.TaskDescription values =
2472 ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
2473 setTaskDescription(token, values);
Craig Mautner2fbd7542014-03-21 09:34:07 -07002474 reply.writeNoException();
2475 return true;
2476 }
Craig Mautneree2e45a2014-06-27 12:10:03 -07002477
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08002478 case SET_TASK_RESIZEABLE_TRANSACTION: {
2479 data.enforceInterface(IActivityManager.descriptor);
2480 int taskId = data.readInt();
2481 boolean resizeable = (data.readInt() == 1) ? true : false;
2482 setTaskResizeable(taskId, resizeable);
2483 reply.writeNoException();
2484 return true;
2485 }
2486
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002487 case RESIZE_TASK_TRANSACTION: {
2488 data.enforceInterface(IActivityManager.descriptor);
2489 int taskId = data.readInt();
Chong Zhang87b21722015-09-21 15:39:51 -07002490 int resizeMode = data.readInt();
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002491 Rect r = Rect.CREATOR.createFromParcel(data);
Chong Zhang87b21722015-09-21 15:39:51 -07002492 resizeTask(taskId, r, resizeMode);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002493 reply.writeNoException();
2494 return true;
2495 }
2496
Wale Ogunwalee4a0c572015-06-30 08:40:31 -07002497 case GET_TASK_BOUNDS_TRANSACTION: {
2498 data.enforceInterface(IActivityManager.descriptor);
2499 int taskId = data.readInt();
2500 Rect r = getTaskBounds(taskId);
2501 reply.writeNoException();
2502 r.writeToParcel(reply, 0);
2503 return true;
2504 }
2505
Craig Mautner648f69b2014-09-18 14:16:26 -07002506 case GET_TASK_DESCRIPTION_ICON_TRANSACTION: {
2507 data.enforceInterface(IActivityManager.descriptor);
2508 String filename = data.readString();
Suprabh Shukla23593142015-11-03 17:31:15 -08002509 int userId = data.readInt();
2510 Bitmap icon = getTaskDescriptionIcon(filename, userId);
Craig Mautner648f69b2014-09-18 14:16:26 -07002511 reply.writeNoException();
2512 if (icon == null) {
2513 reply.writeInt(0);
2514 } else {
2515 reply.writeInt(1);
2516 icon.writeToParcel(reply, 0);
2517 }
2518 return true;
2519 }
2520
Winson Chung044d5292014-11-06 11:05:19 -08002521 case START_IN_PLACE_ANIMATION_TRANSACTION: {
2522 data.enforceInterface(IActivityManager.descriptor);
2523 final Bundle bundle;
2524 if (data.readInt() == 0) {
2525 bundle = null;
2526 } else {
2527 bundle = data.readBundle();
2528 }
Chong Zhang280d3322015-11-03 17:27:26 -08002529 final ActivityOptions options = ActivityOptions.fromBundle(bundle);
Winson Chung044d5292014-11-06 11:05:19 -08002530 startInPlaceAnimationOnFrontMostApplication(options);
2531 reply.writeNoException();
2532 return true;
2533 }
2534
Jose Lima4b6c6692014-08-12 17:41:12 -07002535 case REQUEST_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002536 data.enforceInterface(IActivityManager.descriptor);
2537 IBinder token = data.readStrongBinder();
2538 boolean enable = data.readInt() > 0;
Jose Lima4b6c6692014-08-12 17:41:12 -07002539 boolean success = requestVisibleBehind(token, enable);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002540 reply.writeNoException();
2541 reply.writeInt(success ? 1 : 0);
2542 return true;
2543 }
2544
Jose Lima4b6c6692014-08-12 17:41:12 -07002545 case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002546 data.enforceInterface(IActivityManager.descriptor);
2547 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002548 final boolean enabled = isBackgroundVisibleBehind(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002549 reply.writeNoException();
2550 reply.writeInt(enabled ? 1 : 0);
2551 return true;
2552 }
2553
Jose Lima4b6c6692014-08-12 17:41:12 -07002554 case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002555 data.enforceInterface(IActivityManager.descriptor);
2556 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002557 backgroundResourcesReleased(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002558 reply.writeNoException();
2559 return true;
2560 }
Craig Mautnerbb742462014-07-07 15:28:55 -07002561
2562 case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: {
2563 data.enforceInterface(IActivityManager.descriptor);
2564 IBinder token = data.readStrongBinder();
2565 notifyLaunchTaskBehindComplete(token);
2566 reply.writeNoException();
2567 return true;
2568 }
Craig Mautner8746a472014-07-24 15:12:54 -07002569
2570 case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: {
2571 data.enforceInterface(IActivityManager.descriptor);
2572 IBinder token = data.readStrongBinder();
2573 notifyEnterAnimationComplete(token);
2574 reply.writeNoException();
2575 return true;
2576 }
Craig Mautner6e2f3952014-09-09 14:26:41 -07002577
2578 case BOOT_ANIMATION_COMPLETE_TRANSACTION: {
2579 data.enforceInterface(IActivityManager.descriptor);
2580 bootAnimationComplete();
2581 reply.writeNoException();
2582 return true;
2583 }
Wale Ogunwale18795a22014-12-03 11:38:33 -08002584
Jeff Sharkey605eb792014-11-04 13:34:06 -08002585 case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: {
2586 data.enforceInterface(IActivityManager.descriptor);
2587 final int uid = data.readInt();
2588 final byte[] firstPacket = data.createByteArray();
2589 notifyCleartextNetwork(uid, firstPacket);
2590 reply.writeNoException();
2591 return true;
2592 }
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002593
2594 case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: {
2595 data.enforceInterface(IActivityManager.descriptor);
2596 String procName = data.readString();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002597 int uid = data.readInt();
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002598 long maxMemSize = data.readLong();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002599 String reportPackage = data.readString();
2600 setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002601 reply.writeNoException();
2602 return true;
2603 }
2604
2605 case DUMP_HEAP_FINISHED_TRANSACTION: {
2606 data.enforceInterface(IActivityManager.descriptor);
2607 String path = data.readString();
2608 dumpHeapFinished(path);
2609 reply.writeNoException();
2610 return true;
2611 }
Dianne Hackborn3d07c942015-03-13 18:02:54 -07002612
2613 case SET_VOICE_KEEP_AWAKE_TRANSACTION: {
2614 data.enforceInterface(IActivityManager.descriptor);
2615 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
2616 data.readStrongBinder());
2617 boolean keepAwake = data.readInt() != 0;
2618 setVoiceKeepAwake(session, keepAwake);
2619 reply.writeNoException();
2620 return true;
2621 }
Craig Mautnere5600772015-04-03 21:36:37 -07002622
2623 case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: {
2624 data.enforceInterface(IActivityManager.descriptor);
2625 int userId = data.readInt();
2626 String[] packages = data.readStringArray();
2627 updateLockTaskPackages(userId, packages);
2628 reply.writeNoException();
2629 return true;
2630 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07002631
Makoto Onuki219bbaf2015-11-12 01:38:47 +00002632 case UPDATE_DEVICE_OWNER_TRANSACTION: {
2633 data.enforceInterface(IActivityManager.descriptor);
2634 String packageName = data.readString();
2635 updateDeviceOwner(packageName);
2636 reply.writeNoException();
2637 return true;
2638 }
2639
Dianne Hackborn1e383822015-04-10 14:02:33 -07002640 case GET_PACKAGE_PROCESS_STATE_TRANSACTION: {
2641 data.enforceInterface(IActivityManager.descriptor);
2642 String pkg = data.readString();
Adam Lesinskic30454c2015-06-24 13:24:35 -07002643 String callingPackage = data.readString();
2644 int res = getPackageProcessState(pkg, callingPackage);
Dianne Hackborn1e383822015-04-10 14:02:33 -07002645 reply.writeNoException();
2646 reply.writeInt(res);
2647 return true;
2648 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07002649
2650 case SET_PROCESS_MEMORY_TRIM_TRANSACTION: {
2651 data.enforceInterface(IActivityManager.descriptor);
2652 String process = data.readString();
2653 int userId = data.readInt();
2654 int level = data.readInt();
2655 boolean res = setProcessMemoryTrimLevel(process, userId, level);
2656 reply.writeNoException();
2657 reply.writeInt(res ? 1 : 0);
2658 return true;
2659 }
Rahul Chaturvedi52613f92015-06-17 23:54:08 -04002660
Dianne Hackbornfb81d092015-08-03 17:14:46 -07002661 case IS_ROOT_VOICE_INTERACTION_TRANSACTION: {
2662 data.enforceInterface(IActivityManager.descriptor);
2663 IBinder token = data.readStrongBinder();
2664 boolean res = isRootVoiceInteraction(token);
2665 reply.writeNoException();
2666 reply.writeInt(res ? 1 : 0);
2667 return true;
2668 }
Ian Pedowitza3710842015-08-03 23:36:15 -07002669
Rahul Chaturvedi52613f92015-06-17 23:54:08 -04002670 case START_BINDER_TRACKING_TRANSACTION: {
2671 data.enforceInterface(IActivityManager.descriptor);
2672 boolean res = startBinderTracking();
2673 reply.writeNoException();
2674 reply.writeInt(res ? 1 : 0);
2675 return true;
2676 }
2677
2678 case STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION: {
2679 data.enforceInterface(IActivityManager.descriptor);
2680 ParcelFileDescriptor fd = data.readInt() != 0
2681 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
2682 boolean res = stopBinderTrackingAndDump(fd);
2683 reply.writeNoException();
2684 reply.writeInt(res ? 1 : 0);
2685 return true;
2686 }
Wale Ogunwale868a5e12015-08-02 16:19:20 -07002687 case GET_ACTIVITY_STACK_ID_TRANSACTION: {
2688 data.enforceInterface(IActivityManager.descriptor);
2689 IBinder token = data.readStrongBinder();
2690 int stackId = getActivityStackId(token);
2691 reply.writeNoException();
2692 reply.writeInt(stackId);
2693 return true;
2694 }
2695 case MOVE_ACTIVITY_TO_STACK_TRANSACTION: {
2696 data.enforceInterface(IActivityManager.descriptor);
2697 IBinder token = data.readStrongBinder();
2698 int stackId = data.readInt();
2699 moveActivityToStack(token, stackId);
2700 reply.writeNoException();
2701 return true;
2702 }
Filip Gruszczynski23493322015-07-29 17:02:59 -07002703 case REPORT_SIZE_CONFIGURATIONS: {
2704 data.enforceInterface(IActivityManager.descriptor);
2705 IBinder token = data.readStrongBinder();
Filip Gruszczynski20aa0ae2015-10-30 10:08:27 -07002706 int[] horizontal = readIntArray(data);
2707 int[] vertical = readIntArray(data);
2708 int[] smallest = readIntArray(data);
2709 reportSizeConfigurations(token, horizontal, vertical, smallest);
Filip Gruszczynski23493322015-07-29 17:02:59 -07002710 return true;
2711 }
Wale Ogunwale83301a92015-09-24 15:54:08 -07002712 case SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION: {
2713 data.enforceInterface(IActivityManager.descriptor);
2714 final boolean suppress = data.readInt() == 1;
2715 suppressResizeConfigChanges(suppress);
2716 reply.writeNoException();
2717 return true;
2718 }
Dianne Hackbornbef28fe2015-10-29 17:57:11 -07002719 case REMOVE_STACK_TRANSACTION: {
Filip Gruszczynski57b6cce2015-10-06 09:50:51 -07002720 data.enforceInterface(IActivityManager.descriptor);
2721 final int stackId = data.readInt();
2722 removeStack(stackId);
2723 reply.writeNoException();
2724 return true;
2725 }
Dianne Hackbornbef28fe2015-10-29 17:57:11 -07002726 case GET_APP_START_MODE_TRANSACTION: {
2727 data.enforceInterface(IActivityManager.descriptor);
2728 final int uid = data.readInt();
2729 final String pkg = data.readString();
2730 int res = getAppStartMode(uid, pkg);
2731 reply.writeNoException();
2732 reply.writeInt(res);
2733 return true;
2734 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002735 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002736
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002737 return super.onTransact(code, data, reply, flags);
2738 }
2739
Filip Gruszczynski20aa0ae2015-10-30 10:08:27 -07002740 private int[] readIntArray(Parcel data) {
2741 int[] smallest = null;
2742 int smallestSize = data.readInt();
2743 if (smallestSize > 0) {
2744 smallest = new int[smallestSize];
2745 data.readIntArray(smallest);
2746 }
2747 return smallest;
2748 }
2749
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002750 public IBinder asBinder() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002751 return this;
2752 }
2753
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002754 private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
2755 protected IActivityManager create() {
2756 IBinder b = ServiceManager.getService("activity");
Joe Onorato43a17652011-04-06 19:22:23 -07002757 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002758 Log.v("ActivityManager", "default service binder = " + b);
2759 }
2760 IActivityManager am = asInterface(b);
Joe Onorato43a17652011-04-06 19:22:23 -07002761 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002762 Log.v("ActivityManager", "default service = " + am);
2763 }
2764 return am;
2765 }
2766 };
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002767}
2768
2769class ActivityManagerProxy implements IActivityManager
2770{
2771 public ActivityManagerProxy(IBinder remote)
2772 {
2773 mRemote = remote;
2774 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002775
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002776 public IBinder asBinder()
2777 {
2778 return mRemote;
2779 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002780
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002781 public int startActivity(IApplicationThread caller, String callingPackage, Intent intent,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002782 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002783 int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002784 Parcel data = Parcel.obtain();
2785 Parcel reply = Parcel.obtain();
2786 data.writeInterfaceToken(IActivityManager.descriptor);
2787 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002788 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002789 intent.writeToParcel(data, 0);
2790 data.writeString(resolvedType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002791 data.writeStrongBinder(resultTo);
2792 data.writeString(resultWho);
2793 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002794 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002795 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002796 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002797 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002798 } else {
2799 data.writeInt(0);
2800 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002801 if (options != null) {
2802 data.writeInt(1);
2803 options.writeToParcel(data, 0);
2804 } else {
2805 data.writeInt(0);
2806 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002807 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2808 reply.readException();
2809 int result = reply.readInt();
2810 reply.recycle();
2811 data.recycle();
2812 return result;
2813 }
Amith Yamasani82644082012-08-03 13:09:11 -07002814
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002815 public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent,
Amith Yamasani82644082012-08-03 13:09:11 -07002816 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002817 int startFlags, ProfilerInfo profilerInfo, Bundle options,
2818 int userId) throws RemoteException {
Amith Yamasani82644082012-08-03 13:09:11 -07002819 Parcel data = Parcel.obtain();
2820 Parcel reply = Parcel.obtain();
2821 data.writeInterfaceToken(IActivityManager.descriptor);
2822 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002823 data.writeString(callingPackage);
Amith Yamasani82644082012-08-03 13:09:11 -07002824 intent.writeToParcel(data, 0);
2825 data.writeString(resolvedType);
2826 data.writeStrongBinder(resultTo);
2827 data.writeString(resultWho);
2828 data.writeInt(requestCode);
2829 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002830 if (profilerInfo != null) {
Amith Yamasani82644082012-08-03 13:09:11 -07002831 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002832 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Amith Yamasani82644082012-08-03 13:09:11 -07002833 } else {
2834 data.writeInt(0);
2835 }
2836 if (options != null) {
2837 data.writeInt(1);
2838 options.writeToParcel(data, 0);
2839 } else {
2840 data.writeInt(0);
2841 }
2842 data.writeInt(userId);
2843 mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0);
2844 reply.readException();
2845 int result = reply.readInt();
2846 reply.recycle();
2847 data.recycle();
2848 return result;
2849 }
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002850 public int startActivityAsCaller(IApplicationThread caller, String callingPackage,
2851 Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna7cfbe02015-07-16 10:52:52 -07002852 int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity,
2853 int userId) throws RemoteException {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002854 Parcel data = Parcel.obtain();
2855 Parcel reply = Parcel.obtain();
2856 data.writeInterfaceToken(IActivityManager.descriptor);
2857 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2858 data.writeString(callingPackage);
2859 intent.writeToParcel(data, 0);
2860 data.writeString(resolvedType);
2861 data.writeStrongBinder(resultTo);
2862 data.writeString(resultWho);
2863 data.writeInt(requestCode);
2864 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002865 if (profilerInfo != null) {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002866 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002867 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002868 } else {
2869 data.writeInt(0);
2870 }
2871 if (options != null) {
2872 data.writeInt(1);
2873 options.writeToParcel(data, 0);
2874 } else {
2875 data.writeInt(0);
2876 }
Dianne Hackborna7cfbe02015-07-16 10:52:52 -07002877 data.writeInt(ignoreTargetSecurity ? 1 : 0);
Jeff Sharkey97978802014-10-14 10:48:18 -07002878 data.writeInt(userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002879 mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0);
2880 reply.readException();
2881 int result = reply.readInt();
2882 reply.recycle();
2883 data.recycle();
2884 return result;
2885 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002886 public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage,
2887 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Jeff Hao1b012d32014-08-20 10:35:34 -07002888 int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options,
2889 int userId) throws RemoteException {
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002890 Parcel data = Parcel.obtain();
2891 Parcel reply = Parcel.obtain();
2892 data.writeInterfaceToken(IActivityManager.descriptor);
2893 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002894 data.writeString(callingPackage);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002895 intent.writeToParcel(data, 0);
2896 data.writeString(resolvedType);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002897 data.writeStrongBinder(resultTo);
2898 data.writeString(resultWho);
2899 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002900 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002901 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002902 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002903 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002904 } else {
2905 data.writeInt(0);
2906 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002907 if (options != null) {
2908 data.writeInt(1);
2909 options.writeToParcel(data, 0);
2910 } else {
2911 data.writeInt(0);
2912 }
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002913 data.writeInt(userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002914 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
2915 reply.readException();
2916 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
2917 reply.recycle();
2918 data.recycle();
2919 return result;
2920 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002921 public int startActivityWithConfig(IApplicationThread caller, String callingPackage,
2922 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002923 int requestCode, int startFlags, Configuration config,
Dianne Hackborn41203752012-08-31 14:05:51 -07002924 Bundle options, int userId) throws RemoteException {
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002925 Parcel data = Parcel.obtain();
2926 Parcel reply = Parcel.obtain();
2927 data.writeInterfaceToken(IActivityManager.descriptor);
2928 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002929 data.writeString(callingPackage);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002930 intent.writeToParcel(data, 0);
2931 data.writeString(resolvedType);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002932 data.writeStrongBinder(resultTo);
2933 data.writeString(resultWho);
2934 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002935 data.writeInt(startFlags);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002936 config.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002937 if (options != null) {
2938 data.writeInt(1);
2939 options.writeToParcel(data, 0);
2940 } else {
2941 data.writeInt(0);
2942 }
Dianne Hackborn41203752012-08-31 14:05:51 -07002943 data.writeInt(userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002944 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2945 reply.readException();
2946 int result = reply.readInt();
2947 reply.recycle();
2948 data.recycle();
2949 return result;
2950 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002951 public int startActivityIntentSender(IApplicationThread caller,
2952 IntentSender intent, Intent fillInIntent, String resolvedType,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002953 IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002954 int flagsMask, int flagsValues, Bundle options) throws RemoteException {
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002955 Parcel data = Parcel.obtain();
2956 Parcel reply = Parcel.obtain();
2957 data.writeInterfaceToken(IActivityManager.descriptor);
2958 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2959 intent.writeToParcel(data, 0);
2960 if (fillInIntent != null) {
2961 data.writeInt(1);
2962 fillInIntent.writeToParcel(data, 0);
2963 } else {
2964 data.writeInt(0);
2965 }
2966 data.writeString(resolvedType);
2967 data.writeStrongBinder(resultTo);
2968 data.writeString(resultWho);
2969 data.writeInt(requestCode);
2970 data.writeInt(flagsMask);
2971 data.writeInt(flagsValues);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002972 if (options != null) {
2973 data.writeInt(1);
2974 options.writeToParcel(data, 0);
2975 } else {
2976 data.writeInt(0);
2977 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002978 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002979 reply.readException();
2980 int result = reply.readInt();
2981 reply.recycle();
2982 data.recycle();
2983 return result;
2984 }
Dianne Hackborn91097de2014-04-04 18:02:06 -07002985 public int startVoiceActivity(String callingPackage, int callingPid, int callingUid,
2986 Intent intent, String resolvedType, IVoiceInteractionSession session,
Jeff Hao1b012d32014-08-20 10:35:34 -07002987 IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo,
2988 Bundle options, int userId) throws RemoteException {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002989 Parcel data = Parcel.obtain();
2990 Parcel reply = Parcel.obtain();
2991 data.writeInterfaceToken(IActivityManager.descriptor);
2992 data.writeString(callingPackage);
2993 data.writeInt(callingPid);
2994 data.writeInt(callingUid);
2995 intent.writeToParcel(data, 0);
2996 data.writeString(resolvedType);
2997 data.writeStrongBinder(session.asBinder());
2998 data.writeStrongBinder(interactor.asBinder());
2999 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07003000 if (profilerInfo != null) {
Dianne Hackborn91097de2014-04-04 18:02:06 -07003001 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07003002 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn91097de2014-04-04 18:02:06 -07003003 } else {
3004 data.writeInt(0);
3005 }
3006 if (options != null) {
3007 data.writeInt(1);
3008 options.writeToParcel(data, 0);
3009 } else {
3010 data.writeInt(0);
3011 }
3012 data.writeInt(userId);
3013 mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0);
3014 reply.readException();
3015 int result = reply.readInt();
3016 reply.recycle();
3017 data.recycle();
3018 return result;
3019 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003020 public boolean startNextMatchingActivity(IBinder callingActivity,
Dianne Hackborna4972e92012-03-14 10:38:05 -07003021 Intent intent, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003022 Parcel data = Parcel.obtain();
3023 Parcel reply = Parcel.obtain();
3024 data.writeInterfaceToken(IActivityManager.descriptor);
3025 data.writeStrongBinder(callingActivity);
3026 intent.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07003027 if (options != null) {
3028 data.writeInt(1);
3029 options.writeToParcel(data, 0);
3030 } else {
3031 data.writeInt(0);
3032 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003033 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
3034 reply.readException();
3035 int result = reply.readInt();
3036 reply.recycle();
3037 data.recycle();
3038 return result != 0;
3039 }
Wale Ogunwale7e8184b2015-10-05 14:37:03 -07003040 public int startActivityFromRecents(int taskId, int launchStackId, Bundle options)
3041 throws RemoteException {
Craig Mautnerdc00cbe2014-07-20 17:48:47 -07003042 Parcel data = Parcel.obtain();
3043 Parcel reply = Parcel.obtain();
3044 data.writeInterfaceToken(IActivityManager.descriptor);
3045 data.writeInt(taskId);
Wale Ogunwale7e8184b2015-10-05 14:37:03 -07003046 data.writeInt(launchStackId);
Craig Mautnerdc00cbe2014-07-20 17:48:47 -07003047 if (options == null) {
3048 data.writeInt(0);
3049 } else {
3050 data.writeInt(1);
3051 options.writeToParcel(data, 0);
3052 }
3053 mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0);
3054 reply.readException();
3055 int result = reply.readInt();
3056 reply.recycle();
3057 data.recycle();
3058 return result;
3059 }
Wale Ogunwaleba7881c2015-08-01 19:28:29 -07003060 public boolean finishActivity(IBinder token, int resultCode, Intent resultData, int finishTask)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003061 throws RemoteException {
3062 Parcel data = Parcel.obtain();
3063 Parcel reply = Parcel.obtain();
3064 data.writeInterfaceToken(IActivityManager.descriptor);
3065 data.writeStrongBinder(token);
3066 data.writeInt(resultCode);
3067 if (resultData != null) {
3068 data.writeInt(1);
3069 resultData.writeToParcel(data, 0);
3070 } else {
3071 data.writeInt(0);
3072 }
Wale Ogunwaleba7881c2015-08-01 19:28:29 -07003073 data.writeInt(finishTask);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003074 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
3075 reply.readException();
3076 boolean res = reply.readInt() != 0;
3077 data.recycle();
3078 reply.recycle();
3079 return res;
3080 }
3081 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
3082 {
3083 Parcel data = Parcel.obtain();
3084 Parcel reply = Parcel.obtain();
3085 data.writeInterfaceToken(IActivityManager.descriptor);
3086 data.writeStrongBinder(token);
3087 data.writeString(resultWho);
3088 data.writeInt(requestCode);
3089 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
3090 reply.readException();
3091 data.recycle();
3092 reply.recycle();
3093 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -07003094 public boolean finishActivityAffinity(IBinder token) throws RemoteException {
3095 Parcel data = Parcel.obtain();
3096 Parcel reply = Parcel.obtain();
3097 data.writeInterfaceToken(IActivityManager.descriptor);
3098 data.writeStrongBinder(token);
3099 mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0);
3100 reply.readException();
3101 boolean res = reply.readInt() != 0;
3102 data.recycle();
3103 reply.recycle();
3104 return res;
3105 }
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -07003106 public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException {
3107 Parcel data = Parcel.obtain();
3108 Parcel reply = Parcel.obtain();
3109 data.writeInterfaceToken(IActivityManager.descriptor);
3110 data.writeStrongBinder(session.asBinder());
3111 mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0);
3112 reply.readException();
3113 data.recycle();
3114 reply.recycle();
3115 }
Dianne Hackborn89ad4562014-08-24 16:45:38 -07003116 public boolean releaseActivityInstance(IBinder token) throws RemoteException {
3117 Parcel data = Parcel.obtain();
3118 Parcel reply = Parcel.obtain();
3119 data.writeInterfaceToken(IActivityManager.descriptor);
3120 data.writeStrongBinder(token);
3121 mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0);
3122 reply.readException();
3123 boolean res = reply.readInt() != 0;
3124 data.recycle();
3125 reply.recycle();
3126 return res;
3127 }
3128 public void releaseSomeActivities(IApplicationThread app) throws RemoteException {
3129 Parcel data = Parcel.obtain();
3130 Parcel reply = Parcel.obtain();
3131 data.writeInterfaceToken(IActivityManager.descriptor);
3132 data.writeStrongBinder(app.asBinder());
3133 mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0);
3134 reply.readException();
3135 data.recycle();
3136 reply.recycle();
3137 }
Dianne Hackborn061d58a2010-03-12 15:07:06 -08003138 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
3139 Parcel data = Parcel.obtain();
3140 Parcel reply = Parcel.obtain();
3141 data.writeInterfaceToken(IActivityManager.descriptor);
3142 data.writeStrongBinder(token);
3143 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
3144 reply.readException();
3145 boolean res = reply.readInt() != 0;
3146 data.recycle();
3147 reply.recycle();
3148 return res;
3149 }
Dianne Hackborn6c418d52011-06-29 14:05:33 -07003150 public Intent registerReceiver(IApplicationThread caller, String packageName,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003151 IIntentReceiver receiver,
Dianne Hackborn20e80982012-08-31 19:00:44 -07003152 IntentFilter filter, String perm, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003153 {
3154 Parcel data = Parcel.obtain();
3155 Parcel reply = Parcel.obtain();
3156 data.writeInterfaceToken(IActivityManager.descriptor);
3157 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackborn6c418d52011-06-29 14:05:33 -07003158 data.writeString(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003159 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
3160 filter.writeToParcel(data, 0);
3161 data.writeString(perm);
Dianne Hackborn20e80982012-08-31 19:00:44 -07003162 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003163 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
3164 reply.readException();
3165 Intent intent = null;
3166 int haveIntent = reply.readInt();
3167 if (haveIntent != 0) {
3168 intent = Intent.CREATOR.createFromParcel(reply);
3169 }
3170 reply.recycle();
3171 data.recycle();
3172 return intent;
3173 }
3174 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
3175 {
3176 Parcel data = Parcel.obtain();
3177 Parcel reply = Parcel.obtain();
3178 data.writeInterfaceToken(IActivityManager.descriptor);
3179 data.writeStrongBinder(receiver.asBinder());
3180 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
3181 reply.readException();
3182 data.recycle();
3183 reply.recycle();
3184 }
3185 public int broadcastIntent(IApplicationThread caller,
Dianne Hackborna750a632015-06-16 17:18:23 -07003186 Intent intent, String resolvedType, IIntentReceiver resultTo,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003187 int resultCode, String resultData, Bundle map,
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -07003188 String[] requiredPermissions, int appOp, Bundle options, boolean serialized,
Amith Yamasani742a6712011-05-04 14:49:28 -07003189 boolean sticky, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003190 {
3191 Parcel data = Parcel.obtain();
3192 Parcel reply = Parcel.obtain();
3193 data.writeInterfaceToken(IActivityManager.descriptor);
3194 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3195 intent.writeToParcel(data, 0);
3196 data.writeString(resolvedType);
3197 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
3198 data.writeInt(resultCode);
3199 data.writeString(resultData);
3200 data.writeBundle(map);
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -07003201 data.writeStringArray(requiredPermissions);
Dianne Hackbornf51f6122013-02-04 18:23:34 -08003202 data.writeInt(appOp);
Dianne Hackborna750a632015-06-16 17:18:23 -07003203 data.writeBundle(options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003204 data.writeInt(serialized ? 1 : 0);
3205 data.writeInt(sticky ? 1 : 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003206 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003207 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
3208 reply.readException();
3209 int res = reply.readInt();
3210 reply.recycle();
3211 data.recycle();
3212 return res;
3213 }
Amith Yamasani742a6712011-05-04 14:49:28 -07003214 public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
3215 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003216 {
3217 Parcel data = Parcel.obtain();
3218 Parcel reply = Parcel.obtain();
3219 data.writeInterfaceToken(IActivityManager.descriptor);
3220 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3221 intent.writeToParcel(data, 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003222 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003223 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
3224 reply.readException();
3225 data.recycle();
3226 reply.recycle();
3227 }
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003228 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map,
3229 boolean abortBroadcast, int flags) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003230 {
3231 Parcel data = Parcel.obtain();
3232 Parcel reply = Parcel.obtain();
3233 data.writeInterfaceToken(IActivityManager.descriptor);
3234 data.writeStrongBinder(who);
3235 data.writeInt(resultCode);
3236 data.writeString(resultData);
3237 data.writeBundle(map);
3238 data.writeInt(abortBroadcast ? 1 : 0);
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003239 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003240 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3241 reply.readException();
3242 data.recycle();
3243 reply.recycle();
3244 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003245 public void attachApplication(IApplicationThread app) throws RemoteException
3246 {
3247 Parcel data = Parcel.obtain();
3248 Parcel reply = Parcel.obtain();
3249 data.writeInterfaceToken(IActivityManager.descriptor);
3250 data.writeStrongBinder(app.asBinder());
3251 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
3252 reply.readException();
3253 data.recycle();
3254 reply.recycle();
3255 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003256 public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
3257 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003258 {
3259 Parcel data = Parcel.obtain();
3260 Parcel reply = Parcel.obtain();
3261 data.writeInterfaceToken(IActivityManager.descriptor);
3262 data.writeStrongBinder(token);
Dianne Hackborne88846e2009-09-30 21:34:25 -07003263 if (config != null) {
3264 data.writeInt(1);
3265 config.writeToParcel(data, 0);
3266 } else {
3267 data.writeInt(0);
3268 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003269 data.writeInt(stopProfiling ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003270 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3271 reply.readException();
3272 data.recycle();
3273 reply.recycle();
3274 }
Dianne Hackbornad9b32112012-09-17 15:35:01 -07003275 public void activityResumed(IBinder token) throws RemoteException
3276 {
3277 Parcel data = Parcel.obtain();
3278 Parcel reply = Parcel.obtain();
3279 data.writeInterfaceToken(IActivityManager.descriptor);
3280 data.writeStrongBinder(token);
3281 mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0);
3282 reply.readException();
3283 data.recycle();
3284 reply.recycle();
3285 }
Dianne Hackborna4e102e2014-09-04 22:52:27 -07003286 public void activityPaused(IBinder token) throws RemoteException
Dianne Hackborn0aae2d42010-12-07 23:51:29 -08003287 {
3288 Parcel data = Parcel.obtain();
3289 Parcel reply = Parcel.obtain();
3290 data.writeInterfaceToken(IActivityManager.descriptor);
3291 data.writeStrongBinder(token);
3292 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
3293 reply.readException();
3294 data.recycle();
3295 reply.recycle();
3296 }
3297 public void activityStopped(IBinder token, Bundle state,
Craig Mautnera0026042014-04-23 11:45:37 -07003298 PersistableBundle persistentState, CharSequence description) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003299 {
3300 Parcel data = Parcel.obtain();
3301 Parcel reply = Parcel.obtain();
3302 data.writeInterfaceToken(IActivityManager.descriptor);
3303 data.writeStrongBinder(token);
3304 data.writeBundle(state);
Craig Mautnera0026042014-04-23 11:45:37 -07003305 data.writePersistableBundle(persistentState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003306 TextUtils.writeToParcel(description, data, 0);
3307 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3308 reply.readException();
3309 data.recycle();
3310 reply.recycle();
3311 }
Dianne Hackborn4eba96b2011-01-21 13:34:36 -08003312 public void activitySlept(IBinder token) throws RemoteException
3313 {
3314 Parcel data = Parcel.obtain();
3315 Parcel reply = Parcel.obtain();
3316 data.writeInterfaceToken(IActivityManager.descriptor);
3317 data.writeStrongBinder(token);
3318 mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3319 reply.readException();
3320 data.recycle();
3321 reply.recycle();
3322 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003323 public void activityDestroyed(IBinder token) throws RemoteException
3324 {
3325 Parcel data = Parcel.obtain();
3326 Parcel reply = Parcel.obtain();
3327 data.writeInterfaceToken(IActivityManager.descriptor);
3328 data.writeStrongBinder(token);
3329 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3330 reply.readException();
3331 data.recycle();
3332 reply.recycle();
3333 }
3334 public String getCallingPackage(IBinder token) throws RemoteException
3335 {
3336 Parcel data = Parcel.obtain();
3337 Parcel reply = Parcel.obtain();
3338 data.writeInterfaceToken(IActivityManager.descriptor);
3339 data.writeStrongBinder(token);
3340 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
3341 reply.readException();
3342 String res = reply.readString();
3343 data.recycle();
3344 reply.recycle();
3345 return res;
3346 }
3347 public ComponentName getCallingActivity(IBinder token)
3348 throws RemoteException {
3349 Parcel data = Parcel.obtain();
3350 Parcel reply = Parcel.obtain();
3351 data.writeInterfaceToken(IActivityManager.descriptor);
3352 data.writeStrongBinder(token);
3353 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
3354 reply.readException();
3355 ComponentName res = ComponentName.readFromParcel(reply);
3356 data.recycle();
3357 reply.recycle();
3358 return res;
3359 }
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003360 public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException {
Winson Chung1147c402014-05-14 11:05:00 -07003361 Parcel data = Parcel.obtain();
3362 Parcel reply = Parcel.obtain();
3363 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003364 data.writeString(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -07003365 mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0);
3366 reply.readException();
3367 ArrayList<IAppTask> list = null;
3368 int N = reply.readInt();
3369 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003370 list = new ArrayList<>();
Winson Chung1147c402014-05-14 11:05:00 -07003371 while (N > 0) {
3372 IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder());
3373 list.add(task);
3374 N--;
3375 }
3376 }
3377 data.recycle();
3378 reply.recycle();
3379 return list;
3380 }
Dianne Hackbornaec68bb2014-08-20 15:25:13 -07003381 public int addAppTask(IBinder activityToken, Intent intent,
3382 ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException {
3383 Parcel data = Parcel.obtain();
3384 Parcel reply = Parcel.obtain();
3385 data.writeInterfaceToken(IActivityManager.descriptor);
3386 data.writeStrongBinder(activityToken);
3387 intent.writeToParcel(data, 0);
3388 description.writeToParcel(data, 0);
3389 thumbnail.writeToParcel(data, 0);
3390 mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0);
3391 reply.readException();
3392 int res = reply.readInt();
3393 data.recycle();
3394 reply.recycle();
3395 return res;
3396 }
3397 public Point getAppTaskThumbnailSize() throws RemoteException {
3398 Parcel data = Parcel.obtain();
3399 Parcel reply = Parcel.obtain();
3400 data.writeInterfaceToken(IActivityManager.descriptor);
3401 mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0);
3402 reply.readException();
3403 Point size = Point.CREATOR.createFromParcel(reply);
3404 data.recycle();
3405 reply.recycle();
3406 return size;
3407 }
Todd Kennedye635f662015-01-20 10:36:49 -08003408 public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags)
3409 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003410 Parcel data = Parcel.obtain();
3411 Parcel reply = Parcel.obtain();
3412 data.writeInterfaceToken(IActivityManager.descriptor);
3413 data.writeInt(maxNum);
3414 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003415 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
3416 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003417 ArrayList<ActivityManager.RunningTaskInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003418 int N = reply.readInt();
3419 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003420 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003421 while (N > 0) {
3422 ActivityManager.RunningTaskInfo info =
3423 ActivityManager.RunningTaskInfo.CREATOR
Winson Chung1147c402014-05-14 11:05:00 -07003424 .createFromParcel(reply);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003425 list.add(info);
3426 N--;
3427 }
3428 }
3429 data.recycle();
3430 reply.recycle();
3431 return list;
3432 }
3433 public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -07003434 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003435 Parcel data = Parcel.obtain();
3436 Parcel reply = Parcel.obtain();
3437 data.writeInterfaceToken(IActivityManager.descriptor);
3438 data.writeInt(maxNum);
3439 data.writeInt(flags);
Amith Yamasani82644082012-08-03 13:09:11 -07003440 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003441 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
3442 reply.readException();
3443 ArrayList<ActivityManager.RecentTaskInfo> list
3444 = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR);
3445 data.recycle();
3446 reply.recycle();
3447 return list;
3448 }
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003449 public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException {
Dianne Hackbornd94df452011-02-16 18:53:31 -08003450 Parcel data = Parcel.obtain();
3451 Parcel reply = Parcel.obtain();
3452 data.writeInterfaceToken(IActivityManager.descriptor);
3453 data.writeInt(id);
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003454 mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003455 reply.readException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003456 ActivityManager.TaskThumbnail taskThumbnail = null;
Dianne Hackbornd94df452011-02-16 18:53:31 -08003457 if (reply.readInt() != 0) {
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003458 taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003459 }
3460 data.recycle();
3461 reply.recycle();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003462 return taskThumbnail;
Dianne Hackborn15491c62012-09-19 10:59:14 -07003463 }
Todd Kennedye635f662015-01-20 10:36:49 -08003464 public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags)
3465 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003466 Parcel data = Parcel.obtain();
3467 Parcel reply = Parcel.obtain();
3468 data.writeInterfaceToken(IActivityManager.descriptor);
3469 data.writeInt(maxNum);
3470 data.writeInt(flags);
3471 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
3472 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003473 ArrayList<ActivityManager.RunningServiceInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003474 int N = reply.readInt();
3475 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003476 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003477 while (N > 0) {
3478 ActivityManager.RunningServiceInfo info =
3479 ActivityManager.RunningServiceInfo.CREATOR
3480 .createFromParcel(reply);
3481 list.add(info);
3482 N--;
3483 }
3484 }
3485 data.recycle();
3486 reply.recycle();
3487 return list;
3488 }
3489 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
3490 throws RemoteException {
3491 Parcel data = Parcel.obtain();
3492 Parcel reply = Parcel.obtain();
3493 data.writeInterfaceToken(IActivityManager.descriptor);
3494 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
3495 reply.readException();
3496 ArrayList<ActivityManager.ProcessErrorStateInfo> list
3497 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
3498 data.recycle();
3499 reply.recycle();
3500 return list;
3501 }
3502 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
3503 throws RemoteException {
3504 Parcel data = Parcel.obtain();
3505 Parcel reply = Parcel.obtain();
3506 data.writeInterfaceToken(IActivityManager.descriptor);
3507 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
3508 reply.readException();
3509 ArrayList<ActivityManager.RunningAppProcessInfo> list
3510 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
3511 data.recycle();
3512 reply.recycle();
3513 return list;
3514 }
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -07003515 public List<ApplicationInfo> getRunningExternalApplications()
3516 throws RemoteException {
3517 Parcel data = Parcel.obtain();
3518 Parcel reply = Parcel.obtain();
3519 data.writeInterfaceToken(IActivityManager.descriptor);
3520 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
3521 reply.readException();
3522 ArrayList<ApplicationInfo> list
3523 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
3524 data.recycle();
3525 reply.recycle();
3526 return list;
3527 }
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003528 public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003529 {
3530 Parcel data = Parcel.obtain();
3531 Parcel reply = Parcel.obtain();
3532 data.writeInterfaceToken(IActivityManager.descriptor);
3533 data.writeInt(task);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003534 data.writeInt(flags);
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003535 if (options != null) {
3536 data.writeInt(1);
3537 options.writeToParcel(data, 0);
3538 } else {
3539 data.writeInt(0);
3540 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003541 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
3542 reply.readException();
3543 data.recycle();
3544 reply.recycle();
3545 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003546 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
3547 throws RemoteException {
3548 Parcel data = Parcel.obtain();
3549 Parcel reply = Parcel.obtain();
3550 data.writeInterfaceToken(IActivityManager.descriptor);
3551 data.writeStrongBinder(token);
3552 data.writeInt(nonRoot ? 1 : 0);
3553 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
3554 reply.readException();
3555 boolean res = reply.readInt() != 0;
3556 data.recycle();
3557 reply.recycle();
3558 return res;
3559 }
3560 public void moveTaskBackwards(int task) throws RemoteException
3561 {
3562 Parcel data = Parcel.obtain();
3563 Parcel reply = Parcel.obtain();
3564 data.writeInterfaceToken(IActivityManager.descriptor);
3565 data.writeInt(task);
3566 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
3567 reply.readException();
3568 data.recycle();
3569 reply.recycle();
3570 }
Craig Mautnerc00204b2013-03-05 15:02:14 -08003571 @Override
Craig Mautnerc00204b2013-03-05 15:02:14 -08003572 public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException
3573 {
3574 Parcel data = Parcel.obtain();
3575 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003576 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003577 data.writeInt(taskId);
3578 data.writeInt(stackId);
3579 data.writeInt(toTop ? 1 : 0);
3580 mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0);
3581 reply.readException();
3582 data.recycle();
3583 reply.recycle();
3584 }
3585 @Override
Jorim Jaggi9ea2f7b2015-11-23 18:08:28 -08003586 public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate,
3587 Rect initialBounds) throws RemoteException
Wale Ogunwale59a73ca2015-09-14 12:54:50 -07003588 {
3589 Parcel data = Parcel.obtain();
3590 Parcel reply = Parcel.obtain();
3591 data.writeInterfaceToken(IActivityManager.descriptor);
3592 data.writeInt(taskId);
3593 data.writeInt(createMode);
3594 data.writeInt(toTop ? 1 : 0);
Jorim Jaggi030979c2015-11-20 15:14:43 -08003595 data.writeInt(animate ? 1 : 0);
Jorim Jaggi9ea2f7b2015-11-23 18:08:28 -08003596 if (initialBounds != null) {
3597 data.writeInt(1);
3598 initialBounds.writeToParcel(data, 0);
3599 } else {
3600 data.writeInt(0);
3601 }
Wale Ogunwale59a73ca2015-09-14 12:54:50 -07003602 mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0);
3603 reply.readException();
3604 data.recycle();
3605 reply.recycle();
3606 }
3607 @Override
Wale Ogunwale079a0042015-10-24 11:44:07 -07003608 public boolean moveTopActivityToPinnedStack(int stackId, Rect r)
3609 throws RemoteException
3610 {
3611 Parcel data = Parcel.obtain();
3612 Parcel reply = Parcel.obtain();
3613 data.writeInterfaceToken(IActivityManager.descriptor);
3614 data.writeInt(stackId);
3615 r.writeToParcel(data, 0);
Dianne Hackbornbef28fe2015-10-29 17:57:11 -07003616 mRemote.transact(MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION, data, reply, 0);
Wale Ogunwale079a0042015-10-24 11:44:07 -07003617 reply.readException();
3618 final boolean res = reply.readInt() != 0;
3619 data.recycle();
3620 reply.recycle();
3621 return res;
3622 }
3623 @Override
Wale Ogunwaleffc11bb2015-10-10 13:05:45 -07003624 public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode)
3625 throws RemoteException
Craig Mautnerc00204b2013-03-05 15:02:14 -08003626 {
3627 Parcel data = Parcel.obtain();
3628 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003629 data.writeInterfaceToken(IActivityManager.descriptor);
Wale Ogunwaleb34a7ad2015-08-14 11:05:30 -07003630 data.writeInt(stackId);
Jorim Jaggi61f39a72015-10-29 16:54:18 +01003631 if (r != null) {
3632 data.writeInt(1);
3633 r.writeToParcel(data, 0);
3634 } else {
3635 data.writeInt(0);
3636 }
Wale Ogunwaleffc11bb2015-10-10 13:05:45 -07003637 data.writeInt(allowResizeInDockedMode ? 1 : 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07003638 mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003639 reply.readException();
3640 data.recycle();
3641 reply.recycle();
3642 }
Craig Mautner967212c2013-04-13 21:10:58 -07003643 @Override
Wale Ogunwaleddc1cb22015-07-25 19:23:04 -07003644 public void positionTaskInStack(int taskId, int stackId, int position) throws RemoteException
3645 {
3646 Parcel data = Parcel.obtain();
3647 Parcel reply = Parcel.obtain();
3648 data.writeInterfaceToken(IActivityManager.descriptor);
3649 data.writeInt(taskId);
3650 data.writeInt(stackId);
3651 data.writeInt(position);
3652 mRemote.transact(POSITION_TASK_IN_STACK_TRANSACTION, data, reply, 0);
3653 reply.readException();
3654 data.recycle();
3655 reply.recycle();
3656 }
3657 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003658 public List<StackInfo> getAllStackInfos() throws RemoteException
Craig Mautner5ff12102013-05-24 12:50:15 -07003659 {
3660 Parcel data = Parcel.obtain();
3661 Parcel reply = Parcel.obtain();
3662 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003663 mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0);
Craig Mautner5ff12102013-05-24 12:50:15 -07003664 reply.readException();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003665 ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR);
Craig Mautner967212c2013-04-13 21:10:58 -07003666 data.recycle();
3667 reply.recycle();
3668 return list;
3669 }
Craig Mautnercf910b02013-04-23 11:23:27 -07003670 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003671 public StackInfo getStackInfo(int stackId) throws RemoteException
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003672 {
3673 Parcel data = Parcel.obtain();
3674 Parcel reply = Parcel.obtain();
3675 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003676 data.writeInt(stackId);
3677 mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003678 reply.readException();
3679 int res = reply.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003680 StackInfo info = null;
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003681 if (res != 0) {
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003682 info = StackInfo.CREATOR.createFromParcel(reply);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003683 }
3684 data.recycle();
3685 reply.recycle();
3686 return info;
3687 }
3688 @Override
Winson Chung303e1ff2014-03-07 15:06:19 -08003689 public boolean isInHomeStack(int taskId) throws RemoteException {
3690 Parcel data = Parcel.obtain();
3691 Parcel reply = Parcel.obtain();
3692 data.writeInterfaceToken(IActivityManager.descriptor);
3693 data.writeInt(taskId);
3694 mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0);
3695 reply.readException();
3696 boolean isInHomeStack = reply.readInt() > 0;
3697 data.recycle();
3698 reply.recycle();
3699 return isInHomeStack;
3700 }
3701 @Override
Craig Mautnercf910b02013-04-23 11:23:27 -07003702 public void setFocusedStack(int stackId) throws RemoteException
3703 {
3704 Parcel data = Parcel.obtain();
3705 Parcel reply = Parcel.obtain();
3706 data.writeInterfaceToken(IActivityManager.descriptor);
3707 data.writeInt(stackId);
Dianne Hackborn1e383822015-04-10 14:02:33 -07003708 mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0);
Craig Mautnercf910b02013-04-23 11:23:27 -07003709 reply.readException();
3710 data.recycle();
3711 reply.recycle();
3712 }
Winson Chung740c3ac2014-11-12 16:14:38 -08003713 @Override
Winson Chungd16c5652015-01-26 16:11:07 -08003714 public int getFocusedStackId() throws RemoteException {
3715 Parcel data = Parcel.obtain();
3716 Parcel reply = Parcel.obtain();
3717 data.writeInterfaceToken(IActivityManager.descriptor);
3718 mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0);
3719 reply.readException();
3720 int focusedStackId = reply.readInt();
3721 data.recycle();
3722 reply.recycle();
3723 return focusedStackId;
3724 }
3725 @Override
Wale Ogunwalee4a0c572015-06-30 08:40:31 -07003726 public void setFocusedTask(int taskId) throws RemoteException
3727 {
3728 Parcel data = Parcel.obtain();
3729 Parcel reply = Parcel.obtain();
3730 data.writeInterfaceToken(IActivityManager.descriptor);
3731 data.writeInt(taskId);
3732 mRemote.transact(SET_FOCUSED_TASK_TRANSACTION, data, reply, 0);
3733 reply.readException();
3734 data.recycle();
3735 reply.recycle();
3736 }
3737 @Override
Winson Chung740c3ac2014-11-12 16:14:38 -08003738 public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException
3739 {
3740 Parcel data = Parcel.obtain();
3741 Parcel reply = Parcel.obtain();
3742 data.writeInterfaceToken(IActivityManager.descriptor);
3743 data.writeStrongBinder(listener.asBinder());
Dianne Hackborn1e383822015-04-10 14:02:33 -07003744 mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0);
Winson Chung740c3ac2014-11-12 16:14:38 -08003745 reply.readException();
3746 data.recycle();
3747 reply.recycle();
3748 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003749 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
3750 {
3751 Parcel data = Parcel.obtain();
3752 Parcel reply = Parcel.obtain();
3753 data.writeInterfaceToken(IActivityManager.descriptor);
3754 data.writeStrongBinder(token);
3755 data.writeInt(onlyRoot ? 1 : 0);
3756 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
3757 reply.readException();
3758 int res = reply.readInt();
3759 data.recycle();
3760 reply.recycle();
3761 return res;
3762 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003763 public ContentProviderHolder getContentProvider(IApplicationThread caller,
Jeff Sharkey6d515712012-09-20 16:06:08 -07003764 String name, int userId, boolean stable) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003765 Parcel data = Parcel.obtain();
3766 Parcel reply = Parcel.obtain();
3767 data.writeInterfaceToken(IActivityManager.descriptor);
3768 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3769 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003770 data.writeInt(userId);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003771 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003772 mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3773 reply.readException();
3774 int res = reply.readInt();
3775 ContentProviderHolder cph = null;
3776 if (res != 0) {
3777 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3778 }
3779 data.recycle();
3780 reply.recycle();
3781 return cph;
3782 }
Jeff Sharkey6d515712012-09-20 16:06:08 -07003783 public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token)
3784 throws RemoteException {
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003785 Parcel data = Parcel.obtain();
3786 Parcel reply = Parcel.obtain();
3787 data.writeInterfaceToken(IActivityManager.descriptor);
3788 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003789 data.writeInt(userId);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003790 data.writeStrongBinder(token);
3791 mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3792 reply.readException();
3793 int res = reply.readInt();
3794 ContentProviderHolder cph = null;
3795 if (res != 0) {
3796 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3797 }
3798 data.recycle();
3799 reply.recycle();
3800 return cph;
3801 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003802 public void publishContentProviders(IApplicationThread caller,
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003803 List<ContentProviderHolder> providers) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003804 {
3805 Parcel data = Parcel.obtain();
3806 Parcel reply = Parcel.obtain();
3807 data.writeInterfaceToken(IActivityManager.descriptor);
3808 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3809 data.writeTypedList(providers);
3810 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
3811 reply.readException();
3812 data.recycle();
3813 reply.recycle();
3814 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003815 public boolean refContentProvider(IBinder connection, int stable, int unstable)
3816 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003817 Parcel data = Parcel.obtain();
3818 Parcel reply = Parcel.obtain();
3819 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003820 data.writeStrongBinder(connection);
3821 data.writeInt(stable);
3822 data.writeInt(unstable);
3823 mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3824 reply.readException();
3825 boolean res = reply.readInt() != 0;
3826 data.recycle();
3827 reply.recycle();
3828 return res;
3829 }
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003830
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003831 public void unstableProviderDied(IBinder connection) throws RemoteException {
3832 Parcel data = Parcel.obtain();
3833 Parcel reply = Parcel.obtain();
3834 data.writeInterfaceToken(IActivityManager.descriptor);
3835 data.writeStrongBinder(connection);
3836 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0);
3837 reply.readException();
3838 data.recycle();
3839 reply.recycle();
3840 }
3841
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003842 @Override
3843 public void appNotRespondingViaProvider(IBinder connection) throws RemoteException {
3844 Parcel data = Parcel.obtain();
3845 Parcel reply = Parcel.obtain();
3846 data.writeInterfaceToken(IActivityManager.descriptor);
3847 data.writeStrongBinder(connection);
3848 mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0);
3849 reply.readException();
3850 data.recycle();
3851 reply.recycle();
3852 }
3853
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003854 public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException {
3855 Parcel data = Parcel.obtain();
3856 Parcel reply = Parcel.obtain();
3857 data.writeInterfaceToken(IActivityManager.descriptor);
3858 data.writeStrongBinder(connection);
3859 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003860 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3861 reply.readException();
3862 data.recycle();
3863 reply.recycle();
3864 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003865
3866 public void removeContentProviderExternal(String name, IBinder token) throws RemoteException {
3867 Parcel data = Parcel.obtain();
3868 Parcel reply = Parcel.obtain();
3869 data.writeInterfaceToken(IActivityManager.descriptor);
3870 data.writeString(name);
3871 data.writeStrongBinder(token);
3872 mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3873 reply.readException();
3874 data.recycle();
3875 reply.recycle();
3876 }
3877
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07003878 public PendingIntent getRunningServiceControlPanel(ComponentName service)
3879 throws RemoteException
3880 {
3881 Parcel data = Parcel.obtain();
3882 Parcel reply = Parcel.obtain();
3883 data.writeInterfaceToken(IActivityManager.descriptor);
3884 service.writeToParcel(data, 0);
3885 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
3886 reply.readException();
3887 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
3888 data.recycle();
3889 reply.recycle();
3890 return res;
3891 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003892
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003893 public ComponentName startService(IApplicationThread caller, Intent service,
Svet Ganov99b60432015-06-27 13:15:22 -07003894 String resolvedType, String callingPackage, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003895 {
3896 Parcel data = Parcel.obtain();
3897 Parcel reply = Parcel.obtain();
3898 data.writeInterfaceToken(IActivityManager.descriptor);
3899 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3900 service.writeToParcel(data, 0);
3901 data.writeString(resolvedType);
Svet Ganov99b60432015-06-27 13:15:22 -07003902 data.writeString(callingPackage);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003903 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003904 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
3905 reply.readException();
3906 ComponentName res = ComponentName.readFromParcel(reply);
3907 data.recycle();
3908 reply.recycle();
3909 return res;
3910 }
3911 public int stopService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003912 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003913 {
3914 Parcel data = Parcel.obtain();
3915 Parcel reply = Parcel.obtain();
3916 data.writeInterfaceToken(IActivityManager.descriptor);
3917 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3918 service.writeToParcel(data, 0);
3919 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003920 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003921 mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0);
3922 reply.readException();
3923 int res = reply.readInt();
3924 reply.recycle();
3925 data.recycle();
3926 return res;
3927 }
3928 public boolean stopServiceToken(ComponentName className, IBinder token,
3929 int startId) throws RemoteException {
3930 Parcel data = Parcel.obtain();
3931 Parcel reply = Parcel.obtain();
3932 data.writeInterfaceToken(IActivityManager.descriptor);
3933 ComponentName.writeToParcel(className, data);
3934 data.writeStrongBinder(token);
3935 data.writeInt(startId);
3936 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
3937 reply.readException();
3938 boolean res = reply.readInt() != 0;
3939 data.recycle();
3940 reply.recycle();
3941 return res;
3942 }
3943 public void setServiceForeground(ComponentName className, IBinder token,
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003944 int id, Notification notification, boolean removeNotification) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003945 Parcel data = Parcel.obtain();
3946 Parcel reply = Parcel.obtain();
3947 data.writeInterfaceToken(IActivityManager.descriptor);
3948 ComponentName.writeToParcel(className, data);
3949 data.writeStrongBinder(token);
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003950 data.writeInt(id);
3951 if (notification != null) {
3952 data.writeInt(1);
3953 notification.writeToParcel(data, 0);
3954 } else {
3955 data.writeInt(0);
3956 }
3957 data.writeInt(removeNotification ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003958 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
3959 reply.readException();
3960 data.recycle();
3961 reply.recycle();
3962 }
3963 public int bindService(IApplicationThread caller, IBinder token,
3964 Intent service, String resolvedType, IServiceConnection connection,
Svet Ganov99b60432015-06-27 13:15:22 -07003965 int flags, String callingPackage, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003966 Parcel data = Parcel.obtain();
3967 Parcel reply = Parcel.obtain();
3968 data.writeInterfaceToken(IActivityManager.descriptor);
3969 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3970 data.writeStrongBinder(token);
3971 service.writeToParcel(data, 0);
3972 data.writeString(resolvedType);
3973 data.writeStrongBinder(connection.asBinder());
3974 data.writeInt(flags);
Svet Ganov99b60432015-06-27 13:15:22 -07003975 data.writeString(callingPackage);
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003976 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003977 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
3978 reply.readException();
3979 int res = reply.readInt();
3980 data.recycle();
3981 reply.recycle();
3982 return res;
3983 }
3984 public boolean unbindService(IServiceConnection connection) throws RemoteException
3985 {
3986 Parcel data = Parcel.obtain();
3987 Parcel reply = Parcel.obtain();
3988 data.writeInterfaceToken(IActivityManager.descriptor);
3989 data.writeStrongBinder(connection.asBinder());
3990 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
3991 reply.readException();
3992 boolean res = reply.readInt() != 0;
3993 data.recycle();
3994 reply.recycle();
3995 return res;
3996 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003997
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003998 public void publishService(IBinder token,
3999 Intent intent, IBinder service) throws RemoteException {
4000 Parcel data = Parcel.obtain();
4001 Parcel reply = Parcel.obtain();
4002 data.writeInterfaceToken(IActivityManager.descriptor);
4003 data.writeStrongBinder(token);
4004 intent.writeToParcel(data, 0);
4005 data.writeStrongBinder(service);
4006 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
4007 reply.readException();
4008 data.recycle();
4009 reply.recycle();
4010 }
4011
4012 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
4013 throws RemoteException {
4014 Parcel data = Parcel.obtain();
4015 Parcel reply = Parcel.obtain();
4016 data.writeInterfaceToken(IActivityManager.descriptor);
4017 data.writeStrongBinder(token);
4018 intent.writeToParcel(data, 0);
4019 data.writeInt(doRebind ? 1 : 0);
4020 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
4021 reply.readException();
4022 data.recycle();
4023 reply.recycle();
4024 }
4025
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07004026 public void serviceDoneExecuting(IBinder token, int type, int startId,
4027 int res) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004028 Parcel data = Parcel.obtain();
4029 Parcel reply = Parcel.obtain();
4030 data.writeInterfaceToken(IActivityManager.descriptor);
4031 data.writeStrongBinder(token);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07004032 data.writeInt(type);
4033 data.writeInt(startId);
4034 data.writeInt(res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004035 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
4036 reply.readException();
4037 data.recycle();
4038 reply.recycle();
4039 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004040
Svet Ganov99b60432015-06-27 13:15:22 -07004041 public IBinder peekService(Intent service, String resolvedType, String callingPackage)
4042 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004043 Parcel data = Parcel.obtain();
4044 Parcel reply = Parcel.obtain();
4045 data.writeInterfaceToken(IActivityManager.descriptor);
4046 service.writeToParcel(data, 0);
4047 data.writeString(resolvedType);
Svet Ganov99b60432015-06-27 13:15:22 -07004048 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004049 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
4050 reply.readException();
4051 IBinder binder = reply.readStrongBinder();
4052 reply.recycle();
4053 data.recycle();
4054 return binder;
4055 }
4056
Christopher Tate181fafa2009-05-14 11:12:14 -07004057 public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
4058 throws RemoteException {
4059 Parcel data = Parcel.obtain();
4060 Parcel reply = Parcel.obtain();
4061 data.writeInterfaceToken(IActivityManager.descriptor);
4062 app.writeToParcel(data, 0);
4063 data.writeInt(backupRestoreMode);
4064 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
4065 reply.readException();
4066 boolean success = reply.readInt() != 0;
4067 reply.recycle();
4068 data.recycle();
4069 return success;
4070 }
4071
Christopher Tate346acb12012-10-15 19:20:25 -07004072 public void clearPendingBackup() throws RemoteException {
4073 Parcel data = Parcel.obtain();
4074 Parcel reply = Parcel.obtain();
4075 data.writeInterfaceToken(IActivityManager.descriptor);
4076 mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0);
4077 reply.recycle();
4078 data.recycle();
4079 }
4080
Christopher Tate181fafa2009-05-14 11:12:14 -07004081 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
4082 Parcel data = Parcel.obtain();
4083 Parcel reply = Parcel.obtain();
4084 data.writeInterfaceToken(IActivityManager.descriptor);
4085 data.writeString(packageName);
4086 data.writeStrongBinder(agent);
4087 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
4088 reply.recycle();
4089 data.recycle();
4090 }
4091
4092 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
4093 Parcel data = Parcel.obtain();
4094 Parcel reply = Parcel.obtain();
4095 data.writeInterfaceToken(IActivityManager.descriptor);
4096 app.writeToParcel(data, 0);
4097 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
4098 reply.readException();
4099 reply.recycle();
4100 data.recycle();
4101 }
4102
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004103 public boolean startInstrumentation(ComponentName className, String profileFile,
Svetoslav Ganov80943d82013-01-02 10:25:37 -08004104 int flags, Bundle arguments, IInstrumentationWatcher watcher,
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01004105 IUiAutomationConnection connection, int userId, String instructionSet)
4106 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004107 Parcel data = Parcel.obtain();
4108 Parcel reply = Parcel.obtain();
4109 data.writeInterfaceToken(IActivityManager.descriptor);
4110 ComponentName.writeToParcel(className, data);
4111 data.writeString(profileFile);
4112 data.writeInt(flags);
4113 data.writeBundle(arguments);
4114 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08004115 data.writeStrongBinder(connection != null ? connection.asBinder() : null);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004116 data.writeInt(userId);
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01004117 data.writeString(instructionSet);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004118 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
4119 reply.readException();
4120 boolean res = reply.readInt() != 0;
4121 reply.recycle();
4122 data.recycle();
4123 return res;
4124 }
4125
4126 public void finishInstrumentation(IApplicationThread target,
4127 int resultCode, Bundle results) throws RemoteException {
4128 Parcel data = Parcel.obtain();
4129 Parcel reply = Parcel.obtain();
4130 data.writeInterfaceToken(IActivityManager.descriptor);
4131 data.writeStrongBinder(target != null ? target.asBinder() : null);
4132 data.writeInt(resultCode);
4133 data.writeBundle(results);
4134 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
4135 reply.readException();
4136 data.recycle();
4137 reply.recycle();
4138 }
4139 public Configuration getConfiguration() throws RemoteException
4140 {
4141 Parcel data = Parcel.obtain();
4142 Parcel reply = Parcel.obtain();
4143 data.writeInterfaceToken(IActivityManager.descriptor);
4144 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
4145 reply.readException();
4146 Configuration res = Configuration.CREATOR.createFromParcel(reply);
4147 reply.recycle();
4148 data.recycle();
4149 return res;
4150 }
4151 public void updateConfiguration(Configuration values) throws RemoteException
4152 {
4153 Parcel data = Parcel.obtain();
4154 Parcel reply = Parcel.obtain();
4155 data.writeInterfaceToken(IActivityManager.descriptor);
4156 values.writeToParcel(data, 0);
4157 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
4158 reply.readException();
4159 data.recycle();
4160 reply.recycle();
4161 }
4162 public void setRequestedOrientation(IBinder token, int requestedOrientation)
4163 throws RemoteException {
4164 Parcel data = Parcel.obtain();
4165 Parcel reply = Parcel.obtain();
4166 data.writeInterfaceToken(IActivityManager.descriptor);
4167 data.writeStrongBinder(token);
4168 data.writeInt(requestedOrientation);
4169 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
4170 reply.readException();
4171 data.recycle();
4172 reply.recycle();
4173 }
4174 public int getRequestedOrientation(IBinder token) throws RemoteException {
4175 Parcel data = Parcel.obtain();
4176 Parcel reply = Parcel.obtain();
4177 data.writeInterfaceToken(IActivityManager.descriptor);
4178 data.writeStrongBinder(token);
4179 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
4180 reply.readException();
4181 int res = reply.readInt();
4182 data.recycle();
4183 reply.recycle();
4184 return res;
4185 }
4186 public ComponentName getActivityClassForToken(IBinder token)
4187 throws RemoteException {
4188 Parcel data = Parcel.obtain();
4189 Parcel reply = Parcel.obtain();
4190 data.writeInterfaceToken(IActivityManager.descriptor);
4191 data.writeStrongBinder(token);
4192 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
4193 reply.readException();
4194 ComponentName res = ComponentName.readFromParcel(reply);
4195 data.recycle();
4196 reply.recycle();
4197 return res;
4198 }
4199 public String getPackageForToken(IBinder token) throws RemoteException
4200 {
4201 Parcel data = Parcel.obtain();
4202 Parcel reply = Parcel.obtain();
4203 data.writeInterfaceToken(IActivityManager.descriptor);
4204 data.writeStrongBinder(token);
4205 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
4206 reply.readException();
4207 String res = reply.readString();
4208 data.recycle();
4209 reply.recycle();
4210 return res;
4211 }
4212 public IIntentSender getIntentSender(int type,
4213 String packageName, IBinder token, String resultWho,
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07004214 int requestCode, Intent[] intents, String[] resolvedTypes, int flags,
Dianne Hackborn41203752012-08-31 14:05:51 -07004215 Bundle options, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004216 Parcel data = Parcel.obtain();
4217 Parcel reply = Parcel.obtain();
4218 data.writeInterfaceToken(IActivityManager.descriptor);
4219 data.writeInt(type);
4220 data.writeString(packageName);
4221 data.writeStrongBinder(token);
4222 data.writeString(resultWho);
4223 data.writeInt(requestCode);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004224 if (intents != null) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004225 data.writeInt(1);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004226 data.writeTypedArray(intents, 0);
4227 data.writeStringArray(resolvedTypes);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004228 } else {
4229 data.writeInt(0);
4230 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004231 data.writeInt(flags);
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07004232 if (options != null) {
4233 data.writeInt(1);
4234 options.writeToParcel(data, 0);
4235 } else {
4236 data.writeInt(0);
4237 }
Dianne Hackborn41203752012-08-31 14:05:51 -07004238 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004239 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
4240 reply.readException();
4241 IIntentSender res = IIntentSender.Stub.asInterface(
Dianne Hackbornff170242014-11-19 10:59:01 -08004242 reply.readStrongBinder());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004243 data.recycle();
4244 reply.recycle();
4245 return res;
4246 }
4247 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
4248 Parcel data = Parcel.obtain();
4249 Parcel reply = Parcel.obtain();
4250 data.writeInterfaceToken(IActivityManager.descriptor);
4251 data.writeStrongBinder(sender.asBinder());
4252 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
4253 reply.readException();
4254 data.recycle();
4255 reply.recycle();
4256 }
4257 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
4258 Parcel data = Parcel.obtain();
4259 Parcel reply = Parcel.obtain();
4260 data.writeInterfaceToken(IActivityManager.descriptor);
4261 data.writeStrongBinder(sender.asBinder());
4262 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4263 reply.readException();
4264 String res = reply.readString();
4265 data.recycle();
4266 reply.recycle();
4267 return res;
4268 }
Christopher Tatec4a07d12012-04-06 14:19:13 -07004269 public int getUidForIntentSender(IIntentSender sender) throws RemoteException {
4270 Parcel data = Parcel.obtain();
4271 Parcel reply = Parcel.obtain();
4272 data.writeInterfaceToken(IActivityManager.descriptor);
4273 data.writeStrongBinder(sender.asBinder());
4274 mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4275 reply.readException();
4276 int res = reply.readInt();
4277 data.recycle();
4278 reply.recycle();
4279 return res;
4280 }
Dianne Hackborn41203752012-08-31 14:05:51 -07004281 public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
4282 boolean requireFull, String name, String callerPackage) throws RemoteException {
4283 Parcel data = Parcel.obtain();
4284 Parcel reply = Parcel.obtain();
4285 data.writeInterfaceToken(IActivityManager.descriptor);
4286 data.writeInt(callingPid);
4287 data.writeInt(callingUid);
4288 data.writeInt(userId);
4289 data.writeInt(allowAll ? 1 : 0);
4290 data.writeInt(requireFull ? 1 : 0);
4291 data.writeString(name);
4292 data.writeString(callerPackage);
4293 mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0);
4294 reply.readException();
4295 int res = reply.readInt();
4296 data.recycle();
4297 reply.recycle();
4298 return res;
4299 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004300 public void setProcessLimit(int max) throws RemoteException
4301 {
4302 Parcel data = Parcel.obtain();
4303 Parcel reply = Parcel.obtain();
4304 data.writeInterfaceToken(IActivityManager.descriptor);
4305 data.writeInt(max);
4306 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4307 reply.readException();
4308 data.recycle();
4309 reply.recycle();
4310 }
4311 public int getProcessLimit() throws RemoteException
4312 {
4313 Parcel data = Parcel.obtain();
4314 Parcel reply = Parcel.obtain();
4315 data.writeInterfaceToken(IActivityManager.descriptor);
4316 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4317 reply.readException();
4318 int res = reply.readInt();
4319 data.recycle();
4320 reply.recycle();
4321 return res;
4322 }
4323 public void setProcessForeground(IBinder token, int pid,
4324 boolean isForeground) throws RemoteException {
4325 Parcel data = Parcel.obtain();
4326 Parcel reply = Parcel.obtain();
4327 data.writeInterfaceToken(IActivityManager.descriptor);
4328 data.writeStrongBinder(token);
4329 data.writeInt(pid);
4330 data.writeInt(isForeground ? 1 : 0);
4331 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
4332 reply.readException();
4333 data.recycle();
4334 reply.recycle();
4335 }
4336 public int checkPermission(String permission, int pid, int uid)
4337 throws RemoteException {
4338 Parcel data = Parcel.obtain();
4339 Parcel reply = Parcel.obtain();
4340 data.writeInterfaceToken(IActivityManager.descriptor);
4341 data.writeString(permission);
4342 data.writeInt(pid);
4343 data.writeInt(uid);
4344 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
4345 reply.readException();
4346 int res = reply.readInt();
4347 data.recycle();
4348 reply.recycle();
4349 return res;
4350 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004351 public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken)
4352 throws RemoteException {
4353 Parcel data = Parcel.obtain();
4354 Parcel reply = Parcel.obtain();
4355 data.writeInterfaceToken(IActivityManager.descriptor);
4356 data.writeString(permission);
4357 data.writeInt(pid);
4358 data.writeInt(uid);
4359 data.writeStrongBinder(callerToken);
4360 mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0);
4361 reply.readException();
4362 int res = reply.readInt();
4363 data.recycle();
4364 reply.recycle();
4365 return res;
4366 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004367 public boolean clearApplicationUserData(final String packageName,
Amith Yamasani742a6712011-05-04 14:49:28 -07004368 final IPackageDataObserver observer, final int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004369 Parcel data = Parcel.obtain();
4370 Parcel reply = Parcel.obtain();
4371 data.writeInterfaceToken(IActivityManager.descriptor);
4372 data.writeString(packageName);
Christopher Tate31b65f92013-09-09 14:17:27 -07004373 data.writeStrongBinder((observer != null) ? observer.asBinder() : null);
Amith Yamasani742a6712011-05-04 14:49:28 -07004374 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004375 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
4376 reply.readException();
4377 boolean res = reply.readInt() != 0;
4378 data.recycle();
4379 reply.recycle();
4380 return res;
4381 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004382 public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId,
4383 IBinder callerToken) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004384 Parcel data = Parcel.obtain();
4385 Parcel reply = Parcel.obtain();
4386 data.writeInterfaceToken(IActivityManager.descriptor);
4387 uri.writeToParcel(data, 0);
4388 data.writeInt(pid);
4389 data.writeInt(uid);
4390 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004391 data.writeInt(userId);
Dianne Hackbornff170242014-11-19 10:59:01 -08004392 data.writeStrongBinder(callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004393 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
4394 reply.readException();
4395 int res = reply.readInt();
4396 data.recycle();
4397 reply.recycle();
4398 return res;
4399 }
4400 public void grantUriPermission(IApplicationThread caller, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004401 Uri uri, int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004402 Parcel data = Parcel.obtain();
4403 Parcel reply = Parcel.obtain();
4404 data.writeInterfaceToken(IActivityManager.descriptor);
4405 data.writeStrongBinder(caller.asBinder());
4406 data.writeString(targetPkg);
4407 uri.writeToParcel(data, 0);
4408 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004409 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004410 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4411 reply.readException();
4412 data.recycle();
4413 reply.recycle();
4414 }
4415 public void revokeUriPermission(IApplicationThread caller, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004416 int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004417 Parcel data = Parcel.obtain();
4418 Parcel reply = Parcel.obtain();
4419 data.writeInterfaceToken(IActivityManager.descriptor);
4420 data.writeStrongBinder(caller.asBinder());
4421 uri.writeToParcel(data, 0);
4422 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004423 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004424 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4425 reply.readException();
4426 data.recycle();
4427 reply.recycle();
4428 }
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004429
4430 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004431 public void takePersistableUriPermission(Uri uri, int mode, int userId)
4432 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004433 Parcel data = Parcel.obtain();
4434 Parcel reply = Parcel.obtain();
4435 data.writeInterfaceToken(IActivityManager.descriptor);
4436 uri.writeToParcel(data, 0);
4437 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004438 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004439 mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4440 reply.readException();
4441 data.recycle();
4442 reply.recycle();
4443 }
4444
4445 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004446 public void releasePersistableUriPermission(Uri uri, int mode, int userId)
4447 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004448 Parcel data = Parcel.obtain();
4449 Parcel reply = Parcel.obtain();
4450 data.writeInterfaceToken(IActivityManager.descriptor);
4451 uri.writeToParcel(data, 0);
4452 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004453 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004454 mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4455 reply.readException();
4456 data.recycle();
4457 reply.recycle();
4458 }
4459
4460 @Override
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004461 public ParceledListSlice<UriPermission> getPersistedUriPermissions(
4462 String packageName, boolean incoming) throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004463 Parcel data = Parcel.obtain();
4464 Parcel reply = Parcel.obtain();
4465 data.writeInterfaceToken(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004466 data.writeString(packageName);
4467 data.writeInt(incoming ? 1 : 0);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004468 mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
4469 reply.readException();
4470 final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel(
4471 reply);
4472 data.recycle();
4473 reply.recycle();
4474 return perms;
4475 }
4476
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004477 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
4478 throws RemoteException {
4479 Parcel data = Parcel.obtain();
4480 Parcel reply = Parcel.obtain();
4481 data.writeInterfaceToken(IActivityManager.descriptor);
4482 data.writeStrongBinder(who.asBinder());
4483 data.writeInt(waiting ? 1 : 0);
4484 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
4485 reply.readException();
4486 data.recycle();
4487 reply.recycle();
4488 }
4489 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
4490 Parcel data = Parcel.obtain();
4491 Parcel reply = Parcel.obtain();
4492 data.writeInterfaceToken(IActivityManager.descriptor);
4493 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
4494 reply.readException();
4495 outInfo.readFromParcel(reply);
4496 data.recycle();
4497 reply.recycle();
4498 }
4499 public void unhandledBack() throws RemoteException
4500 {
4501 Parcel data = Parcel.obtain();
4502 Parcel reply = Parcel.obtain();
4503 data.writeInterfaceToken(IActivityManager.descriptor);
4504 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
4505 reply.readException();
4506 data.recycle();
4507 reply.recycle();
4508 }
4509 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
4510 {
4511 Parcel data = Parcel.obtain();
4512 Parcel reply = Parcel.obtain();
4513 data.writeInterfaceToken(IActivityManager.descriptor);
4514 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
4515 reply.readException();
4516 ParcelFileDescriptor pfd = null;
4517 if (reply.readInt() != 0) {
4518 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
4519 }
4520 data.recycle();
4521 reply.recycle();
4522 return pfd;
4523 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07004524 public void setLockScreenShown(boolean shown) throws RemoteException
4525 {
4526 Parcel data = Parcel.obtain();
4527 Parcel reply = Parcel.obtain();
4528 data.writeInterfaceToken(IActivityManager.descriptor);
4529 data.writeInt(shown ? 1 : 0);
4530 mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0);
4531 reply.readException();
4532 data.recycle();
4533 reply.recycle();
4534 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004535 public void setDebugApp(
4536 String packageName, boolean waitForDebugger, boolean persistent)
4537 throws RemoteException
4538 {
4539 Parcel data = Parcel.obtain();
4540 Parcel reply = Parcel.obtain();
4541 data.writeInterfaceToken(IActivityManager.descriptor);
4542 data.writeString(packageName);
4543 data.writeInt(waitForDebugger ? 1 : 0);
4544 data.writeInt(persistent ? 1 : 0);
4545 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
4546 reply.readException();
4547 data.recycle();
4548 reply.recycle();
4549 }
4550 public void setAlwaysFinish(boolean enabled) throws RemoteException
4551 {
4552 Parcel data = Parcel.obtain();
4553 Parcel reply = Parcel.obtain();
4554 data.writeInterfaceToken(IActivityManager.descriptor);
4555 data.writeInt(enabled ? 1 : 0);
4556 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
4557 reply.readException();
4558 data.recycle();
4559 reply.recycle();
4560 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004561 public void setActivityController(IActivityController watcher) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004562 {
4563 Parcel data = Parcel.obtain();
4564 Parcel reply = Parcel.obtain();
4565 data.writeInterfaceToken(IActivityManager.descriptor);
4566 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004567 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004568 reply.readException();
4569 data.recycle();
4570 reply.recycle();
4571 }
4572 public void enterSafeMode() throws RemoteException {
4573 Parcel data = Parcel.obtain();
4574 data.writeInterfaceToken(IActivityManager.descriptor);
4575 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
4576 data.recycle();
4577 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07004578 public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag)
Dianne Hackborn099bc622014-01-22 13:39:16 -08004579 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004580 Parcel data = Parcel.obtain();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004581 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn099bc622014-01-22 13:39:16 -08004582 data.writeStrongBinder(sender.asBinder());
4583 data.writeInt(sourceUid);
4584 data.writeString(sourcePkg);
Dianne Hackborn1e383822015-04-10 14:02:33 -07004585 data.writeString(tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004586 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
4587 data.recycle();
4588 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07004589 public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag)
4590 throws RemoteException {
4591 Parcel data = Parcel.obtain();
4592 data.writeInterfaceToken(IActivityManager.descriptor);
4593 data.writeStrongBinder(sender.asBinder());
4594 data.writeInt(sourceUid);
4595 data.writeString(tag);
4596 mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0);
4597 data.recycle();
4598 }
4599 public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag)
4600 throws RemoteException {
4601 Parcel data = Parcel.obtain();
4602 data.writeInterfaceToken(IActivityManager.descriptor);
4603 data.writeStrongBinder(sender.asBinder());
4604 data.writeInt(sourceUid);
4605 data.writeString(tag);
4606 mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0);
4607 data.recycle();
4608 }
Dianne Hackborn64825172011-03-02 21:32:58 -08004609 public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004610 Parcel data = Parcel.obtain();
4611 Parcel reply = Parcel.obtain();
4612 data.writeInterfaceToken(IActivityManager.descriptor);
4613 data.writeIntArray(pids);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004614 data.writeString(reason);
Dianne Hackborn64825172011-03-02 21:32:58 -08004615 data.writeInt(secure ? 1 : 0);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004616 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07004617 reply.readException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004618 boolean res = reply.readInt() != 0;
4619 data.recycle();
4620 reply.recycle();
4621 return res;
4622 }
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07004623 @Override
4624 public boolean killProcessesBelowForeground(String reason) throws RemoteException {
4625 Parcel data = Parcel.obtain();
4626 Parcel reply = Parcel.obtain();
4627 data.writeInterfaceToken(IActivityManager.descriptor);
4628 data.writeString(reason);
4629 mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0);
4630 boolean res = reply.readInt() != 0;
4631 data.recycle();
4632 reply.recycle();
4633 return res;
4634 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004635 public boolean testIsSystemReady()
4636 {
4637 /* this base class version is never called */
4638 return true;
4639 }
Dan Egnor60d87622009-12-16 16:32:58 -08004640 public void handleApplicationCrash(IBinder app,
4641 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
4642 {
4643 Parcel data = Parcel.obtain();
4644 Parcel reply = Parcel.obtain();
4645 data.writeInterfaceToken(IActivityManager.descriptor);
4646 data.writeStrongBinder(app);
4647 crashInfo.writeToParcel(data, 0);
4648 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
4649 reply.readException();
4650 reply.recycle();
4651 data.recycle();
4652 }
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004653
Dianne Hackborn52322712014-08-26 22:47:26 -07004654 public boolean handleApplicationWtf(IBinder app, String tag, boolean system,
Dan Egnorb7f03672009-12-09 16:22:32 -08004655 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004656 {
4657 Parcel data = Parcel.obtain();
4658 Parcel reply = Parcel.obtain();
4659 data.writeInterfaceToken(IActivityManager.descriptor);
4660 data.writeStrongBinder(app);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004661 data.writeString(tag);
Dianne Hackborn52322712014-08-26 22:47:26 -07004662 data.writeInt(system ? 1 : 0);
Dan Egnorb7f03672009-12-09 16:22:32 -08004663 crashInfo.writeToParcel(data, 0);
Dan Egnor60d87622009-12-16 16:32:58 -08004664 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004665 reply.readException();
Dan Egnor60d87622009-12-16 16:32:58 -08004666 boolean res = reply.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004667 reply.recycle();
4668 data.recycle();
Dan Egnor60d87622009-12-16 16:32:58 -08004669 return res;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004670 }
Dan Egnorb7f03672009-12-09 16:22:32 -08004671
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004672 public void handleApplicationStrictModeViolation(IBinder app,
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004673 int violationMask,
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004674 StrictMode.ViolationInfo info) throws RemoteException
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004675 {
4676 Parcel data = Parcel.obtain();
4677 Parcel reply = Parcel.obtain();
4678 data.writeInterfaceToken(IActivityManager.descriptor);
4679 data.writeStrongBinder(app);
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004680 data.writeInt(violationMask);
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004681 info.writeToParcel(data, 0);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004682 mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0);
4683 reply.readException();
4684 reply.recycle();
4685 data.recycle();
4686 }
4687
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004688 public void signalPersistentProcesses(int sig) throws RemoteException {
4689 Parcel data = Parcel.obtain();
4690 Parcel reply = Parcel.obtain();
4691 data.writeInterfaceToken(IActivityManager.descriptor);
4692 data.writeInt(sig);
4693 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
4694 reply.readException();
4695 data.recycle();
4696 reply.recycle();
4697 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004698
Dianne Hackborn1676c852012-09-10 14:52:30 -07004699 public void killBackgroundProcesses(String packageName, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004700 Parcel data = Parcel.obtain();
4701 Parcel reply = Parcel.obtain();
4702 data.writeInterfaceToken(IActivityManager.descriptor);
4703 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004704 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004705 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4706 reply.readException();
4707 data.recycle();
4708 reply.recycle();
4709 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004710
4711 public void killAllBackgroundProcesses() throws RemoteException {
4712 Parcel data = Parcel.obtain();
4713 Parcel reply = Parcel.obtain();
4714 data.writeInterfaceToken(IActivityManager.descriptor);
4715 mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4716 reply.readException();
4717 data.recycle();
4718 reply.recycle();
4719 }
4720
Dianne Hackborn1676c852012-09-10 14:52:30 -07004721 public void forceStopPackage(String packageName, int userId) throws RemoteException {
Dianne Hackborn03abb812010-01-04 18:43:19 -08004722 Parcel data = Parcel.obtain();
4723 Parcel reply = Parcel.obtain();
4724 data.writeInterfaceToken(IActivityManager.descriptor);
4725 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004726 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004727 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004728 reply.readException();
4729 data.recycle();
4730 reply.recycle();
4731 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004732
Dianne Hackborn27ff9132012-03-06 14:57:58 -08004733 public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
4734 throws RemoteException
4735 {
4736 Parcel data = Parcel.obtain();
4737 Parcel reply = Parcel.obtain();
4738 data.writeInterfaceToken(IActivityManager.descriptor);
4739 mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0);
4740 reply.readException();
4741 outInfo.readFromParcel(reply);
4742 reply.recycle();
4743 data.recycle();
4744 }
4745
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004746 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
4747 {
4748 Parcel data = Parcel.obtain();
4749 Parcel reply = Parcel.obtain();
4750 data.writeInterfaceToken(IActivityManager.descriptor);
4751 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
4752 reply.readException();
4753 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
4754 reply.recycle();
4755 data.recycle();
4756 return res;
4757 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004758
Dianne Hackborn1676c852012-09-10 14:52:30 -07004759 public boolean profileControl(String process, int userId, boolean start,
Jeff Hao1b012d32014-08-20 10:35:34 -07004760 ProfilerInfo profilerInfo, int profileType) throws RemoteException
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004761 {
4762 Parcel data = Parcel.obtain();
4763 Parcel reply = Parcel.obtain();
4764 data.writeInterfaceToken(IActivityManager.descriptor);
4765 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004766 data.writeInt(userId);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004767 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07004768 data.writeInt(profileType);
Jeff Hao1b012d32014-08-20 10:35:34 -07004769 if (profilerInfo != null) {
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004770 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07004771 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004772 } else {
4773 data.writeInt(0);
4774 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004775 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
4776 reply.readException();
4777 boolean res = reply.readInt() != 0;
4778 reply.recycle();
4779 data.recycle();
4780 return res;
4781 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004782
Dianne Hackborn55280a92009-05-07 15:53:46 -07004783 public boolean shutdown(int timeout) throws RemoteException
4784 {
4785 Parcel data = Parcel.obtain();
4786 Parcel reply = Parcel.obtain();
4787 data.writeInterfaceToken(IActivityManager.descriptor);
4788 data.writeInt(timeout);
4789 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
4790 reply.readException();
4791 boolean res = reply.readInt() != 0;
4792 reply.recycle();
4793 data.recycle();
4794 return res;
4795 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004796
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07004797 public void stopAppSwitches() throws RemoteException {
4798 Parcel data = Parcel.obtain();
4799 Parcel reply = Parcel.obtain();
4800 data.writeInterfaceToken(IActivityManager.descriptor);
4801 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
4802 reply.readException();
4803 reply.recycle();
4804 data.recycle();
4805 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004806
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07004807 public void resumeAppSwitches() throws RemoteException {
4808 Parcel data = Parcel.obtain();
4809 Parcel reply = Parcel.obtain();
4810 data.writeInterfaceToken(IActivityManager.descriptor);
4811 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
4812 reply.readException();
4813 reply.recycle();
4814 data.recycle();
4815 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07004816
4817 public void addPackageDependency(String packageName) throws RemoteException {
4818 Parcel data = Parcel.obtain();
4819 Parcel reply = Parcel.obtain();
4820 data.writeInterfaceToken(IActivityManager.descriptor);
4821 data.writeString(packageName);
4822 mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0);
4823 reply.readException();
4824 data.recycle();
4825 reply.recycle();
4826 }
4827
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004828 public void killApplicationWithAppId(String pkg, int appid, String reason)
4829 throws RemoteException {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004830 Parcel data = Parcel.obtain();
4831 Parcel reply = Parcel.obtain();
4832 data.writeInterfaceToken(IActivityManager.descriptor);
4833 data.writeString(pkg);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004834 data.writeInt(appid);
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004835 data.writeString(reason);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004836 mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004837 reply.readException();
4838 data.recycle();
4839 reply.recycle();
4840 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004841
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07004842 public void closeSystemDialogs(String reason) throws RemoteException {
4843 Parcel data = Parcel.obtain();
4844 Parcel reply = Parcel.obtain();
4845 data.writeInterfaceToken(IActivityManager.descriptor);
4846 data.writeString(reason);
4847 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
4848 reply.readException();
4849 data.recycle();
4850 reply.recycle();
4851 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004852
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004853 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004854 throws RemoteException {
4855 Parcel data = Parcel.obtain();
4856 Parcel reply = Parcel.obtain();
4857 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004858 data.writeIntArray(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004859 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
4860 reply.readException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004861 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004862 data.recycle();
4863 reply.recycle();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004864 return res;
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004865 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07004866
4867 public void killApplicationProcess(String processName, int uid) throws RemoteException {
4868 Parcel data = Parcel.obtain();
4869 Parcel reply = Parcel.obtain();
4870 data.writeInterfaceToken(IActivityManager.descriptor);
4871 data.writeString(processName);
4872 data.writeInt(uid);
4873 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
4874 reply.readException();
4875 data.recycle();
4876 reply.recycle();
4877 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004878
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07004879 public void overridePendingTransition(IBinder token, String packageName,
4880 int enterAnim, int exitAnim) throws RemoteException {
4881 Parcel data = Parcel.obtain();
4882 Parcel reply = Parcel.obtain();
4883 data.writeInterfaceToken(IActivityManager.descriptor);
4884 data.writeStrongBinder(token);
4885 data.writeString(packageName);
4886 data.writeInt(enterAnim);
4887 data.writeInt(exitAnim);
4888 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
4889 reply.readException();
4890 data.recycle();
4891 reply.recycle();
4892 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004893
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08004894 public boolean isUserAMonkey() throws RemoteException {
4895 Parcel data = Parcel.obtain();
4896 Parcel reply = Parcel.obtain();
4897 data.writeInterfaceToken(IActivityManager.descriptor);
4898 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
4899 reply.readException();
4900 boolean res = reply.readInt() != 0;
4901 data.recycle();
4902 reply.recycle();
4903 return res;
4904 }
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07004905
4906 public void setUserIsMonkey(boolean monkey) throws RemoteException {
4907 Parcel data = Parcel.obtain();
4908 Parcel reply = Parcel.obtain();
4909 data.writeInterfaceToken(IActivityManager.descriptor);
4910 data.writeInt(monkey ? 1 : 0);
4911 mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0);
4912 reply.readException();
4913 data.recycle();
4914 reply.recycle();
4915 }
4916
Dianne Hackborn860755f2010-06-03 18:47:52 -07004917 public void finishHeavyWeightApp() throws RemoteException {
4918 Parcel data = Parcel.obtain();
4919 Parcel reply = Parcel.obtain();
4920 data.writeInterfaceToken(IActivityManager.descriptor);
4921 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
4922 reply.readException();
4923 data.recycle();
4924 reply.recycle();
4925 }
Craig Mautner4addfc52013-06-25 08:05:45 -07004926
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004927 public boolean convertFromTranslucent(IBinder token)
Craig Mautner4addfc52013-06-25 08:05:45 -07004928 throws RemoteException {
4929 Parcel data = Parcel.obtain();
4930 Parcel reply = Parcel.obtain();
4931 data.writeInterfaceToken(IActivityManager.descriptor);
4932 data.writeStrongBinder(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07004933 mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0);
4934 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004935 boolean res = reply.readInt() != 0;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004936 data.recycle();
4937 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004938 return res;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004939 }
4940
Craig Mautner233ceee2014-05-09 17:05:11 -07004941 public boolean convertToTranslucent(IBinder token, ActivityOptions options)
Craig Mautner5eda9b32013-07-02 11:58:16 -07004942 throws RemoteException {
4943 Parcel data = Parcel.obtain();
4944 Parcel reply = Parcel.obtain();
4945 data.writeInterfaceToken(IActivityManager.descriptor);
4946 data.writeStrongBinder(token);
Craig Mautner233ceee2014-05-09 17:05:11 -07004947 if (options == null) {
4948 data.writeInt(0);
4949 } else {
4950 data.writeInt(1);
4951 data.writeBundle(options.toBundle());
4952 }
Craig Mautner5eda9b32013-07-02 11:58:16 -07004953 mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07004954 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004955 boolean res = reply.readInt() != 0;
Craig Mautner4addfc52013-06-25 08:05:45 -07004956 data.recycle();
4957 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004958 return res;
Craig Mautner4addfc52013-06-25 08:05:45 -07004959 }
4960
Craig Mautner233ceee2014-05-09 17:05:11 -07004961 public ActivityOptions getActivityOptions(IBinder token) throws RemoteException {
4962 Parcel data = Parcel.obtain();
4963 Parcel reply = Parcel.obtain();
4964 data.writeInterfaceToken(IActivityManager.descriptor);
4965 data.writeStrongBinder(token);
4966 mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0);
4967 reply.readException();
Chong Zhang280d3322015-11-03 17:27:26 -08004968 ActivityOptions options = ActivityOptions.fromBundle(reply.readBundle());
Craig Mautner233ceee2014-05-09 17:05:11 -07004969 data.recycle();
4970 reply.recycle();
4971 return options;
4972 }
4973
Daniel Sandler69a48172010-06-23 16:29:36 -04004974 public void setImmersive(IBinder token, boolean immersive)
4975 throws RemoteException {
4976 Parcel data = Parcel.obtain();
4977 Parcel reply = Parcel.obtain();
4978 data.writeInterfaceToken(IActivityManager.descriptor);
4979 data.writeStrongBinder(token);
4980 data.writeInt(immersive ? 1 : 0);
4981 mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
4982 reply.readException();
4983 data.recycle();
4984 reply.recycle();
4985 }
4986
4987 public boolean isImmersive(IBinder token)
4988 throws RemoteException {
4989 Parcel data = Parcel.obtain();
4990 Parcel reply = Parcel.obtain();
4991 data.writeInterfaceToken(IActivityManager.descriptor);
4992 data.writeStrongBinder(token);
4993 mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004994 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004995 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004996 data.recycle();
4997 reply.recycle();
4998 return res;
4999 }
5000
Craig Mautnerd61dc202014-07-07 11:09:11 -07005001 public boolean isTopOfTask(IBinder token) throws RemoteException {
5002 Parcel data = Parcel.obtain();
5003 Parcel reply = Parcel.obtain();
5004 data.writeInterfaceToken(IActivityManager.descriptor);
5005 data.writeStrongBinder(token);
5006 mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0);
5007 reply.readException();
5008 boolean res = reply.readInt() == 1;
5009 data.recycle();
5010 reply.recycle();
5011 return res;
5012 }
5013
Daniel Sandler69a48172010-06-23 16:29:36 -04005014 public boolean isTopActivityImmersive()
5015 throws RemoteException {
5016 Parcel data = Parcel.obtain();
5017 Parcel reply = Parcel.obtain();
5018 data.writeInterfaceToken(IActivityManager.descriptor);
5019 mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04005020 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07005021 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04005022 data.recycle();
5023 reply.recycle();
5024 return res;
5025 }
5026
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07005027 public void crashApplication(int uid, int initialPid, String packageName,
5028 String message) throws RemoteException {
5029 Parcel data = Parcel.obtain();
5030 Parcel reply = Parcel.obtain();
5031 data.writeInterfaceToken(IActivityManager.descriptor);
5032 data.writeInt(uid);
5033 data.writeInt(initialPid);
5034 data.writeString(packageName);
5035 data.writeString(message);
5036 mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0);
5037 reply.readException();
5038 data.recycle();
5039 reply.recycle();
5040 }
Andy McFadden824c5102010-07-09 16:26:57 -07005041
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005042 public String getProviderMimeType(Uri uri, int userId) throws RemoteException {
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07005043 Parcel data = Parcel.obtain();
5044 Parcel reply = Parcel.obtain();
5045 data.writeInterfaceToken(IActivityManager.descriptor);
5046 uri.writeToParcel(data, 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005047 data.writeInt(userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07005048 mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0);
5049 reply.readException();
5050 String res = reply.readString();
5051 data.recycle();
5052 reply.recycle();
5053 return res;
5054 }
5055
Dianne Hackborn7e269642010-08-25 19:50:20 -07005056 public IBinder newUriPermissionOwner(String name)
5057 throws RemoteException {
5058 Parcel data = Parcel.obtain();
5059 Parcel reply = Parcel.obtain();
5060 data.writeInterfaceToken(IActivityManager.descriptor);
5061 data.writeString(name);
5062 mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
5063 reply.readException();
5064 IBinder res = reply.readStrongBinder();
5065 data.recycle();
5066 reply.recycle();
5067 return res;
5068 }
5069
5070 public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
Nicolas Prevotf1939902014-06-25 09:29:02 +01005071 Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07005072 Parcel data = Parcel.obtain();
5073 Parcel reply = Parcel.obtain();
5074 data.writeInterfaceToken(IActivityManager.descriptor);
5075 data.writeStrongBinder(owner);
5076 data.writeInt(fromUid);
5077 data.writeString(targetPkg);
5078 uri.writeToParcel(data, 0);
5079 data.writeInt(mode);
Nicolas Prevotf1939902014-06-25 09:29:02 +01005080 data.writeInt(sourceUserId);
5081 data.writeInt(targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07005082 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
5083 reply.readException();
5084 data.recycle();
5085 reply.recycle();
5086 }
5087
5088 public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01005089 int mode, int userId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07005090 Parcel data = Parcel.obtain();
5091 Parcel reply = Parcel.obtain();
5092 data.writeInterfaceToken(IActivityManager.descriptor);
5093 data.writeStrongBinder(owner);
5094 if (uri != null) {
5095 data.writeInt(1);
5096 uri.writeToParcel(data, 0);
5097 } else {
5098 data.writeInt(0);
5099 }
5100 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01005101 data.writeInt(userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07005102 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
5103 reply.readException();
5104 data.recycle();
5105 reply.recycle();
5106 }
Dianne Hackbornc8f84972010-08-25 23:14:44 -07005107
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07005108 public int checkGrantUriPermission(int callingUid, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01005109 Uri uri, int modeFlags, int userId) throws RemoteException {
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07005110 Parcel data = Parcel.obtain();
5111 Parcel reply = Parcel.obtain();
5112 data.writeInterfaceToken(IActivityManager.descriptor);
5113 data.writeInt(callingUid);
5114 data.writeString(targetPkg);
5115 uri.writeToParcel(data, 0);
5116 data.writeInt(modeFlags);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01005117 data.writeInt(userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07005118 mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
5119 reply.readException();
5120 int res = reply.readInt();
5121 data.recycle();
5122 reply.recycle();
5123 return res;
5124 }
5125
Dianne Hackborn1676c852012-09-10 14:52:30 -07005126 public boolean dumpHeap(String process, int userId, boolean managed,
Andy McFadden824c5102010-07-09 16:26:57 -07005127 String path, ParcelFileDescriptor fd) throws RemoteException {
5128 Parcel data = Parcel.obtain();
5129 Parcel reply = Parcel.obtain();
5130 data.writeInterfaceToken(IActivityManager.descriptor);
5131 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07005132 data.writeInt(userId);
Andy McFadden824c5102010-07-09 16:26:57 -07005133 data.writeInt(managed ? 1 : 0);
5134 data.writeString(path);
5135 if (fd != null) {
5136 data.writeInt(1);
5137 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
5138 } else {
5139 data.writeInt(0);
5140 }
5141 mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
5142 reply.readException();
5143 boolean res = reply.readInt() != 0;
5144 reply.recycle();
5145 data.recycle();
5146 return res;
5147 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07005148
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005149 public int startActivities(IApplicationThread caller, String callingPackage,
Dianne Hackborna4972e92012-03-14 10:38:05 -07005150 Intent[] intents, String[] resolvedTypes, IBinder resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07005151 Bundle options, int userId) throws RemoteException {
Dianne Hackborn621e17d2010-11-22 15:59:56 -08005152 Parcel data = Parcel.obtain();
5153 Parcel reply = Parcel.obtain();
5154 data.writeInterfaceToken(IActivityManager.descriptor);
5155 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005156 data.writeString(callingPackage);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08005157 data.writeTypedArray(intents, 0);
5158 data.writeStringArray(resolvedTypes);
5159 data.writeStrongBinder(resultTo);
Dianne Hackborna4972e92012-03-14 10:38:05 -07005160 if (options != null) {
5161 data.writeInt(1);
5162 options.writeToParcel(data, 0);
5163 } else {
5164 data.writeInt(0);
5165 }
Amith Yamasaniea7e9152012-09-24 16:11:18 -07005166 data.writeInt(userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08005167 mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0);
5168 reply.readException();
5169 int result = reply.readInt();
5170 reply.recycle();
5171 data.recycle();
5172 return result;
5173 }
5174
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07005175 public int getFrontActivityScreenCompatMode() throws RemoteException {
5176 Parcel data = Parcel.obtain();
5177 Parcel reply = Parcel.obtain();
5178 data.writeInterfaceToken(IActivityManager.descriptor);
5179 mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
5180 reply.readException();
5181 int mode = reply.readInt();
5182 reply.recycle();
5183 data.recycle();
5184 return mode;
5185 }
5186
5187 public void setFrontActivityScreenCompatMode(int mode) throws RemoteException {
5188 Parcel data = Parcel.obtain();
5189 Parcel reply = Parcel.obtain();
5190 data.writeInterfaceToken(IActivityManager.descriptor);
5191 data.writeInt(mode);
5192 mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
5193 reply.readException();
5194 reply.recycle();
5195 data.recycle();
5196 }
5197
5198 public int getPackageScreenCompatMode(String packageName) throws RemoteException {
5199 Parcel data = Parcel.obtain();
5200 Parcel reply = Parcel.obtain();
5201 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07005202 data.writeString(packageName);
5203 mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07005204 reply.readException();
5205 int mode = reply.readInt();
5206 reply.recycle();
5207 data.recycle();
5208 return mode;
5209 }
5210
5211 public void setPackageScreenCompatMode(String packageName, int mode)
Dianne Hackborne2515ee2011-04-27 18:52:56 -04005212 throws RemoteException {
5213 Parcel data = Parcel.obtain();
5214 Parcel reply = Parcel.obtain();
5215 data.writeInterfaceToken(IActivityManager.descriptor);
5216 data.writeString(packageName);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07005217 data.writeInt(mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04005218 mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
5219 reply.readException();
5220 reply.recycle();
5221 data.recycle();
5222 }
5223
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07005224 public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
5225 Parcel data = Parcel.obtain();
5226 Parcel reply = Parcel.obtain();
5227 data.writeInterfaceToken(IActivityManager.descriptor);
5228 data.writeString(packageName);
5229 mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
5230 reply.readException();
5231 boolean ask = reply.readInt() != 0;
5232 reply.recycle();
5233 data.recycle();
5234 return ask;
5235 }
5236
5237 public void setPackageAskScreenCompat(String packageName, boolean ask)
5238 throws RemoteException {
5239 Parcel data = Parcel.obtain();
5240 Parcel reply = Parcel.obtain();
5241 data.writeInterfaceToken(IActivityManager.descriptor);
5242 data.writeString(packageName);
5243 data.writeInt(ask ? 1 : 0);
5244 mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
5245 reply.readException();
5246 reply.recycle();
5247 data.recycle();
5248 }
5249
Amith Yamasani4b2e9342011-03-31 12:38:53 -07005250 public boolean switchUser(int userid) throws RemoteException {
5251 Parcel data = Parcel.obtain();
5252 Parcel reply = Parcel.obtain();
5253 data.writeInterfaceToken(IActivityManager.descriptor);
5254 data.writeInt(userid);
5255 mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0);
5256 reply.readException();
5257 boolean result = reply.readInt() != 0;
5258 reply.recycle();
5259 data.recycle();
5260 return result;
5261 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07005262
Kenny Guy08488bf2014-02-21 17:40:37 +00005263 public boolean startUserInBackground(int userid) throws RemoteException {
5264 Parcel data = Parcel.obtain();
5265 Parcel reply = Parcel.obtain();
5266 data.writeInterfaceToken(IActivityManager.descriptor);
5267 data.writeInt(userid);
5268 mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0);
5269 reply.readException();
5270 boolean result = reply.readInt() != 0;
5271 reply.recycle();
5272 data.recycle();
5273 return result;
5274 }
5275
Jeff Sharkeyba512352015-11-12 20:17:45 -08005276 public boolean unlockUser(int userId, byte[] token) throws RemoteException {
5277 Parcel data = Parcel.obtain();
5278 Parcel reply = Parcel.obtain();
5279 data.writeInterfaceToken(IActivityManager.descriptor);
5280 data.writeInt(userId);
5281 data.writeByteArray(token);
5282 mRemote.transact(IActivityManager.UNLOCK_USER_TRANSACTION, data, reply, 0);
5283 reply.readException();
5284 boolean result = reply.readInt() != 0;
5285 reply.recycle();
5286 data.recycle();
5287 return result;
5288 }
5289
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005290 public int stopUser(int userid, IStopUserCallback callback) throws RemoteException {
5291 Parcel data = Parcel.obtain();
5292 Parcel reply = Parcel.obtain();
5293 data.writeInterfaceToken(IActivityManager.descriptor);
5294 data.writeInt(userid);
5295 data.writeStrongInterface(callback);
5296 mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0);
5297 reply.readException();
5298 int result = reply.readInt();
5299 reply.recycle();
5300 data.recycle();
5301 return result;
5302 }
5303
Amith Yamasani52f1d752012-03-28 18:19:29 -07005304 public UserInfo getCurrentUser() throws RemoteException {
5305 Parcel data = Parcel.obtain();
5306 Parcel reply = Parcel.obtain();
5307 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005308 mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0);
Amith Yamasani52f1d752012-03-28 18:19:29 -07005309 reply.readException();
5310 UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply);
5311 reply.recycle();
5312 data.recycle();
5313 return userInfo;
5314 }
5315
Jeff Sharkeye17ac152015-11-06 22:40:29 -08005316 public boolean isUserRunning(int userid, int flags) throws RemoteException {
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005317 Parcel data = Parcel.obtain();
5318 Parcel reply = Parcel.obtain();
5319 data.writeInterfaceToken(IActivityManager.descriptor);
5320 data.writeInt(userid);
Jeff Sharkeye17ac152015-11-06 22:40:29 -08005321 data.writeInt(flags);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005322 mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0);
5323 reply.readException();
5324 boolean result = reply.readInt() != 0;
5325 reply.recycle();
5326 data.recycle();
5327 return result;
5328 }
5329
Dianne Hackbornc72fc672012-09-20 13:12:03 -07005330 public int[] getRunningUserIds() throws RemoteException {
5331 Parcel data = Parcel.obtain();
5332 Parcel reply = Parcel.obtain();
5333 data.writeInterfaceToken(IActivityManager.descriptor);
5334 mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0);
5335 reply.readException();
5336 int[] result = reply.createIntArray();
5337 reply.recycle();
5338 data.recycle();
5339 return result;
5340 }
5341
Wale Ogunwaled54b5782014-10-23 15:55:23 -07005342 public boolean removeTask(int taskId) throws RemoteException {
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005343 Parcel data = Parcel.obtain();
5344 Parcel reply = Parcel.obtain();
5345 data.writeInterfaceToken(IActivityManager.descriptor);
5346 data.writeInt(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005347 mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
5348 reply.readException();
5349 boolean result = reply.readInt() != 0;
5350 reply.recycle();
5351 data.recycle();
5352 return result;
5353 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07005354
Jeff Sharkeya4620792011-05-20 15:29:23 -07005355 public void registerProcessObserver(IProcessObserver observer) throws RemoteException {
5356 Parcel data = Parcel.obtain();
5357 Parcel reply = Parcel.obtain();
5358 data.writeInterfaceToken(IActivityManager.descriptor);
5359 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5360 mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5361 reply.readException();
5362 data.recycle();
5363 reply.recycle();
5364 }
5365
5366 public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException {
5367 Parcel data = Parcel.obtain();
5368 Parcel reply = Parcel.obtain();
5369 data.writeInterfaceToken(IActivityManager.descriptor);
5370 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5371 mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5372 reply.readException();
5373 data.recycle();
5374 reply.recycle();
5375 }
5376
Dianne Hackbornbef28fe2015-10-29 17:57:11 -07005377 public void registerUidObserver(IUidObserver observer, int which) throws RemoteException {
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07005378 Parcel data = Parcel.obtain();
5379 Parcel reply = Parcel.obtain();
5380 data.writeInterfaceToken(IActivityManager.descriptor);
5381 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
Dianne Hackbornbef28fe2015-10-29 17:57:11 -07005382 data.writeInt(which);
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07005383 mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0);
5384 reply.readException();
5385 data.recycle();
5386 reply.recycle();
5387 }
5388
5389 public void unregisterUidObserver(IUidObserver observer) throws RemoteException {
5390 Parcel data = Parcel.obtain();
5391 Parcel reply = Parcel.obtain();
5392 data.writeInterfaceToken(IActivityManager.descriptor);
5393 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5394 mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0);
5395 reply.readException();
5396 data.recycle();
5397 reply.recycle();
5398 }
5399
Dianne Hackborn6c418d52011-06-29 14:05:33 -07005400 public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException {
5401 Parcel data = Parcel.obtain();
5402 Parcel reply = Parcel.obtain();
5403 data.writeInterfaceToken(IActivityManager.descriptor);
5404 data.writeStrongBinder(sender.asBinder());
5405 mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0);
5406 reply.readException();
5407 boolean res = reply.readInt() != 0;
5408 data.recycle();
5409 reply.recycle();
5410 return res;
5411 }
5412
Dianne Hackborn1927ae82012-06-22 15:21:36 -07005413 public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException {
5414 Parcel data = Parcel.obtain();
5415 Parcel reply = Parcel.obtain();
5416 data.writeInterfaceToken(IActivityManager.descriptor);
5417 data.writeStrongBinder(sender.asBinder());
5418 mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0);
5419 reply.readException();
5420 boolean res = reply.readInt() != 0;
5421 data.recycle();
5422 reply.recycle();
5423 return res;
5424 }
5425
Dianne Hackborn81038902012-11-26 17:04:09 -08005426 public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException {
5427 Parcel data = Parcel.obtain();
5428 Parcel reply = Parcel.obtain();
5429 data.writeInterfaceToken(IActivityManager.descriptor);
5430 data.writeStrongBinder(sender.asBinder());
5431 mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5432 reply.readException();
5433 Intent res = reply.readInt() != 0
5434 ? Intent.CREATOR.createFromParcel(reply) : null;
5435 data.recycle();
5436 reply.recycle();
5437 return res;
5438 }
5439
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08005440 public String getTagForIntentSender(IIntentSender sender, String prefix)
5441 throws RemoteException {
5442 Parcel data = Parcel.obtain();
5443 Parcel reply = Parcel.obtain();
5444 data.writeInterfaceToken(IActivityManager.descriptor);
5445 data.writeStrongBinder(sender.asBinder());
5446 data.writeString(prefix);
5447 mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5448 reply.readException();
5449 String res = reply.readString();
5450 data.recycle();
5451 reply.recycle();
5452 return res;
5453 }
5454
Dianne Hackborn31ca8542011-07-19 14:58:28 -07005455 public void updatePersistentConfiguration(Configuration values) throws RemoteException
5456 {
5457 Parcel data = Parcel.obtain();
5458 Parcel reply = Parcel.obtain();
5459 data.writeInterfaceToken(IActivityManager.descriptor);
5460 values.writeToParcel(data, 0);
5461 mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0);
5462 reply.readException();
5463 data.recycle();
5464 reply.recycle();
5465 }
5466
Dianne Hackbornb437e092011-08-05 17:50:29 -07005467 public long[] getProcessPss(int[] pids) throws RemoteException {
5468 Parcel data = Parcel.obtain();
5469 Parcel reply = Parcel.obtain();
5470 data.writeInterfaceToken(IActivityManager.descriptor);
5471 data.writeIntArray(pids);
5472 mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0);
5473 reply.readException();
5474 long[] res = reply.createLongArray();
5475 data.recycle();
5476 reply.recycle();
5477 return res;
5478 }
5479
Dianne Hackborn661cd522011-08-22 00:26:20 -07005480 public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
5481 Parcel data = Parcel.obtain();
5482 Parcel reply = Parcel.obtain();
5483 data.writeInterfaceToken(IActivityManager.descriptor);
5484 TextUtils.writeToParcel(msg, data, 0);
5485 data.writeInt(always ? 1 : 0);
5486 mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
5487 reply.readException();
5488 data.recycle();
5489 reply.recycle();
5490 }
5491
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02005492 public void keyguardWaitingForActivityDrawn() throws RemoteException {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07005493 Parcel data = Parcel.obtain();
5494 Parcel reply = Parcel.obtain();
5495 data.writeInterfaceToken(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02005496 mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
Dianne Hackborn90c52de2011-09-23 12:57:44 -07005497 reply.readException();
5498 data.recycle();
5499 reply.recycle();
5500 }
5501
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07005502 public void keyguardGoingAway(boolean disableWindowAnimations,
5503 boolean keyguardGoingToNotificationShade) throws RemoteException {
5504 Parcel data = Parcel.obtain();
5505 Parcel reply = Parcel.obtain();
5506 data.writeInterfaceToken(IActivityManager.descriptor);
5507 data.writeInt(disableWindowAnimations ? 1 : 0);
5508 data.writeInt(keyguardGoingToNotificationShade ? 1 : 0);
5509 mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0);
5510 reply.readException();
5511 data.recycle();
5512 reply.recycle();
5513 }
5514
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07005515 public boolean shouldUpRecreateTask(IBinder token, String destAffinity)
Adam Powelldd8fab22012-03-22 17:47:27 -07005516 throws RemoteException {
5517 Parcel data = Parcel.obtain();
5518 Parcel reply = Parcel.obtain();
5519 data.writeInterfaceToken(IActivityManager.descriptor);
5520 data.writeStrongBinder(token);
5521 data.writeString(destAffinity);
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07005522 mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0);
Adam Powelldd8fab22012-03-22 17:47:27 -07005523 reply.readException();
5524 boolean result = reply.readInt() != 0;
5525 data.recycle();
5526 reply.recycle();
5527 return result;
5528 }
5529
5530 public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData)
5531 throws RemoteException {
5532 Parcel data = Parcel.obtain();
5533 Parcel reply = Parcel.obtain();
5534 data.writeInterfaceToken(IActivityManager.descriptor);
5535 data.writeStrongBinder(token);
5536 target.writeToParcel(data, 0);
5537 data.writeInt(resultCode);
5538 if (resultData != null) {
5539 data.writeInt(1);
5540 resultData.writeToParcel(data, 0);
5541 } else {
5542 data.writeInt(0);
5543 }
5544 mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0);
5545 reply.readException();
5546 boolean result = reply.readInt() != 0;
5547 data.recycle();
5548 reply.recycle();
5549 return result;
5550 }
5551
Dianne Hackborn5320eb82012-05-18 12:05:04 -07005552 public int getLaunchedFromUid(IBinder activityToken) throws RemoteException {
5553 Parcel data = Parcel.obtain();
5554 Parcel reply = Parcel.obtain();
5555 data.writeInterfaceToken(IActivityManager.descriptor);
5556 data.writeStrongBinder(activityToken);
5557 mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0);
5558 reply.readException();
5559 int result = reply.readInt();
5560 data.recycle();
5561 reply.recycle();
5562 return result;
5563 }
5564
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005565 public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException {
5566 Parcel data = Parcel.obtain();
5567 Parcel reply = Parcel.obtain();
5568 data.writeInterfaceToken(IActivityManager.descriptor);
5569 data.writeStrongBinder(activityToken);
5570 mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0);
5571 reply.readException();
5572 String result = reply.readString();
5573 data.recycle();
5574 reply.recycle();
5575 return result;
5576 }
5577
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07005578 public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5579 Parcel data = Parcel.obtain();
5580 Parcel reply = Parcel.obtain();
5581 data.writeInterfaceToken(IActivityManager.descriptor);
5582 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5583 mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5584 reply.readException();
5585 data.recycle();
5586 reply.recycle();
5587 }
5588
5589 public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5590 Parcel data = Parcel.obtain();
5591 Parcel reply = Parcel.obtain();
5592 data.writeInterfaceToken(IActivityManager.descriptor);
5593 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5594 mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5595 reply.readException();
5596 data.recycle();
5597 reply.recycle();
5598 }
5599
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07005600 public void requestBugReport() throws RemoteException {
5601 Parcel data = Parcel.obtain();
5602 Parcel reply = Parcel.obtain();
5603 data.writeInterfaceToken(IActivityManager.descriptor);
5604 mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0);
5605 reply.readException();
5606 data.recycle();
5607 reply.recycle();
5608 }
5609
Jeff Brownbd181bb2013-09-10 16:44:24 -07005610 public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason)
5611 throws RemoteException {
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005612 Parcel data = Parcel.obtain();
5613 Parcel reply = Parcel.obtain();
5614 data.writeInterfaceToken(IActivityManager.descriptor);
5615 data.writeInt(pid);
5616 data.writeInt(aboveSystem ? 1 : 0);
Jeff Brownbd181bb2013-09-10 16:44:24 -07005617 data.writeString(reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005618 mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0);
5619 reply.readException();
5620 long res = reply.readInt();
5621 data.recycle();
5622 reply.recycle();
5623 return res;
5624 }
5625
Adam Skorydfc7fd72013-08-05 19:23:41 -07005626 public Bundle getAssistContextExtras(int requestType) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005627 Parcel data = Parcel.obtain();
5628 Parcel reply = Parcel.obtain();
5629 data.writeInterfaceToken(IActivityManager.descriptor);
5630 data.writeInt(requestType);
Adam Skorydfc7fd72013-08-05 19:23:41 -07005631 mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005632 reply.readException();
5633 Bundle res = reply.readBundle();
5634 data.recycle();
5635 reply.recycle();
5636 return res;
5637 }
5638
Dianne Hackborn17f69352015-07-17 18:04:14 -07005639 public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver,
5640 IBinder activityToken) throws RemoteException {
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005641 Parcel data = Parcel.obtain();
5642 Parcel reply = Parcel.obtain();
5643 data.writeInterfaceToken(IActivityManager.descriptor);
5644 data.writeInt(requestType);
5645 data.writeStrongBinder(receiver.asBinder());
Dianne Hackborn17f69352015-07-17 18:04:14 -07005646 data.writeStrongBinder(activityToken);
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005647 mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
5648 reply.readException();
Dianne Hackborn17f69352015-07-17 18:04:14 -07005649 boolean res = reply.readInt() != 0;
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005650 data.recycle();
5651 reply.recycle();
Dianne Hackborn17f69352015-07-17 18:04:14 -07005652 return res;
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005653 }
5654
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07005655 public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure,
Dianne Hackborna3acdb32015-06-08 17:07:40 -07005656 AssistContent content, Uri referrer) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005657 Parcel data = Parcel.obtain();
5658 Parcel reply = Parcel.obtain();
5659 data.writeInterfaceToken(IActivityManager.descriptor);
5660 data.writeStrongBinder(token);
5661 data.writeBundle(extras);
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07005662 structure.writeToParcel(data, 0);
5663 content.writeToParcel(data, 0);
Dianne Hackborna3acdb32015-06-08 17:07:40 -07005664 if (referrer != null) {
5665 data.writeInt(1);
5666 referrer.writeToParcel(data, 0);
5667 } else {
5668 data.writeInt(0);
5669 }
Adam Skorydfc7fd72013-08-05 19:23:41 -07005670 mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005671 reply.readException();
5672 data.recycle();
5673 reply.recycle();
5674 }
5675
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07005676 public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle,
5677 Bundle args) throws RemoteException {
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07005678 Parcel data = Parcel.obtain();
5679 Parcel reply = Parcel.obtain();
5680 data.writeInterfaceToken(IActivityManager.descriptor);
5681 intent.writeToParcel(data, 0);
5682 data.writeInt(requestType);
5683 data.writeString(hint);
5684 data.writeInt(userHandle);
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07005685 data.writeBundle(args);
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07005686 mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0);
5687 reply.readException();
5688 boolean res = reply.readInt() != 0;
5689 data.recycle();
5690 reply.recycle();
5691 return res;
5692 }
5693
Dianne Hackborn17f69352015-07-17 18:04:14 -07005694 public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException {
Benjamin Franzc200f442015-06-25 18:20:04 +01005695 Parcel data = Parcel.obtain();
5696 Parcel reply = Parcel.obtain();
5697 data.writeInterfaceToken(IActivityManager.descriptor);
5698 mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0);
5699 reply.readException();
5700 boolean res = reply.readInt() != 0;
5701 data.recycle();
5702 reply.recycle();
5703 return res;
5704 }
5705
Dianne Hackborn17f69352015-07-17 18:04:14 -07005706 public boolean showAssistFromActivity(IBinder token, Bundle args) throws RemoteException {
5707 Parcel data = Parcel.obtain();
5708 Parcel reply = Parcel.obtain();
5709 data.writeInterfaceToken(IActivityManager.descriptor);
5710 data.writeStrongBinder(token);
5711 data.writeBundle(args);
5712 mRemote.transact(SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION, data, reply, 0);
5713 reply.readException();
5714 boolean res = reply.readInt() != 0;
5715 data.recycle();
5716 reply.recycle();
5717 return res;
5718 }
5719
Svetoslavaa41add2015-08-06 15:03:55 -07005720 public void killUid(int appId, int userId, String reason) throws RemoteException {
Dianne Hackbornf1b78242013-04-08 22:28:59 -07005721 Parcel data = Parcel.obtain();
5722 Parcel reply = Parcel.obtain();
5723 data.writeInterfaceToken(IActivityManager.descriptor);
Svetoslavaa41add2015-08-06 15:03:55 -07005724 data.writeInt(appId);
5725 data.writeInt(userId);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07005726 data.writeString(reason);
5727 mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0);
5728 reply.readException();
5729 data.recycle();
5730 reply.recycle();
5731 }
5732
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07005733 public void hang(IBinder who, boolean allowRestart) throws RemoteException {
5734 Parcel data = Parcel.obtain();
5735 Parcel reply = Parcel.obtain();
5736 data.writeInterfaceToken(IActivityManager.descriptor);
5737 data.writeStrongBinder(who);
5738 data.writeInt(allowRestart ? 1 : 0);
5739 mRemote.transact(HANG_TRANSACTION, data, reply, 0);
5740 reply.readException();
5741 data.recycle();
5742 reply.recycle();
5743 }
5744
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07005745 public void reportActivityFullyDrawn(IBinder token) throws RemoteException {
5746 Parcel data = Parcel.obtain();
5747 Parcel reply = Parcel.obtain();
5748 data.writeInterfaceToken(IActivityManager.descriptor);
5749 data.writeStrongBinder(token);
5750 mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0);
5751 reply.readException();
5752 data.recycle();
5753 reply.recycle();
5754 }
5755
Craig Mautner5eda9b32013-07-02 11:58:16 -07005756 public void notifyActivityDrawn(IBinder token) throws RemoteException {
5757 Parcel data = Parcel.obtain();
5758 Parcel reply = Parcel.obtain();
5759 data.writeInterfaceToken(IActivityManager.descriptor);
5760 data.writeStrongBinder(token);
5761 mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
5762 reply.readException();
5763 data.recycle();
5764 reply.recycle();
5765 }
5766
Dianne Hackborn57a7f592013-07-22 18:21:32 -07005767 public void restart() throws RemoteException {
5768 Parcel data = Parcel.obtain();
5769 Parcel reply = Parcel.obtain();
5770 data.writeInterfaceToken(IActivityManager.descriptor);
5771 mRemote.transact(RESTART_TRANSACTION, data, reply, 0);
5772 reply.readException();
5773 data.recycle();
5774 reply.recycle();
5775 }
5776
Dianne Hackborn35f72be2013-09-16 10:57:39 -07005777 public void performIdleMaintenance() throws RemoteException {
5778 Parcel data = Parcel.obtain();
5779 Parcel reply = Parcel.obtain();
5780 data.writeInterfaceToken(IActivityManager.descriptor);
5781 mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0);
5782 reply.readException();
5783 data.recycle();
5784 reply.recycle();
5785 }
5786
Todd Kennedyca4d8422015-01-15 15:19:22 -08005787 public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken,
Craig Mautner4a1cb222013-12-04 16:14:06 -08005788 IActivityContainerCallback callback) throws RemoteException {
5789 Parcel data = Parcel.obtain();
5790 Parcel reply = Parcel.obtain();
5791 data.writeInterfaceToken(IActivityManager.descriptor);
5792 data.writeStrongBinder(parentActivityToken);
Craig Mautnere3a00d72014-04-16 08:31:19 -07005793 data.writeStrongBinder(callback == null ? null : callback.asBinder());
Todd Kennedyca4d8422015-01-15 15:19:22 -08005794 mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
Craig Mautner4a1cb222013-12-04 16:14:06 -08005795 reply.readException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08005796 final int result = reply.readInt();
5797 final IActivityContainer res;
5798 if (result == 1) {
5799 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5800 } else {
5801 res = null;
5802 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08005803 data.recycle();
5804 reply.recycle();
5805 return res;
5806 }
5807
Craig Mautner95da1082014-02-24 17:54:35 -08005808 public void deleteActivityContainer(IActivityContainer activityContainer)
5809 throws RemoteException {
5810 Parcel data = Parcel.obtain();
5811 Parcel reply = Parcel.obtain();
5812 data.writeInterfaceToken(IActivityManager.descriptor);
5813 data.writeStrongBinder(activityContainer.asBinder());
5814 mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
5815 reply.readException();
5816 data.recycle();
5817 reply.recycle();
5818 }
5819
Rahul Chaturvedi52613f92015-06-17 23:54:08 -04005820 public boolean startBinderTracking() throws RemoteException {
5821 Parcel data = Parcel.obtain();
5822 Parcel reply = Parcel.obtain();
5823 data.writeInterfaceToken(IActivityManager.descriptor);
5824 mRemote.transact(START_BINDER_TRACKING_TRANSACTION, data, reply, 0);
5825 reply.readException();
5826 boolean res = reply.readInt() != 0;
5827 reply.recycle();
5828 data.recycle();
5829 return res;
5830 }
5831
5832 public boolean stopBinderTrackingAndDump(ParcelFileDescriptor fd) throws RemoteException {
5833 Parcel data = Parcel.obtain();
5834 Parcel reply = Parcel.obtain();
5835 data.writeInterfaceToken(IActivityManager.descriptor);
5836 if (fd != null) {
5837 data.writeInt(1);
5838 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
5839 } else {
5840 data.writeInt(0);
5841 }
5842 mRemote.transact(STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION, data, reply, 0);
5843 reply.readException();
5844 boolean res = reply.readInt() != 0;
5845 reply.recycle();
5846 data.recycle();
5847 return res;
5848 }
5849
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005850 @Override
Todd Kennedy4900bf92015-01-16 16:05:14 -08005851 public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException {
5852 Parcel data = Parcel.obtain();
5853 Parcel reply = Parcel.obtain();
5854 data.writeInterfaceToken(IActivityManager.descriptor);
5855 data.writeInt(displayId);
5856 mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0);
5857 reply.readException();
5858 final int result = reply.readInt();
5859 final IActivityContainer res;
5860 if (result == 1) {
5861 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5862 } else {
5863 res = null;
5864 }
5865 data.recycle();
5866 reply.recycle();
5867 return res;
5868 }
5869
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005870 @Override
5871 public int getActivityDisplayId(IBinder activityToken)
Craig Mautnere0a38842013-12-16 16:14:02 -08005872 throws RemoteException {
5873 Parcel data = Parcel.obtain();
5874 Parcel reply = Parcel.obtain();
5875 data.writeInterfaceToken(IActivityManager.descriptor);
5876 data.writeStrongBinder(activityToken);
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005877 mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0);
Craig Mautnere0a38842013-12-16 16:14:02 -08005878 reply.readException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005879 final int displayId = reply.readInt();
Craig Mautnere0a38842013-12-16 16:14:02 -08005880 data.recycle();
5881 reply.recycle();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005882 return displayId;
Craig Mautnere0a38842013-12-16 16:14:02 -08005883 }
5884
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005885 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005886 public void startLockTaskMode(int taskId) throws RemoteException {
5887 Parcel data = Parcel.obtain();
5888 Parcel reply = Parcel.obtain();
5889 data.writeInterfaceToken(IActivityManager.descriptor);
5890 data.writeInt(taskId);
5891 mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0);
5892 reply.readException();
5893 data.recycle();
5894 reply.recycle();
5895 }
5896
5897 @Override
5898 public void startLockTaskMode(IBinder token) throws RemoteException {
5899 Parcel data = Parcel.obtain();
5900 Parcel reply = Parcel.obtain();
5901 data.writeInterfaceToken(IActivityManager.descriptor);
5902 data.writeStrongBinder(token);
5903 mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0);
5904 reply.readException();
5905 data.recycle();
5906 reply.recycle();
5907 }
5908
5909 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005910 public void startLockTaskModeOnCurrent() throws RemoteException {
5911 Parcel data = Parcel.obtain();
5912 Parcel reply = Parcel.obtain();
5913 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005914 mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005915 reply.readException();
5916 data.recycle();
5917 reply.recycle();
5918 }
5919
5920 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005921 public void stopLockTaskMode() throws RemoteException {
5922 Parcel data = Parcel.obtain();
5923 Parcel reply = Parcel.obtain();
5924 data.writeInterfaceToken(IActivityManager.descriptor);
5925 mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5926 reply.readException();
5927 data.recycle();
5928 reply.recycle();
5929 }
5930
5931 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005932 public void stopLockTaskModeOnCurrent() throws RemoteException {
5933 Parcel data = Parcel.obtain();
5934 Parcel reply = Parcel.obtain();
5935 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005936 mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005937 reply.readException();
5938 data.recycle();
5939 reply.recycle();
5940 }
5941
5942 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005943 public boolean isInLockTaskMode() throws RemoteException {
5944 Parcel data = Parcel.obtain();
5945 Parcel reply = Parcel.obtain();
5946 data.writeInterfaceToken(IActivityManager.descriptor);
5947 mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5948 reply.readException();
5949 boolean isInLockTaskMode = reply.readInt() == 1;
5950 data.recycle();
5951 reply.recycle();
5952 return isInLockTaskMode;
5953 }
5954
Craig Mautner688b5102014-03-27 16:55:03 -07005955 @Override
Benjamin Franz43261142015-02-11 15:59:44 +00005956 public int getLockTaskModeState() throws RemoteException {
5957 Parcel data = Parcel.obtain();
5958 Parcel reply = Parcel.obtain();
5959 data.writeInterfaceToken(IActivityManager.descriptor);
5960 mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0);
5961 reply.readException();
5962 int lockTaskModeState = reply.readInt();
5963 data.recycle();
5964 reply.recycle();
5965 return lockTaskModeState;
5966 }
5967
5968 @Override
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07005969 public void showLockTaskEscapeMessage(IBinder token) throws RemoteException {
5970 Parcel data = Parcel.obtain();
5971 Parcel reply = Parcel.obtain();
5972 data.writeInterfaceToken(IActivityManager.descriptor);
5973 data.writeStrongBinder(token);
5974 mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply,
5975 IBinder.FLAG_ONEWAY);
5976 reply.readException();
5977 data.recycle();
5978 reply.recycle();
5979 }
5980
5981 @Override
Winson Chunga449dc02014-05-16 11:15:04 -07005982 public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values)
Winson Chung03a9bae2014-05-02 09:56:12 -07005983 throws RemoteException {
Craig Mautner2fbd7542014-03-21 09:34:07 -07005984 Parcel data = Parcel.obtain();
5985 Parcel reply = Parcel.obtain();
5986 data.writeInterfaceToken(IActivityManager.descriptor);
5987 data.writeStrongBinder(token);
Winson Chung03a9bae2014-05-02 09:56:12 -07005988 values.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005989 mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0);
Craig Mautner2fbd7542014-03-21 09:34:07 -07005990 reply.readException();
5991 data.recycle();
5992 reply.recycle();
5993 }
5994
Craig Mautneree2e45a2014-06-27 12:10:03 -07005995 @Override
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08005996 public void setTaskResizeable(int taskId, boolean resizeable) throws RemoteException {
5997 Parcel data = Parcel.obtain();
5998 Parcel reply = Parcel.obtain();
5999 data.writeInterfaceToken(IActivityManager.descriptor);
6000 data.writeInt(taskId);
6001 data.writeInt(resizeable ? 1 : 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006002 mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0);
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08006003 reply.readException();
6004 data.recycle();
6005 reply.recycle();
6006 }
6007
6008 @Override
Chong Zhang87b21722015-09-21 15:39:51 -07006009 public void resizeTask(int taskId, Rect r, int resizeMode) throws RemoteException
Wale Ogunwale53a29a92015-02-23 15:42:52 -08006010 {
6011 Parcel data = Parcel.obtain();
6012 Parcel reply = Parcel.obtain();
6013 data.writeInterfaceToken(IActivityManager.descriptor);
6014 data.writeInt(taskId);
Chong Zhang87b21722015-09-21 15:39:51 -07006015 data.writeInt(resizeMode);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08006016 r.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006017 mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08006018 reply.readException();
6019 data.recycle();
6020 reply.recycle();
6021 }
6022
6023 @Override
Wale Ogunwalee4a0c572015-06-30 08:40:31 -07006024 public Rect getTaskBounds(int taskId) throws RemoteException
6025 {
6026 Parcel data = Parcel.obtain();
6027 Parcel reply = Parcel.obtain();
6028 data.writeInterfaceToken(IActivityManager.descriptor);
6029 data.writeInt(taskId);
6030 mRemote.transact(GET_TASK_BOUNDS_TRANSACTION, data, reply, 0);
6031 reply.readException();
6032 Rect rect = Rect.CREATOR.createFromParcel(reply);
6033 data.recycle();
6034 reply.recycle();
6035 return rect;
6036 }
6037
6038 @Override
Suprabh Shukla23593142015-11-03 17:31:15 -08006039 public Bitmap getTaskDescriptionIcon(String filename, int userId) throws RemoteException {
Craig Mautner648f69b2014-09-18 14:16:26 -07006040 Parcel data = Parcel.obtain();
6041 Parcel reply = Parcel.obtain();
6042 data.writeInterfaceToken(IActivityManager.descriptor);
6043 data.writeString(filename);
Suprabh Shukla23593142015-11-03 17:31:15 -08006044 data.writeInt(userId);
Craig Mautner648f69b2014-09-18 14:16:26 -07006045 mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0);
6046 reply.readException();
6047 final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply);
6048 data.recycle();
6049 reply.recycle();
6050 return icon;
6051 }
6052
6053 @Override
Winson Chung044d5292014-11-06 11:05:19 -08006054 public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options)
6055 throws RemoteException {
6056 Parcel data = Parcel.obtain();
6057 Parcel reply = Parcel.obtain();
6058 data.writeInterfaceToken(IActivityManager.descriptor);
6059 if (options == null) {
6060 data.writeInt(0);
6061 } else {
6062 data.writeInt(1);
6063 data.writeBundle(options.toBundle());
6064 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07006065 mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0);
Winson Chung044d5292014-11-06 11:05:19 -08006066 reply.readException();
6067 data.recycle();
6068 reply.recycle();
6069 }
6070
6071 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07006072 public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07006073 Parcel data = Parcel.obtain();
6074 Parcel reply = Parcel.obtain();
6075 data.writeInterfaceToken(IActivityManager.descriptor);
6076 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07006077 data.writeInt(visible ? 1 : 0);
6078 mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07006079 reply.readException();
6080 boolean success = reply.readInt() > 0;
6081 data.recycle();
6082 reply.recycle();
6083 return success;
6084 }
6085
6086 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07006087 public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07006088 Parcel data = Parcel.obtain();
6089 Parcel reply = Parcel.obtain();
6090 data.writeInterfaceToken(IActivityManager.descriptor);
6091 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07006092 mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07006093 reply.readException();
Jose Lima4b6c6692014-08-12 17:41:12 -07006094 final boolean visible = reply.readInt() > 0;
Craig Mautneree2e45a2014-06-27 12:10:03 -07006095 data.recycle();
6096 reply.recycle();
Jose Lima4b6c6692014-08-12 17:41:12 -07006097 return visible;
Craig Mautneree2e45a2014-06-27 12:10:03 -07006098 }
6099
6100 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07006101 public void backgroundResourcesReleased(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07006102 Parcel data = Parcel.obtain();
6103 Parcel reply = Parcel.obtain();
6104 data.writeInterfaceToken(IActivityManager.descriptor);
6105 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006106 mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0);
Craig Mautnerbb742462014-07-07 15:28:55 -07006107 reply.readException();
6108 data.recycle();
6109 reply.recycle();
6110 }
6111
6112 @Override
6113 public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException {
6114 Parcel data = Parcel.obtain();
6115 Parcel reply = Parcel.obtain();
6116 data.writeInterfaceToken(IActivityManager.descriptor);
6117 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006118 mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07006119 reply.readException();
6120 data.recycle();
6121 reply.recycle();
6122 }
6123
Craig Mautner8746a472014-07-24 15:12:54 -07006124 @Override
6125 public void notifyEnterAnimationComplete(IBinder token) throws RemoteException {
6126 Parcel data = Parcel.obtain();
6127 Parcel reply = Parcel.obtain();
6128 data.writeInterfaceToken(IActivityManager.descriptor);
6129 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006130 mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautner8746a472014-07-24 15:12:54 -07006131 reply.readException();
6132 data.recycle();
6133 reply.recycle();
6134 }
6135
Craig Mautner6e2f3952014-09-09 14:26:41 -07006136 @Override
6137 public void bootAnimationComplete() throws RemoteException {
6138 Parcel data = Parcel.obtain();
6139 Parcel reply = Parcel.obtain();
6140 data.writeInterfaceToken(IActivityManager.descriptor);
6141 mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
6142 reply.readException();
6143 data.recycle();
6144 reply.recycle();
6145 }
6146
Wale Ogunwale18795a22014-12-03 11:38:33 -08006147 @Override
Jeff Sharkey605eb792014-11-04 13:34:06 -08006148 public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException {
6149 Parcel data = Parcel.obtain();
6150 Parcel reply = Parcel.obtain();
6151 data.writeInterfaceToken(IActivityManager.descriptor);
6152 data.writeInt(uid);
6153 data.writeByteArray(firstPacket);
6154 mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0);
6155 reply.readException();
6156 data.recycle();
6157 reply.recycle();
6158 }
6159
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08006160 @Override
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07006161 public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize,
6162 String reportPackage) throws RemoteException {
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08006163 Parcel data = Parcel.obtain();
6164 Parcel reply = Parcel.obtain();
6165 data.writeInterfaceToken(IActivityManager.descriptor);
6166 data.writeString(processName);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07006167 data.writeInt(uid);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08006168 data.writeLong(maxMemSize);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07006169 data.writeString(reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08006170 mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0);
6171 reply.readException();
6172 data.recycle();
6173 reply.recycle();
6174 }
6175
6176 @Override
6177 public void dumpHeapFinished(String path) throws RemoteException {
6178 Parcel data = Parcel.obtain();
6179 Parcel reply = Parcel.obtain();
6180 data.writeInterfaceToken(IActivityManager.descriptor);
6181 data.writeString(path);
6182 mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0);
6183 reply.readException();
6184 data.recycle();
6185 reply.recycle();
6186 }
6187
Dianne Hackborn3d07c942015-03-13 18:02:54 -07006188 @Override
6189 public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake)
6190 throws RemoteException {
6191 Parcel data = Parcel.obtain();
6192 Parcel reply = Parcel.obtain();
6193 data.writeInterfaceToken(IActivityManager.descriptor);
6194 data.writeStrongBinder(session.asBinder());
6195 data.writeInt(keepAwake ? 1 : 0);
6196 mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0);
6197 reply.readException();
6198 data.recycle();
6199 reply.recycle();
6200 }
6201
Craig Mautnere5600772015-04-03 21:36:37 -07006202 @Override
6203 public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException {
6204 Parcel data = Parcel.obtain();
6205 Parcel reply = Parcel.obtain();
6206 data.writeInterfaceToken(IActivityManager.descriptor);
6207 data.writeInt(userId);
6208 data.writeStringArray(packages);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006209 mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0);
Craig Mautnere5600772015-04-03 21:36:37 -07006210 reply.readException();
6211 data.recycle();
6212 reply.recycle();
6213 }
6214
Dianne Hackborn1e383822015-04-10 14:02:33 -07006215 @Override
Makoto Onuki219bbaf2015-11-12 01:38:47 +00006216 public void updateDeviceOwner(String packageName) throws RemoteException {
6217 Parcel data = Parcel.obtain();
6218 Parcel reply = Parcel.obtain();
6219 data.writeInterfaceToken(IActivityManager.descriptor);
6220 data.writeString(packageName);
6221 mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0);
6222 reply.readException();
6223 data.recycle();
6224 reply.recycle();
6225 }
6226
6227 @Override
Adam Lesinskic30454c2015-06-24 13:24:35 -07006228 public int getPackageProcessState(String packageName, String callingPackage)
6229 throws RemoteException {
Dianne Hackborn1e383822015-04-10 14:02:33 -07006230 Parcel data = Parcel.obtain();
6231 Parcel reply = Parcel.obtain();
6232 data.writeInterfaceToken(IActivityManager.descriptor);
6233 data.writeString(packageName);
Adam Lesinskic30454c2015-06-24 13:24:35 -07006234 data.writeString(callingPackage);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006235 mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0);
6236 reply.readException();
6237 int res = reply.readInt();
6238 data.recycle();
6239 reply.recycle();
6240 return res;
6241 }
6242
Stefan Kuhne16045c22015-06-05 07:18:06 -07006243 @Override
6244 public boolean setProcessMemoryTrimLevel(String process, int userId, int level)
6245 throws RemoteException {
6246 Parcel data = Parcel.obtain();
6247 Parcel reply = Parcel.obtain();
6248 data.writeInterfaceToken(IActivityManager.descriptor);
6249 data.writeString(process);
6250 data.writeInt(userId);
6251 data.writeInt(level);
6252 mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0);
6253 reply.readException();
6254 int res = reply.readInt();
6255 data.recycle();
6256 reply.recycle();
6257 return res != 0;
6258 }
6259
Dianne Hackbornfb81d092015-08-03 17:14:46 -07006260 @Override
6261 public boolean isRootVoiceInteraction(IBinder token) throws RemoteException {
6262 Parcel data = Parcel.obtain();
6263 Parcel reply = Parcel.obtain();
6264 data.writeInterfaceToken(IActivityManager.descriptor);
6265 data.writeStrongBinder(token);
6266 mRemote.transact(IS_ROOT_VOICE_INTERACTION_TRANSACTION, data, reply, 0);
6267 reply.readException();
6268 int res = reply.readInt();
6269 data.recycle();
6270 reply.recycle();
6271 return res != 0;
6272 }
6273
Wale Ogunwale868a5e12015-08-02 16:19:20 -07006274 @Override
6275 public void moveActivityToStack(IBinder token, int stackId) throws RemoteException {
6276 Parcel data = Parcel.obtain();
6277 Parcel reply = Parcel.obtain();
6278 data.writeInterfaceToken(IActivityManager.descriptor);
6279 data.writeStrongBinder(token);
6280 data.writeInt(stackId);
6281 mRemote.transact(MOVE_ACTIVITY_TO_STACK_TRANSACTION, data, reply, 0);
6282 reply.readException();
6283 data.recycle();
6284 reply.recycle();
6285 }
6286
6287 @Override
6288 public int getActivityStackId(IBinder token) throws RemoteException {
6289 Parcel data = Parcel.obtain();
6290 Parcel reply = Parcel.obtain();
6291 data.writeInterfaceToken(IActivityManager.descriptor);
6292 data.writeStrongBinder(token);
6293 mRemote.transact(GET_ACTIVITY_STACK_ID_TRANSACTION, data, reply, 0);
6294 reply.readException();
6295 int stackId = reply.readInt();
6296 data.recycle();
6297 reply.recycle();
6298 return stackId;
6299 }
6300
Filip Gruszczynski23493322015-07-29 17:02:59 -07006301 @Override
6302 public void reportSizeConfigurations(IBinder token, int[] horizontalSizeConfiguration,
Filip Gruszczynski20aa0ae2015-10-30 10:08:27 -07006303 int[] verticalSizeConfigurations, int[] smallestSizeConfigurations)
6304 throws RemoteException {
Filip Gruszczynski23493322015-07-29 17:02:59 -07006305 Parcel data = Parcel.obtain();
6306 Parcel reply = Parcel.obtain();
6307 data.writeInterfaceToken(IActivityManager.descriptor);
6308 data.writeStrongBinder(token);
Filip Gruszczynski20aa0ae2015-10-30 10:08:27 -07006309 writeIntArray(horizontalSizeConfiguration, data);
6310 writeIntArray(verticalSizeConfigurations, data);
6311 writeIntArray(smallestSizeConfigurations, data);
Filip Gruszczynski23493322015-07-29 17:02:59 -07006312 mRemote.transact(REPORT_SIZE_CONFIGURATIONS, data, reply, 0);
6313 reply.readException();
6314 data.recycle();
6315 reply.recycle();
6316 }
6317
Filip Gruszczynski20aa0ae2015-10-30 10:08:27 -07006318 private static void writeIntArray(int[] array, Parcel data) {
6319 if (array == null) {
6320 data.writeInt(0);
6321 } else {
6322 data.writeInt(array.length);
6323 data.writeIntArray(array);
6324 }
6325 }
6326
Wale Ogunwale83301a92015-09-24 15:54:08 -07006327 @Override
6328 public void suppressResizeConfigChanges(boolean suppress) throws RemoteException {
6329 Parcel data = Parcel.obtain();
6330 Parcel reply = Parcel.obtain();
6331 data.writeInterfaceToken(IActivityManager.descriptor);
6332 data.writeInt(suppress ? 1 : 0);
6333 mRemote.transact(SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION, data, reply, 0);
6334 reply.readException();
6335 data.recycle();
6336 reply.recycle();
6337 }
6338
Filip Gruszczynski57b6cce2015-10-06 09:50:51 -07006339 @Override
6340 public void removeStack(int stackId) throws RemoteException {
6341 Parcel data = Parcel.obtain();
6342 Parcel reply = Parcel.obtain();
6343 data.writeInterfaceToken(IActivityManager.descriptor);
6344 data.writeInt(stackId);
Dianne Hackbornbef28fe2015-10-29 17:57:11 -07006345 mRemote.transact(REMOVE_STACK_TRANSACTION, data, reply, 0);
Filip Gruszczynski57b6cce2015-10-06 09:50:51 -07006346 reply.readException();
6347 data.recycle();
6348 reply.recycle();
6349 }
6350
Dianne Hackbornbef28fe2015-10-29 17:57:11 -07006351 @Override
6352 public int getAppStartMode(int uid, String packageName) throws RemoteException {
6353 Parcel data = Parcel.obtain();
6354 Parcel reply = Parcel.obtain();
6355 data.writeInterfaceToken(IActivityManager.descriptor);
6356 data.writeInt(uid);
6357 data.writeString(packageName);
6358 mRemote.transact(GET_APP_START_MODE_TRANSACTION, data, reply, 0);
6359 reply.readException();
6360 int res = reply.readInt();
6361 data.recycle();
6362 reply.recycle();
6363 return res;
6364 }
6365
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006366 private IBinder mRemote;
6367}