blob: a24b1ecd269b22d1a6c950964ebb165d44b5f605 [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;
754 moveTaskToDockedStack(taskId, createMode, toTop);
755 reply.writeNoException();
756 return true;
757 }
758
Wale Ogunwale079a0042015-10-24 11:44:07 -0700759 case MOVE_TOP_ACTIVITY_TO_PINNED_STACK: {
760 data.enforceInterface(IActivityManager.descriptor);
761 final int stackId = data.readInt();
762 final Rect r = Rect.CREATOR.createFromParcel(data);
763 final boolean res = moveTopActivityToPinnedStack(stackId, r);
764 reply.writeNoException();
765 reply.writeInt(res ? 1 : 0);
766 return true;
767 }
768
Craig Mautnerc00204b2013-03-05 15:02:14 -0800769 case RESIZE_STACK_TRANSACTION: {
770 data.enforceInterface(IActivityManager.descriptor);
Wale Ogunwaleffc11bb2015-10-10 13:05:45 -0700771 final int stackId = data.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800772 Rect r = Rect.CREATOR.createFromParcel(data);
Wale Ogunwaleffc11bb2015-10-10 13:05:45 -0700773 final boolean allowResizeInDockedMode = data.readInt() == 1;
774 resizeStack(stackId, r, allowResizeInDockedMode);
Craig Mautnerc00204b2013-03-05 15:02:14 -0800775 reply.writeNoException();
776 return true;
777 }
778
Wale Ogunwaleddc1cb22015-07-25 19:23:04 -0700779 case POSITION_TASK_IN_STACK_TRANSACTION: {
780 data.enforceInterface(IActivityManager.descriptor);
781 int taskId = data.readInt();
782 int stackId = data.readInt();
783 int position = data.readInt();
784 positionTaskInStack(taskId, stackId, position);
785 reply.writeNoException();
786 return true;
787 }
788
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800789 case GET_ALL_STACK_INFOS_TRANSACTION: {
Craig Mautner5ff12102013-05-24 12:50:15 -0700790 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800791 List<StackInfo> list = getAllStackInfos();
Craig Mautner5ff12102013-05-24 12:50:15 -0700792 reply.writeNoException();
793 reply.writeTypedList(list);
794 return true;
795 }
796
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800797 case GET_STACK_INFO_TRANSACTION: {
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700798 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800799 int stackId = data.readInt();
800 StackInfo info = getStackInfo(stackId);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700801 reply.writeNoException();
802 if (info != null) {
803 reply.writeInt(1);
804 info.writeToParcel(reply, 0);
805 } else {
806 reply.writeInt(0);
807 }
808 return true;
809 }
810
Winson Chung303e1ff2014-03-07 15:06:19 -0800811 case IS_IN_HOME_STACK_TRANSACTION: {
812 data.enforceInterface(IActivityManager.descriptor);
813 int taskId = data.readInt();
814 boolean isInHomeStack = isInHomeStack(taskId);
815 reply.writeNoException();
816 reply.writeInt(isInHomeStack ? 1 : 0);
817 return true;
818 }
819
Craig Mautnercf910b02013-04-23 11:23:27 -0700820 case SET_FOCUSED_STACK_TRANSACTION: {
821 data.enforceInterface(IActivityManager.descriptor);
822 int stackId = data.readInt();
823 setFocusedStack(stackId);
824 reply.writeNoException();
825 return true;
826 }
827
Winson Chungd16c5652015-01-26 16:11:07 -0800828 case GET_FOCUSED_STACK_ID_TRANSACTION: {
829 data.enforceInterface(IActivityManager.descriptor);
830 int focusedStackId = getFocusedStackId();
831 reply.writeNoException();
832 reply.writeInt(focusedStackId);
833 return true;
834 }
835
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700836 case SET_FOCUSED_TASK_TRANSACTION: {
837 data.enforceInterface(IActivityManager.descriptor);
838 int taskId = data.readInt();
Skuhnef36bb0c2015-08-26 14:26:17 -0700839 setFocusedTask(taskId);
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700840 reply.writeNoException();
841 return true;
842 }
843
Winson Chung740c3ac2014-11-12 16:14:38 -0800844 case REGISTER_TASK_STACK_LISTENER_TRANSACTION: {
845 data.enforceInterface(IActivityManager.descriptor);
846 IBinder token = data.readStrongBinder();
847 registerTaskStackListener(ITaskStackListener.Stub.asInterface(token));
848 reply.writeNoException();
849 return true;
850 }
851
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800852 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
853 data.enforceInterface(IActivityManager.descriptor);
854 IBinder token = data.readStrongBinder();
855 boolean onlyRoot = data.readInt() != 0;
856 int res = token != null
857 ? getTaskForActivity(token, onlyRoot) : -1;
858 reply.writeNoException();
859 reply.writeInt(res);
860 return true;
861 }
862
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800863 case GET_CONTENT_PROVIDER_TRANSACTION: {
864 data.enforceInterface(IActivityManager.descriptor);
865 IBinder b = data.readStrongBinder();
866 IApplicationThread app = ApplicationThreadNative.asInterface(b);
867 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700868 int userId = data.readInt();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700869 boolean stable = data.readInt() != 0;
Jeff Sharkey6d515712012-09-20 16:06:08 -0700870 ContentProviderHolder cph = getContentProvider(app, name, userId, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800871 reply.writeNoException();
872 if (cph != null) {
873 reply.writeInt(1);
874 cph.writeToParcel(reply, 0);
875 } else {
876 reply.writeInt(0);
877 }
878 return true;
879 }
880
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800881 case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
882 data.enforceInterface(IActivityManager.descriptor);
883 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700884 int userId = data.readInt();
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800885 IBinder token = data.readStrongBinder();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700886 ContentProviderHolder cph = getContentProviderExternal(name, userId, token);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800887 reply.writeNoException();
888 if (cph != null) {
889 reply.writeInt(1);
890 cph.writeToParcel(reply, 0);
891 } else {
892 reply.writeInt(0);
893 }
894 return true;
895 }
896
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800897 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
898 data.enforceInterface(IActivityManager.descriptor);
899 IBinder b = data.readStrongBinder();
900 IApplicationThread app = ApplicationThreadNative.asInterface(b);
901 ArrayList<ContentProviderHolder> providers =
902 data.createTypedArrayList(ContentProviderHolder.CREATOR);
903 publishContentProviders(app, providers);
904 reply.writeNoException();
905 return true;
906 }
907
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700908 case REF_CONTENT_PROVIDER_TRANSACTION: {
909 data.enforceInterface(IActivityManager.descriptor);
910 IBinder b = data.readStrongBinder();
911 int stable = data.readInt();
912 int unstable = data.readInt();
913 boolean res = refContentProvider(b, stable, unstable);
914 reply.writeNoException();
915 reply.writeInt(res ? 1 : 0);
916 return true;
917 }
918
919 case UNSTABLE_PROVIDER_DIED_TRANSACTION: {
920 data.enforceInterface(IActivityManager.descriptor);
921 IBinder b = data.readStrongBinder();
922 unstableProviderDied(b);
923 reply.writeNoException();
924 return true;
925 }
926
Jeff Sharkey7aa76012013-09-30 14:26:27 -0700927 case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: {
928 data.enforceInterface(IActivityManager.descriptor);
929 IBinder b = data.readStrongBinder();
930 appNotRespondingViaProvider(b);
931 reply.writeNoException();
932 return true;
933 }
934
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800935 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
936 data.enforceInterface(IActivityManager.descriptor);
937 IBinder b = data.readStrongBinder();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700938 boolean stable = data.readInt() != 0;
939 removeContentProvider(b, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800940 reply.writeNoException();
941 return true;
942 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800943
944 case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
945 data.enforceInterface(IActivityManager.descriptor);
946 String name = data.readString();
947 IBinder token = data.readStrongBinder();
948 removeContentProviderExternal(name, token);
949 reply.writeNoException();
950 return true;
951 }
952
Dianne Hackborndd9b82c2009-09-03 00:18:47 -0700953 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
954 data.enforceInterface(IActivityManager.descriptor);
955 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
956 PendingIntent pi = getRunningServiceControlPanel(comp);
957 reply.writeNoException();
958 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
959 return true;
960 }
961
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800962 case START_SERVICE_TRANSACTION: {
963 data.enforceInterface(IActivityManager.descriptor);
964 IBinder b = data.readStrongBinder();
965 IApplicationThread app = ApplicationThreadNative.asInterface(b);
966 Intent service = Intent.CREATOR.createFromParcel(data);
967 String resolvedType = data.readString();
Svet Ganov99b60432015-06-27 13:15:22 -0700968 String callingPackage = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700969 int userId = data.readInt();
Svet Ganov99b60432015-06-27 13:15:22 -0700970 ComponentName cn = startService(app, service, resolvedType, callingPackage, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800971 reply.writeNoException();
972 ComponentName.writeToParcel(cn, reply);
973 return true;
974 }
975
976 case STOP_SERVICE_TRANSACTION: {
977 data.enforceInterface(IActivityManager.descriptor);
978 IBinder b = data.readStrongBinder();
979 IApplicationThread app = ApplicationThreadNative.asInterface(b);
980 Intent service = Intent.CREATOR.createFromParcel(data);
981 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700982 int userId = data.readInt();
983 int res = stopService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800984 reply.writeNoException();
985 reply.writeInt(res);
986 return true;
987 }
988
989 case STOP_SERVICE_TOKEN_TRANSACTION: {
990 data.enforceInterface(IActivityManager.descriptor);
991 ComponentName className = ComponentName.readFromParcel(data);
992 IBinder token = data.readStrongBinder();
993 int startId = data.readInt();
994 boolean res = stopServiceToken(className, token, startId);
995 reply.writeNoException();
996 reply.writeInt(res ? 1 : 0);
997 return true;
998 }
999
1000 case SET_SERVICE_FOREGROUND_TRANSACTION: {
1001 data.enforceInterface(IActivityManager.descriptor);
1002 ComponentName className = ComponentName.readFromParcel(data);
1003 IBinder token = data.readStrongBinder();
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07001004 int id = data.readInt();
1005 Notification notification = null;
1006 if (data.readInt() != 0) {
1007 notification = Notification.CREATOR.createFromParcel(data);
1008 }
1009 boolean removeNotification = data.readInt() != 0;
1010 setServiceForeground(className, token, id, notification, removeNotification);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001011 reply.writeNoException();
1012 return true;
1013 }
1014
1015 case BIND_SERVICE_TRANSACTION: {
1016 data.enforceInterface(IActivityManager.descriptor);
1017 IBinder b = data.readStrongBinder();
1018 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1019 IBinder token = data.readStrongBinder();
1020 Intent service = Intent.CREATOR.createFromParcel(data);
1021 String resolvedType = data.readString();
1022 b = data.readStrongBinder();
1023 int fl = data.readInt();
Svet Ganov99b60432015-06-27 13:15:22 -07001024 String callingPackage = data.readString();
Amith Yamasani37ce3a82012-02-06 12:04:42 -08001025 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001026 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
Svet Ganov99b60432015-06-27 13:15:22 -07001027 int res = bindService(app, token, service, resolvedType, conn, fl,
1028 callingPackage, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001029 reply.writeNoException();
1030 reply.writeInt(res);
1031 return true;
1032 }
1033
1034 case UNBIND_SERVICE_TRANSACTION: {
1035 data.enforceInterface(IActivityManager.descriptor);
1036 IBinder b = data.readStrongBinder();
1037 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
1038 boolean res = unbindService(conn);
1039 reply.writeNoException();
1040 reply.writeInt(res ? 1 : 0);
1041 return true;
1042 }
1043
1044 case PUBLISH_SERVICE_TRANSACTION: {
1045 data.enforceInterface(IActivityManager.descriptor);
1046 IBinder token = data.readStrongBinder();
1047 Intent intent = Intent.CREATOR.createFromParcel(data);
1048 IBinder service = data.readStrongBinder();
1049 publishService(token, intent, service);
1050 reply.writeNoException();
1051 return true;
1052 }
1053
1054 case UNBIND_FINISHED_TRANSACTION: {
1055 data.enforceInterface(IActivityManager.descriptor);
1056 IBinder token = data.readStrongBinder();
1057 Intent intent = Intent.CREATOR.createFromParcel(data);
1058 boolean doRebind = data.readInt() != 0;
1059 unbindFinished(token, intent, doRebind);
1060 reply.writeNoException();
1061 return true;
1062 }
1063
1064 case SERVICE_DONE_EXECUTING_TRANSACTION: {
1065 data.enforceInterface(IActivityManager.descriptor);
1066 IBinder token = data.readStrongBinder();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07001067 int type = data.readInt();
1068 int startId = data.readInt();
1069 int res = data.readInt();
1070 serviceDoneExecuting(token, type, startId, res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001071 reply.writeNoException();
1072 return true;
1073 }
1074
1075 case START_INSTRUMENTATION_TRANSACTION: {
1076 data.enforceInterface(IActivityManager.descriptor);
1077 ComponentName className = ComponentName.readFromParcel(data);
1078 String profileFile = data.readString();
1079 int fl = data.readInt();
1080 Bundle arguments = data.readBundle();
1081 IBinder b = data.readStrongBinder();
1082 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08001083 b = data.readStrongBinder();
1084 IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001085 int userId = data.readInt();
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01001086 String abiOverride = data.readString();
1087 boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId,
1088 abiOverride);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001089 reply.writeNoException();
1090 reply.writeInt(res ? 1 : 0);
1091 return true;
1092 }
1093
1094
1095 case FINISH_INSTRUMENTATION_TRANSACTION: {
1096 data.enforceInterface(IActivityManager.descriptor);
1097 IBinder b = data.readStrongBinder();
1098 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1099 int resultCode = data.readInt();
1100 Bundle results = data.readBundle();
1101 finishInstrumentation(app, resultCode, results);
1102 reply.writeNoException();
1103 return true;
1104 }
1105
1106 case GET_CONFIGURATION_TRANSACTION: {
1107 data.enforceInterface(IActivityManager.descriptor);
1108 Configuration config = getConfiguration();
1109 reply.writeNoException();
1110 config.writeToParcel(reply, 0);
1111 return true;
1112 }
1113
1114 case UPDATE_CONFIGURATION_TRANSACTION: {
1115 data.enforceInterface(IActivityManager.descriptor);
1116 Configuration config = Configuration.CREATOR.createFromParcel(data);
1117 updateConfiguration(config);
1118 reply.writeNoException();
1119 return true;
1120 }
1121
1122 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
1123 data.enforceInterface(IActivityManager.descriptor);
1124 IBinder token = data.readStrongBinder();
1125 int requestedOrientation = data.readInt();
1126 setRequestedOrientation(token, requestedOrientation);
1127 reply.writeNoException();
1128 return true;
1129 }
1130
1131 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
1132 data.enforceInterface(IActivityManager.descriptor);
1133 IBinder token = data.readStrongBinder();
1134 int req = getRequestedOrientation(token);
1135 reply.writeNoException();
1136 reply.writeInt(req);
1137 return true;
1138 }
1139
1140 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
1141 data.enforceInterface(IActivityManager.descriptor);
1142 IBinder token = data.readStrongBinder();
1143 ComponentName cn = getActivityClassForToken(token);
1144 reply.writeNoException();
1145 ComponentName.writeToParcel(cn, reply);
1146 return true;
1147 }
1148
1149 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
1150 data.enforceInterface(IActivityManager.descriptor);
1151 IBinder token = data.readStrongBinder();
1152 reply.writeNoException();
1153 reply.writeString(getPackageForToken(token));
1154 return true;
1155 }
1156
1157 case GET_INTENT_SENDER_TRANSACTION: {
1158 data.enforceInterface(IActivityManager.descriptor);
1159 int type = data.readInt();
1160 String packageName = data.readString();
1161 IBinder token = data.readStrongBinder();
1162 String resultWho = data.readString();
1163 int requestCode = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001164 Intent[] requestIntents;
1165 String[] requestResolvedTypes;
1166 if (data.readInt() != 0) {
1167 requestIntents = data.createTypedArray(Intent.CREATOR);
1168 requestResolvedTypes = data.createStringArray();
1169 } else {
1170 requestIntents = null;
1171 requestResolvedTypes = null;
1172 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001173 int fl = data.readInt();
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07001174 Bundle options = data.readInt() != 0
1175 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -07001176 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001177 IIntentSender res = getIntentSender(type, packageName, token,
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001178 resultWho, requestCode, requestIntents,
Dianne Hackborn41203752012-08-31 14:05:51 -07001179 requestResolvedTypes, fl, options, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001180 reply.writeNoException();
1181 reply.writeStrongBinder(res != null ? res.asBinder() : null);
1182 return true;
1183 }
1184
1185 case CANCEL_INTENT_SENDER_TRANSACTION: {
1186 data.enforceInterface(IActivityManager.descriptor);
1187 IIntentSender r = IIntentSender.Stub.asInterface(
1188 data.readStrongBinder());
1189 cancelIntentSender(r);
1190 reply.writeNoException();
1191 return true;
1192 }
1193
1194 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
1195 data.enforceInterface(IActivityManager.descriptor);
1196 IIntentSender r = IIntentSender.Stub.asInterface(
1197 data.readStrongBinder());
1198 String res = getPackageForIntentSender(r);
1199 reply.writeNoException();
1200 reply.writeString(res);
1201 return true;
1202 }
1203
Christopher Tatec4a07d12012-04-06 14:19:13 -07001204 case GET_UID_FOR_INTENT_SENDER_TRANSACTION: {
1205 data.enforceInterface(IActivityManager.descriptor);
1206 IIntentSender r = IIntentSender.Stub.asInterface(
1207 data.readStrongBinder());
1208 int res = getUidForIntentSender(r);
1209 reply.writeNoException();
1210 reply.writeInt(res);
1211 return true;
1212 }
1213
Dianne Hackborn41203752012-08-31 14:05:51 -07001214 case HANDLE_INCOMING_USER_TRANSACTION: {
1215 data.enforceInterface(IActivityManager.descriptor);
1216 int callingPid = data.readInt();
1217 int callingUid = data.readInt();
1218 int userId = data.readInt();
1219 boolean allowAll = data.readInt() != 0 ;
1220 boolean requireFull = data.readInt() != 0;
1221 String name = data.readString();
1222 String callerPackage = data.readString();
1223 int res = handleIncomingUser(callingPid, callingUid, userId, allowAll,
1224 requireFull, name, callerPackage);
1225 reply.writeNoException();
1226 reply.writeInt(res);
1227 return true;
1228 }
1229
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001230 case SET_PROCESS_LIMIT_TRANSACTION: {
1231 data.enforceInterface(IActivityManager.descriptor);
1232 int max = data.readInt();
1233 setProcessLimit(max);
1234 reply.writeNoException();
1235 return true;
1236 }
1237
1238 case GET_PROCESS_LIMIT_TRANSACTION: {
1239 data.enforceInterface(IActivityManager.descriptor);
1240 int limit = getProcessLimit();
1241 reply.writeNoException();
1242 reply.writeInt(limit);
1243 return true;
1244 }
1245
1246 case SET_PROCESS_FOREGROUND_TRANSACTION: {
1247 data.enforceInterface(IActivityManager.descriptor);
1248 IBinder token = data.readStrongBinder();
1249 int pid = data.readInt();
1250 boolean isForeground = data.readInt() != 0;
1251 setProcessForeground(token, pid, isForeground);
1252 reply.writeNoException();
1253 return true;
1254 }
1255
1256 case CHECK_PERMISSION_TRANSACTION: {
1257 data.enforceInterface(IActivityManager.descriptor);
1258 String perm = data.readString();
1259 int pid = data.readInt();
1260 int uid = data.readInt();
1261 int res = checkPermission(perm, pid, uid);
1262 reply.writeNoException();
1263 reply.writeInt(res);
1264 return true;
1265 }
1266
Dianne Hackbornff170242014-11-19 10:59:01 -08001267 case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: {
1268 data.enforceInterface(IActivityManager.descriptor);
1269 String perm = data.readString();
1270 int pid = data.readInt();
1271 int uid = data.readInt();
1272 IBinder token = data.readStrongBinder();
1273 int res = checkPermissionWithToken(perm, pid, uid, token);
1274 reply.writeNoException();
1275 reply.writeInt(res);
1276 return true;
1277 }
1278
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001279 case CHECK_URI_PERMISSION_TRANSACTION: {
1280 data.enforceInterface(IActivityManager.descriptor);
1281 Uri uri = Uri.CREATOR.createFromParcel(data);
1282 int pid = data.readInt();
1283 int uid = data.readInt();
1284 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001285 int userId = data.readInt();
Dianne Hackbornff170242014-11-19 10:59:01 -08001286 IBinder callerToken = data.readStrongBinder();
1287 int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001288 reply.writeNoException();
1289 reply.writeInt(res);
1290 return true;
1291 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001292
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001293 case CLEAR_APP_DATA_TRANSACTION: {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001294 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001295 String packageName = data.readString();
1296 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
1297 data.readStrongBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -07001298 int userId = data.readInt();
1299 boolean res = clearApplicationUserData(packageName, observer, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001300 reply.writeNoException();
1301 reply.writeInt(res ? 1 : 0);
1302 return true;
1303 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001304
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001305 case GRANT_URI_PERMISSION_TRANSACTION: {
1306 data.enforceInterface(IActivityManager.descriptor);
1307 IBinder b = data.readStrongBinder();
1308 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1309 String targetPkg = data.readString();
1310 Uri uri = Uri.CREATOR.createFromParcel(data);
1311 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001312 int userId = data.readInt();
1313 grantUriPermission(app, targetPkg, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001314 reply.writeNoException();
1315 return true;
1316 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001317
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001318 case REVOKE_URI_PERMISSION_TRANSACTION: {
1319 data.enforceInterface(IActivityManager.descriptor);
1320 IBinder b = data.readStrongBinder();
1321 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1322 Uri uri = Uri.CREATOR.createFromParcel(data);
1323 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001324 int userId = data.readInt();
1325 revokeUriPermission(app, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001326 reply.writeNoException();
1327 return true;
1328 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001329
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001330 case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1331 data.enforceInterface(IActivityManager.descriptor);
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 takePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001336 reply.writeNoException();
1337 return true;
1338 }
1339
1340 case RELEASE_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 releasePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001346 reply.writeNoException();
1347 return true;
1348 }
1349
1350 case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: {
1351 data.enforceInterface(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07001352 final String packageName = data.readString();
1353 final boolean incoming = data.readInt() != 0;
1354 final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions(
1355 packageName, incoming);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001356 reply.writeNoException();
1357 perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1358 return true;
1359 }
1360
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001361 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
1362 data.enforceInterface(IActivityManager.descriptor);
1363 IBinder b = data.readStrongBinder();
1364 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1365 boolean waiting = data.readInt() != 0;
1366 showWaitingForDebugger(app, waiting);
1367 reply.writeNoException();
1368 return true;
1369 }
1370
1371 case GET_MEMORY_INFO_TRANSACTION: {
1372 data.enforceInterface(IActivityManager.descriptor);
1373 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
1374 getMemoryInfo(mi);
1375 reply.writeNoException();
1376 mi.writeToParcel(reply, 0);
1377 return true;
1378 }
1379
1380 case UNHANDLED_BACK_TRANSACTION: {
1381 data.enforceInterface(IActivityManager.descriptor);
1382 unhandledBack();
1383 reply.writeNoException();
1384 return true;
1385 }
1386
1387 case OPEN_CONTENT_URI_TRANSACTION: {
1388 data.enforceInterface(IActivityManager.descriptor);
1389 Uri uri = Uri.parse(data.readString());
1390 ParcelFileDescriptor pfd = openContentUri(uri);
1391 reply.writeNoException();
1392 if (pfd != null) {
1393 reply.writeInt(1);
1394 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1395 } else {
1396 reply.writeInt(0);
1397 }
1398 return true;
1399 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001400
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001401 case SET_LOCK_SCREEN_SHOWN_TRANSACTION: {
1402 data.enforceInterface(IActivityManager.descriptor);
1403 setLockScreenShown(data.readInt() != 0);
1404 reply.writeNoException();
1405 return true;
1406 }
1407
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001408 case SET_DEBUG_APP_TRANSACTION: {
1409 data.enforceInterface(IActivityManager.descriptor);
1410 String pn = data.readString();
1411 boolean wfd = data.readInt() != 0;
1412 boolean per = data.readInt() != 0;
1413 setDebugApp(pn, wfd, per);
1414 reply.writeNoException();
1415 return true;
1416 }
1417
1418 case SET_ALWAYS_FINISH_TRANSACTION: {
1419 data.enforceInterface(IActivityManager.descriptor);
1420 boolean enabled = data.readInt() != 0;
1421 setAlwaysFinish(enabled);
1422 reply.writeNoException();
1423 return true;
1424 }
1425
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001426 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001427 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001428 IActivityController watcher = IActivityController.Stub.asInterface(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001429 data.readStrongBinder());
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001430 setActivityController(watcher);
Sungmin Choicdb86bb2012-12-20 14:08:59 +09001431 reply.writeNoException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001432 return true;
1433 }
1434
1435 case ENTER_SAFE_MODE_TRANSACTION: {
1436 data.enforceInterface(IActivityManager.descriptor);
1437 enterSafeMode();
1438 reply.writeNoException();
1439 return true;
1440 }
1441
1442 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1443 data.enforceInterface(IActivityManager.descriptor);
1444 IIntentSender is = IIntentSender.Stub.asInterface(
1445 data.readStrongBinder());
Dianne Hackborn099bc622014-01-22 13:39:16 -08001446 int sourceUid = data.readInt();
1447 String sourcePkg = data.readString();
Dianne Hackborn1e383822015-04-10 14:02:33 -07001448 String tag = data.readString();
1449 noteWakeupAlarm(is, sourceUid, sourcePkg, tag);
1450 reply.writeNoException();
1451 return true;
1452 }
1453
1454 case NOTE_ALARM_START_TRANSACTION: {
1455 data.enforceInterface(IActivityManager.descriptor);
1456 IIntentSender is = IIntentSender.Stub.asInterface(
1457 data.readStrongBinder());
1458 int sourceUid = data.readInt();
1459 String tag = data.readString();
1460 noteAlarmStart(is, sourceUid, tag);
1461 reply.writeNoException();
1462 return true;
1463 }
1464
1465 case NOTE_ALARM_FINISH_TRANSACTION: {
1466 data.enforceInterface(IActivityManager.descriptor);
1467 IIntentSender is = IIntentSender.Stub.asInterface(
1468 data.readStrongBinder());
1469 int sourceUid = data.readInt();
1470 String tag = data.readString();
1471 noteAlarmFinish(is, sourceUid, tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001472 reply.writeNoException();
1473 return true;
1474 }
1475
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001476 case KILL_PIDS_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001477 data.enforceInterface(IActivityManager.descriptor);
1478 int[] pids = data.createIntArray();
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001479 String reason = data.readString();
Dianne Hackborn64825172011-03-02 21:32:58 -08001480 boolean secure = data.readInt() != 0;
1481 boolean res = killPids(pids, reason, secure);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001482 reply.writeNoException();
1483 reply.writeInt(res ? 1 : 0);
1484 return true;
1485 }
1486
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07001487 case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: {
1488 data.enforceInterface(IActivityManager.descriptor);
1489 String reason = data.readString();
1490 boolean res = killProcessesBelowForeground(reason);
1491 reply.writeNoException();
1492 reply.writeInt(res ? 1 : 0);
1493 return true;
1494 }
1495
Dan Egnor60d87622009-12-16 16:32:58 -08001496 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1497 data.enforceInterface(IActivityManager.descriptor);
1498 IBinder app = data.readStrongBinder();
1499 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1500 handleApplicationCrash(app, ci);
1501 reply.writeNoException();
1502 return true;
1503 }
1504
1505 case HANDLE_APPLICATION_WTF_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001506 data.enforceInterface(IActivityManager.descriptor);
1507 IBinder app = data.readStrongBinder();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001508 String tag = data.readString();
Dianne Hackborn52322712014-08-26 22:47:26 -07001509 boolean system = data.readInt() != 0;
Dan Egnorb7f03672009-12-09 16:22:32 -08001510 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
Dianne Hackborn52322712014-08-26 22:47:26 -07001511 boolean res = handleApplicationWtf(app, tag, system, ci);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001512 reply.writeNoException();
Dan Egnor60d87622009-12-16 16:32:58 -08001513 reply.writeInt(res ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001514 return true;
1515 }
Dan Egnorb7f03672009-12-09 16:22:32 -08001516
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001517 case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: {
1518 data.enforceInterface(IActivityManager.descriptor);
1519 IBinder app = data.readStrongBinder();
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07001520 int violationMask = data.readInt();
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07001521 StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data);
1522 handleApplicationStrictModeViolation(app, violationMask, info);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001523 reply.writeNoException();
1524 return true;
1525 }
1526
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001527 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1528 data.enforceInterface(IActivityManager.descriptor);
1529 int sig = data.readInt();
1530 signalPersistentProcesses(sig);
1531 reply.writeNoException();
1532 return true;
1533 }
1534
Dianne Hackborn03abb812010-01-04 18:43:19 -08001535 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1536 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001537 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001538 int userId = data.readInt();
1539 killBackgroundProcesses(packageName, userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08001540 reply.writeNoException();
1541 return true;
1542 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08001543
1544 case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
1545 data.enforceInterface(IActivityManager.descriptor);
1546 killAllBackgroundProcesses();
1547 reply.writeNoException();
1548 return true;
1549 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001550
Dianne Hackborn03abb812010-01-04 18:43:19 -08001551 case FORCE_STOP_PACKAGE_TRANSACTION: {
1552 data.enforceInterface(IActivityManager.descriptor);
1553 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001554 int userId = data.readInt();
1555 forceStopPackage(packageName, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001556 reply.writeNoException();
1557 return true;
1558 }
Dianne Hackborn27ff9132012-03-06 14:57:58 -08001559
1560 case GET_MY_MEMORY_STATE_TRANSACTION: {
1561 data.enforceInterface(IActivityManager.descriptor);
1562 ActivityManager.RunningAppProcessInfo info =
1563 new ActivityManager.RunningAppProcessInfo();
1564 getMyMemoryState(info);
1565 reply.writeNoException();
1566 info.writeToParcel(reply, 0);
1567 return true;
1568 }
1569
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001570 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1571 data.enforceInterface(IActivityManager.descriptor);
1572 ConfigurationInfo config = getDeviceConfigurationInfo();
1573 reply.writeNoException();
1574 config.writeToParcel(reply, 0);
1575 return true;
1576 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001577
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001578 case PROFILE_CONTROL_TRANSACTION: {
1579 data.enforceInterface(IActivityManager.descriptor);
1580 String process = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001581 int userId = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001582 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001583 int profileType = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -07001584 ProfilerInfo profilerInfo = data.readInt() != 0
1585 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
1586 boolean res = profileControl(process, userId, start, profilerInfo, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001587 reply.writeNoException();
1588 reply.writeInt(res ? 1 : 0);
1589 return true;
1590 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001591
Dianne Hackborn55280a92009-05-07 15:53:46 -07001592 case SHUTDOWN_TRANSACTION: {
1593 data.enforceInterface(IActivityManager.descriptor);
1594 boolean res = shutdown(data.readInt());
1595 reply.writeNoException();
1596 reply.writeInt(res ? 1 : 0);
1597 return true;
1598 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001599
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001600 case STOP_APP_SWITCHES_TRANSACTION: {
1601 data.enforceInterface(IActivityManager.descriptor);
1602 stopAppSwitches();
1603 reply.writeNoException();
1604 return true;
1605 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001606
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001607 case RESUME_APP_SWITCHES_TRANSACTION: {
1608 data.enforceInterface(IActivityManager.descriptor);
1609 resumeAppSwitches();
1610 reply.writeNoException();
1611 return true;
1612 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001613
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001614 case PEEK_SERVICE_TRANSACTION: {
1615 data.enforceInterface(IActivityManager.descriptor);
1616 Intent service = Intent.CREATOR.createFromParcel(data);
1617 String resolvedType = data.readString();
Svet Ganov99b60432015-06-27 13:15:22 -07001618 String callingPackage = data.readString();
1619 IBinder binder = peekService(service, resolvedType, callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001620 reply.writeNoException();
1621 reply.writeStrongBinder(binder);
1622 return true;
1623 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001624
Christopher Tate181fafa2009-05-14 11:12:14 -07001625 case START_BACKUP_AGENT_TRANSACTION: {
1626 data.enforceInterface(IActivityManager.descriptor);
1627 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1628 int backupRestoreMode = data.readInt();
1629 boolean success = bindBackupAgent(info, backupRestoreMode);
1630 reply.writeNoException();
1631 reply.writeInt(success ? 1 : 0);
1632 return true;
1633 }
1634
1635 case BACKUP_AGENT_CREATED_TRANSACTION: {
1636 data.enforceInterface(IActivityManager.descriptor);
1637 String packageName = data.readString();
1638 IBinder agent = data.readStrongBinder();
1639 backupAgentCreated(packageName, agent);
1640 reply.writeNoException();
1641 return true;
1642 }
1643
1644 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1645 data.enforceInterface(IActivityManager.descriptor);
1646 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1647 unbindBackupAgent(info);
1648 reply.writeNoException();
1649 return true;
1650 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001651
1652 case ADD_PACKAGE_DEPENDENCY_TRANSACTION: {
1653 data.enforceInterface(IActivityManager.descriptor);
1654 String packageName = data.readString();
1655 addPackageDependency(packageName);
1656 reply.writeNoException();
1657 return true;
1658 }
1659
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001660 case KILL_APPLICATION_WITH_APPID_TRANSACTION: {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001661 data.enforceInterface(IActivityManager.descriptor);
1662 String pkg = data.readString();
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001663 int appid = data.readInt();
Dianne Hackborn21d9b562013-05-28 17:46:59 -07001664 String reason = data.readString();
1665 killApplicationWithAppId(pkg, appid, reason);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001666 reply.writeNoException();
1667 return true;
1668 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001669
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001670 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1671 data.enforceInterface(IActivityManager.descriptor);
1672 String reason = data.readString();
1673 closeSystemDialogs(reason);
1674 reply.writeNoException();
1675 return true;
1676 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001677
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001678 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1679 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001680 int[] pids = data.createIntArray();
1681 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001682 reply.writeNoException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001683 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001684 return true;
1685 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001686
1687 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1688 data.enforceInterface(IActivityManager.descriptor);
1689 String processName = data.readString();
1690 int uid = data.readInt();
1691 killApplicationProcess(processName, uid);
1692 reply.writeNoException();
1693 return true;
1694 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001695
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001696 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1697 data.enforceInterface(IActivityManager.descriptor);
1698 IBinder token = data.readStrongBinder();
1699 String packageName = data.readString();
1700 int enterAnim = data.readInt();
1701 int exitAnim = data.readInt();
1702 overridePendingTransition(token, packageName, enterAnim, exitAnim);
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001703 reply.writeNoException();
1704 return true;
1705 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001706
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001707 case IS_USER_A_MONKEY_TRANSACTION: {
1708 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001709 boolean areThey = isUserAMonkey();
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001710 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001711 reply.writeInt(areThey ? 1 : 0);
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001712 return true;
1713 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001714
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07001715 case SET_USER_IS_MONKEY_TRANSACTION: {
1716 data.enforceInterface(IActivityManager.descriptor);
1717 final boolean monkey = (data.readInt() == 1);
1718 setUserIsMonkey(monkey);
1719 reply.writeNoException();
1720 return true;
1721 }
1722
Dianne Hackborn860755f2010-06-03 18:47:52 -07001723 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1724 data.enforceInterface(IActivityManager.descriptor);
1725 finishHeavyWeightApp();
1726 reply.writeNoException();
1727 return true;
1728 }
Daniel Sandler69a48172010-06-23 16:29:36 -04001729
1730 case IS_IMMERSIVE_TRANSACTION: {
1731 data.enforceInterface(IActivityManager.descriptor);
1732 IBinder token = data.readStrongBinder();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001733 boolean isit = isImmersive(token);
Daniel Sandler69a48172010-06-23 16:29:36 -04001734 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001735 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001736 return true;
1737 }
1738
Craig Mautnerd61dc202014-07-07 11:09:11 -07001739 case IS_TOP_OF_TASK_TRANSACTION: {
1740 data.enforceInterface(IActivityManager.descriptor);
1741 IBinder token = data.readStrongBinder();
1742 final boolean isTopOfTask = isTopOfTask(token);
1743 reply.writeNoException();
1744 reply.writeInt(isTopOfTask ? 1 : 0);
1745 return true;
1746 }
1747
Craig Mautner5eda9b32013-07-02 11:58:16 -07001748 case CONVERT_FROM_TRANSLUCENT_TRANSACTION: {
Craig Mautner4addfc52013-06-25 08:05:45 -07001749 data.enforceInterface(IActivityManager.descriptor);
1750 IBinder token = data.readStrongBinder();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001751 boolean converted = convertFromTranslucent(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001752 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001753 reply.writeInt(converted ? 1 : 0);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001754 return true;
1755 }
1756
1757 case CONVERT_TO_TRANSLUCENT_TRANSACTION: {
1758 data.enforceInterface(IActivityManager.descriptor);
1759 IBinder token = data.readStrongBinder();
Craig Mautner233ceee2014-05-09 17:05:11 -07001760 final Bundle bundle;
1761 if (data.readInt() == 0) {
1762 bundle = null;
1763 } else {
1764 bundle = data.readBundle();
1765 }
1766 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
1767 boolean converted = convertToTranslucent(token, options);
Craig Mautner4addfc52013-06-25 08:05:45 -07001768 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001769 reply.writeInt(converted ? 1 : 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07001770 return true;
1771 }
1772
Craig Mautner233ceee2014-05-09 17:05:11 -07001773 case GET_ACTIVITY_OPTIONS_TRANSACTION: {
1774 data.enforceInterface(IActivityManager.descriptor);
1775 IBinder token = data.readStrongBinder();
1776 final ActivityOptions options = getActivityOptions(token);
1777 reply.writeNoException();
1778 reply.writeBundle(options == null ? null : options.toBundle());
1779 return true;
1780 }
1781
Daniel Sandler69a48172010-06-23 16:29:36 -04001782 case SET_IMMERSIVE_TRANSACTION: {
1783 data.enforceInterface(IActivityManager.descriptor);
1784 IBinder token = data.readStrongBinder();
1785 boolean imm = data.readInt() == 1;
1786 setImmersive(token, imm);
1787 reply.writeNoException();
1788 return true;
1789 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001790
Daniel Sandler69a48172010-06-23 16:29:36 -04001791 case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
1792 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001793 boolean isit = isTopActivityImmersive();
Daniel Sandler69a48172010-06-23 16:29:36 -04001794 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001795 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001796 return true;
1797 }
1798
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001799 case CRASH_APPLICATION_TRANSACTION: {
1800 data.enforceInterface(IActivityManager.descriptor);
1801 int uid = data.readInt();
1802 int initialPid = data.readInt();
1803 String packageName = data.readString();
1804 String message = data.readString();
1805 crashApplication(uid, initialPid, packageName, message);
1806 reply.writeNoException();
1807 return true;
1808 }
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001809
1810 case GET_PROVIDER_MIME_TYPE_TRANSACTION: {
1811 data.enforceInterface(IActivityManager.descriptor);
1812 Uri uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001813 int userId = data.readInt();
1814 String type = getProviderMimeType(uri, userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001815 reply.writeNoException();
1816 reply.writeString(type);
1817 return true;
1818 }
1819
Dianne Hackborn7e269642010-08-25 19:50:20 -07001820 case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
1821 data.enforceInterface(IActivityManager.descriptor);
1822 String name = data.readString();
1823 IBinder perm = newUriPermissionOwner(name);
1824 reply.writeNoException();
1825 reply.writeStrongBinder(perm);
1826 return true;
1827 }
1828
1829 case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1830 data.enforceInterface(IActivityManager.descriptor);
1831 IBinder owner = data.readStrongBinder();
1832 int fromUid = data.readInt();
1833 String targetPkg = data.readString();
1834 Uri uri = Uri.CREATOR.createFromParcel(data);
1835 int mode = data.readInt();
Nicolas Prevotf1939902014-06-25 09:29:02 +01001836 int sourceUserId = data.readInt();
1837 int targetUserId = data.readInt();
1838 grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId,
1839 targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001840 reply.writeNoException();
1841 return true;
1842 }
1843
1844 case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1845 data.enforceInterface(IActivityManager.descriptor);
1846 IBinder owner = data.readStrongBinder();
1847 Uri uri = null;
1848 if (data.readInt() != 0) {
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001849 uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001850 }
1851 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001852 int userId = data.readInt();
1853 revokeUriPermissionFromOwner(owner, uri, mode, userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001854 reply.writeNoException();
1855 return true;
1856 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001857
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001858 case CHECK_GRANT_URI_PERMISSION_TRANSACTION: {
1859 data.enforceInterface(IActivityManager.descriptor);
1860 int callingUid = data.readInt();
1861 String targetPkg = data.readString();
1862 Uri uri = Uri.CREATOR.createFromParcel(data);
1863 int modeFlags = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001864 int userId = data.readInt();
1865 int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07001866 reply.writeNoException();
1867 reply.writeInt(res);
1868 return true;
1869 }
1870
Andy McFadden824c5102010-07-09 16:26:57 -07001871 case DUMP_HEAP_TRANSACTION: {
1872 data.enforceInterface(IActivityManager.descriptor);
1873 String process = data.readString();
Dianne Hackbornb12e1352012-09-26 11:39:20 -07001874 int userId = data.readInt();
Andy McFadden824c5102010-07-09 16:26:57 -07001875 boolean managed = data.readInt() != 0;
1876 String path = data.readString();
1877 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -07001878 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborn1676c852012-09-10 14:52:30 -07001879 boolean res = dumpHeap(process, userId, managed, path, fd);
Andy McFadden824c5102010-07-09 16:26:57 -07001880 reply.writeNoException();
1881 reply.writeInt(res ? 1 : 0);
1882 return true;
1883 }
1884
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001885 case START_ACTIVITIES_TRANSACTION:
1886 {
1887 data.enforceInterface(IActivityManager.descriptor);
1888 IBinder b = data.readStrongBinder();
1889 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001890 String callingPackage = data.readString();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001891 Intent[] intents = data.createTypedArray(Intent.CREATOR);
1892 String[] resolvedTypes = data.createStringArray();
1893 IBinder resultTo = data.readStrongBinder();
Dianne Hackborna4972e92012-03-14 10:38:05 -07001894 Bundle options = data.readInt() != 0
1895 ? Bundle.CREATOR.createFromParcel(data) : null;
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001896 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -08001897 int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07001898 options, userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001899 reply.writeNoException();
1900 reply.writeInt(result);
1901 return true;
1902 }
1903
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001904 case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1905 {
1906 data.enforceInterface(IActivityManager.descriptor);
1907 int mode = getFrontActivityScreenCompatMode();
1908 reply.writeNoException();
1909 reply.writeInt(mode);
1910 return true;
1911 }
1912
1913 case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
1914 {
1915 data.enforceInterface(IActivityManager.descriptor);
1916 int mode = data.readInt();
1917 setFrontActivityScreenCompatMode(mode);
1918 reply.writeNoException();
1919 reply.writeInt(mode);
1920 return true;
1921 }
1922
1923 case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1924 {
1925 data.enforceInterface(IActivityManager.descriptor);
1926 String pkg = data.readString();
1927 int mode = getPackageScreenCompatMode(pkg);
1928 reply.writeNoException();
1929 reply.writeInt(mode);
1930 return true;
1931 }
1932
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001933 case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
1934 {
1935 data.enforceInterface(IActivityManager.descriptor);
1936 String pkg = data.readString();
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07001937 int mode = data.readInt();
1938 setPackageScreenCompatMode(pkg, mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04001939 reply.writeNoException();
1940 return true;
1941 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001942
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001943 case SWITCH_USER_TRANSACTION: {
1944 data.enforceInterface(IActivityManager.descriptor);
1945 int userid = data.readInt();
1946 boolean result = switchUser(userid);
1947 reply.writeNoException();
1948 reply.writeInt(result ? 1 : 0);
1949 return true;
1950 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07001951
Kenny Guy08488bf2014-02-21 17:40:37 +00001952 case START_USER_IN_BACKGROUND_TRANSACTION: {
1953 data.enforceInterface(IActivityManager.descriptor);
1954 int userid = data.readInt();
1955 boolean result = startUserInBackground(userid);
1956 reply.writeNoException();
1957 reply.writeInt(result ? 1 : 0);
1958 return true;
1959 }
1960
Dianne Hackborn80a4af22012-08-27 19:18:31 -07001961 case STOP_USER_TRANSACTION: {
1962 data.enforceInterface(IActivityManager.descriptor);
1963 int userid = data.readInt();
1964 IStopUserCallback callback = IStopUserCallback.Stub.asInterface(
1965 data.readStrongBinder());
1966 int result = stopUser(userid, callback);
1967 reply.writeNoException();
1968 reply.writeInt(result);
1969 return true;
1970 }
1971
Amith Yamasani52f1d752012-03-28 18:19:29 -07001972 case GET_CURRENT_USER_TRANSACTION: {
1973 data.enforceInterface(IActivityManager.descriptor);
1974 UserInfo userInfo = getCurrentUser();
1975 reply.writeNoException();
1976 userInfo.writeToParcel(reply, 0);
1977 return true;
1978 }
1979
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001980 case IS_USER_RUNNING_TRANSACTION: {
1981 data.enforceInterface(IActivityManager.descriptor);
1982 int userid = data.readInt();
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07001983 boolean orStopping = data.readInt() != 0;
1984 boolean result = isUserRunning(userid, orStopping);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001985 reply.writeNoException();
1986 reply.writeInt(result ? 1 : 0);
1987 return true;
1988 }
1989
Dianne Hackbornc72fc672012-09-20 13:12:03 -07001990 case GET_RUNNING_USER_IDS_TRANSACTION: {
1991 data.enforceInterface(IActivityManager.descriptor);
1992 int[] result = getRunningUserIds();
1993 reply.writeNoException();
1994 reply.writeIntArray(result);
1995 return true;
1996 }
1997
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07001998 case REMOVE_TASK_TRANSACTION:
1999 {
2000 data.enforceInterface(IActivityManager.descriptor);
2001 int taskId = data.readInt();
Wale Ogunwaled54b5782014-10-23 15:55:23 -07002002 boolean result = removeTask(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07002003 reply.writeNoException();
2004 reply.writeInt(result ? 1 : 0);
2005 return true;
2006 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002007
Jeff Sharkeya4620792011-05-20 15:29:23 -07002008 case REGISTER_PROCESS_OBSERVER_TRANSACTION: {
2009 data.enforceInterface(IActivityManager.descriptor);
2010 IProcessObserver observer = IProcessObserver.Stub.asInterface(
2011 data.readStrongBinder());
2012 registerProcessObserver(observer);
2013 return true;
2014 }
2015
2016 case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: {
2017 data.enforceInterface(IActivityManager.descriptor);
2018 IProcessObserver observer = IProcessObserver.Stub.asInterface(
2019 data.readStrongBinder());
2020 unregisterProcessObserver(observer);
2021 return true;
2022 }
2023
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07002024 case REGISTER_UID_OBSERVER_TRANSACTION: {
2025 data.enforceInterface(IActivityManager.descriptor);
2026 IUidObserver observer = IUidObserver.Stub.asInterface(
2027 data.readStrongBinder());
2028 registerUidObserver(observer);
2029 return true;
2030 }
2031
2032 case UNREGISTER_UID_OBSERVER_TRANSACTION: {
2033 data.enforceInterface(IActivityManager.descriptor);
2034 IUidObserver observer = IUidObserver.Stub.asInterface(
2035 data.readStrongBinder());
2036 unregisterUidObserver(observer);
2037 return true;
2038 }
2039
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07002040 case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
2041 {
2042 data.enforceInterface(IActivityManager.descriptor);
2043 String pkg = data.readString();
2044 boolean ask = getPackageAskScreenCompat(pkg);
2045 reply.writeNoException();
2046 reply.writeInt(ask ? 1 : 0);
2047 return true;
2048 }
2049
2050 case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
2051 {
2052 data.enforceInterface(IActivityManager.descriptor);
2053 String pkg = data.readString();
2054 boolean ask = data.readInt() != 0;
2055 setPackageAskScreenCompat(pkg, ask);
2056 reply.writeNoException();
2057 return true;
2058 }
2059
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002060 case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: {
2061 data.enforceInterface(IActivityManager.descriptor);
2062 IIntentSender r = IIntentSender.Stub.asInterface(
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002063 data.readStrongBinder());
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002064 boolean res = isIntentSenderTargetedToPackage(r);
2065 reply.writeNoException();
2066 reply.writeInt(res ? 1 : 0);
2067 return true;
2068 }
2069
Dianne Hackborn1927ae82012-06-22 15:21:36 -07002070 case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: {
2071 data.enforceInterface(IActivityManager.descriptor);
2072 IIntentSender r = IIntentSender.Stub.asInterface(
2073 data.readStrongBinder());
2074 boolean res = isIntentSenderAnActivity(r);
2075 reply.writeNoException();
2076 reply.writeInt(res ? 1 : 0);
2077 return true;
2078 }
2079
Dianne Hackborn81038902012-11-26 17:04:09 -08002080 case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: {
2081 data.enforceInterface(IActivityManager.descriptor);
2082 IIntentSender r = IIntentSender.Stub.asInterface(
2083 data.readStrongBinder());
2084 Intent intent = getIntentForIntentSender(r);
2085 reply.writeNoException();
2086 if (intent != null) {
2087 reply.writeInt(1);
2088 intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2089 } else {
2090 reply.writeInt(0);
2091 }
2092 return true;
2093 }
2094
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08002095 case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: {
2096 data.enforceInterface(IActivityManager.descriptor);
2097 IIntentSender r = IIntentSender.Stub.asInterface(
2098 data.readStrongBinder());
2099 String prefix = data.readString();
2100 String tag = getTagForIntentSender(r, prefix);
2101 reply.writeNoException();
2102 reply.writeString(tag);
2103 return true;
2104 }
2105
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002106 case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
2107 data.enforceInterface(IActivityManager.descriptor);
2108 Configuration config = Configuration.CREATOR.createFromParcel(data);
2109 updatePersistentConfiguration(config);
2110 reply.writeNoException();
2111 return true;
2112 }
2113
Dianne Hackbornb437e092011-08-05 17:50:29 -07002114 case GET_PROCESS_PSS_TRANSACTION: {
2115 data.enforceInterface(IActivityManager.descriptor);
2116 int[] pids = data.createIntArray();
2117 long[] pss = getProcessPss(pids);
2118 reply.writeNoException();
2119 reply.writeLongArray(pss);
2120 return true;
2121 }
2122
Dianne Hackborn661cd522011-08-22 00:26:20 -07002123 case SHOW_BOOT_MESSAGE_TRANSACTION: {
2124 data.enforceInterface(IActivityManager.descriptor);
2125 CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
2126 boolean always = data.readInt() != 0;
2127 showBootMessage(msg, always);
2128 reply.writeNoException();
2129 return true;
2130 }
2131
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002132 case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002133 data.enforceInterface(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002134 keyguardWaitingForActivityDrawn();
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002135 reply.writeNoException();
2136 return true;
2137 }
2138
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07002139 case KEYGUARD_GOING_AWAY_TRANSACTION: {
2140 data.enforceInterface(IActivityManager.descriptor);
2141 keyguardGoingAway(data.readInt() != 0, data.readInt() != 0);
2142 reply.writeNoException();
2143 return true;
2144 }
2145
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002146 case SHOULD_UP_RECREATE_TASK_TRANSACTION: {
Adam Powelldd8fab22012-03-22 17:47:27 -07002147 data.enforceInterface(IActivityManager.descriptor);
2148 IBinder token = data.readStrongBinder();
2149 String destAffinity = data.readString();
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002150 boolean res = shouldUpRecreateTask(token, destAffinity);
Adam Powelldd8fab22012-03-22 17:47:27 -07002151 reply.writeNoException();
2152 reply.writeInt(res ? 1 : 0);
2153 return true;
2154 }
2155
2156 case NAVIGATE_UP_TO_TRANSACTION: {
2157 data.enforceInterface(IActivityManager.descriptor);
2158 IBinder token = data.readStrongBinder();
2159 Intent target = Intent.CREATOR.createFromParcel(data);
2160 int resultCode = data.readInt();
2161 Intent resultData = null;
2162 if (data.readInt() != 0) {
2163 resultData = Intent.CREATOR.createFromParcel(data);
2164 }
2165 boolean res = navigateUpTo(token, target, resultCode, resultData);
2166 reply.writeNoException();
2167 reply.writeInt(res ? 1 : 0);
2168 return true;
2169 }
2170
Dianne Hackborn5320eb82012-05-18 12:05:04 -07002171 case GET_LAUNCHED_FROM_UID_TRANSACTION: {
2172 data.enforceInterface(IActivityManager.descriptor);
2173 IBinder token = data.readStrongBinder();
2174 int res = getLaunchedFromUid(token);
2175 reply.writeNoException();
2176 reply.writeInt(res);
2177 return true;
2178 }
2179
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002180 case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: {
2181 data.enforceInterface(IActivityManager.descriptor);
2182 IBinder token = data.readStrongBinder();
2183 String res = getLaunchedFromPackage(token);
2184 reply.writeNoException();
2185 reply.writeString(res);
2186 return true;
2187 }
2188
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002189 case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2190 data.enforceInterface(IActivityManager.descriptor);
2191 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2192 data.readStrongBinder());
2193 registerUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002194 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002195 return true;
2196 }
2197
2198 case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2199 data.enforceInterface(IActivityManager.descriptor);
2200 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2201 data.readStrongBinder());
2202 unregisterUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002203 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002204 return true;
2205 }
2206
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002207 case REQUEST_BUG_REPORT_TRANSACTION: {
2208 data.enforceInterface(IActivityManager.descriptor);
2209 requestBugReport();
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002210 reply.writeNoException();
2211 return true;
2212 }
2213
2214 case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: {
2215 data.enforceInterface(IActivityManager.descriptor);
2216 int pid = data.readInt();
2217 boolean aboveSystem = data.readInt() != 0;
Jeff Brownbd181bb2013-09-10 16:44:24 -07002218 String reason = data.readString();
2219 long res = inputDispatchingTimedOut(pid, aboveSystem, reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002220 reply.writeNoException();
2221 reply.writeLong(res);
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002222 return true;
2223 }
2224
Adam Skorydfc7fd72013-08-05 19:23:41 -07002225 case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002226 data.enforceInterface(IActivityManager.descriptor);
2227 int requestType = data.readInt();
Adam Skorydfc7fd72013-08-05 19:23:41 -07002228 Bundle res = getAssistContextExtras(requestType);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002229 reply.writeNoException();
2230 reply.writeBundle(res);
2231 return true;
2232 }
2233
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002234 case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
2235 data.enforceInterface(IActivityManager.descriptor);
2236 int requestType = data.readInt();
2237 IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder());
Dianne Hackborn17f69352015-07-17 18:04:14 -07002238 IBinder activityToken = data.readStrongBinder();
2239 boolean res = requestAssistContextExtras(requestType, receiver, activityToken);
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002240 reply.writeNoException();
Dianne Hackborn17f69352015-07-17 18:04:14 -07002241 reply.writeInt(res ? 1 : 0);
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002242 return true;
2243 }
2244
Adam Skorydfc7fd72013-08-05 19:23:41 -07002245 case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002246 data.enforceInterface(IActivityManager.descriptor);
2247 IBinder token = data.readStrongBinder();
2248 Bundle extras = data.readBundle();
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07002249 AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data);
2250 AssistContent content = AssistContent.CREATOR.createFromParcel(data);
Dianne Hackborna3acdb32015-06-08 17:07:40 -07002251 Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null;
2252 reportAssistContextExtras(token, extras, structure, content, referrer);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002253 reply.writeNoException();
2254 return true;
2255 }
2256
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002257 case LAUNCH_ASSIST_INTENT_TRANSACTION: {
2258 data.enforceInterface(IActivityManager.descriptor);
2259 Intent intent = Intent.CREATOR.createFromParcel(data);
2260 int requestType = data.readInt();
2261 String hint = data.readString();
2262 int userHandle = data.readInt();
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07002263 Bundle args = data.readBundle();
2264 boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args);
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002265 reply.writeNoException();
2266 reply.writeInt(res ? 1 : 0);
2267 return true;
2268 }
2269
Benjamin Franzc200f442015-06-25 18:20:04 +01002270 case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: {
2271 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn17f69352015-07-17 18:04:14 -07002272 boolean res = isAssistDataAllowedOnCurrentActivity();
2273 reply.writeNoException();
2274 reply.writeInt(res ? 1 : 0);
2275 return true;
2276 }
2277
2278 case SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION: {
2279 data.enforceInterface(IActivityManager.descriptor);
2280 IBinder token = data.readStrongBinder();
2281 Bundle args = data.readBundle();
2282 boolean res = showAssistFromActivity(token, args);
Benjamin Franzc200f442015-06-25 18:20:04 +01002283 reply.writeNoException();
2284 reply.writeInt(res ? 1 : 0);
2285 return true;
2286 }
2287
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002288 case KILL_UID_TRANSACTION: {
2289 data.enforceInterface(IActivityManager.descriptor);
Svetoslavaa41add2015-08-06 15:03:55 -07002290 int appId = data.readInt();
2291 int userId = data.readInt();
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002292 String reason = data.readString();
Svetoslavaa41add2015-08-06 15:03:55 -07002293 killUid(appId, userId, reason);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002294 reply.writeNoException();
2295 return true;
2296 }
2297
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07002298 case HANG_TRANSACTION: {
2299 data.enforceInterface(IActivityManager.descriptor);
2300 IBinder who = data.readStrongBinder();
2301 boolean allowRestart = data.readInt() != 0;
2302 hang(who, allowRestart);
2303 reply.writeNoException();
2304 return true;
2305 }
2306
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07002307 case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: {
2308 data.enforceInterface(IActivityManager.descriptor);
2309 IBinder token = data.readStrongBinder();
2310 reportActivityFullyDrawn(token);
2311 reply.writeNoException();
2312 return true;
2313 }
2314
Craig Mautner5eda9b32013-07-02 11:58:16 -07002315 case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: {
2316 data.enforceInterface(IActivityManager.descriptor);
2317 IBinder token = data.readStrongBinder();
2318 notifyActivityDrawn(token);
2319 reply.writeNoException();
2320 return true;
2321 }
Dianne Hackborn57a7f592013-07-22 18:21:32 -07002322
2323 case RESTART_TRANSACTION: {
2324 data.enforceInterface(IActivityManager.descriptor);
2325 restart();
2326 reply.writeNoException();
2327 return true;
2328 }
Jeff Sharkey08da7a12013-08-11 20:53:18 -07002329
Dianne Hackborn35f72be2013-09-16 10:57:39 -07002330 case PERFORM_IDLE_MAINTENANCE_TRANSACTION: {
2331 data.enforceInterface(IActivityManager.descriptor);
2332 performIdleMaintenance();
2333 reply.writeNoException();
2334 return true;
2335 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002336
Todd Kennedyca4d8422015-01-15 15:19:22 -08002337 case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: {
Craig Mautner4a1cb222013-12-04 16:14:06 -08002338 data.enforceInterface(IActivityManager.descriptor);
2339 IBinder parentActivityToken = data.readStrongBinder();
2340 IActivityContainerCallback callback =
Craig Mautnere3a00d72014-04-16 08:31:19 -07002341 IActivityContainerCallback.Stub.asInterface(data.readStrongBinder());
Craig Mautner4a1cb222013-12-04 16:14:06 -08002342 IActivityContainer activityContainer =
Todd Kennedyca4d8422015-01-15 15:19:22 -08002343 createVirtualActivityContainer(parentActivityToken, callback);
Craig Mautner4a1cb222013-12-04 16:14:06 -08002344 reply.writeNoException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08002345 if (activityContainer != null) {
2346 reply.writeInt(1);
2347 reply.writeStrongBinder(activityContainer.asBinder());
2348 } else {
2349 reply.writeInt(0);
2350 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002351 return true;
2352 }
2353
Craig Mautner95da1082014-02-24 17:54:35 -08002354 case DELETE_ACTIVITY_CONTAINER_TRANSACTION: {
2355 data.enforceInterface(IActivityManager.descriptor);
2356 IActivityContainer activityContainer =
2357 IActivityContainer.Stub.asInterface(data.readStrongBinder());
2358 deleteActivityContainer(activityContainer);
2359 reply.writeNoException();
2360 return true;
2361 }
2362
Todd Kennedy4900bf92015-01-16 16:05:14 -08002363 case CREATE_STACK_ON_DISPLAY: {
2364 data.enforceInterface(IActivityManager.descriptor);
2365 int displayId = data.readInt();
2366 IActivityContainer activityContainer = createStackOnDisplay(displayId);
2367 reply.writeNoException();
2368 if (activityContainer != null) {
2369 reply.writeInt(1);
2370 reply.writeStrongBinder(activityContainer.asBinder());
2371 } else {
2372 reply.writeInt(0);
2373 }
2374 return true;
2375 }
2376
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002377 case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: {
Craig Mautnere0a38842013-12-16 16:14:02 -08002378 data.enforceInterface(IActivityManager.descriptor);
2379 IBinder activityToken = data.readStrongBinder();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002380 int displayId = getActivityDisplayId(activityToken);
Craig Mautnere0a38842013-12-16 16:14:02 -08002381 reply.writeNoException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002382 reply.writeInt(displayId);
Craig Mautnere0a38842013-12-16 16:14:02 -08002383 return true;
2384 }
2385
Craig Mautneraea74a52014-03-08 14:23:10 -08002386 case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: {
2387 data.enforceInterface(IActivityManager.descriptor);
2388 final int taskId = data.readInt();
2389 startLockTaskMode(taskId);
2390 reply.writeNoException();
2391 return true;
2392 }
2393
2394 case START_LOCK_TASK_BY_TOKEN_TRANSACTION: {
2395 data.enforceInterface(IActivityManager.descriptor);
2396 IBinder token = data.readStrongBinder();
2397 startLockTaskMode(token);
2398 reply.writeNoException();
2399 return true;
2400 }
2401
Craig Mautnerd61dc202014-07-07 11:09:11 -07002402 case START_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002403 data.enforceInterface(IActivityManager.descriptor);
2404 startLockTaskModeOnCurrent();
2405 reply.writeNoException();
2406 return true;
2407 }
2408
Craig Mautneraea74a52014-03-08 14:23:10 -08002409 case STOP_LOCK_TASK_MODE_TRANSACTION: {
2410 data.enforceInterface(IActivityManager.descriptor);
2411 stopLockTaskMode();
2412 reply.writeNoException();
2413 return true;
2414 }
2415
Craig Mautnerd61dc202014-07-07 11:09:11 -07002416 case STOP_LOCK_TASK_BY_CURRENT_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002417 data.enforceInterface(IActivityManager.descriptor);
2418 stopLockTaskModeOnCurrent();
2419 reply.writeNoException();
2420 return true;
2421 }
2422
Craig Mautneraea74a52014-03-08 14:23:10 -08002423 case IS_IN_LOCK_TASK_MODE_TRANSACTION: {
2424 data.enforceInterface(IActivityManager.descriptor);
2425 final boolean isInLockTaskMode = isInLockTaskMode();
2426 reply.writeNoException();
2427 reply.writeInt(isInLockTaskMode ? 1 : 0);
2428 return true;
2429 }
Craig Mautner2fbd7542014-03-21 09:34:07 -07002430
Benjamin Franz43261142015-02-11 15:59:44 +00002431 case GET_LOCK_TASK_MODE_STATE_TRANSACTION: {
2432 data.enforceInterface(IActivityManager.descriptor);
2433 final int lockTaskModeState = getLockTaskModeState();
2434 reply.writeNoException();
2435 reply.writeInt(lockTaskModeState);
2436 return true;
2437 }
2438
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07002439 case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: {
2440 data.enforceInterface(IActivityManager.descriptor);
2441 final IBinder token = data.readStrongBinder();
2442 showLockTaskEscapeMessage(token);
2443 reply.writeNoException();
2444 return true;
2445 }
2446
Winson Chunga449dc02014-05-16 11:15:04 -07002447 case SET_TASK_DESCRIPTION_TRANSACTION: {
Craig Mautner2fbd7542014-03-21 09:34:07 -07002448 data.enforceInterface(IActivityManager.descriptor);
2449 IBinder token = data.readStrongBinder();
Winson Chunga449dc02014-05-16 11:15:04 -07002450 ActivityManager.TaskDescription values =
2451 ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
2452 setTaskDescription(token, values);
Craig Mautner2fbd7542014-03-21 09:34:07 -07002453 reply.writeNoException();
2454 return true;
2455 }
Craig Mautneree2e45a2014-06-27 12:10:03 -07002456
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08002457 case SET_TASK_RESIZEABLE_TRANSACTION: {
2458 data.enforceInterface(IActivityManager.descriptor);
2459 int taskId = data.readInt();
2460 boolean resizeable = (data.readInt() == 1) ? true : false;
2461 setTaskResizeable(taskId, resizeable);
2462 reply.writeNoException();
2463 return true;
2464 }
2465
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002466 case RESIZE_TASK_TRANSACTION: {
2467 data.enforceInterface(IActivityManager.descriptor);
2468 int taskId = data.readInt();
Chong Zhang87b21722015-09-21 15:39:51 -07002469 int resizeMode = data.readInt();
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002470 Rect r = Rect.CREATOR.createFromParcel(data);
Chong Zhang87b21722015-09-21 15:39:51 -07002471 resizeTask(taskId, r, resizeMode);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002472 reply.writeNoException();
2473 return true;
2474 }
2475
Wale Ogunwalee4a0c572015-06-30 08:40:31 -07002476 case GET_TASK_BOUNDS_TRANSACTION: {
2477 data.enforceInterface(IActivityManager.descriptor);
2478 int taskId = data.readInt();
2479 Rect r = getTaskBounds(taskId);
2480 reply.writeNoException();
2481 r.writeToParcel(reply, 0);
2482 return true;
2483 }
2484
Craig Mautner648f69b2014-09-18 14:16:26 -07002485 case GET_TASK_DESCRIPTION_ICON_TRANSACTION: {
2486 data.enforceInterface(IActivityManager.descriptor);
2487 String filename = data.readString();
2488 Bitmap icon = getTaskDescriptionIcon(filename);
2489 reply.writeNoException();
2490 if (icon == null) {
2491 reply.writeInt(0);
2492 } else {
2493 reply.writeInt(1);
2494 icon.writeToParcel(reply, 0);
2495 }
2496 return true;
2497 }
2498
Winson Chung044d5292014-11-06 11:05:19 -08002499 case START_IN_PLACE_ANIMATION_TRANSACTION: {
2500 data.enforceInterface(IActivityManager.descriptor);
2501 final Bundle bundle;
2502 if (data.readInt() == 0) {
2503 bundle = null;
2504 } else {
2505 bundle = data.readBundle();
2506 }
2507 final ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
2508 startInPlaceAnimationOnFrontMostApplication(options);
2509 reply.writeNoException();
2510 return true;
2511 }
2512
Jose Lima4b6c6692014-08-12 17:41:12 -07002513 case REQUEST_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002514 data.enforceInterface(IActivityManager.descriptor);
2515 IBinder token = data.readStrongBinder();
2516 boolean enable = data.readInt() > 0;
Jose Lima4b6c6692014-08-12 17:41:12 -07002517 boolean success = requestVisibleBehind(token, enable);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002518 reply.writeNoException();
2519 reply.writeInt(success ? 1 : 0);
2520 return true;
2521 }
2522
Jose Lima4b6c6692014-08-12 17:41:12 -07002523 case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002524 data.enforceInterface(IActivityManager.descriptor);
2525 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002526 final boolean enabled = isBackgroundVisibleBehind(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002527 reply.writeNoException();
2528 reply.writeInt(enabled ? 1 : 0);
2529 return true;
2530 }
2531
Jose Lima4b6c6692014-08-12 17:41:12 -07002532 case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002533 data.enforceInterface(IActivityManager.descriptor);
2534 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002535 backgroundResourcesReleased(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002536 reply.writeNoException();
2537 return true;
2538 }
Craig Mautnerbb742462014-07-07 15:28:55 -07002539
2540 case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: {
2541 data.enforceInterface(IActivityManager.descriptor);
2542 IBinder token = data.readStrongBinder();
2543 notifyLaunchTaskBehindComplete(token);
2544 reply.writeNoException();
2545 return true;
2546 }
Craig Mautner8746a472014-07-24 15:12:54 -07002547
2548 case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: {
2549 data.enforceInterface(IActivityManager.descriptor);
2550 IBinder token = data.readStrongBinder();
2551 notifyEnterAnimationComplete(token);
2552 reply.writeNoException();
2553 return true;
2554 }
Craig Mautner6e2f3952014-09-09 14:26:41 -07002555
2556 case BOOT_ANIMATION_COMPLETE_TRANSACTION: {
2557 data.enforceInterface(IActivityManager.descriptor);
2558 bootAnimationComplete();
2559 reply.writeNoException();
2560 return true;
2561 }
Wale Ogunwale18795a22014-12-03 11:38:33 -08002562
Jeff Sharkey605eb792014-11-04 13:34:06 -08002563 case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: {
2564 data.enforceInterface(IActivityManager.descriptor);
2565 final int uid = data.readInt();
2566 final byte[] firstPacket = data.createByteArray();
2567 notifyCleartextNetwork(uid, firstPacket);
2568 reply.writeNoException();
2569 return true;
2570 }
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002571
2572 case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: {
2573 data.enforceInterface(IActivityManager.descriptor);
2574 String procName = data.readString();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002575 int uid = data.readInt();
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002576 long maxMemSize = data.readLong();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002577 String reportPackage = data.readString();
2578 setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002579 reply.writeNoException();
2580 return true;
2581 }
2582
2583 case DUMP_HEAP_FINISHED_TRANSACTION: {
2584 data.enforceInterface(IActivityManager.descriptor);
2585 String path = data.readString();
2586 dumpHeapFinished(path);
2587 reply.writeNoException();
2588 return true;
2589 }
Dianne Hackborn3d07c942015-03-13 18:02:54 -07002590
2591 case SET_VOICE_KEEP_AWAKE_TRANSACTION: {
2592 data.enforceInterface(IActivityManager.descriptor);
2593 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
2594 data.readStrongBinder());
2595 boolean keepAwake = data.readInt() != 0;
2596 setVoiceKeepAwake(session, keepAwake);
2597 reply.writeNoException();
2598 return true;
2599 }
Craig Mautnere5600772015-04-03 21:36:37 -07002600
2601 case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: {
2602 data.enforceInterface(IActivityManager.descriptor);
2603 int userId = data.readInt();
2604 String[] packages = data.readStringArray();
2605 updateLockTaskPackages(userId, packages);
2606 reply.writeNoException();
2607 return true;
2608 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07002609
Craig Mautner015c5e52015-04-23 10:39:39 -07002610 case UPDATE_DEVICE_OWNER_TRANSACTION: {
2611 data.enforceInterface(IActivityManager.descriptor);
2612 String packageName = data.readString();
2613 updateDeviceOwner(packageName);
2614 reply.writeNoException();
2615 return true;
2616 }
2617
Dianne Hackborn1e383822015-04-10 14:02:33 -07002618 case GET_PACKAGE_PROCESS_STATE_TRANSACTION: {
2619 data.enforceInterface(IActivityManager.descriptor);
2620 String pkg = data.readString();
Adam Lesinskic30454c2015-06-24 13:24:35 -07002621 String callingPackage = data.readString();
2622 int res = getPackageProcessState(pkg, callingPackage);
Dianne Hackborn1e383822015-04-10 14:02:33 -07002623 reply.writeNoException();
2624 reply.writeInt(res);
2625 return true;
2626 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07002627
2628 case SET_PROCESS_MEMORY_TRIM_TRANSACTION: {
2629 data.enforceInterface(IActivityManager.descriptor);
2630 String process = data.readString();
2631 int userId = data.readInt();
2632 int level = data.readInt();
2633 boolean res = setProcessMemoryTrimLevel(process, userId, level);
2634 reply.writeNoException();
2635 reply.writeInt(res ? 1 : 0);
2636 return true;
2637 }
Rahul Chaturvedi52613f92015-06-17 23:54:08 -04002638
Dianne Hackbornfb81d092015-08-03 17:14:46 -07002639 case IS_ROOT_VOICE_INTERACTION_TRANSACTION: {
2640 data.enforceInterface(IActivityManager.descriptor);
2641 IBinder token = data.readStrongBinder();
2642 boolean res = isRootVoiceInteraction(token);
2643 reply.writeNoException();
2644 reply.writeInt(res ? 1 : 0);
2645 return true;
2646 }
Ian Pedowitza3710842015-08-03 23:36:15 -07002647
Rahul Chaturvedi52613f92015-06-17 23:54:08 -04002648 case START_BINDER_TRACKING_TRANSACTION: {
2649 data.enforceInterface(IActivityManager.descriptor);
2650 boolean res = startBinderTracking();
2651 reply.writeNoException();
2652 reply.writeInt(res ? 1 : 0);
2653 return true;
2654 }
2655
2656 case STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION: {
2657 data.enforceInterface(IActivityManager.descriptor);
2658 ParcelFileDescriptor fd = data.readInt() != 0
2659 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
2660 boolean res = stopBinderTrackingAndDump(fd);
2661 reply.writeNoException();
2662 reply.writeInt(res ? 1 : 0);
2663 return true;
2664 }
Wale Ogunwale868a5e12015-08-02 16:19:20 -07002665 case GET_ACTIVITY_STACK_ID_TRANSACTION: {
2666 data.enforceInterface(IActivityManager.descriptor);
2667 IBinder token = data.readStrongBinder();
2668 int stackId = getActivityStackId(token);
2669 reply.writeNoException();
2670 reply.writeInt(stackId);
2671 return true;
2672 }
2673 case MOVE_ACTIVITY_TO_STACK_TRANSACTION: {
2674 data.enforceInterface(IActivityManager.descriptor);
2675 IBinder token = data.readStrongBinder();
2676 int stackId = data.readInt();
2677 moveActivityToStack(token, stackId);
2678 reply.writeNoException();
2679 return true;
2680 }
Filip Gruszczynski23493322015-07-29 17:02:59 -07002681 case REPORT_SIZE_CONFIGURATIONS: {
2682 data.enforceInterface(IActivityManager.descriptor);
2683 IBinder token = data.readStrongBinder();
2684 int horizontalSize = data.readInt();
2685 int[] horizontal = null;
2686 if (horizontalSize > 0) {
2687 horizontal = new int[horizontalSize];
2688 data.readIntArray(horizontal);
2689 }
2690 int[] vertical = null;
2691 int verticalSize = data.readInt();
2692 if (verticalSize > 0) {
2693 vertical = new int[verticalSize];
2694 data.readIntArray(vertical);
2695 }
2696 reportSizeConfigurations(token, horizontal, vertical);
2697 return true;
2698 }
Wale Ogunwale83301a92015-09-24 15:54:08 -07002699 case SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION: {
2700 data.enforceInterface(IActivityManager.descriptor);
2701 final boolean suppress = data.readInt() == 1;
2702 suppressResizeConfigChanges(suppress);
2703 reply.writeNoException();
2704 return true;
2705 }
Filip Gruszczynski57b6cce2015-10-06 09:50:51 -07002706 case REMOVE_STACK: {
2707 data.enforceInterface(IActivityManager.descriptor);
2708 final int stackId = data.readInt();
2709 removeStack(stackId);
2710 reply.writeNoException();
2711 return true;
2712 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002713 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002714
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002715 return super.onTransact(code, data, reply, flags);
2716 }
2717
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002718 public IBinder asBinder() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002719 return this;
2720 }
2721
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002722 private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
2723 protected IActivityManager create() {
2724 IBinder b = ServiceManager.getService("activity");
Joe Onorato43a17652011-04-06 19:22:23 -07002725 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002726 Log.v("ActivityManager", "default service binder = " + b);
2727 }
2728 IActivityManager am = asInterface(b);
Joe Onorato43a17652011-04-06 19:22:23 -07002729 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08002730 Log.v("ActivityManager", "default service = " + am);
2731 }
2732 return am;
2733 }
2734 };
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002735}
2736
2737class ActivityManagerProxy implements IActivityManager
2738{
2739 public ActivityManagerProxy(IBinder remote)
2740 {
2741 mRemote = remote;
2742 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002743
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002744 public IBinder asBinder()
2745 {
2746 return mRemote;
2747 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08002748
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002749 public int startActivity(IApplicationThread caller, String callingPackage, Intent intent,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002750 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002751 int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002752 Parcel data = Parcel.obtain();
2753 Parcel reply = Parcel.obtain();
2754 data.writeInterfaceToken(IActivityManager.descriptor);
2755 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002756 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002757 intent.writeToParcel(data, 0);
2758 data.writeString(resolvedType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002759 data.writeStrongBinder(resultTo);
2760 data.writeString(resultWho);
2761 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002762 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002763 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002764 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002765 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002766 } else {
2767 data.writeInt(0);
2768 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002769 if (options != null) {
2770 data.writeInt(1);
2771 options.writeToParcel(data, 0);
2772 } else {
2773 data.writeInt(0);
2774 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002775 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2776 reply.readException();
2777 int result = reply.readInt();
2778 reply.recycle();
2779 data.recycle();
2780 return result;
2781 }
Amith Yamasani82644082012-08-03 13:09:11 -07002782
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002783 public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent,
Amith Yamasani82644082012-08-03 13:09:11 -07002784 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07002785 int startFlags, ProfilerInfo profilerInfo, Bundle options,
2786 int userId) throws RemoteException {
Amith Yamasani82644082012-08-03 13:09:11 -07002787 Parcel data = Parcel.obtain();
2788 Parcel reply = Parcel.obtain();
2789 data.writeInterfaceToken(IActivityManager.descriptor);
2790 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002791 data.writeString(callingPackage);
Amith Yamasani82644082012-08-03 13:09:11 -07002792 intent.writeToParcel(data, 0);
2793 data.writeString(resolvedType);
2794 data.writeStrongBinder(resultTo);
2795 data.writeString(resultWho);
2796 data.writeInt(requestCode);
2797 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002798 if (profilerInfo != null) {
Amith Yamasani82644082012-08-03 13:09:11 -07002799 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002800 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Amith Yamasani82644082012-08-03 13:09:11 -07002801 } else {
2802 data.writeInt(0);
2803 }
2804 if (options != null) {
2805 data.writeInt(1);
2806 options.writeToParcel(data, 0);
2807 } else {
2808 data.writeInt(0);
2809 }
2810 data.writeInt(userId);
2811 mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0);
2812 reply.readException();
2813 int result = reply.readInt();
2814 reply.recycle();
2815 data.recycle();
2816 return result;
2817 }
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002818 public int startActivityAsCaller(IApplicationThread caller, String callingPackage,
2819 Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna7cfbe02015-07-16 10:52:52 -07002820 int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity,
2821 int userId) throws RemoteException {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002822 Parcel data = Parcel.obtain();
2823 Parcel reply = Parcel.obtain();
2824 data.writeInterfaceToken(IActivityManager.descriptor);
2825 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2826 data.writeString(callingPackage);
2827 intent.writeToParcel(data, 0);
2828 data.writeString(resolvedType);
2829 data.writeStrongBinder(resultTo);
2830 data.writeString(resultWho);
2831 data.writeInt(requestCode);
2832 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002833 if (profilerInfo != null) {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002834 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002835 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002836 } else {
2837 data.writeInt(0);
2838 }
2839 if (options != null) {
2840 data.writeInt(1);
2841 options.writeToParcel(data, 0);
2842 } else {
2843 data.writeInt(0);
2844 }
Dianne Hackborna7cfbe02015-07-16 10:52:52 -07002845 data.writeInt(ignoreTargetSecurity ? 1 : 0);
Jeff Sharkey97978802014-10-14 10:48:18 -07002846 data.writeInt(userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07002847 mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0);
2848 reply.readException();
2849 int result = reply.readInt();
2850 reply.recycle();
2851 data.recycle();
2852 return result;
2853 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002854 public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage,
2855 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Jeff Hao1b012d32014-08-20 10:35:34 -07002856 int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options,
2857 int userId) throws RemoteException {
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002858 Parcel data = Parcel.obtain();
2859 Parcel reply = Parcel.obtain();
2860 data.writeInterfaceToken(IActivityManager.descriptor);
2861 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002862 data.writeString(callingPackage);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002863 intent.writeToParcel(data, 0);
2864 data.writeString(resolvedType);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002865 data.writeStrongBinder(resultTo);
2866 data.writeString(resultWho);
2867 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002868 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002869 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002870 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002871 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07002872 } else {
2873 data.writeInt(0);
2874 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07002875 if (options != null) {
2876 data.writeInt(1);
2877 options.writeToParcel(data, 0);
2878 } else {
2879 data.writeInt(0);
2880 }
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002881 data.writeInt(userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08002882 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
2883 reply.readException();
2884 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
2885 reply.recycle();
2886 data.recycle();
2887 return result;
2888 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002889 public int startActivityWithConfig(IApplicationThread caller, String callingPackage,
2890 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002891 int requestCode, int startFlags, Configuration config,
Dianne Hackborn41203752012-08-31 14:05:51 -07002892 Bundle options, int userId) throws RemoteException {
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002893 Parcel data = Parcel.obtain();
2894 Parcel reply = Parcel.obtain();
2895 data.writeInterfaceToken(IActivityManager.descriptor);
2896 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002897 data.writeString(callingPackage);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002898 intent.writeToParcel(data, 0);
2899 data.writeString(resolvedType);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002900 data.writeStrongBinder(resultTo);
2901 data.writeString(resultWho);
2902 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002903 data.writeInt(startFlags);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002904 config.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002905 if (options != null) {
2906 data.writeInt(1);
2907 options.writeToParcel(data, 0);
2908 } else {
2909 data.writeInt(0);
2910 }
Dianne Hackborn41203752012-08-31 14:05:51 -07002911 data.writeInt(userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07002912 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
2913 reply.readException();
2914 int result = reply.readInt();
2915 reply.recycle();
2916 data.recycle();
2917 return result;
2918 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002919 public int startActivityIntentSender(IApplicationThread caller,
2920 IntentSender intent, Intent fillInIntent, String resolvedType,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002921 IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002922 int flagsMask, int flagsValues, Bundle options) throws RemoteException {
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002923 Parcel data = Parcel.obtain();
2924 Parcel reply = Parcel.obtain();
2925 data.writeInterfaceToken(IActivityManager.descriptor);
2926 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
2927 intent.writeToParcel(data, 0);
2928 if (fillInIntent != null) {
2929 data.writeInt(1);
2930 fillInIntent.writeToParcel(data, 0);
2931 } else {
2932 data.writeInt(0);
2933 }
2934 data.writeString(resolvedType);
2935 data.writeStrongBinder(resultTo);
2936 data.writeString(resultWho);
2937 data.writeInt(requestCode);
2938 data.writeInt(flagsMask);
2939 data.writeInt(flagsValues);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002940 if (options != null) {
2941 data.writeInt(1);
2942 options.writeToParcel(data, 0);
2943 } else {
2944 data.writeInt(0);
2945 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07002946 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07002947 reply.readException();
2948 int result = reply.readInt();
2949 reply.recycle();
2950 data.recycle();
2951 return result;
2952 }
Dianne Hackborn91097de2014-04-04 18:02:06 -07002953 public int startVoiceActivity(String callingPackage, int callingPid, int callingUid,
2954 Intent intent, String resolvedType, IVoiceInteractionSession session,
Jeff Hao1b012d32014-08-20 10:35:34 -07002955 IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo,
2956 Bundle options, int userId) throws RemoteException {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002957 Parcel data = Parcel.obtain();
2958 Parcel reply = Parcel.obtain();
2959 data.writeInterfaceToken(IActivityManager.descriptor);
2960 data.writeString(callingPackage);
2961 data.writeInt(callingPid);
2962 data.writeInt(callingUid);
2963 intent.writeToParcel(data, 0);
2964 data.writeString(resolvedType);
2965 data.writeStrongBinder(session.asBinder());
2966 data.writeStrongBinder(interactor.asBinder());
2967 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07002968 if (profilerInfo != null) {
Dianne Hackborn91097de2014-04-04 18:02:06 -07002969 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07002970 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn91097de2014-04-04 18:02:06 -07002971 } else {
2972 data.writeInt(0);
2973 }
2974 if (options != null) {
2975 data.writeInt(1);
2976 options.writeToParcel(data, 0);
2977 } else {
2978 data.writeInt(0);
2979 }
2980 data.writeInt(userId);
2981 mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0);
2982 reply.readException();
2983 int result = reply.readInt();
2984 reply.recycle();
2985 data.recycle();
2986 return result;
2987 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002988 public boolean startNextMatchingActivity(IBinder callingActivity,
Dianne Hackborna4972e92012-03-14 10:38:05 -07002989 Intent intent, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002990 Parcel data = Parcel.obtain();
2991 Parcel reply = Parcel.obtain();
2992 data.writeInterfaceToken(IActivityManager.descriptor);
2993 data.writeStrongBinder(callingActivity);
2994 intent.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07002995 if (options != null) {
2996 data.writeInt(1);
2997 options.writeToParcel(data, 0);
2998 } else {
2999 data.writeInt(0);
3000 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003001 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
3002 reply.readException();
3003 int result = reply.readInt();
3004 reply.recycle();
3005 data.recycle();
3006 return result != 0;
3007 }
Wale Ogunwale7e8184b2015-10-05 14:37:03 -07003008 public int startActivityFromRecents(int taskId, int launchStackId, Bundle options)
3009 throws RemoteException {
Craig Mautnerdc00cbe2014-07-20 17:48:47 -07003010 Parcel data = Parcel.obtain();
3011 Parcel reply = Parcel.obtain();
3012 data.writeInterfaceToken(IActivityManager.descriptor);
3013 data.writeInt(taskId);
Wale Ogunwale7e8184b2015-10-05 14:37:03 -07003014 data.writeInt(launchStackId);
Craig Mautnerdc00cbe2014-07-20 17:48:47 -07003015 if (options == null) {
3016 data.writeInt(0);
3017 } else {
3018 data.writeInt(1);
3019 options.writeToParcel(data, 0);
3020 }
3021 mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0);
3022 reply.readException();
3023 int result = reply.readInt();
3024 reply.recycle();
3025 data.recycle();
3026 return result;
3027 }
Wale Ogunwaleba7881c2015-08-01 19:28:29 -07003028 public boolean finishActivity(IBinder token, int resultCode, Intent resultData, int finishTask)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003029 throws RemoteException {
3030 Parcel data = Parcel.obtain();
3031 Parcel reply = Parcel.obtain();
3032 data.writeInterfaceToken(IActivityManager.descriptor);
3033 data.writeStrongBinder(token);
3034 data.writeInt(resultCode);
3035 if (resultData != null) {
3036 data.writeInt(1);
3037 resultData.writeToParcel(data, 0);
3038 } else {
3039 data.writeInt(0);
3040 }
Wale Ogunwaleba7881c2015-08-01 19:28:29 -07003041 data.writeInt(finishTask);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003042 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
3043 reply.readException();
3044 boolean res = reply.readInt() != 0;
3045 data.recycle();
3046 reply.recycle();
3047 return res;
3048 }
3049 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
3050 {
3051 Parcel data = Parcel.obtain();
3052 Parcel reply = Parcel.obtain();
3053 data.writeInterfaceToken(IActivityManager.descriptor);
3054 data.writeStrongBinder(token);
3055 data.writeString(resultWho);
3056 data.writeInt(requestCode);
3057 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
3058 reply.readException();
3059 data.recycle();
3060 reply.recycle();
3061 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -07003062 public boolean finishActivityAffinity(IBinder token) throws RemoteException {
3063 Parcel data = Parcel.obtain();
3064 Parcel reply = Parcel.obtain();
3065 data.writeInterfaceToken(IActivityManager.descriptor);
3066 data.writeStrongBinder(token);
3067 mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0);
3068 reply.readException();
3069 boolean res = reply.readInt() != 0;
3070 data.recycle();
3071 reply.recycle();
3072 return res;
3073 }
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -07003074 public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException {
3075 Parcel data = Parcel.obtain();
3076 Parcel reply = Parcel.obtain();
3077 data.writeInterfaceToken(IActivityManager.descriptor);
3078 data.writeStrongBinder(session.asBinder());
3079 mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0);
3080 reply.readException();
3081 data.recycle();
3082 reply.recycle();
3083 }
Dianne Hackborn89ad4562014-08-24 16:45:38 -07003084 public boolean releaseActivityInstance(IBinder token) throws RemoteException {
3085 Parcel data = Parcel.obtain();
3086 Parcel reply = Parcel.obtain();
3087 data.writeInterfaceToken(IActivityManager.descriptor);
3088 data.writeStrongBinder(token);
3089 mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0);
3090 reply.readException();
3091 boolean res = reply.readInt() != 0;
3092 data.recycle();
3093 reply.recycle();
3094 return res;
3095 }
3096 public void releaseSomeActivities(IApplicationThread app) throws RemoteException {
3097 Parcel data = Parcel.obtain();
3098 Parcel reply = Parcel.obtain();
3099 data.writeInterfaceToken(IActivityManager.descriptor);
3100 data.writeStrongBinder(app.asBinder());
3101 mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0);
3102 reply.readException();
3103 data.recycle();
3104 reply.recycle();
3105 }
Dianne Hackborn061d58a2010-03-12 15:07:06 -08003106 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
3107 Parcel data = Parcel.obtain();
3108 Parcel reply = Parcel.obtain();
3109 data.writeInterfaceToken(IActivityManager.descriptor);
3110 data.writeStrongBinder(token);
3111 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
3112 reply.readException();
3113 boolean res = reply.readInt() != 0;
3114 data.recycle();
3115 reply.recycle();
3116 return res;
3117 }
Dianne Hackborn6c418d52011-06-29 14:05:33 -07003118 public Intent registerReceiver(IApplicationThread caller, String packageName,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003119 IIntentReceiver receiver,
Dianne Hackborn20e80982012-08-31 19:00:44 -07003120 IntentFilter filter, String perm, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003121 {
3122 Parcel data = Parcel.obtain();
3123 Parcel reply = Parcel.obtain();
3124 data.writeInterfaceToken(IActivityManager.descriptor);
3125 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackborn6c418d52011-06-29 14:05:33 -07003126 data.writeString(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003127 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
3128 filter.writeToParcel(data, 0);
3129 data.writeString(perm);
Dianne Hackborn20e80982012-08-31 19:00:44 -07003130 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003131 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
3132 reply.readException();
3133 Intent intent = null;
3134 int haveIntent = reply.readInt();
3135 if (haveIntent != 0) {
3136 intent = Intent.CREATOR.createFromParcel(reply);
3137 }
3138 reply.recycle();
3139 data.recycle();
3140 return intent;
3141 }
3142 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
3143 {
3144 Parcel data = Parcel.obtain();
3145 Parcel reply = Parcel.obtain();
3146 data.writeInterfaceToken(IActivityManager.descriptor);
3147 data.writeStrongBinder(receiver.asBinder());
3148 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
3149 reply.readException();
3150 data.recycle();
3151 reply.recycle();
3152 }
3153 public int broadcastIntent(IApplicationThread caller,
Dianne Hackborna750a632015-06-16 17:18:23 -07003154 Intent intent, String resolvedType, IIntentReceiver resultTo,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003155 int resultCode, String resultData, Bundle map,
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -07003156 String[] requiredPermissions, int appOp, Bundle options, boolean serialized,
Amith Yamasani742a6712011-05-04 14:49:28 -07003157 boolean sticky, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003158 {
3159 Parcel data = Parcel.obtain();
3160 Parcel reply = Parcel.obtain();
3161 data.writeInterfaceToken(IActivityManager.descriptor);
3162 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3163 intent.writeToParcel(data, 0);
3164 data.writeString(resolvedType);
3165 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
3166 data.writeInt(resultCode);
3167 data.writeString(resultData);
3168 data.writeBundle(map);
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -07003169 data.writeStringArray(requiredPermissions);
Dianne Hackbornf51f6122013-02-04 18:23:34 -08003170 data.writeInt(appOp);
Dianne Hackborna750a632015-06-16 17:18:23 -07003171 data.writeBundle(options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003172 data.writeInt(serialized ? 1 : 0);
3173 data.writeInt(sticky ? 1 : 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003174 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003175 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
3176 reply.readException();
3177 int res = reply.readInt();
3178 reply.recycle();
3179 data.recycle();
3180 return res;
3181 }
Amith Yamasani742a6712011-05-04 14:49:28 -07003182 public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
3183 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003184 {
3185 Parcel data = Parcel.obtain();
3186 Parcel reply = Parcel.obtain();
3187 data.writeInterfaceToken(IActivityManager.descriptor);
3188 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3189 intent.writeToParcel(data, 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003190 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003191 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
3192 reply.readException();
3193 data.recycle();
3194 reply.recycle();
3195 }
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003196 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map,
3197 boolean abortBroadcast, int flags) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003198 {
3199 Parcel data = Parcel.obtain();
3200 Parcel reply = Parcel.obtain();
3201 data.writeInterfaceToken(IActivityManager.descriptor);
3202 data.writeStrongBinder(who);
3203 data.writeInt(resultCode);
3204 data.writeString(resultData);
3205 data.writeBundle(map);
3206 data.writeInt(abortBroadcast ? 1 : 0);
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003207 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003208 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3209 reply.readException();
3210 data.recycle();
3211 reply.recycle();
3212 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003213 public void attachApplication(IApplicationThread app) throws RemoteException
3214 {
3215 Parcel data = Parcel.obtain();
3216 Parcel reply = Parcel.obtain();
3217 data.writeInterfaceToken(IActivityManager.descriptor);
3218 data.writeStrongBinder(app.asBinder());
3219 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
3220 reply.readException();
3221 data.recycle();
3222 reply.recycle();
3223 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003224 public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
3225 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003226 {
3227 Parcel data = Parcel.obtain();
3228 Parcel reply = Parcel.obtain();
3229 data.writeInterfaceToken(IActivityManager.descriptor);
3230 data.writeStrongBinder(token);
Dianne Hackborne88846e2009-09-30 21:34:25 -07003231 if (config != null) {
3232 data.writeInt(1);
3233 config.writeToParcel(data, 0);
3234 } else {
3235 data.writeInt(0);
3236 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003237 data.writeInt(stopProfiling ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003238 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3239 reply.readException();
3240 data.recycle();
3241 reply.recycle();
3242 }
Dianne Hackbornad9b32112012-09-17 15:35:01 -07003243 public void activityResumed(IBinder token) throws RemoteException
3244 {
3245 Parcel data = Parcel.obtain();
3246 Parcel reply = Parcel.obtain();
3247 data.writeInterfaceToken(IActivityManager.descriptor);
3248 data.writeStrongBinder(token);
3249 mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0);
3250 reply.readException();
3251 data.recycle();
3252 reply.recycle();
3253 }
Dianne Hackborna4e102e2014-09-04 22:52:27 -07003254 public void activityPaused(IBinder token) throws RemoteException
Dianne Hackborn0aae2d42010-12-07 23:51:29 -08003255 {
3256 Parcel data = Parcel.obtain();
3257 Parcel reply = Parcel.obtain();
3258 data.writeInterfaceToken(IActivityManager.descriptor);
3259 data.writeStrongBinder(token);
3260 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
3261 reply.readException();
3262 data.recycle();
3263 reply.recycle();
3264 }
3265 public void activityStopped(IBinder token, Bundle state,
Craig Mautnera0026042014-04-23 11:45:37 -07003266 PersistableBundle persistentState, CharSequence description) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003267 {
3268 Parcel data = Parcel.obtain();
3269 Parcel reply = Parcel.obtain();
3270 data.writeInterfaceToken(IActivityManager.descriptor);
3271 data.writeStrongBinder(token);
3272 data.writeBundle(state);
Craig Mautnera0026042014-04-23 11:45:37 -07003273 data.writePersistableBundle(persistentState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003274 TextUtils.writeToParcel(description, data, 0);
3275 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3276 reply.readException();
3277 data.recycle();
3278 reply.recycle();
3279 }
Dianne Hackborn4eba96b2011-01-21 13:34:36 -08003280 public void activitySlept(IBinder token) throws RemoteException
3281 {
3282 Parcel data = Parcel.obtain();
3283 Parcel reply = Parcel.obtain();
3284 data.writeInterfaceToken(IActivityManager.descriptor);
3285 data.writeStrongBinder(token);
3286 mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3287 reply.readException();
3288 data.recycle();
3289 reply.recycle();
3290 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003291 public void activityDestroyed(IBinder token) throws RemoteException
3292 {
3293 Parcel data = Parcel.obtain();
3294 Parcel reply = Parcel.obtain();
3295 data.writeInterfaceToken(IActivityManager.descriptor);
3296 data.writeStrongBinder(token);
3297 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3298 reply.readException();
3299 data.recycle();
3300 reply.recycle();
3301 }
3302 public String getCallingPackage(IBinder token) throws RemoteException
3303 {
3304 Parcel data = Parcel.obtain();
3305 Parcel reply = Parcel.obtain();
3306 data.writeInterfaceToken(IActivityManager.descriptor);
3307 data.writeStrongBinder(token);
3308 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
3309 reply.readException();
3310 String res = reply.readString();
3311 data.recycle();
3312 reply.recycle();
3313 return res;
3314 }
3315 public ComponentName getCallingActivity(IBinder token)
3316 throws RemoteException {
3317 Parcel data = Parcel.obtain();
3318 Parcel reply = Parcel.obtain();
3319 data.writeInterfaceToken(IActivityManager.descriptor);
3320 data.writeStrongBinder(token);
3321 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
3322 reply.readException();
3323 ComponentName res = ComponentName.readFromParcel(reply);
3324 data.recycle();
3325 reply.recycle();
3326 return res;
3327 }
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003328 public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException {
Winson Chung1147c402014-05-14 11:05:00 -07003329 Parcel data = Parcel.obtain();
3330 Parcel reply = Parcel.obtain();
3331 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003332 data.writeString(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -07003333 mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0);
3334 reply.readException();
3335 ArrayList<IAppTask> list = null;
3336 int N = reply.readInt();
3337 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003338 list = new ArrayList<>();
Winson Chung1147c402014-05-14 11:05:00 -07003339 while (N > 0) {
3340 IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder());
3341 list.add(task);
3342 N--;
3343 }
3344 }
3345 data.recycle();
3346 reply.recycle();
3347 return list;
3348 }
Dianne Hackbornaec68bb2014-08-20 15:25:13 -07003349 public int addAppTask(IBinder activityToken, Intent intent,
3350 ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException {
3351 Parcel data = Parcel.obtain();
3352 Parcel reply = Parcel.obtain();
3353 data.writeInterfaceToken(IActivityManager.descriptor);
3354 data.writeStrongBinder(activityToken);
3355 intent.writeToParcel(data, 0);
3356 description.writeToParcel(data, 0);
3357 thumbnail.writeToParcel(data, 0);
3358 mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0);
3359 reply.readException();
3360 int res = reply.readInt();
3361 data.recycle();
3362 reply.recycle();
3363 return res;
3364 }
3365 public Point getAppTaskThumbnailSize() throws RemoteException {
3366 Parcel data = Parcel.obtain();
3367 Parcel reply = Parcel.obtain();
3368 data.writeInterfaceToken(IActivityManager.descriptor);
3369 mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0);
3370 reply.readException();
3371 Point size = Point.CREATOR.createFromParcel(reply);
3372 data.recycle();
3373 reply.recycle();
3374 return size;
3375 }
Todd Kennedye635f662015-01-20 10:36:49 -08003376 public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags)
3377 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003378 Parcel data = Parcel.obtain();
3379 Parcel reply = Parcel.obtain();
3380 data.writeInterfaceToken(IActivityManager.descriptor);
3381 data.writeInt(maxNum);
3382 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003383 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
3384 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003385 ArrayList<ActivityManager.RunningTaskInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003386 int N = reply.readInt();
3387 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003388 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003389 while (N > 0) {
3390 ActivityManager.RunningTaskInfo info =
3391 ActivityManager.RunningTaskInfo.CREATOR
Winson Chung1147c402014-05-14 11:05:00 -07003392 .createFromParcel(reply);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003393 list.add(info);
3394 N--;
3395 }
3396 }
3397 data.recycle();
3398 reply.recycle();
3399 return list;
3400 }
3401 public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -07003402 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003403 Parcel data = Parcel.obtain();
3404 Parcel reply = Parcel.obtain();
3405 data.writeInterfaceToken(IActivityManager.descriptor);
3406 data.writeInt(maxNum);
3407 data.writeInt(flags);
Amith Yamasani82644082012-08-03 13:09:11 -07003408 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003409 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
3410 reply.readException();
3411 ArrayList<ActivityManager.RecentTaskInfo> list
3412 = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR);
3413 data.recycle();
3414 reply.recycle();
3415 return list;
3416 }
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003417 public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException {
Dianne Hackbornd94df452011-02-16 18:53:31 -08003418 Parcel data = Parcel.obtain();
3419 Parcel reply = Parcel.obtain();
3420 data.writeInterfaceToken(IActivityManager.descriptor);
3421 data.writeInt(id);
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003422 mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003423 reply.readException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003424 ActivityManager.TaskThumbnail taskThumbnail = null;
Dianne Hackbornd94df452011-02-16 18:53:31 -08003425 if (reply.readInt() != 0) {
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003426 taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003427 }
3428 data.recycle();
3429 reply.recycle();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003430 return taskThumbnail;
Dianne Hackborn15491c62012-09-19 10:59:14 -07003431 }
Todd Kennedye635f662015-01-20 10:36:49 -08003432 public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags)
3433 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003434 Parcel data = Parcel.obtain();
3435 Parcel reply = Parcel.obtain();
3436 data.writeInterfaceToken(IActivityManager.descriptor);
3437 data.writeInt(maxNum);
3438 data.writeInt(flags);
3439 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
3440 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003441 ArrayList<ActivityManager.RunningServiceInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003442 int N = reply.readInt();
3443 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003444 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003445 while (N > 0) {
3446 ActivityManager.RunningServiceInfo info =
3447 ActivityManager.RunningServiceInfo.CREATOR
3448 .createFromParcel(reply);
3449 list.add(info);
3450 N--;
3451 }
3452 }
3453 data.recycle();
3454 reply.recycle();
3455 return list;
3456 }
3457 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
3458 throws RemoteException {
3459 Parcel data = Parcel.obtain();
3460 Parcel reply = Parcel.obtain();
3461 data.writeInterfaceToken(IActivityManager.descriptor);
3462 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
3463 reply.readException();
3464 ArrayList<ActivityManager.ProcessErrorStateInfo> list
3465 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
3466 data.recycle();
3467 reply.recycle();
3468 return list;
3469 }
3470 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
3471 throws RemoteException {
3472 Parcel data = Parcel.obtain();
3473 Parcel reply = Parcel.obtain();
3474 data.writeInterfaceToken(IActivityManager.descriptor);
3475 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
3476 reply.readException();
3477 ArrayList<ActivityManager.RunningAppProcessInfo> list
3478 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
3479 data.recycle();
3480 reply.recycle();
3481 return list;
3482 }
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -07003483 public List<ApplicationInfo> getRunningExternalApplications()
3484 throws RemoteException {
3485 Parcel data = Parcel.obtain();
3486 Parcel reply = Parcel.obtain();
3487 data.writeInterfaceToken(IActivityManager.descriptor);
3488 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
3489 reply.readException();
3490 ArrayList<ApplicationInfo> list
3491 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
3492 data.recycle();
3493 reply.recycle();
3494 return list;
3495 }
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003496 public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003497 {
3498 Parcel data = Parcel.obtain();
3499 Parcel reply = Parcel.obtain();
3500 data.writeInterfaceToken(IActivityManager.descriptor);
3501 data.writeInt(task);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003502 data.writeInt(flags);
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003503 if (options != null) {
3504 data.writeInt(1);
3505 options.writeToParcel(data, 0);
3506 } else {
3507 data.writeInt(0);
3508 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003509 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
3510 reply.readException();
3511 data.recycle();
3512 reply.recycle();
3513 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003514 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
3515 throws RemoteException {
3516 Parcel data = Parcel.obtain();
3517 Parcel reply = Parcel.obtain();
3518 data.writeInterfaceToken(IActivityManager.descriptor);
3519 data.writeStrongBinder(token);
3520 data.writeInt(nonRoot ? 1 : 0);
3521 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
3522 reply.readException();
3523 boolean res = reply.readInt() != 0;
3524 data.recycle();
3525 reply.recycle();
3526 return res;
3527 }
3528 public void moveTaskBackwards(int task) throws RemoteException
3529 {
3530 Parcel data = Parcel.obtain();
3531 Parcel reply = Parcel.obtain();
3532 data.writeInterfaceToken(IActivityManager.descriptor);
3533 data.writeInt(task);
3534 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
3535 reply.readException();
3536 data.recycle();
3537 reply.recycle();
3538 }
Craig Mautnerc00204b2013-03-05 15:02:14 -08003539 @Override
Craig Mautnerc00204b2013-03-05 15:02:14 -08003540 public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException
3541 {
3542 Parcel data = Parcel.obtain();
3543 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003544 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003545 data.writeInt(taskId);
3546 data.writeInt(stackId);
3547 data.writeInt(toTop ? 1 : 0);
3548 mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0);
3549 reply.readException();
3550 data.recycle();
3551 reply.recycle();
3552 }
3553 @Override
Wale Ogunwale59a73ca2015-09-14 12:54:50 -07003554 public void moveTaskToDockedStack(int taskId, int createMode, boolean toTop)
3555 throws RemoteException
3556 {
3557 Parcel data = Parcel.obtain();
3558 Parcel reply = Parcel.obtain();
3559 data.writeInterfaceToken(IActivityManager.descriptor);
3560 data.writeInt(taskId);
3561 data.writeInt(createMode);
3562 data.writeInt(toTop ? 1 : 0);
3563 mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0);
3564 reply.readException();
3565 data.recycle();
3566 reply.recycle();
3567 }
3568 @Override
Wale Ogunwale079a0042015-10-24 11:44:07 -07003569 public boolean moveTopActivityToPinnedStack(int stackId, Rect r)
3570 throws RemoteException
3571 {
3572 Parcel data = Parcel.obtain();
3573 Parcel reply = Parcel.obtain();
3574 data.writeInterfaceToken(IActivityManager.descriptor);
3575 data.writeInt(stackId);
3576 r.writeToParcel(data, 0);
3577 mRemote.transact(MOVE_TOP_ACTIVITY_TO_PINNED_STACK, data, reply, 0);
3578 reply.readException();
3579 final boolean res = reply.readInt() != 0;
3580 data.recycle();
3581 reply.recycle();
3582 return res;
3583 }
3584 @Override
Wale Ogunwaleffc11bb2015-10-10 13:05:45 -07003585 public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode)
3586 throws RemoteException
Craig Mautnerc00204b2013-03-05 15:02:14 -08003587 {
3588 Parcel data = Parcel.obtain();
3589 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003590 data.writeInterfaceToken(IActivityManager.descriptor);
Wale Ogunwaleb34a7ad2015-08-14 11:05:30 -07003591 data.writeInt(stackId);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003592 r.writeToParcel(data, 0);
Wale Ogunwaleffc11bb2015-10-10 13:05:45 -07003593 data.writeInt(allowResizeInDockedMode ? 1 : 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07003594 mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003595 reply.readException();
3596 data.recycle();
3597 reply.recycle();
3598 }
Craig Mautner967212c2013-04-13 21:10:58 -07003599 @Override
Wale Ogunwaleddc1cb22015-07-25 19:23:04 -07003600 public void positionTaskInStack(int taskId, int stackId, int position) throws RemoteException
3601 {
3602 Parcel data = Parcel.obtain();
3603 Parcel reply = Parcel.obtain();
3604 data.writeInterfaceToken(IActivityManager.descriptor);
3605 data.writeInt(taskId);
3606 data.writeInt(stackId);
3607 data.writeInt(position);
3608 mRemote.transact(POSITION_TASK_IN_STACK_TRANSACTION, data, reply, 0);
3609 reply.readException();
3610 data.recycle();
3611 reply.recycle();
3612 }
3613 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003614 public List<StackInfo> getAllStackInfos() throws RemoteException
Craig Mautner5ff12102013-05-24 12:50:15 -07003615 {
3616 Parcel data = Parcel.obtain();
3617 Parcel reply = Parcel.obtain();
3618 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003619 mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0);
Craig Mautner5ff12102013-05-24 12:50:15 -07003620 reply.readException();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003621 ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR);
Craig Mautner967212c2013-04-13 21:10:58 -07003622 data.recycle();
3623 reply.recycle();
3624 return list;
3625 }
Craig Mautnercf910b02013-04-23 11:23:27 -07003626 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003627 public StackInfo getStackInfo(int stackId) throws RemoteException
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003628 {
3629 Parcel data = Parcel.obtain();
3630 Parcel reply = Parcel.obtain();
3631 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003632 data.writeInt(stackId);
3633 mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003634 reply.readException();
3635 int res = reply.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003636 StackInfo info = null;
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003637 if (res != 0) {
Craig Mautnerbdc748af2013-12-02 14:08:25 -08003638 info = StackInfo.CREATOR.createFromParcel(reply);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07003639 }
3640 data.recycle();
3641 reply.recycle();
3642 return info;
3643 }
3644 @Override
Winson Chung303e1ff2014-03-07 15:06:19 -08003645 public boolean isInHomeStack(int taskId) throws RemoteException {
3646 Parcel data = Parcel.obtain();
3647 Parcel reply = Parcel.obtain();
3648 data.writeInterfaceToken(IActivityManager.descriptor);
3649 data.writeInt(taskId);
3650 mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0);
3651 reply.readException();
3652 boolean isInHomeStack = reply.readInt() > 0;
3653 data.recycle();
3654 reply.recycle();
3655 return isInHomeStack;
3656 }
3657 @Override
Craig Mautnercf910b02013-04-23 11:23:27 -07003658 public void setFocusedStack(int stackId) throws RemoteException
3659 {
3660 Parcel data = Parcel.obtain();
3661 Parcel reply = Parcel.obtain();
3662 data.writeInterfaceToken(IActivityManager.descriptor);
3663 data.writeInt(stackId);
Dianne Hackborn1e383822015-04-10 14:02:33 -07003664 mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0);
Craig Mautnercf910b02013-04-23 11:23:27 -07003665 reply.readException();
3666 data.recycle();
3667 reply.recycle();
3668 }
Winson Chung740c3ac2014-11-12 16:14:38 -08003669 @Override
Winson Chungd16c5652015-01-26 16:11:07 -08003670 public int getFocusedStackId() throws RemoteException {
3671 Parcel data = Parcel.obtain();
3672 Parcel reply = Parcel.obtain();
3673 data.writeInterfaceToken(IActivityManager.descriptor);
3674 mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0);
3675 reply.readException();
3676 int focusedStackId = reply.readInt();
3677 data.recycle();
3678 reply.recycle();
3679 return focusedStackId;
3680 }
3681 @Override
Wale Ogunwalee4a0c572015-06-30 08:40:31 -07003682 public void setFocusedTask(int taskId) throws RemoteException
3683 {
3684 Parcel data = Parcel.obtain();
3685 Parcel reply = Parcel.obtain();
3686 data.writeInterfaceToken(IActivityManager.descriptor);
3687 data.writeInt(taskId);
3688 mRemote.transact(SET_FOCUSED_TASK_TRANSACTION, data, reply, 0);
3689 reply.readException();
3690 data.recycle();
3691 reply.recycle();
3692 }
3693 @Override
Winson Chung740c3ac2014-11-12 16:14:38 -08003694 public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException
3695 {
3696 Parcel data = Parcel.obtain();
3697 Parcel reply = Parcel.obtain();
3698 data.writeInterfaceToken(IActivityManager.descriptor);
3699 data.writeStrongBinder(listener.asBinder());
Dianne Hackborn1e383822015-04-10 14:02:33 -07003700 mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0);
Winson Chung740c3ac2014-11-12 16:14:38 -08003701 reply.readException();
3702 data.recycle();
3703 reply.recycle();
3704 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003705 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
3706 {
3707 Parcel data = Parcel.obtain();
3708 Parcel reply = Parcel.obtain();
3709 data.writeInterfaceToken(IActivityManager.descriptor);
3710 data.writeStrongBinder(token);
3711 data.writeInt(onlyRoot ? 1 : 0);
3712 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
3713 reply.readException();
3714 int res = reply.readInt();
3715 data.recycle();
3716 reply.recycle();
3717 return res;
3718 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003719 public ContentProviderHolder getContentProvider(IApplicationThread caller,
Jeff Sharkey6d515712012-09-20 16:06:08 -07003720 String name, int userId, boolean stable) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003721 Parcel data = Parcel.obtain();
3722 Parcel reply = Parcel.obtain();
3723 data.writeInterfaceToken(IActivityManager.descriptor);
3724 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3725 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003726 data.writeInt(userId);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003727 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003728 mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3729 reply.readException();
3730 int res = reply.readInt();
3731 ContentProviderHolder cph = null;
3732 if (res != 0) {
3733 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3734 }
3735 data.recycle();
3736 reply.recycle();
3737 return cph;
3738 }
Jeff Sharkey6d515712012-09-20 16:06:08 -07003739 public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token)
3740 throws RemoteException {
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003741 Parcel data = Parcel.obtain();
3742 Parcel reply = Parcel.obtain();
3743 data.writeInterfaceToken(IActivityManager.descriptor);
3744 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07003745 data.writeInt(userId);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003746 data.writeStrongBinder(token);
3747 mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3748 reply.readException();
3749 int res = reply.readInt();
3750 ContentProviderHolder cph = null;
3751 if (res != 0) {
3752 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
3753 }
3754 data.recycle();
3755 reply.recycle();
3756 return cph;
3757 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003758 public void publishContentProviders(IApplicationThread caller,
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003759 List<ContentProviderHolder> providers) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003760 {
3761 Parcel data = Parcel.obtain();
3762 Parcel reply = Parcel.obtain();
3763 data.writeInterfaceToken(IActivityManager.descriptor);
3764 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3765 data.writeTypedList(providers);
3766 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
3767 reply.readException();
3768 data.recycle();
3769 reply.recycle();
3770 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003771 public boolean refContentProvider(IBinder connection, int stable, int unstable)
3772 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003773 Parcel data = Parcel.obtain();
3774 Parcel reply = Parcel.obtain();
3775 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003776 data.writeStrongBinder(connection);
3777 data.writeInt(stable);
3778 data.writeInt(unstable);
3779 mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3780 reply.readException();
3781 boolean res = reply.readInt() != 0;
3782 data.recycle();
3783 reply.recycle();
3784 return res;
3785 }
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003786
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003787 public void unstableProviderDied(IBinder connection) throws RemoteException {
3788 Parcel data = Parcel.obtain();
3789 Parcel reply = Parcel.obtain();
3790 data.writeInterfaceToken(IActivityManager.descriptor);
3791 data.writeStrongBinder(connection);
3792 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0);
3793 reply.readException();
3794 data.recycle();
3795 reply.recycle();
3796 }
3797
Jeff Sharkey7aa76012013-09-30 14:26:27 -07003798 @Override
3799 public void appNotRespondingViaProvider(IBinder connection) throws RemoteException {
3800 Parcel data = Parcel.obtain();
3801 Parcel reply = Parcel.obtain();
3802 data.writeInterfaceToken(IActivityManager.descriptor);
3803 data.writeStrongBinder(connection);
3804 mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0);
3805 reply.readException();
3806 data.recycle();
3807 reply.recycle();
3808 }
3809
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07003810 public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException {
3811 Parcel data = Parcel.obtain();
3812 Parcel reply = Parcel.obtain();
3813 data.writeInterfaceToken(IActivityManager.descriptor);
3814 data.writeStrongBinder(connection);
3815 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003816 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
3817 reply.readException();
3818 data.recycle();
3819 reply.recycle();
3820 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08003821
3822 public void removeContentProviderExternal(String name, IBinder token) throws RemoteException {
3823 Parcel data = Parcel.obtain();
3824 Parcel reply = Parcel.obtain();
3825 data.writeInterfaceToken(IActivityManager.descriptor);
3826 data.writeString(name);
3827 data.writeStrongBinder(token);
3828 mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
3829 reply.readException();
3830 data.recycle();
3831 reply.recycle();
3832 }
3833
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07003834 public PendingIntent getRunningServiceControlPanel(ComponentName service)
3835 throws RemoteException
3836 {
3837 Parcel data = Parcel.obtain();
3838 Parcel reply = Parcel.obtain();
3839 data.writeInterfaceToken(IActivityManager.descriptor);
3840 service.writeToParcel(data, 0);
3841 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
3842 reply.readException();
3843 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
3844 data.recycle();
3845 reply.recycle();
3846 return res;
3847 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003848
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003849 public ComponentName startService(IApplicationThread caller, Intent service,
Svet Ganov99b60432015-06-27 13:15:22 -07003850 String resolvedType, String callingPackage, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003851 {
3852 Parcel data = Parcel.obtain();
3853 Parcel reply = Parcel.obtain();
3854 data.writeInterfaceToken(IActivityManager.descriptor);
3855 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3856 service.writeToParcel(data, 0);
3857 data.writeString(resolvedType);
Svet Ganov99b60432015-06-27 13:15:22 -07003858 data.writeString(callingPackage);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003859 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003860 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
3861 reply.readException();
3862 ComponentName res = ComponentName.readFromParcel(reply);
3863 data.recycle();
3864 reply.recycle();
3865 return res;
3866 }
3867 public int stopService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003868 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003869 {
3870 Parcel data = Parcel.obtain();
3871 Parcel reply = Parcel.obtain();
3872 data.writeInterfaceToken(IActivityManager.descriptor);
3873 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3874 service.writeToParcel(data, 0);
3875 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003876 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003877 mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0);
3878 reply.readException();
3879 int res = reply.readInt();
3880 reply.recycle();
3881 data.recycle();
3882 return res;
3883 }
3884 public boolean stopServiceToken(ComponentName className, IBinder token,
3885 int startId) throws RemoteException {
3886 Parcel data = Parcel.obtain();
3887 Parcel reply = Parcel.obtain();
3888 data.writeInterfaceToken(IActivityManager.descriptor);
3889 ComponentName.writeToParcel(className, data);
3890 data.writeStrongBinder(token);
3891 data.writeInt(startId);
3892 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
3893 reply.readException();
3894 boolean res = reply.readInt() != 0;
3895 data.recycle();
3896 reply.recycle();
3897 return res;
3898 }
3899 public void setServiceForeground(ComponentName className, IBinder token,
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003900 int id, Notification notification, boolean removeNotification) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003901 Parcel data = Parcel.obtain();
3902 Parcel reply = Parcel.obtain();
3903 data.writeInterfaceToken(IActivityManager.descriptor);
3904 ComponentName.writeToParcel(className, data);
3905 data.writeStrongBinder(token);
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07003906 data.writeInt(id);
3907 if (notification != null) {
3908 data.writeInt(1);
3909 notification.writeToParcel(data, 0);
3910 } else {
3911 data.writeInt(0);
3912 }
3913 data.writeInt(removeNotification ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003914 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
3915 reply.readException();
3916 data.recycle();
3917 reply.recycle();
3918 }
3919 public int bindService(IApplicationThread caller, IBinder token,
3920 Intent service, String resolvedType, IServiceConnection connection,
Svet Ganov99b60432015-06-27 13:15:22 -07003921 int flags, String callingPackage, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003922 Parcel data = Parcel.obtain();
3923 Parcel reply = Parcel.obtain();
3924 data.writeInterfaceToken(IActivityManager.descriptor);
3925 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3926 data.writeStrongBinder(token);
3927 service.writeToParcel(data, 0);
3928 data.writeString(resolvedType);
3929 data.writeStrongBinder(connection.asBinder());
3930 data.writeInt(flags);
Svet Ganov99b60432015-06-27 13:15:22 -07003931 data.writeString(callingPackage);
Amith Yamasani37ce3a82012-02-06 12:04:42 -08003932 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003933 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
3934 reply.readException();
3935 int res = reply.readInt();
3936 data.recycle();
3937 reply.recycle();
3938 return res;
3939 }
3940 public boolean unbindService(IServiceConnection connection) throws RemoteException
3941 {
3942 Parcel data = Parcel.obtain();
3943 Parcel reply = Parcel.obtain();
3944 data.writeInterfaceToken(IActivityManager.descriptor);
3945 data.writeStrongBinder(connection.asBinder());
3946 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
3947 reply.readException();
3948 boolean res = reply.readInt() != 0;
3949 data.recycle();
3950 reply.recycle();
3951 return res;
3952 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003953
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003954 public void publishService(IBinder token,
3955 Intent intent, IBinder service) throws RemoteException {
3956 Parcel data = Parcel.obtain();
3957 Parcel reply = Parcel.obtain();
3958 data.writeInterfaceToken(IActivityManager.descriptor);
3959 data.writeStrongBinder(token);
3960 intent.writeToParcel(data, 0);
3961 data.writeStrongBinder(service);
3962 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
3963 reply.readException();
3964 data.recycle();
3965 reply.recycle();
3966 }
3967
3968 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
3969 throws RemoteException {
3970 Parcel data = Parcel.obtain();
3971 Parcel reply = Parcel.obtain();
3972 data.writeInterfaceToken(IActivityManager.descriptor);
3973 data.writeStrongBinder(token);
3974 intent.writeToParcel(data, 0);
3975 data.writeInt(doRebind ? 1 : 0);
3976 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
3977 reply.readException();
3978 data.recycle();
3979 reply.recycle();
3980 }
3981
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003982 public void serviceDoneExecuting(IBinder token, int type, int startId,
3983 int res) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003984 Parcel data = Parcel.obtain();
3985 Parcel reply = Parcel.obtain();
3986 data.writeInterfaceToken(IActivityManager.descriptor);
3987 data.writeStrongBinder(token);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07003988 data.writeInt(type);
3989 data.writeInt(startId);
3990 data.writeInt(res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003991 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3992 reply.readException();
3993 data.recycle();
3994 reply.recycle();
3995 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07003996
Svet Ganov99b60432015-06-27 13:15:22 -07003997 public IBinder peekService(Intent service, String resolvedType, String callingPackage)
3998 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003999 Parcel data = Parcel.obtain();
4000 Parcel reply = Parcel.obtain();
4001 data.writeInterfaceToken(IActivityManager.descriptor);
4002 service.writeToParcel(data, 0);
4003 data.writeString(resolvedType);
Svet Ganov99b60432015-06-27 13:15:22 -07004004 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004005 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
4006 reply.readException();
4007 IBinder binder = reply.readStrongBinder();
4008 reply.recycle();
4009 data.recycle();
4010 return binder;
4011 }
4012
Christopher Tate181fafa2009-05-14 11:12:14 -07004013 public boolean bindBackupAgent(ApplicationInfo app, int backupRestoreMode)
4014 throws RemoteException {
4015 Parcel data = Parcel.obtain();
4016 Parcel reply = Parcel.obtain();
4017 data.writeInterfaceToken(IActivityManager.descriptor);
4018 app.writeToParcel(data, 0);
4019 data.writeInt(backupRestoreMode);
4020 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
4021 reply.readException();
4022 boolean success = reply.readInt() != 0;
4023 reply.recycle();
4024 data.recycle();
4025 return success;
4026 }
4027
Christopher Tate346acb12012-10-15 19:20:25 -07004028 public void clearPendingBackup() throws RemoteException {
4029 Parcel data = Parcel.obtain();
4030 Parcel reply = Parcel.obtain();
4031 data.writeInterfaceToken(IActivityManager.descriptor);
4032 mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0);
4033 reply.recycle();
4034 data.recycle();
4035 }
4036
Christopher Tate181fafa2009-05-14 11:12:14 -07004037 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
4038 Parcel data = Parcel.obtain();
4039 Parcel reply = Parcel.obtain();
4040 data.writeInterfaceToken(IActivityManager.descriptor);
4041 data.writeString(packageName);
4042 data.writeStrongBinder(agent);
4043 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
4044 reply.recycle();
4045 data.recycle();
4046 }
4047
4048 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
4049 Parcel data = Parcel.obtain();
4050 Parcel reply = Parcel.obtain();
4051 data.writeInterfaceToken(IActivityManager.descriptor);
4052 app.writeToParcel(data, 0);
4053 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
4054 reply.readException();
4055 reply.recycle();
4056 data.recycle();
4057 }
4058
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004059 public boolean startInstrumentation(ComponentName className, String profileFile,
Svetoslav Ganov80943d82013-01-02 10:25:37 -08004060 int flags, Bundle arguments, IInstrumentationWatcher watcher,
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01004061 IUiAutomationConnection connection, int userId, String instructionSet)
4062 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004063 Parcel data = Parcel.obtain();
4064 Parcel reply = Parcel.obtain();
4065 data.writeInterfaceToken(IActivityManager.descriptor);
4066 ComponentName.writeToParcel(className, data);
4067 data.writeString(profileFile);
4068 data.writeInt(flags);
4069 data.writeBundle(arguments);
4070 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08004071 data.writeStrongBinder(connection != null ? connection.asBinder() : null);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004072 data.writeInt(userId);
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01004073 data.writeString(instructionSet);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004074 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
4075 reply.readException();
4076 boolean res = reply.readInt() != 0;
4077 reply.recycle();
4078 data.recycle();
4079 return res;
4080 }
4081
4082 public void finishInstrumentation(IApplicationThread target,
4083 int resultCode, Bundle results) throws RemoteException {
4084 Parcel data = Parcel.obtain();
4085 Parcel reply = Parcel.obtain();
4086 data.writeInterfaceToken(IActivityManager.descriptor);
4087 data.writeStrongBinder(target != null ? target.asBinder() : null);
4088 data.writeInt(resultCode);
4089 data.writeBundle(results);
4090 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
4091 reply.readException();
4092 data.recycle();
4093 reply.recycle();
4094 }
4095 public Configuration getConfiguration() throws RemoteException
4096 {
4097 Parcel data = Parcel.obtain();
4098 Parcel reply = Parcel.obtain();
4099 data.writeInterfaceToken(IActivityManager.descriptor);
4100 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
4101 reply.readException();
4102 Configuration res = Configuration.CREATOR.createFromParcel(reply);
4103 reply.recycle();
4104 data.recycle();
4105 return res;
4106 }
4107 public void updateConfiguration(Configuration values) throws RemoteException
4108 {
4109 Parcel data = Parcel.obtain();
4110 Parcel reply = Parcel.obtain();
4111 data.writeInterfaceToken(IActivityManager.descriptor);
4112 values.writeToParcel(data, 0);
4113 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
4114 reply.readException();
4115 data.recycle();
4116 reply.recycle();
4117 }
4118 public void setRequestedOrientation(IBinder token, int requestedOrientation)
4119 throws RemoteException {
4120 Parcel data = Parcel.obtain();
4121 Parcel reply = Parcel.obtain();
4122 data.writeInterfaceToken(IActivityManager.descriptor);
4123 data.writeStrongBinder(token);
4124 data.writeInt(requestedOrientation);
4125 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
4126 reply.readException();
4127 data.recycle();
4128 reply.recycle();
4129 }
4130 public int getRequestedOrientation(IBinder token) throws RemoteException {
4131 Parcel data = Parcel.obtain();
4132 Parcel reply = Parcel.obtain();
4133 data.writeInterfaceToken(IActivityManager.descriptor);
4134 data.writeStrongBinder(token);
4135 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
4136 reply.readException();
4137 int res = reply.readInt();
4138 data.recycle();
4139 reply.recycle();
4140 return res;
4141 }
4142 public ComponentName getActivityClassForToken(IBinder token)
4143 throws RemoteException {
4144 Parcel data = Parcel.obtain();
4145 Parcel reply = Parcel.obtain();
4146 data.writeInterfaceToken(IActivityManager.descriptor);
4147 data.writeStrongBinder(token);
4148 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
4149 reply.readException();
4150 ComponentName res = ComponentName.readFromParcel(reply);
4151 data.recycle();
4152 reply.recycle();
4153 return res;
4154 }
4155 public String getPackageForToken(IBinder token) throws RemoteException
4156 {
4157 Parcel data = Parcel.obtain();
4158 Parcel reply = Parcel.obtain();
4159 data.writeInterfaceToken(IActivityManager.descriptor);
4160 data.writeStrongBinder(token);
4161 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
4162 reply.readException();
4163 String res = reply.readString();
4164 data.recycle();
4165 reply.recycle();
4166 return res;
4167 }
4168 public IIntentSender getIntentSender(int type,
4169 String packageName, IBinder token, String resultWho,
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07004170 int requestCode, Intent[] intents, String[] resolvedTypes, int flags,
Dianne Hackborn41203752012-08-31 14:05:51 -07004171 Bundle options, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004172 Parcel data = Parcel.obtain();
4173 Parcel reply = Parcel.obtain();
4174 data.writeInterfaceToken(IActivityManager.descriptor);
4175 data.writeInt(type);
4176 data.writeString(packageName);
4177 data.writeStrongBinder(token);
4178 data.writeString(resultWho);
4179 data.writeInt(requestCode);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004180 if (intents != null) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004181 data.writeInt(1);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004182 data.writeTypedArray(intents, 0);
4183 data.writeStringArray(resolvedTypes);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004184 } else {
4185 data.writeInt(0);
4186 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004187 data.writeInt(flags);
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07004188 if (options != null) {
4189 data.writeInt(1);
4190 options.writeToParcel(data, 0);
4191 } else {
4192 data.writeInt(0);
4193 }
Dianne Hackborn41203752012-08-31 14:05:51 -07004194 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004195 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
4196 reply.readException();
4197 IIntentSender res = IIntentSender.Stub.asInterface(
Dianne Hackbornff170242014-11-19 10:59:01 -08004198 reply.readStrongBinder());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004199 data.recycle();
4200 reply.recycle();
4201 return res;
4202 }
4203 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
4204 Parcel data = Parcel.obtain();
4205 Parcel reply = Parcel.obtain();
4206 data.writeInterfaceToken(IActivityManager.descriptor);
4207 data.writeStrongBinder(sender.asBinder());
4208 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
4209 reply.readException();
4210 data.recycle();
4211 reply.recycle();
4212 }
4213 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
4214 Parcel data = Parcel.obtain();
4215 Parcel reply = Parcel.obtain();
4216 data.writeInterfaceToken(IActivityManager.descriptor);
4217 data.writeStrongBinder(sender.asBinder());
4218 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4219 reply.readException();
4220 String res = reply.readString();
4221 data.recycle();
4222 reply.recycle();
4223 return res;
4224 }
Christopher Tatec4a07d12012-04-06 14:19:13 -07004225 public int getUidForIntentSender(IIntentSender sender) throws RemoteException {
4226 Parcel data = Parcel.obtain();
4227 Parcel reply = Parcel.obtain();
4228 data.writeInterfaceToken(IActivityManager.descriptor);
4229 data.writeStrongBinder(sender.asBinder());
4230 mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4231 reply.readException();
4232 int res = reply.readInt();
4233 data.recycle();
4234 reply.recycle();
4235 return res;
4236 }
Dianne Hackborn41203752012-08-31 14:05:51 -07004237 public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
4238 boolean requireFull, String name, String callerPackage) throws RemoteException {
4239 Parcel data = Parcel.obtain();
4240 Parcel reply = Parcel.obtain();
4241 data.writeInterfaceToken(IActivityManager.descriptor);
4242 data.writeInt(callingPid);
4243 data.writeInt(callingUid);
4244 data.writeInt(userId);
4245 data.writeInt(allowAll ? 1 : 0);
4246 data.writeInt(requireFull ? 1 : 0);
4247 data.writeString(name);
4248 data.writeString(callerPackage);
4249 mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0);
4250 reply.readException();
4251 int res = reply.readInt();
4252 data.recycle();
4253 reply.recycle();
4254 return res;
4255 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004256 public void setProcessLimit(int max) throws RemoteException
4257 {
4258 Parcel data = Parcel.obtain();
4259 Parcel reply = Parcel.obtain();
4260 data.writeInterfaceToken(IActivityManager.descriptor);
4261 data.writeInt(max);
4262 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4263 reply.readException();
4264 data.recycle();
4265 reply.recycle();
4266 }
4267 public int getProcessLimit() throws RemoteException
4268 {
4269 Parcel data = Parcel.obtain();
4270 Parcel reply = Parcel.obtain();
4271 data.writeInterfaceToken(IActivityManager.descriptor);
4272 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4273 reply.readException();
4274 int res = reply.readInt();
4275 data.recycle();
4276 reply.recycle();
4277 return res;
4278 }
4279 public void setProcessForeground(IBinder token, int pid,
4280 boolean isForeground) throws RemoteException {
4281 Parcel data = Parcel.obtain();
4282 Parcel reply = Parcel.obtain();
4283 data.writeInterfaceToken(IActivityManager.descriptor);
4284 data.writeStrongBinder(token);
4285 data.writeInt(pid);
4286 data.writeInt(isForeground ? 1 : 0);
4287 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
4288 reply.readException();
4289 data.recycle();
4290 reply.recycle();
4291 }
4292 public int checkPermission(String permission, int pid, int uid)
4293 throws RemoteException {
4294 Parcel data = Parcel.obtain();
4295 Parcel reply = Parcel.obtain();
4296 data.writeInterfaceToken(IActivityManager.descriptor);
4297 data.writeString(permission);
4298 data.writeInt(pid);
4299 data.writeInt(uid);
4300 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
4301 reply.readException();
4302 int res = reply.readInt();
4303 data.recycle();
4304 reply.recycle();
4305 return res;
4306 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004307 public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken)
4308 throws RemoteException {
4309 Parcel data = Parcel.obtain();
4310 Parcel reply = Parcel.obtain();
4311 data.writeInterfaceToken(IActivityManager.descriptor);
4312 data.writeString(permission);
4313 data.writeInt(pid);
4314 data.writeInt(uid);
4315 data.writeStrongBinder(callerToken);
4316 mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0);
4317 reply.readException();
4318 int res = reply.readInt();
4319 data.recycle();
4320 reply.recycle();
4321 return res;
4322 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004323 public boolean clearApplicationUserData(final String packageName,
Amith Yamasani742a6712011-05-04 14:49:28 -07004324 final IPackageDataObserver observer, final int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004325 Parcel data = Parcel.obtain();
4326 Parcel reply = Parcel.obtain();
4327 data.writeInterfaceToken(IActivityManager.descriptor);
4328 data.writeString(packageName);
Christopher Tate31b65f92013-09-09 14:17:27 -07004329 data.writeStrongBinder((observer != null) ? observer.asBinder() : null);
Amith Yamasani742a6712011-05-04 14:49:28 -07004330 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004331 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
4332 reply.readException();
4333 boolean res = reply.readInt() != 0;
4334 data.recycle();
4335 reply.recycle();
4336 return res;
4337 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004338 public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId,
4339 IBinder callerToken) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004340 Parcel data = Parcel.obtain();
4341 Parcel reply = Parcel.obtain();
4342 data.writeInterfaceToken(IActivityManager.descriptor);
4343 uri.writeToParcel(data, 0);
4344 data.writeInt(pid);
4345 data.writeInt(uid);
4346 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004347 data.writeInt(userId);
Dianne Hackbornff170242014-11-19 10:59:01 -08004348 data.writeStrongBinder(callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004349 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
4350 reply.readException();
4351 int res = reply.readInt();
4352 data.recycle();
4353 reply.recycle();
4354 return res;
4355 }
4356 public void grantUriPermission(IApplicationThread caller, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004357 Uri uri, int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004358 Parcel data = Parcel.obtain();
4359 Parcel reply = Parcel.obtain();
4360 data.writeInterfaceToken(IActivityManager.descriptor);
4361 data.writeStrongBinder(caller.asBinder());
4362 data.writeString(targetPkg);
4363 uri.writeToParcel(data, 0);
4364 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004365 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004366 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4367 reply.readException();
4368 data.recycle();
4369 reply.recycle();
4370 }
4371 public void revokeUriPermission(IApplicationThread caller, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004372 int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004373 Parcel data = Parcel.obtain();
4374 Parcel reply = Parcel.obtain();
4375 data.writeInterfaceToken(IActivityManager.descriptor);
4376 data.writeStrongBinder(caller.asBinder());
4377 uri.writeToParcel(data, 0);
4378 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004379 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004380 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4381 reply.readException();
4382 data.recycle();
4383 reply.recycle();
4384 }
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004385
4386 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004387 public void takePersistableUriPermission(Uri uri, int mode, int userId)
4388 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004389 Parcel data = Parcel.obtain();
4390 Parcel reply = Parcel.obtain();
4391 data.writeInterfaceToken(IActivityManager.descriptor);
4392 uri.writeToParcel(data, 0);
4393 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004394 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004395 mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4396 reply.readException();
4397 data.recycle();
4398 reply.recycle();
4399 }
4400
4401 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004402 public void releasePersistableUriPermission(Uri uri, int mode, int userId)
4403 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004404 Parcel data = Parcel.obtain();
4405 Parcel reply = Parcel.obtain();
4406 data.writeInterfaceToken(IActivityManager.descriptor);
4407 uri.writeToParcel(data, 0);
4408 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004409 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004410 mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4411 reply.readException();
4412 data.recycle();
4413 reply.recycle();
4414 }
4415
4416 @Override
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004417 public ParceledListSlice<UriPermission> getPersistedUriPermissions(
4418 String packageName, boolean incoming) throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004419 Parcel data = Parcel.obtain();
4420 Parcel reply = Parcel.obtain();
4421 data.writeInterfaceToken(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004422 data.writeString(packageName);
4423 data.writeInt(incoming ? 1 : 0);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004424 mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
4425 reply.readException();
4426 final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel(
4427 reply);
4428 data.recycle();
4429 reply.recycle();
4430 return perms;
4431 }
4432
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004433 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
4434 throws RemoteException {
4435 Parcel data = Parcel.obtain();
4436 Parcel reply = Parcel.obtain();
4437 data.writeInterfaceToken(IActivityManager.descriptor);
4438 data.writeStrongBinder(who.asBinder());
4439 data.writeInt(waiting ? 1 : 0);
4440 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
4441 reply.readException();
4442 data.recycle();
4443 reply.recycle();
4444 }
4445 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
4446 Parcel data = Parcel.obtain();
4447 Parcel reply = Parcel.obtain();
4448 data.writeInterfaceToken(IActivityManager.descriptor);
4449 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
4450 reply.readException();
4451 outInfo.readFromParcel(reply);
4452 data.recycle();
4453 reply.recycle();
4454 }
4455 public void unhandledBack() throws RemoteException
4456 {
4457 Parcel data = Parcel.obtain();
4458 Parcel reply = Parcel.obtain();
4459 data.writeInterfaceToken(IActivityManager.descriptor);
4460 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
4461 reply.readException();
4462 data.recycle();
4463 reply.recycle();
4464 }
4465 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
4466 {
4467 Parcel data = Parcel.obtain();
4468 Parcel reply = Parcel.obtain();
4469 data.writeInterfaceToken(IActivityManager.descriptor);
4470 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
4471 reply.readException();
4472 ParcelFileDescriptor pfd = null;
4473 if (reply.readInt() != 0) {
4474 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
4475 }
4476 data.recycle();
4477 reply.recycle();
4478 return pfd;
4479 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07004480 public void setLockScreenShown(boolean shown) throws RemoteException
4481 {
4482 Parcel data = Parcel.obtain();
4483 Parcel reply = Parcel.obtain();
4484 data.writeInterfaceToken(IActivityManager.descriptor);
4485 data.writeInt(shown ? 1 : 0);
4486 mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0);
4487 reply.readException();
4488 data.recycle();
4489 reply.recycle();
4490 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004491 public void setDebugApp(
4492 String packageName, boolean waitForDebugger, boolean persistent)
4493 throws RemoteException
4494 {
4495 Parcel data = Parcel.obtain();
4496 Parcel reply = Parcel.obtain();
4497 data.writeInterfaceToken(IActivityManager.descriptor);
4498 data.writeString(packageName);
4499 data.writeInt(waitForDebugger ? 1 : 0);
4500 data.writeInt(persistent ? 1 : 0);
4501 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
4502 reply.readException();
4503 data.recycle();
4504 reply.recycle();
4505 }
4506 public void setAlwaysFinish(boolean enabled) throws RemoteException
4507 {
4508 Parcel data = Parcel.obtain();
4509 Parcel reply = Parcel.obtain();
4510 data.writeInterfaceToken(IActivityManager.descriptor);
4511 data.writeInt(enabled ? 1 : 0);
4512 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
4513 reply.readException();
4514 data.recycle();
4515 reply.recycle();
4516 }
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004517 public void setActivityController(IActivityController watcher) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004518 {
4519 Parcel data = Parcel.obtain();
4520 Parcel reply = Parcel.obtain();
4521 data.writeInterfaceToken(IActivityManager.descriptor);
4522 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07004523 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004524 reply.readException();
4525 data.recycle();
4526 reply.recycle();
4527 }
4528 public void enterSafeMode() throws RemoteException {
4529 Parcel data = Parcel.obtain();
4530 data.writeInterfaceToken(IActivityManager.descriptor);
4531 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
4532 data.recycle();
4533 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07004534 public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag)
Dianne Hackborn099bc622014-01-22 13:39:16 -08004535 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004536 Parcel data = Parcel.obtain();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004537 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn099bc622014-01-22 13:39:16 -08004538 data.writeStrongBinder(sender.asBinder());
4539 data.writeInt(sourceUid);
4540 data.writeString(sourcePkg);
Dianne Hackborn1e383822015-04-10 14:02:33 -07004541 data.writeString(tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004542 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
4543 data.recycle();
4544 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07004545 public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag)
4546 throws RemoteException {
4547 Parcel data = Parcel.obtain();
4548 data.writeInterfaceToken(IActivityManager.descriptor);
4549 data.writeStrongBinder(sender.asBinder());
4550 data.writeInt(sourceUid);
4551 data.writeString(tag);
4552 mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0);
4553 data.recycle();
4554 }
4555 public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag)
4556 throws RemoteException {
4557 Parcel data = Parcel.obtain();
4558 data.writeInterfaceToken(IActivityManager.descriptor);
4559 data.writeStrongBinder(sender.asBinder());
4560 data.writeInt(sourceUid);
4561 data.writeString(tag);
4562 mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0);
4563 data.recycle();
4564 }
Dianne Hackborn64825172011-03-02 21:32:58 -08004565 public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004566 Parcel data = Parcel.obtain();
4567 Parcel reply = Parcel.obtain();
4568 data.writeInterfaceToken(IActivityManager.descriptor);
4569 data.writeIntArray(pids);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004570 data.writeString(reason);
Dianne Hackborn64825172011-03-02 21:32:58 -08004571 data.writeInt(secure ? 1 : 0);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07004572 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07004573 reply.readException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004574 boolean res = reply.readInt() != 0;
4575 data.recycle();
4576 reply.recycle();
4577 return res;
4578 }
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07004579 @Override
4580 public boolean killProcessesBelowForeground(String reason) throws RemoteException {
4581 Parcel data = Parcel.obtain();
4582 Parcel reply = Parcel.obtain();
4583 data.writeInterfaceToken(IActivityManager.descriptor);
4584 data.writeString(reason);
4585 mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0);
4586 boolean res = reply.readInt() != 0;
4587 data.recycle();
4588 reply.recycle();
4589 return res;
4590 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004591 public boolean testIsSystemReady()
4592 {
4593 /* this base class version is never called */
4594 return true;
4595 }
Dan Egnor60d87622009-12-16 16:32:58 -08004596 public void handleApplicationCrash(IBinder app,
4597 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
4598 {
4599 Parcel data = Parcel.obtain();
4600 Parcel reply = Parcel.obtain();
4601 data.writeInterfaceToken(IActivityManager.descriptor);
4602 data.writeStrongBinder(app);
4603 crashInfo.writeToParcel(data, 0);
4604 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
4605 reply.readException();
4606 reply.recycle();
4607 data.recycle();
4608 }
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004609
Dianne Hackborn52322712014-08-26 22:47:26 -07004610 public boolean handleApplicationWtf(IBinder app, String tag, boolean system,
Dan Egnorb7f03672009-12-09 16:22:32 -08004611 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004612 {
4613 Parcel data = Parcel.obtain();
4614 Parcel reply = Parcel.obtain();
4615 data.writeInterfaceToken(IActivityManager.descriptor);
4616 data.writeStrongBinder(app);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004617 data.writeString(tag);
Dianne Hackborn52322712014-08-26 22:47:26 -07004618 data.writeInt(system ? 1 : 0);
Dan Egnorb7f03672009-12-09 16:22:32 -08004619 crashInfo.writeToParcel(data, 0);
Dan Egnor60d87622009-12-16 16:32:58 -08004620 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004621 reply.readException();
Dan Egnor60d87622009-12-16 16:32:58 -08004622 boolean res = reply.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004623 reply.recycle();
4624 data.recycle();
Dan Egnor60d87622009-12-16 16:32:58 -08004625 return res;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004626 }
Dan Egnorb7f03672009-12-09 16:22:32 -08004627
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004628 public void handleApplicationStrictModeViolation(IBinder app,
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004629 int violationMask,
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004630 StrictMode.ViolationInfo info) throws RemoteException
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004631 {
4632 Parcel data = Parcel.obtain();
4633 Parcel reply = Parcel.obtain();
4634 data.writeInterfaceToken(IActivityManager.descriptor);
4635 data.writeStrongBinder(app);
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07004636 data.writeInt(violationMask);
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07004637 info.writeToParcel(data, 0);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07004638 mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0);
4639 reply.readException();
4640 reply.recycle();
4641 data.recycle();
4642 }
4643
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004644 public void signalPersistentProcesses(int sig) throws RemoteException {
4645 Parcel data = Parcel.obtain();
4646 Parcel reply = Parcel.obtain();
4647 data.writeInterfaceToken(IActivityManager.descriptor);
4648 data.writeInt(sig);
4649 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
4650 reply.readException();
4651 data.recycle();
4652 reply.recycle();
4653 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004654
Dianne Hackborn1676c852012-09-10 14:52:30 -07004655 public void killBackgroundProcesses(String packageName, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004656 Parcel data = Parcel.obtain();
4657 Parcel reply = Parcel.obtain();
4658 data.writeInterfaceToken(IActivityManager.descriptor);
4659 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004660 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004661 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4662 reply.readException();
4663 data.recycle();
4664 reply.recycle();
4665 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08004666
4667 public void killAllBackgroundProcesses() throws RemoteException {
4668 Parcel data = Parcel.obtain();
4669 Parcel reply = Parcel.obtain();
4670 data.writeInterfaceToken(IActivityManager.descriptor);
4671 mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
4672 reply.readException();
4673 data.recycle();
4674 reply.recycle();
4675 }
4676
Dianne Hackborn1676c852012-09-10 14:52:30 -07004677 public void forceStopPackage(String packageName, int userId) throws RemoteException {
Dianne Hackborn03abb812010-01-04 18:43:19 -08004678 Parcel data = Parcel.obtain();
4679 Parcel reply = Parcel.obtain();
4680 data.writeInterfaceToken(IActivityManager.descriptor);
4681 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004682 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08004683 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004684 reply.readException();
4685 data.recycle();
4686 reply.recycle();
4687 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004688
Dianne Hackborn27ff9132012-03-06 14:57:58 -08004689 public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
4690 throws RemoteException
4691 {
4692 Parcel data = Parcel.obtain();
4693 Parcel reply = Parcel.obtain();
4694 data.writeInterfaceToken(IActivityManager.descriptor);
4695 mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0);
4696 reply.readException();
4697 outInfo.readFromParcel(reply);
4698 reply.recycle();
4699 data.recycle();
4700 }
4701
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004702 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
4703 {
4704 Parcel data = Parcel.obtain();
4705 Parcel reply = Parcel.obtain();
4706 data.writeInterfaceToken(IActivityManager.descriptor);
4707 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
4708 reply.readException();
4709 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
4710 reply.recycle();
4711 data.recycle();
4712 return res;
4713 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004714
Dianne Hackborn1676c852012-09-10 14:52:30 -07004715 public boolean profileControl(String process, int userId, boolean start,
Jeff Hao1b012d32014-08-20 10:35:34 -07004716 ProfilerInfo profilerInfo, int profileType) throws RemoteException
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004717 {
4718 Parcel data = Parcel.obtain();
4719 Parcel reply = Parcel.obtain();
4720 data.writeInterfaceToken(IActivityManager.descriptor);
4721 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07004722 data.writeInt(userId);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004723 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07004724 data.writeInt(profileType);
Jeff Hao1b012d32014-08-20 10:35:34 -07004725 if (profilerInfo != null) {
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004726 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07004727 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07004728 } else {
4729 data.writeInt(0);
4730 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08004731 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
4732 reply.readException();
4733 boolean res = reply.readInt() != 0;
4734 reply.recycle();
4735 data.recycle();
4736 return res;
4737 }
Jeff Hao1b012d32014-08-20 10:35:34 -07004738
Dianne Hackborn55280a92009-05-07 15:53:46 -07004739 public boolean shutdown(int timeout) throws RemoteException
4740 {
4741 Parcel data = Parcel.obtain();
4742 Parcel reply = Parcel.obtain();
4743 data.writeInterfaceToken(IActivityManager.descriptor);
4744 data.writeInt(timeout);
4745 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
4746 reply.readException();
4747 boolean res = reply.readInt() != 0;
4748 reply.recycle();
4749 data.recycle();
4750 return res;
4751 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004752
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07004753 public void stopAppSwitches() throws RemoteException {
4754 Parcel data = Parcel.obtain();
4755 Parcel reply = Parcel.obtain();
4756 data.writeInterfaceToken(IActivityManager.descriptor);
4757 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
4758 reply.readException();
4759 reply.recycle();
4760 data.recycle();
4761 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004762
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07004763 public void resumeAppSwitches() throws RemoteException {
4764 Parcel data = Parcel.obtain();
4765 Parcel reply = Parcel.obtain();
4766 data.writeInterfaceToken(IActivityManager.descriptor);
4767 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
4768 reply.readException();
4769 reply.recycle();
4770 data.recycle();
4771 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07004772
4773 public void addPackageDependency(String packageName) throws RemoteException {
4774 Parcel data = Parcel.obtain();
4775 Parcel reply = Parcel.obtain();
4776 data.writeInterfaceToken(IActivityManager.descriptor);
4777 data.writeString(packageName);
4778 mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0);
4779 reply.readException();
4780 data.recycle();
4781 reply.recycle();
4782 }
4783
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004784 public void killApplicationWithAppId(String pkg, int appid, String reason)
4785 throws RemoteException {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004786 Parcel data = Parcel.obtain();
4787 Parcel reply = Parcel.obtain();
4788 data.writeInterfaceToken(IActivityManager.descriptor);
4789 data.writeString(pkg);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004790 data.writeInt(appid);
Dianne Hackborn21d9b562013-05-28 17:46:59 -07004791 data.writeString(reason);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004792 mRemote.transact(KILL_APPLICATION_WITH_APPID_TRANSACTION, data, reply, 0);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07004793 reply.readException();
4794 data.recycle();
4795 reply.recycle();
4796 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004797
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07004798 public void closeSystemDialogs(String reason) throws RemoteException {
4799 Parcel data = Parcel.obtain();
4800 Parcel reply = Parcel.obtain();
4801 data.writeInterfaceToken(IActivityManager.descriptor);
4802 data.writeString(reason);
4803 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
4804 reply.readException();
4805 data.recycle();
4806 reply.recycle();
4807 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004808
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004809 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004810 throws RemoteException {
4811 Parcel data = Parcel.obtain();
4812 Parcel reply = Parcel.obtain();
4813 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004814 data.writeIntArray(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004815 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
4816 reply.readException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004817 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004818 data.recycle();
4819 reply.recycle();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07004820 return res;
Dianne Hackborn3025ef32009-08-31 21:31:47 -07004821 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07004822
4823 public void killApplicationProcess(String processName, int uid) throws RemoteException {
4824 Parcel data = Parcel.obtain();
4825 Parcel reply = Parcel.obtain();
4826 data.writeInterfaceToken(IActivityManager.descriptor);
4827 data.writeString(processName);
4828 data.writeInt(uid);
4829 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
4830 reply.readException();
4831 data.recycle();
4832 reply.recycle();
4833 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004834
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07004835 public void overridePendingTransition(IBinder token, String packageName,
4836 int enterAnim, int exitAnim) throws RemoteException {
4837 Parcel data = Parcel.obtain();
4838 Parcel reply = Parcel.obtain();
4839 data.writeInterfaceToken(IActivityManager.descriptor);
4840 data.writeStrongBinder(token);
4841 data.writeString(packageName);
4842 data.writeInt(enterAnim);
4843 data.writeInt(exitAnim);
4844 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
4845 reply.readException();
4846 data.recycle();
4847 reply.recycle();
4848 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004849
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08004850 public boolean isUserAMonkey() throws RemoteException {
4851 Parcel data = Parcel.obtain();
4852 Parcel reply = Parcel.obtain();
4853 data.writeInterfaceToken(IActivityManager.descriptor);
4854 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
4855 reply.readException();
4856 boolean res = reply.readInt() != 0;
4857 data.recycle();
4858 reply.recycle();
4859 return res;
4860 }
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07004861
4862 public void setUserIsMonkey(boolean monkey) throws RemoteException {
4863 Parcel data = Parcel.obtain();
4864 Parcel reply = Parcel.obtain();
4865 data.writeInterfaceToken(IActivityManager.descriptor);
4866 data.writeInt(monkey ? 1 : 0);
4867 mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0);
4868 reply.readException();
4869 data.recycle();
4870 reply.recycle();
4871 }
4872
Dianne Hackborn860755f2010-06-03 18:47:52 -07004873 public void finishHeavyWeightApp() throws RemoteException {
4874 Parcel data = Parcel.obtain();
4875 Parcel reply = Parcel.obtain();
4876 data.writeInterfaceToken(IActivityManager.descriptor);
4877 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
4878 reply.readException();
4879 data.recycle();
4880 reply.recycle();
4881 }
Craig Mautner4addfc52013-06-25 08:05:45 -07004882
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004883 public boolean convertFromTranslucent(IBinder token)
Craig Mautner4addfc52013-06-25 08:05:45 -07004884 throws RemoteException {
4885 Parcel data = Parcel.obtain();
4886 Parcel reply = Parcel.obtain();
4887 data.writeInterfaceToken(IActivityManager.descriptor);
4888 data.writeStrongBinder(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07004889 mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0);
4890 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004891 boolean res = reply.readInt() != 0;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004892 data.recycle();
4893 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004894 return res;
Craig Mautner5eda9b32013-07-02 11:58:16 -07004895 }
4896
Craig Mautner233ceee2014-05-09 17:05:11 -07004897 public boolean convertToTranslucent(IBinder token, ActivityOptions options)
Craig Mautner5eda9b32013-07-02 11:58:16 -07004898 throws RemoteException {
4899 Parcel data = Parcel.obtain();
4900 Parcel reply = Parcel.obtain();
4901 data.writeInterfaceToken(IActivityManager.descriptor);
4902 data.writeStrongBinder(token);
Craig Mautner233ceee2014-05-09 17:05:11 -07004903 if (options == null) {
4904 data.writeInt(0);
4905 } else {
4906 data.writeInt(1);
4907 data.writeBundle(options.toBundle());
4908 }
Craig Mautner5eda9b32013-07-02 11:58:16 -07004909 mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07004910 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004911 boolean res = reply.readInt() != 0;
Craig Mautner4addfc52013-06-25 08:05:45 -07004912 data.recycle();
4913 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07004914 return res;
Craig Mautner4addfc52013-06-25 08:05:45 -07004915 }
4916
Craig Mautner233ceee2014-05-09 17:05:11 -07004917 public ActivityOptions getActivityOptions(IBinder token) throws RemoteException {
4918 Parcel data = Parcel.obtain();
4919 Parcel reply = Parcel.obtain();
4920 data.writeInterfaceToken(IActivityManager.descriptor);
4921 data.writeStrongBinder(token);
4922 mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0);
4923 reply.readException();
4924 Bundle bundle = reply.readBundle();
4925 ActivityOptions options = bundle == null ? null : new ActivityOptions(bundle);
4926 data.recycle();
4927 reply.recycle();
4928 return options;
4929 }
4930
Daniel Sandler69a48172010-06-23 16:29:36 -04004931 public void setImmersive(IBinder token, boolean immersive)
4932 throws RemoteException {
4933 Parcel data = Parcel.obtain();
4934 Parcel reply = Parcel.obtain();
4935 data.writeInterfaceToken(IActivityManager.descriptor);
4936 data.writeStrongBinder(token);
4937 data.writeInt(immersive ? 1 : 0);
4938 mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
4939 reply.readException();
4940 data.recycle();
4941 reply.recycle();
4942 }
4943
4944 public boolean isImmersive(IBinder token)
4945 throws RemoteException {
4946 Parcel data = Parcel.obtain();
4947 Parcel reply = Parcel.obtain();
4948 data.writeInterfaceToken(IActivityManager.descriptor);
4949 data.writeStrongBinder(token);
4950 mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004951 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004952 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004953 data.recycle();
4954 reply.recycle();
4955 return res;
4956 }
4957
Craig Mautnerd61dc202014-07-07 11:09:11 -07004958 public boolean isTopOfTask(IBinder token) throws RemoteException {
4959 Parcel data = Parcel.obtain();
4960 Parcel reply = Parcel.obtain();
4961 data.writeInterfaceToken(IActivityManager.descriptor);
4962 data.writeStrongBinder(token);
4963 mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0);
4964 reply.readException();
4965 boolean res = reply.readInt() == 1;
4966 data.recycle();
4967 reply.recycle();
4968 return res;
4969 }
4970
Daniel Sandler69a48172010-06-23 16:29:36 -04004971 public boolean isTopActivityImmersive()
4972 throws RemoteException {
4973 Parcel data = Parcel.obtain();
4974 Parcel reply = Parcel.obtain();
4975 data.writeInterfaceToken(IActivityManager.descriptor);
4976 mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04004977 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07004978 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04004979 data.recycle();
4980 reply.recycle();
4981 return res;
4982 }
4983
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07004984 public void crashApplication(int uid, int initialPid, String packageName,
4985 String message) throws RemoteException {
4986 Parcel data = Parcel.obtain();
4987 Parcel reply = Parcel.obtain();
4988 data.writeInterfaceToken(IActivityManager.descriptor);
4989 data.writeInt(uid);
4990 data.writeInt(initialPid);
4991 data.writeString(packageName);
4992 data.writeString(message);
4993 mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0);
4994 reply.readException();
4995 data.recycle();
4996 reply.recycle();
4997 }
Andy McFadden824c5102010-07-09 16:26:57 -07004998
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004999 public String getProviderMimeType(Uri uri, int userId) throws RemoteException {
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07005000 Parcel data = Parcel.obtain();
5001 Parcel reply = Parcel.obtain();
5002 data.writeInterfaceToken(IActivityManager.descriptor);
5003 uri.writeToParcel(data, 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005004 data.writeInt(userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07005005 mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0);
5006 reply.readException();
5007 String res = reply.readString();
5008 data.recycle();
5009 reply.recycle();
5010 return res;
5011 }
5012
Dianne Hackborn7e269642010-08-25 19:50:20 -07005013 public IBinder newUriPermissionOwner(String name)
5014 throws RemoteException {
5015 Parcel data = Parcel.obtain();
5016 Parcel reply = Parcel.obtain();
5017 data.writeInterfaceToken(IActivityManager.descriptor);
5018 data.writeString(name);
5019 mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
5020 reply.readException();
5021 IBinder res = reply.readStrongBinder();
5022 data.recycle();
5023 reply.recycle();
5024 return res;
5025 }
5026
5027 public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
Nicolas Prevotf1939902014-06-25 09:29:02 +01005028 Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07005029 Parcel data = Parcel.obtain();
5030 Parcel reply = Parcel.obtain();
5031 data.writeInterfaceToken(IActivityManager.descriptor);
5032 data.writeStrongBinder(owner);
5033 data.writeInt(fromUid);
5034 data.writeString(targetPkg);
5035 uri.writeToParcel(data, 0);
5036 data.writeInt(mode);
Nicolas Prevotf1939902014-06-25 09:29:02 +01005037 data.writeInt(sourceUserId);
5038 data.writeInt(targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07005039 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
5040 reply.readException();
5041 data.recycle();
5042 reply.recycle();
5043 }
5044
5045 public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01005046 int mode, int userId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07005047 Parcel data = Parcel.obtain();
5048 Parcel reply = Parcel.obtain();
5049 data.writeInterfaceToken(IActivityManager.descriptor);
5050 data.writeStrongBinder(owner);
5051 if (uri != null) {
5052 data.writeInt(1);
5053 uri.writeToParcel(data, 0);
5054 } else {
5055 data.writeInt(0);
5056 }
5057 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01005058 data.writeInt(userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07005059 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
5060 reply.readException();
5061 data.recycle();
5062 reply.recycle();
5063 }
Dianne Hackbornc8f84972010-08-25 23:14:44 -07005064
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07005065 public int checkGrantUriPermission(int callingUid, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01005066 Uri uri, int modeFlags, int userId) throws RemoteException {
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07005067 Parcel data = Parcel.obtain();
5068 Parcel reply = Parcel.obtain();
5069 data.writeInterfaceToken(IActivityManager.descriptor);
5070 data.writeInt(callingUid);
5071 data.writeString(targetPkg);
5072 uri.writeToParcel(data, 0);
5073 data.writeInt(modeFlags);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01005074 data.writeInt(userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07005075 mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
5076 reply.readException();
5077 int res = reply.readInt();
5078 data.recycle();
5079 reply.recycle();
5080 return res;
5081 }
5082
Dianne Hackborn1676c852012-09-10 14:52:30 -07005083 public boolean dumpHeap(String process, int userId, boolean managed,
Andy McFadden824c5102010-07-09 16:26:57 -07005084 String path, ParcelFileDescriptor fd) throws RemoteException {
5085 Parcel data = Parcel.obtain();
5086 Parcel reply = Parcel.obtain();
5087 data.writeInterfaceToken(IActivityManager.descriptor);
5088 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07005089 data.writeInt(userId);
Andy McFadden824c5102010-07-09 16:26:57 -07005090 data.writeInt(managed ? 1 : 0);
5091 data.writeString(path);
5092 if (fd != null) {
5093 data.writeInt(1);
5094 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
5095 } else {
5096 data.writeInt(0);
5097 }
5098 mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
5099 reply.readException();
5100 boolean res = reply.readInt() != 0;
5101 reply.recycle();
5102 data.recycle();
5103 return res;
5104 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07005105
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005106 public int startActivities(IApplicationThread caller, String callingPackage,
Dianne Hackborna4972e92012-03-14 10:38:05 -07005107 Intent[] intents, String[] resolvedTypes, IBinder resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07005108 Bundle options, int userId) throws RemoteException {
Dianne Hackborn621e17d2010-11-22 15:59:56 -08005109 Parcel data = Parcel.obtain();
5110 Parcel reply = Parcel.obtain();
5111 data.writeInterfaceToken(IActivityManager.descriptor);
5112 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005113 data.writeString(callingPackage);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08005114 data.writeTypedArray(intents, 0);
5115 data.writeStringArray(resolvedTypes);
5116 data.writeStrongBinder(resultTo);
Dianne Hackborna4972e92012-03-14 10:38:05 -07005117 if (options != null) {
5118 data.writeInt(1);
5119 options.writeToParcel(data, 0);
5120 } else {
5121 data.writeInt(0);
5122 }
Amith Yamasaniea7e9152012-09-24 16:11:18 -07005123 data.writeInt(userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08005124 mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0);
5125 reply.readException();
5126 int result = reply.readInt();
5127 reply.recycle();
5128 data.recycle();
5129 return result;
5130 }
5131
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07005132 public int getFrontActivityScreenCompatMode() throws RemoteException {
5133 Parcel data = Parcel.obtain();
5134 Parcel reply = Parcel.obtain();
5135 data.writeInterfaceToken(IActivityManager.descriptor);
5136 mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
5137 reply.readException();
5138 int mode = reply.readInt();
5139 reply.recycle();
5140 data.recycle();
5141 return mode;
5142 }
5143
5144 public void setFrontActivityScreenCompatMode(int mode) throws RemoteException {
5145 Parcel data = Parcel.obtain();
5146 Parcel reply = Parcel.obtain();
5147 data.writeInterfaceToken(IActivityManager.descriptor);
5148 data.writeInt(mode);
5149 mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
5150 reply.readException();
5151 reply.recycle();
5152 data.recycle();
5153 }
5154
5155 public int getPackageScreenCompatMode(String packageName) throws RemoteException {
5156 Parcel data = Parcel.obtain();
5157 Parcel reply = Parcel.obtain();
5158 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07005159 data.writeString(packageName);
5160 mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07005161 reply.readException();
5162 int mode = reply.readInt();
5163 reply.recycle();
5164 data.recycle();
5165 return mode;
5166 }
5167
5168 public void setPackageScreenCompatMode(String packageName, int mode)
Dianne Hackborne2515ee2011-04-27 18:52:56 -04005169 throws RemoteException {
5170 Parcel data = Parcel.obtain();
5171 Parcel reply = Parcel.obtain();
5172 data.writeInterfaceToken(IActivityManager.descriptor);
5173 data.writeString(packageName);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07005174 data.writeInt(mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04005175 mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
5176 reply.readException();
5177 reply.recycle();
5178 data.recycle();
5179 }
5180
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07005181 public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
5182 Parcel data = Parcel.obtain();
5183 Parcel reply = Parcel.obtain();
5184 data.writeInterfaceToken(IActivityManager.descriptor);
5185 data.writeString(packageName);
5186 mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
5187 reply.readException();
5188 boolean ask = reply.readInt() != 0;
5189 reply.recycle();
5190 data.recycle();
5191 return ask;
5192 }
5193
5194 public void setPackageAskScreenCompat(String packageName, boolean ask)
5195 throws RemoteException {
5196 Parcel data = Parcel.obtain();
5197 Parcel reply = Parcel.obtain();
5198 data.writeInterfaceToken(IActivityManager.descriptor);
5199 data.writeString(packageName);
5200 data.writeInt(ask ? 1 : 0);
5201 mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
5202 reply.readException();
5203 reply.recycle();
5204 data.recycle();
5205 }
5206
Amith Yamasani4b2e9342011-03-31 12:38:53 -07005207 public boolean switchUser(int userid) throws RemoteException {
5208 Parcel data = Parcel.obtain();
5209 Parcel reply = Parcel.obtain();
5210 data.writeInterfaceToken(IActivityManager.descriptor);
5211 data.writeInt(userid);
5212 mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0);
5213 reply.readException();
5214 boolean result = reply.readInt() != 0;
5215 reply.recycle();
5216 data.recycle();
5217 return result;
5218 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07005219
Kenny Guy08488bf2014-02-21 17:40:37 +00005220 public boolean startUserInBackground(int userid) throws RemoteException {
5221 Parcel data = Parcel.obtain();
5222 Parcel reply = Parcel.obtain();
5223 data.writeInterfaceToken(IActivityManager.descriptor);
5224 data.writeInt(userid);
5225 mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0);
5226 reply.readException();
5227 boolean result = reply.readInt() != 0;
5228 reply.recycle();
5229 data.recycle();
5230 return result;
5231 }
5232
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005233 public int stopUser(int userid, IStopUserCallback callback) throws RemoteException {
5234 Parcel data = Parcel.obtain();
5235 Parcel reply = Parcel.obtain();
5236 data.writeInterfaceToken(IActivityManager.descriptor);
5237 data.writeInt(userid);
5238 data.writeStrongInterface(callback);
5239 mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0);
5240 reply.readException();
5241 int result = reply.readInt();
5242 reply.recycle();
5243 data.recycle();
5244 return result;
5245 }
5246
Amith Yamasani52f1d752012-03-28 18:19:29 -07005247 public UserInfo getCurrentUser() throws RemoteException {
5248 Parcel data = Parcel.obtain();
5249 Parcel reply = Parcel.obtain();
5250 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005251 mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0);
Amith Yamasani52f1d752012-03-28 18:19:29 -07005252 reply.readException();
5253 UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply);
5254 reply.recycle();
5255 data.recycle();
5256 return userInfo;
5257 }
5258
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07005259 public boolean isUserRunning(int userid, boolean orStopping) throws RemoteException {
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005260 Parcel data = Parcel.obtain();
5261 Parcel reply = Parcel.obtain();
5262 data.writeInterfaceToken(IActivityManager.descriptor);
5263 data.writeInt(userid);
Dianne Hackborna8a9bd62012-10-09 15:36:59 -07005264 data.writeInt(orStopping ? 1 : 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005265 mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0);
5266 reply.readException();
5267 boolean result = reply.readInt() != 0;
5268 reply.recycle();
5269 data.recycle();
5270 return result;
5271 }
5272
Dianne Hackbornc72fc672012-09-20 13:12:03 -07005273 public int[] getRunningUserIds() throws RemoteException {
5274 Parcel data = Parcel.obtain();
5275 Parcel reply = Parcel.obtain();
5276 data.writeInterfaceToken(IActivityManager.descriptor);
5277 mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0);
5278 reply.readException();
5279 int[] result = reply.createIntArray();
5280 reply.recycle();
5281 data.recycle();
5282 return result;
5283 }
5284
Wale Ogunwaled54b5782014-10-23 15:55:23 -07005285 public boolean removeTask(int taskId) throws RemoteException {
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005286 Parcel data = Parcel.obtain();
5287 Parcel reply = Parcel.obtain();
5288 data.writeInterfaceToken(IActivityManager.descriptor);
5289 data.writeInt(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005290 mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
5291 reply.readException();
5292 boolean result = reply.readInt() != 0;
5293 reply.recycle();
5294 data.recycle();
5295 return result;
5296 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07005297
Jeff Sharkeya4620792011-05-20 15:29:23 -07005298 public void registerProcessObserver(IProcessObserver observer) throws RemoteException {
5299 Parcel data = Parcel.obtain();
5300 Parcel reply = Parcel.obtain();
5301 data.writeInterfaceToken(IActivityManager.descriptor);
5302 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5303 mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5304 reply.readException();
5305 data.recycle();
5306 reply.recycle();
5307 }
5308
5309 public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException {
5310 Parcel data = Parcel.obtain();
5311 Parcel reply = Parcel.obtain();
5312 data.writeInterfaceToken(IActivityManager.descriptor);
5313 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5314 mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5315 reply.readException();
5316 data.recycle();
5317 reply.recycle();
5318 }
5319
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07005320 public void registerUidObserver(IUidObserver observer) throws RemoteException {
5321 Parcel data = Parcel.obtain();
5322 Parcel reply = Parcel.obtain();
5323 data.writeInterfaceToken(IActivityManager.descriptor);
5324 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5325 mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0);
5326 reply.readException();
5327 data.recycle();
5328 reply.recycle();
5329 }
5330
5331 public void unregisterUidObserver(IUidObserver observer) throws RemoteException {
5332 Parcel data = Parcel.obtain();
5333 Parcel reply = Parcel.obtain();
5334 data.writeInterfaceToken(IActivityManager.descriptor);
5335 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5336 mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0);
5337 reply.readException();
5338 data.recycle();
5339 reply.recycle();
5340 }
5341
Dianne Hackborn6c418d52011-06-29 14:05:33 -07005342 public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException {
5343 Parcel data = Parcel.obtain();
5344 Parcel reply = Parcel.obtain();
5345 data.writeInterfaceToken(IActivityManager.descriptor);
5346 data.writeStrongBinder(sender.asBinder());
5347 mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0);
5348 reply.readException();
5349 boolean res = reply.readInt() != 0;
5350 data.recycle();
5351 reply.recycle();
5352 return res;
5353 }
5354
Dianne Hackborn1927ae82012-06-22 15:21:36 -07005355 public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException {
5356 Parcel data = Parcel.obtain();
5357 Parcel reply = Parcel.obtain();
5358 data.writeInterfaceToken(IActivityManager.descriptor);
5359 data.writeStrongBinder(sender.asBinder());
5360 mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0);
5361 reply.readException();
5362 boolean res = reply.readInt() != 0;
5363 data.recycle();
5364 reply.recycle();
5365 return res;
5366 }
5367
Dianne Hackborn81038902012-11-26 17:04:09 -08005368 public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException {
5369 Parcel data = Parcel.obtain();
5370 Parcel reply = Parcel.obtain();
5371 data.writeInterfaceToken(IActivityManager.descriptor);
5372 data.writeStrongBinder(sender.asBinder());
5373 mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5374 reply.readException();
5375 Intent res = reply.readInt() != 0
5376 ? Intent.CREATOR.createFromParcel(reply) : null;
5377 data.recycle();
5378 reply.recycle();
5379 return res;
5380 }
5381
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08005382 public String getTagForIntentSender(IIntentSender sender, String prefix)
5383 throws RemoteException {
5384 Parcel data = Parcel.obtain();
5385 Parcel reply = Parcel.obtain();
5386 data.writeInterfaceToken(IActivityManager.descriptor);
5387 data.writeStrongBinder(sender.asBinder());
5388 data.writeString(prefix);
5389 mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5390 reply.readException();
5391 String res = reply.readString();
5392 data.recycle();
5393 reply.recycle();
5394 return res;
5395 }
5396
Dianne Hackborn31ca8542011-07-19 14:58:28 -07005397 public void updatePersistentConfiguration(Configuration values) throws RemoteException
5398 {
5399 Parcel data = Parcel.obtain();
5400 Parcel reply = Parcel.obtain();
5401 data.writeInterfaceToken(IActivityManager.descriptor);
5402 values.writeToParcel(data, 0);
5403 mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0);
5404 reply.readException();
5405 data.recycle();
5406 reply.recycle();
5407 }
5408
Dianne Hackbornb437e092011-08-05 17:50:29 -07005409 public long[] getProcessPss(int[] pids) throws RemoteException {
5410 Parcel data = Parcel.obtain();
5411 Parcel reply = Parcel.obtain();
5412 data.writeInterfaceToken(IActivityManager.descriptor);
5413 data.writeIntArray(pids);
5414 mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0);
5415 reply.readException();
5416 long[] res = reply.createLongArray();
5417 data.recycle();
5418 reply.recycle();
5419 return res;
5420 }
5421
Dianne Hackborn661cd522011-08-22 00:26:20 -07005422 public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
5423 Parcel data = Parcel.obtain();
5424 Parcel reply = Parcel.obtain();
5425 data.writeInterfaceToken(IActivityManager.descriptor);
5426 TextUtils.writeToParcel(msg, data, 0);
5427 data.writeInt(always ? 1 : 0);
5428 mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
5429 reply.readException();
5430 data.recycle();
5431 reply.recycle();
5432 }
5433
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02005434 public void keyguardWaitingForActivityDrawn() throws RemoteException {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07005435 Parcel data = Parcel.obtain();
5436 Parcel reply = Parcel.obtain();
5437 data.writeInterfaceToken(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02005438 mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
Dianne Hackborn90c52de2011-09-23 12:57:44 -07005439 reply.readException();
5440 data.recycle();
5441 reply.recycle();
5442 }
5443
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07005444 public void keyguardGoingAway(boolean disableWindowAnimations,
5445 boolean keyguardGoingToNotificationShade) throws RemoteException {
5446 Parcel data = Parcel.obtain();
5447 Parcel reply = Parcel.obtain();
5448 data.writeInterfaceToken(IActivityManager.descriptor);
5449 data.writeInt(disableWindowAnimations ? 1 : 0);
5450 data.writeInt(keyguardGoingToNotificationShade ? 1 : 0);
5451 mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0);
5452 reply.readException();
5453 data.recycle();
5454 reply.recycle();
5455 }
5456
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07005457 public boolean shouldUpRecreateTask(IBinder token, String destAffinity)
Adam Powelldd8fab22012-03-22 17:47:27 -07005458 throws RemoteException {
5459 Parcel data = Parcel.obtain();
5460 Parcel reply = Parcel.obtain();
5461 data.writeInterfaceToken(IActivityManager.descriptor);
5462 data.writeStrongBinder(token);
5463 data.writeString(destAffinity);
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07005464 mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0);
Adam Powelldd8fab22012-03-22 17:47:27 -07005465 reply.readException();
5466 boolean result = reply.readInt() != 0;
5467 data.recycle();
5468 reply.recycle();
5469 return result;
5470 }
5471
5472 public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData)
5473 throws RemoteException {
5474 Parcel data = Parcel.obtain();
5475 Parcel reply = Parcel.obtain();
5476 data.writeInterfaceToken(IActivityManager.descriptor);
5477 data.writeStrongBinder(token);
5478 target.writeToParcel(data, 0);
5479 data.writeInt(resultCode);
5480 if (resultData != null) {
5481 data.writeInt(1);
5482 resultData.writeToParcel(data, 0);
5483 } else {
5484 data.writeInt(0);
5485 }
5486 mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0);
5487 reply.readException();
5488 boolean result = reply.readInt() != 0;
5489 data.recycle();
5490 reply.recycle();
5491 return result;
5492 }
5493
Dianne Hackborn5320eb82012-05-18 12:05:04 -07005494 public int getLaunchedFromUid(IBinder activityToken) throws RemoteException {
5495 Parcel data = Parcel.obtain();
5496 Parcel reply = Parcel.obtain();
5497 data.writeInterfaceToken(IActivityManager.descriptor);
5498 data.writeStrongBinder(activityToken);
5499 mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0);
5500 reply.readException();
5501 int result = reply.readInt();
5502 data.recycle();
5503 reply.recycle();
5504 return result;
5505 }
5506
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005507 public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException {
5508 Parcel data = Parcel.obtain();
5509 Parcel reply = Parcel.obtain();
5510 data.writeInterfaceToken(IActivityManager.descriptor);
5511 data.writeStrongBinder(activityToken);
5512 mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0);
5513 reply.readException();
5514 String result = reply.readString();
5515 data.recycle();
5516 reply.recycle();
5517 return result;
5518 }
5519
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07005520 public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5521 Parcel data = Parcel.obtain();
5522 Parcel reply = Parcel.obtain();
5523 data.writeInterfaceToken(IActivityManager.descriptor);
5524 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5525 mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5526 reply.readException();
5527 data.recycle();
5528 reply.recycle();
5529 }
5530
5531 public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
5532 Parcel data = Parcel.obtain();
5533 Parcel reply = Parcel.obtain();
5534 data.writeInterfaceToken(IActivityManager.descriptor);
5535 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5536 mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
5537 reply.readException();
5538 data.recycle();
5539 reply.recycle();
5540 }
5541
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07005542 public void requestBugReport() throws RemoteException {
5543 Parcel data = Parcel.obtain();
5544 Parcel reply = Parcel.obtain();
5545 data.writeInterfaceToken(IActivityManager.descriptor);
5546 mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0);
5547 reply.readException();
5548 data.recycle();
5549 reply.recycle();
5550 }
5551
Jeff Brownbd181bb2013-09-10 16:44:24 -07005552 public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason)
5553 throws RemoteException {
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005554 Parcel data = Parcel.obtain();
5555 Parcel reply = Parcel.obtain();
5556 data.writeInterfaceToken(IActivityManager.descriptor);
5557 data.writeInt(pid);
5558 data.writeInt(aboveSystem ? 1 : 0);
Jeff Brownbd181bb2013-09-10 16:44:24 -07005559 data.writeString(reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07005560 mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0);
5561 reply.readException();
5562 long res = reply.readInt();
5563 data.recycle();
5564 reply.recycle();
5565 return res;
5566 }
5567
Adam Skorydfc7fd72013-08-05 19:23:41 -07005568 public Bundle getAssistContextExtras(int requestType) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005569 Parcel data = Parcel.obtain();
5570 Parcel reply = Parcel.obtain();
5571 data.writeInterfaceToken(IActivityManager.descriptor);
5572 data.writeInt(requestType);
Adam Skorydfc7fd72013-08-05 19:23:41 -07005573 mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005574 reply.readException();
5575 Bundle res = reply.readBundle();
5576 data.recycle();
5577 reply.recycle();
5578 return res;
5579 }
5580
Dianne Hackborn17f69352015-07-17 18:04:14 -07005581 public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver,
5582 IBinder activityToken) throws RemoteException {
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005583 Parcel data = Parcel.obtain();
5584 Parcel reply = Parcel.obtain();
5585 data.writeInterfaceToken(IActivityManager.descriptor);
5586 data.writeInt(requestType);
5587 data.writeStrongBinder(receiver.asBinder());
Dianne Hackborn17f69352015-07-17 18:04:14 -07005588 data.writeStrongBinder(activityToken);
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005589 mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
5590 reply.readException();
Dianne Hackborn17f69352015-07-17 18:04:14 -07005591 boolean res = reply.readInt() != 0;
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005592 data.recycle();
5593 reply.recycle();
Dianne Hackborn17f69352015-07-17 18:04:14 -07005594 return res;
Dianne Hackbornae6688b2015-02-11 17:02:41 -08005595 }
5596
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07005597 public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure,
Dianne Hackborna3acdb32015-06-08 17:07:40 -07005598 AssistContent content, Uri referrer) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005599 Parcel data = Parcel.obtain();
5600 Parcel reply = Parcel.obtain();
5601 data.writeInterfaceToken(IActivityManager.descriptor);
5602 data.writeStrongBinder(token);
5603 data.writeBundle(extras);
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07005604 structure.writeToParcel(data, 0);
5605 content.writeToParcel(data, 0);
Dianne Hackborna3acdb32015-06-08 17:07:40 -07005606 if (referrer != null) {
5607 data.writeInt(1);
5608 referrer.writeToParcel(data, 0);
5609 } else {
5610 data.writeInt(0);
5611 }
Adam Skorydfc7fd72013-08-05 19:23:41 -07005612 mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08005613 reply.readException();
5614 data.recycle();
5615 reply.recycle();
5616 }
5617
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07005618 public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle,
5619 Bundle args) throws RemoteException {
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07005620 Parcel data = Parcel.obtain();
5621 Parcel reply = Parcel.obtain();
5622 data.writeInterfaceToken(IActivityManager.descriptor);
5623 intent.writeToParcel(data, 0);
5624 data.writeInt(requestType);
5625 data.writeString(hint);
5626 data.writeInt(userHandle);
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07005627 data.writeBundle(args);
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07005628 mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0);
5629 reply.readException();
5630 boolean res = reply.readInt() != 0;
5631 data.recycle();
5632 reply.recycle();
5633 return res;
5634 }
5635
Dianne Hackborn17f69352015-07-17 18:04:14 -07005636 public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException {
Benjamin Franzc200f442015-06-25 18:20:04 +01005637 Parcel data = Parcel.obtain();
5638 Parcel reply = Parcel.obtain();
5639 data.writeInterfaceToken(IActivityManager.descriptor);
5640 mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0);
5641 reply.readException();
5642 boolean res = reply.readInt() != 0;
5643 data.recycle();
5644 reply.recycle();
5645 return res;
5646 }
5647
Dianne Hackborn17f69352015-07-17 18:04:14 -07005648 public boolean showAssistFromActivity(IBinder token, Bundle args) throws RemoteException {
5649 Parcel data = Parcel.obtain();
5650 Parcel reply = Parcel.obtain();
5651 data.writeInterfaceToken(IActivityManager.descriptor);
5652 data.writeStrongBinder(token);
5653 data.writeBundle(args);
5654 mRemote.transact(SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION, data, reply, 0);
5655 reply.readException();
5656 boolean res = reply.readInt() != 0;
5657 data.recycle();
5658 reply.recycle();
5659 return res;
5660 }
5661
Svetoslavaa41add2015-08-06 15:03:55 -07005662 public void killUid(int appId, int userId, String reason) throws RemoteException {
Dianne Hackbornf1b78242013-04-08 22:28:59 -07005663 Parcel data = Parcel.obtain();
5664 Parcel reply = Parcel.obtain();
5665 data.writeInterfaceToken(IActivityManager.descriptor);
Svetoslavaa41add2015-08-06 15:03:55 -07005666 data.writeInt(appId);
5667 data.writeInt(userId);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07005668 data.writeString(reason);
5669 mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0);
5670 reply.readException();
5671 data.recycle();
5672 reply.recycle();
5673 }
5674
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07005675 public void hang(IBinder who, boolean allowRestart) throws RemoteException {
5676 Parcel data = Parcel.obtain();
5677 Parcel reply = Parcel.obtain();
5678 data.writeInterfaceToken(IActivityManager.descriptor);
5679 data.writeStrongBinder(who);
5680 data.writeInt(allowRestart ? 1 : 0);
5681 mRemote.transact(HANG_TRANSACTION, data, reply, 0);
5682 reply.readException();
5683 data.recycle();
5684 reply.recycle();
5685 }
5686
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07005687 public void reportActivityFullyDrawn(IBinder token) throws RemoteException {
5688 Parcel data = Parcel.obtain();
5689 Parcel reply = Parcel.obtain();
5690 data.writeInterfaceToken(IActivityManager.descriptor);
5691 data.writeStrongBinder(token);
5692 mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0);
5693 reply.readException();
5694 data.recycle();
5695 reply.recycle();
5696 }
5697
Craig Mautner5eda9b32013-07-02 11:58:16 -07005698 public void notifyActivityDrawn(IBinder token) throws RemoteException {
5699 Parcel data = Parcel.obtain();
5700 Parcel reply = Parcel.obtain();
5701 data.writeInterfaceToken(IActivityManager.descriptor);
5702 data.writeStrongBinder(token);
5703 mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
5704 reply.readException();
5705 data.recycle();
5706 reply.recycle();
5707 }
5708
Dianne Hackborn57a7f592013-07-22 18:21:32 -07005709 public void restart() throws RemoteException {
5710 Parcel data = Parcel.obtain();
5711 Parcel reply = Parcel.obtain();
5712 data.writeInterfaceToken(IActivityManager.descriptor);
5713 mRemote.transact(RESTART_TRANSACTION, data, reply, 0);
5714 reply.readException();
5715 data.recycle();
5716 reply.recycle();
5717 }
5718
Dianne Hackborn35f72be2013-09-16 10:57:39 -07005719 public void performIdleMaintenance() throws RemoteException {
5720 Parcel data = Parcel.obtain();
5721 Parcel reply = Parcel.obtain();
5722 data.writeInterfaceToken(IActivityManager.descriptor);
5723 mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0);
5724 reply.readException();
5725 data.recycle();
5726 reply.recycle();
5727 }
5728
Todd Kennedyca4d8422015-01-15 15:19:22 -08005729 public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken,
Craig Mautner4a1cb222013-12-04 16:14:06 -08005730 IActivityContainerCallback callback) throws RemoteException {
5731 Parcel data = Parcel.obtain();
5732 Parcel reply = Parcel.obtain();
5733 data.writeInterfaceToken(IActivityManager.descriptor);
5734 data.writeStrongBinder(parentActivityToken);
Craig Mautnere3a00d72014-04-16 08:31:19 -07005735 data.writeStrongBinder(callback == null ? null : callback.asBinder());
Todd Kennedyca4d8422015-01-15 15:19:22 -08005736 mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
Craig Mautner4a1cb222013-12-04 16:14:06 -08005737 reply.readException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08005738 final int result = reply.readInt();
5739 final IActivityContainer res;
5740 if (result == 1) {
5741 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5742 } else {
5743 res = null;
5744 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08005745 data.recycle();
5746 reply.recycle();
5747 return res;
5748 }
5749
Craig Mautner95da1082014-02-24 17:54:35 -08005750 public void deleteActivityContainer(IActivityContainer activityContainer)
5751 throws RemoteException {
5752 Parcel data = Parcel.obtain();
5753 Parcel reply = Parcel.obtain();
5754 data.writeInterfaceToken(IActivityManager.descriptor);
5755 data.writeStrongBinder(activityContainer.asBinder());
5756 mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
5757 reply.readException();
5758 data.recycle();
5759 reply.recycle();
5760 }
5761
Rahul Chaturvedi52613f92015-06-17 23:54:08 -04005762 public boolean startBinderTracking() throws RemoteException {
5763 Parcel data = Parcel.obtain();
5764 Parcel reply = Parcel.obtain();
5765 data.writeInterfaceToken(IActivityManager.descriptor);
5766 mRemote.transact(START_BINDER_TRACKING_TRANSACTION, data, reply, 0);
5767 reply.readException();
5768 boolean res = reply.readInt() != 0;
5769 reply.recycle();
5770 data.recycle();
5771 return res;
5772 }
5773
5774 public boolean stopBinderTrackingAndDump(ParcelFileDescriptor fd) throws RemoteException {
5775 Parcel data = Parcel.obtain();
5776 Parcel reply = Parcel.obtain();
5777 data.writeInterfaceToken(IActivityManager.descriptor);
5778 if (fd != null) {
5779 data.writeInt(1);
5780 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
5781 } else {
5782 data.writeInt(0);
5783 }
5784 mRemote.transact(STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION, data, reply, 0);
5785 reply.readException();
5786 boolean res = reply.readInt() != 0;
5787 reply.recycle();
5788 data.recycle();
5789 return res;
5790 }
5791
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005792 @Override
Todd Kennedy4900bf92015-01-16 16:05:14 -08005793 public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException {
5794 Parcel data = Parcel.obtain();
5795 Parcel reply = Parcel.obtain();
5796 data.writeInterfaceToken(IActivityManager.descriptor);
5797 data.writeInt(displayId);
5798 mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0);
5799 reply.readException();
5800 final int result = reply.readInt();
5801 final IActivityContainer res;
5802 if (result == 1) {
5803 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
5804 } else {
5805 res = null;
5806 }
5807 data.recycle();
5808 reply.recycle();
5809 return res;
5810 }
5811
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005812 @Override
5813 public int getActivityDisplayId(IBinder activityToken)
Craig Mautnere0a38842013-12-16 16:14:02 -08005814 throws RemoteException {
5815 Parcel data = Parcel.obtain();
5816 Parcel reply = Parcel.obtain();
5817 data.writeInterfaceToken(IActivityManager.descriptor);
5818 data.writeStrongBinder(activityToken);
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005819 mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0);
Craig Mautnere0a38842013-12-16 16:14:02 -08005820 reply.readException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005821 final int displayId = reply.readInt();
Craig Mautnere0a38842013-12-16 16:14:02 -08005822 data.recycle();
5823 reply.recycle();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005824 return displayId;
Craig Mautnere0a38842013-12-16 16:14:02 -08005825 }
5826
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08005827 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005828 public void startLockTaskMode(int taskId) throws RemoteException {
5829 Parcel data = Parcel.obtain();
5830 Parcel reply = Parcel.obtain();
5831 data.writeInterfaceToken(IActivityManager.descriptor);
5832 data.writeInt(taskId);
5833 mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0);
5834 reply.readException();
5835 data.recycle();
5836 reply.recycle();
5837 }
5838
5839 @Override
5840 public void startLockTaskMode(IBinder token) throws RemoteException {
5841 Parcel data = Parcel.obtain();
5842 Parcel reply = Parcel.obtain();
5843 data.writeInterfaceToken(IActivityManager.descriptor);
5844 data.writeStrongBinder(token);
5845 mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0);
5846 reply.readException();
5847 data.recycle();
5848 reply.recycle();
5849 }
5850
5851 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005852 public void startLockTaskModeOnCurrent() throws RemoteException {
5853 Parcel data = Parcel.obtain();
5854 Parcel reply = Parcel.obtain();
5855 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005856 mRemote.transact(START_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005857 reply.readException();
5858 data.recycle();
5859 reply.recycle();
5860 }
5861
5862 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005863 public void stopLockTaskMode() throws RemoteException {
5864 Parcel data = Parcel.obtain();
5865 Parcel reply = Parcel.obtain();
5866 data.writeInterfaceToken(IActivityManager.descriptor);
5867 mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5868 reply.readException();
5869 data.recycle();
5870 reply.recycle();
5871 }
5872
5873 @Override
Jason Monk62515be2014-05-21 16:06:19 -04005874 public void stopLockTaskModeOnCurrent() throws RemoteException {
5875 Parcel data = Parcel.obtain();
5876 Parcel reply = Parcel.obtain();
5877 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerd61dc202014-07-07 11:09:11 -07005878 mRemote.transact(STOP_LOCK_TASK_BY_CURRENT_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04005879 reply.readException();
5880 data.recycle();
5881 reply.recycle();
5882 }
5883
5884 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08005885 public boolean isInLockTaskMode() throws RemoteException {
5886 Parcel data = Parcel.obtain();
5887 Parcel reply = Parcel.obtain();
5888 data.writeInterfaceToken(IActivityManager.descriptor);
5889 mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
5890 reply.readException();
5891 boolean isInLockTaskMode = reply.readInt() == 1;
5892 data.recycle();
5893 reply.recycle();
5894 return isInLockTaskMode;
5895 }
5896
Craig Mautner688b5102014-03-27 16:55:03 -07005897 @Override
Benjamin Franz43261142015-02-11 15:59:44 +00005898 public int getLockTaskModeState() throws RemoteException {
5899 Parcel data = Parcel.obtain();
5900 Parcel reply = Parcel.obtain();
5901 data.writeInterfaceToken(IActivityManager.descriptor);
5902 mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0);
5903 reply.readException();
5904 int lockTaskModeState = reply.readInt();
5905 data.recycle();
5906 reply.recycle();
5907 return lockTaskModeState;
5908 }
5909
5910 @Override
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07005911 public void showLockTaskEscapeMessage(IBinder token) throws RemoteException {
5912 Parcel data = Parcel.obtain();
5913 Parcel reply = Parcel.obtain();
5914 data.writeInterfaceToken(IActivityManager.descriptor);
5915 data.writeStrongBinder(token);
5916 mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply,
5917 IBinder.FLAG_ONEWAY);
5918 reply.readException();
5919 data.recycle();
5920 reply.recycle();
5921 }
5922
5923 @Override
Winson Chunga449dc02014-05-16 11:15:04 -07005924 public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values)
Winson Chung03a9bae2014-05-02 09:56:12 -07005925 throws RemoteException {
Craig Mautner2fbd7542014-03-21 09:34:07 -07005926 Parcel data = Parcel.obtain();
5927 Parcel reply = Parcel.obtain();
5928 data.writeInterfaceToken(IActivityManager.descriptor);
5929 data.writeStrongBinder(token);
Winson Chung03a9bae2014-05-02 09:56:12 -07005930 values.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005931 mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0);
Craig Mautner2fbd7542014-03-21 09:34:07 -07005932 reply.readException();
5933 data.recycle();
5934 reply.recycle();
5935 }
5936
Craig Mautneree2e45a2014-06-27 12:10:03 -07005937 @Override
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08005938 public void setTaskResizeable(int taskId, boolean resizeable) throws RemoteException {
5939 Parcel data = Parcel.obtain();
5940 Parcel reply = Parcel.obtain();
5941 data.writeInterfaceToken(IActivityManager.descriptor);
5942 data.writeInt(taskId);
5943 data.writeInt(resizeable ? 1 : 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005944 mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0);
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08005945 reply.readException();
5946 data.recycle();
5947 reply.recycle();
5948 }
5949
5950 @Override
Chong Zhang87b21722015-09-21 15:39:51 -07005951 public void resizeTask(int taskId, Rect r, int resizeMode) throws RemoteException
Wale Ogunwale53a29a92015-02-23 15:42:52 -08005952 {
5953 Parcel data = Parcel.obtain();
5954 Parcel reply = Parcel.obtain();
5955 data.writeInterfaceToken(IActivityManager.descriptor);
5956 data.writeInt(taskId);
Chong Zhang87b21722015-09-21 15:39:51 -07005957 data.writeInt(resizeMode);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08005958 r.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005959 mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08005960 reply.readException();
5961 data.recycle();
5962 reply.recycle();
5963 }
5964
5965 @Override
Wale Ogunwalee4a0c572015-06-30 08:40:31 -07005966 public Rect getTaskBounds(int taskId) throws RemoteException
5967 {
5968 Parcel data = Parcel.obtain();
5969 Parcel reply = Parcel.obtain();
5970 data.writeInterfaceToken(IActivityManager.descriptor);
5971 data.writeInt(taskId);
5972 mRemote.transact(GET_TASK_BOUNDS_TRANSACTION, data, reply, 0);
5973 reply.readException();
5974 Rect rect = Rect.CREATOR.createFromParcel(reply);
5975 data.recycle();
5976 reply.recycle();
5977 return rect;
5978 }
5979
5980 @Override
Craig Mautner648f69b2014-09-18 14:16:26 -07005981 public Bitmap getTaskDescriptionIcon(String filename) throws RemoteException {
5982 Parcel data = Parcel.obtain();
5983 Parcel reply = Parcel.obtain();
5984 data.writeInterfaceToken(IActivityManager.descriptor);
5985 data.writeString(filename);
5986 mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0);
5987 reply.readException();
5988 final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply);
5989 data.recycle();
5990 reply.recycle();
5991 return icon;
5992 }
5993
5994 @Override
Winson Chung044d5292014-11-06 11:05:19 -08005995 public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options)
5996 throws RemoteException {
5997 Parcel data = Parcel.obtain();
5998 Parcel reply = Parcel.obtain();
5999 data.writeInterfaceToken(IActivityManager.descriptor);
6000 if (options == null) {
6001 data.writeInt(0);
6002 } else {
6003 data.writeInt(1);
6004 data.writeBundle(options.toBundle());
6005 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07006006 mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0);
Winson Chung044d5292014-11-06 11:05:19 -08006007 reply.readException();
6008 data.recycle();
6009 reply.recycle();
6010 }
6011
6012 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07006013 public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07006014 Parcel data = Parcel.obtain();
6015 Parcel reply = Parcel.obtain();
6016 data.writeInterfaceToken(IActivityManager.descriptor);
6017 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07006018 data.writeInt(visible ? 1 : 0);
6019 mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07006020 reply.readException();
6021 boolean success = reply.readInt() > 0;
6022 data.recycle();
6023 reply.recycle();
6024 return success;
6025 }
6026
6027 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07006028 public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07006029 Parcel data = Parcel.obtain();
6030 Parcel reply = Parcel.obtain();
6031 data.writeInterfaceToken(IActivityManager.descriptor);
6032 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07006033 mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07006034 reply.readException();
Jose Lima4b6c6692014-08-12 17:41:12 -07006035 final boolean visible = reply.readInt() > 0;
Craig Mautneree2e45a2014-06-27 12:10:03 -07006036 data.recycle();
6037 reply.recycle();
Jose Lima4b6c6692014-08-12 17:41:12 -07006038 return visible;
Craig Mautneree2e45a2014-06-27 12:10:03 -07006039 }
6040
6041 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07006042 public void backgroundResourcesReleased(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07006043 Parcel data = Parcel.obtain();
6044 Parcel reply = Parcel.obtain();
6045 data.writeInterfaceToken(IActivityManager.descriptor);
6046 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006047 mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0);
Craig Mautnerbb742462014-07-07 15:28:55 -07006048 reply.readException();
6049 data.recycle();
6050 reply.recycle();
6051 }
6052
6053 @Override
6054 public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException {
6055 Parcel data = Parcel.obtain();
6056 Parcel reply = Parcel.obtain();
6057 data.writeInterfaceToken(IActivityManager.descriptor);
6058 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006059 mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07006060 reply.readException();
6061 data.recycle();
6062 reply.recycle();
6063 }
6064
Craig Mautner8746a472014-07-24 15:12:54 -07006065 @Override
6066 public void notifyEnterAnimationComplete(IBinder token) throws RemoteException {
6067 Parcel data = Parcel.obtain();
6068 Parcel reply = Parcel.obtain();
6069 data.writeInterfaceToken(IActivityManager.descriptor);
6070 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006071 mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautner8746a472014-07-24 15:12:54 -07006072 reply.readException();
6073 data.recycle();
6074 reply.recycle();
6075 }
6076
Craig Mautner6e2f3952014-09-09 14:26:41 -07006077 @Override
6078 public void bootAnimationComplete() throws RemoteException {
6079 Parcel data = Parcel.obtain();
6080 Parcel reply = Parcel.obtain();
6081 data.writeInterfaceToken(IActivityManager.descriptor);
6082 mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
6083 reply.readException();
6084 data.recycle();
6085 reply.recycle();
6086 }
6087
Wale Ogunwale18795a22014-12-03 11:38:33 -08006088 @Override
Jeff Sharkey605eb792014-11-04 13:34:06 -08006089 public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException {
6090 Parcel data = Parcel.obtain();
6091 Parcel reply = Parcel.obtain();
6092 data.writeInterfaceToken(IActivityManager.descriptor);
6093 data.writeInt(uid);
6094 data.writeByteArray(firstPacket);
6095 mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0);
6096 reply.readException();
6097 data.recycle();
6098 reply.recycle();
6099 }
6100
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08006101 @Override
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07006102 public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize,
6103 String reportPackage) throws RemoteException {
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08006104 Parcel data = Parcel.obtain();
6105 Parcel reply = Parcel.obtain();
6106 data.writeInterfaceToken(IActivityManager.descriptor);
6107 data.writeString(processName);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07006108 data.writeInt(uid);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08006109 data.writeLong(maxMemSize);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07006110 data.writeString(reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08006111 mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0);
6112 reply.readException();
6113 data.recycle();
6114 reply.recycle();
6115 }
6116
6117 @Override
6118 public void dumpHeapFinished(String path) throws RemoteException {
6119 Parcel data = Parcel.obtain();
6120 Parcel reply = Parcel.obtain();
6121 data.writeInterfaceToken(IActivityManager.descriptor);
6122 data.writeString(path);
6123 mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0);
6124 reply.readException();
6125 data.recycle();
6126 reply.recycle();
6127 }
6128
Dianne Hackborn3d07c942015-03-13 18:02:54 -07006129 @Override
6130 public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake)
6131 throws RemoteException {
6132 Parcel data = Parcel.obtain();
6133 Parcel reply = Parcel.obtain();
6134 data.writeInterfaceToken(IActivityManager.descriptor);
6135 data.writeStrongBinder(session.asBinder());
6136 data.writeInt(keepAwake ? 1 : 0);
6137 mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0);
6138 reply.readException();
6139 data.recycle();
6140 reply.recycle();
6141 }
6142
Craig Mautnere5600772015-04-03 21:36:37 -07006143 @Override
6144 public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException {
6145 Parcel data = Parcel.obtain();
6146 Parcel reply = Parcel.obtain();
6147 data.writeInterfaceToken(IActivityManager.descriptor);
6148 data.writeInt(userId);
6149 data.writeStringArray(packages);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006150 mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0);
Craig Mautnere5600772015-04-03 21:36:37 -07006151 reply.readException();
6152 data.recycle();
6153 reply.recycle();
6154 }
6155
Dianne Hackborn1e383822015-04-10 14:02:33 -07006156 @Override
Craig Mautner015c5e52015-04-23 10:39:39 -07006157 public void updateDeviceOwner(String packageName) throws RemoteException {
6158 Parcel data = Parcel.obtain();
6159 Parcel reply = Parcel.obtain();
6160 data.writeInterfaceToken(IActivityManager.descriptor);
6161 data.writeString(packageName);
6162 mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0);
6163 reply.readException();
6164 data.recycle();
6165 reply.recycle();
6166 }
6167
6168 @Override
Adam Lesinskic30454c2015-06-24 13:24:35 -07006169 public int getPackageProcessState(String packageName, String callingPackage)
6170 throws RemoteException {
Dianne Hackborn1e383822015-04-10 14:02:33 -07006171 Parcel data = Parcel.obtain();
6172 Parcel reply = Parcel.obtain();
6173 data.writeInterfaceToken(IActivityManager.descriptor);
6174 data.writeString(packageName);
Adam Lesinskic30454c2015-06-24 13:24:35 -07006175 data.writeString(callingPackage);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006176 mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0);
6177 reply.readException();
6178 int res = reply.readInt();
6179 data.recycle();
6180 reply.recycle();
6181 return res;
6182 }
6183
Stefan Kuhne16045c22015-06-05 07:18:06 -07006184 @Override
6185 public boolean setProcessMemoryTrimLevel(String process, int userId, int level)
6186 throws RemoteException {
6187 Parcel data = Parcel.obtain();
6188 Parcel reply = Parcel.obtain();
6189 data.writeInterfaceToken(IActivityManager.descriptor);
6190 data.writeString(process);
6191 data.writeInt(userId);
6192 data.writeInt(level);
6193 mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0);
6194 reply.readException();
6195 int res = reply.readInt();
6196 data.recycle();
6197 reply.recycle();
6198 return res != 0;
6199 }
6200
Dianne Hackbornfb81d092015-08-03 17:14:46 -07006201 @Override
6202 public boolean isRootVoiceInteraction(IBinder token) throws RemoteException {
6203 Parcel data = Parcel.obtain();
6204 Parcel reply = Parcel.obtain();
6205 data.writeInterfaceToken(IActivityManager.descriptor);
6206 data.writeStrongBinder(token);
6207 mRemote.transact(IS_ROOT_VOICE_INTERACTION_TRANSACTION, data, reply, 0);
6208 reply.readException();
6209 int res = reply.readInt();
6210 data.recycle();
6211 reply.recycle();
6212 return res != 0;
6213 }
6214
Wale Ogunwale868a5e12015-08-02 16:19:20 -07006215 @Override
6216 public void moveActivityToStack(IBinder token, int stackId) throws RemoteException {
6217 Parcel data = Parcel.obtain();
6218 Parcel reply = Parcel.obtain();
6219 data.writeInterfaceToken(IActivityManager.descriptor);
6220 data.writeStrongBinder(token);
6221 data.writeInt(stackId);
6222 mRemote.transact(MOVE_ACTIVITY_TO_STACK_TRANSACTION, data, reply, 0);
6223 reply.readException();
6224 data.recycle();
6225 reply.recycle();
6226 }
6227
6228 @Override
6229 public int getActivityStackId(IBinder token) throws RemoteException {
6230 Parcel data = Parcel.obtain();
6231 Parcel reply = Parcel.obtain();
6232 data.writeInterfaceToken(IActivityManager.descriptor);
6233 data.writeStrongBinder(token);
6234 mRemote.transact(GET_ACTIVITY_STACK_ID_TRANSACTION, data, reply, 0);
6235 reply.readException();
6236 int stackId = reply.readInt();
6237 data.recycle();
6238 reply.recycle();
6239 return stackId;
6240 }
6241
Filip Gruszczynski23493322015-07-29 17:02:59 -07006242 @Override
6243 public void reportSizeConfigurations(IBinder token, int[] horizontalSizeConfiguration,
6244 int[] verticalSizeConfigurations) throws RemoteException {
6245 Parcel data = Parcel.obtain();
6246 Parcel reply = Parcel.obtain();
6247 data.writeInterfaceToken(IActivityManager.descriptor);
6248 data.writeStrongBinder(token);
6249 if (horizontalSizeConfiguration == null) {
6250 data.writeInt(0);
6251 } else {
6252 data.writeInt(horizontalSizeConfiguration.length);
6253 data.writeIntArray(horizontalSizeConfiguration);
6254 }
6255 if (verticalSizeConfigurations == null) {
6256 data.writeInt(0);
6257 } else {
6258 data.writeInt(verticalSizeConfigurations.length);
6259 data.writeIntArray(verticalSizeConfigurations);
6260 }
6261 mRemote.transact(REPORT_SIZE_CONFIGURATIONS, data, reply, 0);
6262 reply.readException();
6263 data.recycle();
6264 reply.recycle();
6265 }
6266
Wale Ogunwale83301a92015-09-24 15:54:08 -07006267 @Override
6268 public void suppressResizeConfigChanges(boolean suppress) throws RemoteException {
6269 Parcel data = Parcel.obtain();
6270 Parcel reply = Parcel.obtain();
6271 data.writeInterfaceToken(IActivityManager.descriptor);
6272 data.writeInt(suppress ? 1 : 0);
6273 mRemote.transact(SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION, data, reply, 0);
6274 reply.readException();
6275 data.recycle();
6276 reply.recycle();
6277 }
6278
Filip Gruszczynski57b6cce2015-10-06 09:50:51 -07006279 @Override
6280 public void removeStack(int stackId) throws RemoteException {
6281 Parcel data = Parcel.obtain();
6282 Parcel reply = Parcel.obtain();
6283 data.writeInterfaceToken(IActivityManager.descriptor);
6284 data.writeInt(stackId);
6285 mRemote.transact(REMOVE_STACK, data, reply, 0);
6286 reply.readException();
6287 data.recycle();
6288 reply.recycle();
6289 }
6290
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006291 private IBinder mRemote;
6292}