blob: d91472b6a1ba961e66e2fb9ae74cb68262421afc [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
Tony Mak9c6e8ce2016-03-21 12:07:16 +000019import android.annotation.UserIdInt;
Craig Mautnerbdc748af2013-12-02 14:08:25 -080020import android.app.ActivityManager.StackInfo;
Dianne Hackborn69c6adc2015-06-02 10:52:59 -070021import android.app.assist.AssistContent;
22import android.app.assist.AssistStructure;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023import android.content.ComponentName;
Adam Powelldd8fab22012-03-22 17:47:27 -070024import android.content.IIntentReceiver;
25import android.content.IIntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080026import android.content.Intent;
27import android.content.IntentFilter;
Dianne Hackbornfa82f222009-09-17 15:14:12 -070028import android.content.IntentSender;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070029import android.content.UriPermission;
Christopher Tate181fafa2009-05-14 11:12:14 -070030import android.content.pm.ApplicationInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080031import android.content.pm.ConfigurationInfo;
32import android.content.pm.IPackageDataObserver;
Jeff Sharkeye66c1772013-09-20 14:30:59 -070033import android.content.pm.ParceledListSlice;
Amith Yamasani52f1d752012-03-28 18:19:29 -070034import android.content.pm.UserInfo;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035import android.content.res.Configuration;
Dianne Hackbornaec68bb2014-08-20 15:25:13 -070036import android.graphics.Bitmap;
37import android.graphics.Point;
Craig Mautnerbdc748af2013-12-02 14:08:25 -080038import android.graphics.Rect;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080039import android.net.Uri;
40import android.os.Binder;
41import android.os.Bundle;
Dianne Hackborn3025ef32009-08-31 21:31:47 -070042import android.os.Debug;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080043import android.os.IBinder;
Jeff Sharkeybd91e2f2016-03-22 15:32:31 -060044import android.os.IProgressListener;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080045import android.os.Parcel;
Adam Powelldd8fab22012-03-22 17:47:27 -070046import android.os.ParcelFileDescriptor;
47import android.os.Parcelable;
Craig Mautnera0026042014-04-23 11:45:37 -070048import android.os.PersistableBundle;
Adam Powelldd8fab22012-03-22 17:47:27 -070049import android.os.RemoteException;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080050import android.os.ServiceManager;
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -070051import android.os.StrictMode;
Dianne Hackborn91097de2014-04-04 18:02:06 -070052import android.service.voice.IVoiceInteractionSession;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080053import android.text.TextUtils;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080054import android.util.Log;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080055import android.util.Singleton;
Dianne Hackborn91097de2014-04-04 18:02:06 -070056import com.android.internal.app.IVoiceInteractor;
Dianne Hackbornae6688b2015-02-11 17:02:41 -080057import com.android.internal.os.IResultReceiver;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080058
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080059import java.util.ArrayList;
60import java.util.List;
61
62/** {@hide} */
63public abstract class ActivityManagerNative extends Binder implements IActivityManager
64{
65 /**
66 * Cast a Binder object into an activity manager interface, generating
67 * a proxy if needed.
68 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080069 static public IActivityManager asInterface(IBinder obj) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080070 if (obj == null) {
71 return null;
72 }
73 IActivityManager in =
74 (IActivityManager)obj.queryLocalInterface(descriptor);
75 if (in != null) {
76 return in;
77 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080078
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080079 return new ActivityManagerProxy(obj);
80 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080081
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080082 /**
83 * Retrieve the system's default/global activity manager.
84 */
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080085 static public IActivityManager getDefault() {
86 return gDefault.get();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080087 }
88
89 /**
90 * Convenience for checking whether the system is ready. For internal use only.
91 */
92 static public boolean isSystemReady() {
93 if (!sSystemReady) {
94 sSystemReady = getDefault().testIsSystemReady();
95 }
96 return sSystemReady;
97 }
Jeff Sharkeyb5e89c62016-04-01 23:20:31 -060098 static volatile boolean sSystemReady = false;
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -080099
Svet Ganov16a16892015-04-16 10:32:04 -0700100 static public void broadcastStickyIntent(Intent intent, String permission, int userId) {
101 broadcastStickyIntent(intent, permission, AppOpsManager.OP_NONE, userId);
102 }
103
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800104 /**
105 * Convenience for sending a sticky broadcast. For internal use only.
106 * If you don't care about permission, use null.
107 */
Svet Ganov16a16892015-04-16 10:32:04 -0700108 static public void broadcastStickyIntent(Intent intent, String permission, int appOp,
109 int userId) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800110 try {
111 getDefault().broadcastIntent(
Filip Gruszczynski23493322015-07-29 17:02:59 -0700112 null, intent, null, null, Activity.RESULT_OK, null, null,
113 null /*permission*/, appOp, null, false, true, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800114 } catch (RemoteException ex) {
115 }
116 }
117
Dianne Hackborn1e383822015-04-10 14:02:33 -0700118 static public void noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg,
119 String tag) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800120 try {
Christopher Tate14a7bb02015-10-01 10:24:31 -0700121 getDefault().noteWakeupAlarm((ps != null) ? ps.getTarget() : null,
122 sourceUid, sourcePkg, tag);
Dianne Hackborn1e383822015-04-10 14:02:33 -0700123 } catch (RemoteException ex) {
124 }
125 }
126
127 static public void noteAlarmStart(PendingIntent ps, int sourceUid, String tag) {
128 try {
Christopher Tate14a7bb02015-10-01 10:24:31 -0700129 getDefault().noteAlarmStart((ps != null) ? ps.getTarget() : null, sourceUid, tag);
Dianne Hackborn1e383822015-04-10 14:02:33 -0700130 } catch (RemoteException ex) {
131 }
132 }
133
134 static public void noteAlarmFinish(PendingIntent ps, int sourceUid, String tag) {
135 try {
Christopher Tate14a7bb02015-10-01 10:24:31 -0700136 getDefault().noteAlarmFinish((ps != null) ? ps.getTarget() : null, sourceUid, tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800137 } catch (RemoteException ex) {
138 }
139 }
140
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -0800141 public ActivityManagerNative() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800142 attachInterface(this, descriptor);
143 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700144
145 @Override
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800146 public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
147 throws RemoteException {
148 switch (code) {
149 case START_ACTIVITY_TRANSACTION:
150 {
151 data.enforceInterface(IActivityManager.descriptor);
152 IBinder b = data.readStrongBinder();
153 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800154 String callingPackage = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800155 Intent intent = Intent.CREATOR.createFromParcel(data);
156 String resolvedType = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800157 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800158 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800159 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700160 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700161 ProfilerInfo profilerInfo = data.readInt() != 0
162 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700163 Bundle options = data.readInt() != 0
164 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800165 int result = startActivity(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700166 resultTo, resultWho, requestCode, startFlags, profilerInfo, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800167 reply.writeNoException();
168 reply.writeInt(result);
169 return true;
170 }
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700171
Amith Yamasani82644082012-08-03 13:09:11 -0700172 case START_ACTIVITY_AS_USER_TRANSACTION:
173 {
174 data.enforceInterface(IActivityManager.descriptor);
175 IBinder b = data.readStrongBinder();
176 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800177 String callingPackage = data.readString();
Amith Yamasani82644082012-08-03 13:09:11 -0700178 Intent intent = Intent.CREATOR.createFromParcel(data);
179 String resolvedType = data.readString();
180 IBinder resultTo = data.readStrongBinder();
181 String resultWho = data.readString();
182 int requestCode = data.readInt();
183 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700184 ProfilerInfo profilerInfo = data.readInt() != 0
185 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Amith Yamasani82644082012-08-03 13:09:11 -0700186 Bundle options = data.readInt() != 0
187 ? Bundle.CREATOR.createFromParcel(data) : null;
188 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800189 int result = startActivityAsUser(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700190 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Amith Yamasani82644082012-08-03 13:09:11 -0700191 reply.writeNoException();
192 reply.writeInt(result);
193 return true;
194 }
195
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700196 case START_ACTIVITY_AS_CALLER_TRANSACTION:
197 {
198 data.enforceInterface(IActivityManager.descriptor);
199 IBinder b = data.readStrongBinder();
200 IApplicationThread app = ApplicationThreadNative.asInterface(b);
201 String callingPackage = data.readString();
202 Intent intent = Intent.CREATOR.createFromParcel(data);
203 String resolvedType = data.readString();
204 IBinder resultTo = data.readStrongBinder();
205 String resultWho = data.readString();
206 int requestCode = data.readInt();
207 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700208 ProfilerInfo profilerInfo = data.readInt() != 0
209 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700210 Bundle options = data.readInt() != 0
211 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborna7cfbe02015-07-16 10:52:52 -0700212 boolean ignoreTargetSecurity = data.readInt() != 0;
Jeff Sharkey97978802014-10-14 10:48:18 -0700213 int userId = data.readInt();
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700214 int result = startActivityAsCaller(app, callingPackage, intent, resolvedType,
Dianne Hackborna7cfbe02015-07-16 10:52:52 -0700215 resultTo, resultWho, requestCode, startFlags, profilerInfo, options,
216 ignoreTargetSecurity, userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -0700217 reply.writeNoException();
218 reply.writeInt(result);
219 return true;
220 }
221
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800222 case START_ACTIVITY_AND_WAIT_TRANSACTION:
223 {
224 data.enforceInterface(IActivityManager.descriptor);
225 IBinder b = data.readStrongBinder();
226 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800227 String callingPackage = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800228 Intent intent = Intent.CREATOR.createFromParcel(data);
229 String resolvedType = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800230 IBinder resultTo = data.readStrongBinder();
Siva Velusamy92a8b222012-03-09 16:24:04 -0800231 String resultWho = data.readString();
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800232 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700233 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700234 ProfilerInfo profilerInfo = data.readInt() != 0
235 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborna4972e92012-03-14 10:38:05 -0700236 Bundle options = data.readInt() != 0
237 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -0700238 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800239 WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType,
Jeff Hao1b012d32014-08-20 10:35:34 -0700240 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -0800241 reply.writeNoException();
242 result.writeToParcel(reply, 0);
243 return true;
244 }
245
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700246 case START_ACTIVITY_WITH_CONFIG_TRANSACTION:
247 {
248 data.enforceInterface(IActivityManager.descriptor);
249 IBinder b = data.readStrongBinder();
250 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800251 String callingPackage = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700252 Intent intent = Intent.CREATOR.createFromParcel(data);
253 String resolvedType = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700254 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700255 String resultWho = data.readString();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700256 int requestCode = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700257 int startFlags = data.readInt();
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700258 Configuration config = Configuration.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700259 Bundle options = data.readInt() != 0
260 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -0700261 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -0800262 int result = startActivityWithConfig(app, callingPackage, intent, resolvedType,
Dianne Hackborn41203752012-08-31 14:05:51 -0700263 resultTo, resultWho, requestCode, startFlags, config, options, userId);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -0700264 reply.writeNoException();
265 reply.writeInt(result);
266 return true;
267 }
268
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700269 case START_ACTIVITY_INTENT_SENDER_TRANSACTION:
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700270 {
271 data.enforceInterface(IActivityManager.descriptor);
272 IBinder b = data.readStrongBinder();
273 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700274 IntentSender intent = IntentSender.CREATOR.createFromParcel(data);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700275 Intent fillInIntent = null;
276 if (data.readInt() != 0) {
277 fillInIntent = Intent.CREATOR.createFromParcel(data);
278 }
279 String resolvedType = data.readString();
280 IBinder resultTo = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700281 String resultWho = data.readString();
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700282 int requestCode = data.readInt();
283 int flagsMask = data.readInt();
284 int flagsValues = data.readInt();
Dianne Hackborna4972e92012-03-14 10:38:05 -0700285 Bundle options = data.readInt() != 0
286 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackbornfa82f222009-09-17 15:14:12 -0700287 int result = startActivityIntentSender(app, intent,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700288 fillInIntent, resolvedType, resultTo, resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -0700289 requestCode, flagsMask, flagsValues, options);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -0700290 reply.writeNoException();
291 reply.writeInt(result);
292 return true;
293 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700294
Dianne Hackborn91097de2014-04-04 18:02:06 -0700295 case START_VOICE_ACTIVITY_TRANSACTION:
296 {
297 data.enforceInterface(IActivityManager.descriptor);
298 String callingPackage = data.readString();
299 int callingPid = data.readInt();
300 int callingUid = data.readInt();
301 Intent intent = Intent.CREATOR.createFromParcel(data);
302 String resolvedType = data.readString();
303 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
304 data.readStrongBinder());
305 IVoiceInteractor interactor = IVoiceInteractor.Stub.asInterface(
306 data.readStrongBinder());
307 int startFlags = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700308 ProfilerInfo profilerInfo = data.readInt() != 0
309 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Dianne Hackborn91097de2014-04-04 18:02:06 -0700310 Bundle options = data.readInt() != 0
311 ? Bundle.CREATOR.createFromParcel(data) : null;
312 int userId = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -0700313 int result = startVoiceActivity(callingPackage, callingPid, callingUid, intent,
314 resolvedType, session, interactor, startFlags, profilerInfo, options, userId);
Dianne Hackborn91097de2014-04-04 18:02:06 -0700315 reply.writeNoException();
316 reply.writeInt(result);
317 return true;
318 }
319
Amith Yamasani0af6fa72016-01-17 15:36:19 -0800320 case START_LOCAL_VOICE_INTERACTION_TRANSACTION:
321 {
322 data.enforceInterface(IActivityManager.descriptor);
323 IBinder token = data.readStrongBinder();
324 Bundle options = data.readBundle();
325 startLocalVoiceInteraction(token, options);
326 reply.writeNoException();
327 return true;
328 }
329
330 case STOP_LOCAL_VOICE_INTERACTION_TRANSACTION:
331 {
332 data.enforceInterface(IActivityManager.descriptor);
333 IBinder token = data.readStrongBinder();
334 stopLocalVoiceInteraction(token);
335 reply.writeNoException();
336 return true;
337 }
338
339 case SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION:
340 {
341 data.enforceInterface(IActivityManager.descriptor);
342 boolean result = supportsLocalVoiceInteraction();
343 reply.writeNoException();
344 reply.writeInt(result? 1 : 0);
345 return true;
346 }
347
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800348 case START_NEXT_MATCHING_ACTIVITY_TRANSACTION:
349 {
350 data.enforceInterface(IActivityManager.descriptor);
351 IBinder callingActivity = data.readStrongBinder();
352 Intent intent = Intent.CREATOR.createFromParcel(data);
Dianne Hackborna4972e92012-03-14 10:38:05 -0700353 Bundle options = data.readInt() != 0
354 ? Bundle.CREATOR.createFromParcel(data) : null;
355 boolean result = startNextMatchingActivity(callingActivity, intent, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800356 reply.writeNoException();
357 reply.writeInt(result ? 1 : 0);
358 return true;
359 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700360
Craig Mautnerdc00cbe2014-07-20 17:48:47 -0700361 case START_ACTIVITY_FROM_RECENTS_TRANSACTION:
362 {
363 data.enforceInterface(IActivityManager.descriptor);
Wale Ogunwale7e8184b2015-10-05 14:37:03 -0700364 final int taskId = data.readInt();
Wale Ogunwale7e8184b2015-10-05 14:37:03 -0700365 final Bundle options =
366 data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data);
Wale Ogunwale854809c2015-12-27 16:18:19 -0800367 final int result = startActivityFromRecents(taskId, options);
Craig Mautnerdc00cbe2014-07-20 17:48:47 -0700368 reply.writeNoException();
369 reply.writeInt(result);
370 return true;
371 }
372
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800373 case FINISH_ACTIVITY_TRANSACTION: {
374 data.enforceInterface(IActivityManager.descriptor);
375 IBinder token = data.readStrongBinder();
376 Intent resultData = null;
377 int resultCode = data.readInt();
378 if (data.readInt() != 0) {
379 resultData = Intent.CREATOR.createFromParcel(data);
380 }
Wale Ogunwaleba7881c2015-08-01 19:28:29 -0700381 int finishTask = data.readInt();
Winson Chung3b3f4642014-04-22 10:08:18 -0700382 boolean res = finishActivity(token, resultCode, resultData, finishTask);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800383 reply.writeNoException();
384 reply.writeInt(res ? 1 : 0);
385 return true;
386 }
387
388 case FINISH_SUB_ACTIVITY_TRANSACTION: {
389 data.enforceInterface(IActivityManager.descriptor);
390 IBinder token = data.readStrongBinder();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700391 String resultWho = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800392 int requestCode = data.readInt();
393 finishSubActivity(token, resultWho, requestCode);
394 reply.writeNoException();
395 return true;
396 }
397
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -0700398 case FINISH_ACTIVITY_AFFINITY_TRANSACTION: {
399 data.enforceInterface(IActivityManager.descriptor);
400 IBinder token = data.readStrongBinder();
401 boolean res = finishActivityAffinity(token);
402 reply.writeNoException();
403 reply.writeInt(res ? 1 : 0);
404 return true;
405 }
406
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -0700407 case FINISH_VOICE_TASK_TRANSACTION: {
408 data.enforceInterface(IActivityManager.descriptor);
409 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
410 data.readStrongBinder());
411 finishVoiceTask(session);
412 reply.writeNoException();
413 return true;
414 }
415
Chong Zhangfec694e2016-08-09 12:57:38 -0700416 case REQUEST_ACTIVITY_RELAUNCH: {
417 data.enforceInterface(IActivityManager.descriptor);
418 IBinder token = data.readStrongBinder();
419 requestActivityRelaunch(token);
420 reply.writeNoException();
421 return true;
422 }
423
Dianne Hackborn89ad4562014-08-24 16:45:38 -0700424 case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: {
425 data.enforceInterface(IActivityManager.descriptor);
426 IBinder token = data.readStrongBinder();
427 boolean res = releaseActivityInstance(token);
428 reply.writeNoException();
429 reply.writeInt(res ? 1 : 0);
430 return true;
431 }
432
433 case RELEASE_SOME_ACTIVITIES_TRANSACTION: {
434 data.enforceInterface(IActivityManager.descriptor);
435 IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder());
436 releaseSomeActivities(app);
437 reply.writeNoException();
438 return true;
439 }
440
Dianne Hackborn061d58a2010-03-12 15:07:06 -0800441 case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: {
442 data.enforceInterface(IActivityManager.descriptor);
443 IBinder token = data.readStrongBinder();
444 boolean res = willActivityBeVisible(token);
445 reply.writeNoException();
446 reply.writeInt(res ? 1 : 0);
447 return true;
448 }
449
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800450 case REGISTER_RECEIVER_TRANSACTION:
451 {
452 data.enforceInterface(IActivityManager.descriptor);
453 IBinder b = data.readStrongBinder();
454 IApplicationThread app =
455 b != null ? ApplicationThreadNative.asInterface(b) : null;
Dianne Hackborn6c418d52011-06-29 14:05:33 -0700456 String packageName = data.readString();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800457 b = data.readStrongBinder();
458 IIntentReceiver rec
459 = b != null ? IIntentReceiver.Stub.asInterface(b) : null;
460 IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data);
461 String perm = data.readString();
Dianne Hackborn20e80982012-08-31 19:00:44 -0700462 int userId = data.readInt();
463 Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800464 reply.writeNoException();
465 if (intent != null) {
466 reply.writeInt(1);
467 intent.writeToParcel(reply, 0);
468 } else {
469 reply.writeInt(0);
470 }
471 return true;
472 }
473
474 case UNREGISTER_RECEIVER_TRANSACTION:
475 {
476 data.enforceInterface(IActivityManager.descriptor);
477 IBinder b = data.readStrongBinder();
478 if (b == null) {
479 return true;
480 }
481 IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b);
482 unregisterReceiver(rec);
483 reply.writeNoException();
484 return true;
485 }
486
487 case BROADCAST_INTENT_TRANSACTION:
488 {
489 data.enforceInterface(IActivityManager.descriptor);
490 IBinder b = data.readStrongBinder();
491 IApplicationThread app =
492 b != null ? ApplicationThreadNative.asInterface(b) : null;
493 Intent intent = Intent.CREATOR.createFromParcel(data);
494 String resolvedType = data.readString();
495 b = data.readStrongBinder();
496 IIntentReceiver resultTo =
497 b != null ? IIntentReceiver.Stub.asInterface(b) : null;
498 int resultCode = data.readInt();
499 String resultData = data.readString();
500 Bundle resultExtras = data.readBundle();
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -0700501 String[] perms = data.readStringArray();
Dianne Hackbornf51f6122013-02-04 18:23:34 -0800502 int appOp = data.readInt();
Dianne Hackborna750a632015-06-16 17:18:23 -0700503 Bundle options = data.readBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800504 boolean serialized = data.readInt() != 0;
505 boolean sticky = data.readInt() != 0;
Amith Yamasani742a6712011-05-04 14:49:28 -0700506 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800507 int res = broadcastIntent(app, intent, resolvedType, resultTo,
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -0700508 resultCode, resultData, resultExtras, perms, appOp,
Dianne Hackborna750a632015-06-16 17:18:23 -0700509 options, serialized, sticky, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800510 reply.writeNoException();
511 reply.writeInt(res);
512 return true;
513 }
514
515 case UNBROADCAST_INTENT_TRANSACTION:
516 {
517 data.enforceInterface(IActivityManager.descriptor);
518 IBinder b = data.readStrongBinder();
519 IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null;
520 Intent intent = Intent.CREATOR.createFromParcel(data);
Amith Yamasani742a6712011-05-04 14:49:28 -0700521 int userId = data.readInt();
522 unbroadcastIntent(app, intent, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800523 reply.writeNoException();
524 return true;
525 }
526
527 case FINISH_RECEIVER_TRANSACTION: {
528 data.enforceInterface(IActivityManager.descriptor);
529 IBinder who = data.readStrongBinder();
530 int resultCode = data.readInt();
531 String resultData = data.readString();
532 Bundle resultExtras = data.readBundle();
533 boolean resultAbort = data.readInt() != 0;
riddle_hsu1f5ac4d2015-01-03 15:38:21 +0800534 int intentFlags = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800535 if (who != null) {
riddle_hsu1f5ac4d2015-01-03 15:38:21 +0800536 finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800537 }
538 reply.writeNoException();
539 return true;
540 }
541
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800542 case ATTACH_APPLICATION_TRANSACTION: {
543 data.enforceInterface(IActivityManager.descriptor);
544 IApplicationThread app = ApplicationThreadNative.asInterface(
545 data.readStrongBinder());
546 if (app != null) {
547 attachApplication(app);
548 }
549 reply.writeNoException();
550 return true;
551 }
552
553 case ACTIVITY_IDLE_TRANSACTION: {
554 data.enforceInterface(IActivityManager.descriptor);
555 IBinder token = data.readStrongBinder();
Dianne Hackborne88846e2009-09-30 21:34:25 -0700556 Configuration config = null;
557 if (data.readInt() != 0) {
558 config = Configuration.CREATOR.createFromParcel(data);
559 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700560 boolean stopProfiling = data.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800561 if (token != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -0700562 activityIdle(token, config, stopProfiling);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800563 }
564 reply.writeNoException();
565 return true;
566 }
567
Dianne Hackbornad9b32112012-09-17 15:35:01 -0700568 case ACTIVITY_RESUMED_TRANSACTION: {
569 data.enforceInterface(IActivityManager.descriptor);
570 IBinder token = data.readStrongBinder();
571 activityResumed(token);
572 reply.writeNoException();
573 return true;
574 }
575
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800576 case ACTIVITY_PAUSED_TRANSACTION: {
577 data.enforceInterface(IActivityManager.descriptor);
578 IBinder token = data.readStrongBinder();
Dianne Hackborna4e102e2014-09-04 22:52:27 -0700579 activityPaused(token);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800580 reply.writeNoException();
581 return true;
582 }
583
584 case ACTIVITY_STOPPED_TRANSACTION: {
585 data.enforceInterface(IActivityManager.descriptor);
586 IBinder token = data.readStrongBinder();
Dianne Hackborn0aae2d42010-12-07 23:51:29 -0800587 Bundle map = data.readBundle();
Craig Mautnera0026042014-04-23 11:45:37 -0700588 PersistableBundle persistentState = data.readPersistableBundle();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800589 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
Craig Mautnera0026042014-04-23 11:45:37 -0700590 activityStopped(token, map, persistentState, description);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800591 reply.writeNoException();
592 return true;
593 }
594
Dianne Hackborn4eba96b2011-01-21 13:34:36 -0800595 case ACTIVITY_SLEPT_TRANSACTION: {
596 data.enforceInterface(IActivityManager.descriptor);
597 IBinder token = data.readStrongBinder();
598 activitySlept(token);
599 reply.writeNoException();
600 return true;
601 }
602
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800603 case ACTIVITY_DESTROYED_TRANSACTION: {
604 data.enforceInterface(IActivityManager.descriptor);
605 IBinder token = data.readStrongBinder();
606 activityDestroyed(token);
607 reply.writeNoException();
608 return true;
609 }
610
Jorim Jaggife89d122015-12-22 16:28:44 +0100611 case ACTIVITY_RELAUNCHED_TRANSACTION: {
612 data.enforceInterface(IActivityManager.descriptor);
613 IBinder token = data.readStrongBinder();
614 activityRelaunched(token);
615 reply.writeNoException();
616 return true;
617 }
618
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800619 case GET_CALLING_PACKAGE_TRANSACTION: {
620 data.enforceInterface(IActivityManager.descriptor);
621 IBinder token = data.readStrongBinder();
622 String res = token != null ? getCallingPackage(token) : null;
623 reply.writeNoException();
624 reply.writeString(res);
625 return true;
626 }
627
628 case GET_CALLING_ACTIVITY_TRANSACTION: {
629 data.enforceInterface(IActivityManager.descriptor);
630 IBinder token = data.readStrongBinder();
631 ComponentName cn = getCallingActivity(token);
632 reply.writeNoException();
633 ComponentName.writeToParcel(cn, reply);
634 return true;
635 }
636
Winson Chung1147c402014-05-14 11:05:00 -0700637 case GET_APP_TASKS_TRANSACTION: {
638 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -0700639 String callingPackage = data.readString();
640 List<IAppTask> list = getAppTasks(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -0700641 reply.writeNoException();
642 int N = list != null ? list.size() : -1;
643 reply.writeInt(N);
644 int i;
645 for (i=0; i<N; i++) {
646 IAppTask task = list.get(i);
647 reply.writeStrongBinder(task.asBinder());
648 }
649 return true;
650 }
651
Dianne Hackbornaec68bb2014-08-20 15:25:13 -0700652 case ADD_APP_TASK_TRANSACTION: {
653 data.enforceInterface(IActivityManager.descriptor);
654 IBinder activityToken = data.readStrongBinder();
655 Intent intent = Intent.CREATOR.createFromParcel(data);
656 ActivityManager.TaskDescription descr
657 = ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
658 Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data);
659 int res = addAppTask(activityToken, intent, descr, thumbnail);
660 reply.writeNoException();
661 reply.writeInt(res);
662 return true;
663 }
664
665 case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: {
666 data.enforceInterface(IActivityManager.descriptor);
667 Point size = getAppTaskThumbnailSize();
668 reply.writeNoException();
669 size.writeToParcel(reply, 0);
670 return true;
671 }
672
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800673 case GET_TASKS_TRANSACTION: {
674 data.enforceInterface(IActivityManager.descriptor);
675 int maxNum = data.readInt();
676 int fl = data.readInt();
Dianne Hackborn09233282014-04-30 11:33:59 -0700677 List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800678 reply.writeNoException();
679 int N = list != null ? list.size() : -1;
680 reply.writeInt(N);
681 int i;
682 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700683 ActivityManager.RunningTaskInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800684 info.writeToParcel(reply, 0);
685 }
686 return true;
687 }
688
689 case GET_RECENT_TASKS_TRANSACTION: {
690 data.enforceInterface(IActivityManager.descriptor);
691 int maxNum = data.readInt();
692 int fl = data.readInt();
Amith Yamasani82644082012-08-03 13:09:11 -0700693 int userId = data.readInt();
Jeff Sharkey479212c2016-06-29 16:00:55 -0600694 ParceledListSlice<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -0700695 fl, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800696 reply.writeNoException();
Jeff Sharkey479212c2016-06-29 16:00:55 -0600697 list.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800698 return true;
699 }
Dianne Hackborn15491c62012-09-19 10:59:14 -0700700
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700701 case GET_TASK_THUMBNAIL_TRANSACTION: {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800702 data.enforceInterface(IActivityManager.descriptor);
703 int id = data.readInt();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700704 ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id);
Dianne Hackbornd94df452011-02-16 18:53:31 -0800705 reply.writeNoException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700706 if (taskThumbnail != null) {
Dianne Hackbornd94df452011-02-16 18:53:31 -0800707 reply.writeInt(1);
Craig Mautnerc0ffce52014-07-01 12:38:52 -0700708 taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn15491c62012-09-19 10:59:14 -0700709 } else {
710 reply.writeInt(0);
711 }
712 return true;
713 }
714
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800715 case GET_SERVICES_TRANSACTION: {
716 data.enforceInterface(IActivityManager.descriptor);
717 int maxNum = data.readInt();
718 int fl = data.readInt();
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700719 List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800720 reply.writeNoException();
721 int N = list != null ? list.size() : -1;
722 reply.writeInt(N);
723 int i;
724 for (i=0; i<N; i++) {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700725 ActivityManager.RunningServiceInfo info = list.get(i);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800726 info.writeToParcel(reply, 0);
727 }
728 return true;
729 }
730
731 case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: {
732 data.enforceInterface(IActivityManager.descriptor);
733 List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState();
734 reply.writeNoException();
735 reply.writeTypedList(list);
736 return true;
737 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -0700738
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800739 case GET_RUNNING_APP_PROCESSES_TRANSACTION: {
740 data.enforceInterface(IActivityManager.descriptor);
741 List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses();
742 reply.writeNoException();
743 reply.writeTypedList(list);
744 return true;
745 }
746
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -0700747 case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: {
748 data.enforceInterface(IActivityManager.descriptor);
749 List<ApplicationInfo> list = getRunningExternalApplications();
750 reply.writeNoException();
751 reply.writeTypedList(list);
752 return true;
753 }
754
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800755 case MOVE_TASK_TO_FRONT_TRANSACTION: {
756 data.enforceInterface(IActivityManager.descriptor);
757 int task = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -0800758 int fl = data.readInt();
Dianne Hackborn8078d8c2012-03-20 11:11:26 -0700759 Bundle options = data.readInt() != 0
760 ? Bundle.CREATOR.createFromParcel(data) : null;
761 moveTaskToFront(task, fl, options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800762 reply.writeNoException();
763 return true;
764 }
765
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800766 case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: {
767 data.enforceInterface(IActivityManager.descriptor);
768 IBinder token = data.readStrongBinder();
769 boolean nonRoot = data.readInt() != 0;
770 boolean res = moveActivityTaskToBack(token, nonRoot);
771 reply.writeNoException();
772 reply.writeInt(res ? 1 : 0);
773 return true;
774 }
775
776 case MOVE_TASK_BACKWARDS_TRANSACTION: {
777 data.enforceInterface(IActivityManager.descriptor);
778 int task = data.readInt();
779 moveTaskBackwards(task);
780 reply.writeNoException();
781 return true;
782 }
783
Craig Mautnerc00204b2013-03-05 15:02:14 -0800784 case MOVE_TASK_TO_STACK_TRANSACTION: {
785 data.enforceInterface(IActivityManager.descriptor);
786 int taskId = data.readInt();
787 int stackId = data.readInt();
788 boolean toTop = data.readInt() != 0;
789 moveTaskToStack(taskId, stackId, toTop);
790 reply.writeNoException();
791 return true;
792 }
793
Wale Ogunwale59a73ca2015-09-14 12:54:50 -0700794 case MOVE_TASK_TO_DOCKED_STACK_TRANSACTION: {
795 data.enforceInterface(IActivityManager.descriptor);
796 int taskId = data.readInt();
797 int createMode = data.readInt();
798 boolean toTop = data.readInt() != 0;
Jorim Jaggi030979c2015-11-20 15:14:43 -0800799 boolean animate = data.readInt() != 0;
Jorim Jaggi9ea2f7b2015-11-23 18:08:28 -0800800 Rect bounds = null;
801 boolean hasBounds = data.readInt() != 0;
802 if (hasBounds) {
803 bounds = Rect.CREATOR.createFromParcel(data);
804 }
Wale Ogunwalea4d92a02016-05-01 16:02:16 -0700805 final boolean moveHomeStackFront = data.readInt() != 0;
806 final boolean res = moveTaskToDockedStack(
807 taskId, createMode, toTop, animate, bounds, moveHomeStackFront);
Wale Ogunwale59a73ca2015-09-14 12:54:50 -0700808 reply.writeNoException();
Chong Zhange4fbd322016-03-01 14:44:03 -0800809 reply.writeInt(res ? 1 : 0);
Wale Ogunwale59a73ca2015-09-14 12:54:50 -0700810 return true;
811 }
812
Dianne Hackbornbef28fe2015-10-29 17:57:11 -0700813 case MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION: {
Wale Ogunwale079a0042015-10-24 11:44:07 -0700814 data.enforceInterface(IActivityManager.descriptor);
815 final int stackId = data.readInt();
816 final Rect r = Rect.CREATOR.createFromParcel(data);
817 final boolean res = moveTopActivityToPinnedStack(stackId, r);
818 reply.writeNoException();
819 reply.writeInt(res ? 1 : 0);
820 return true;
821 }
822
Craig Mautnerc00204b2013-03-05 15:02:14 -0800823 case RESIZE_STACK_TRANSACTION: {
824 data.enforceInterface(IActivityManager.descriptor);
Wale Ogunwaleffc11bb2015-10-10 13:05:45 -0700825 final int stackId = data.readInt();
Jorim Jaggi61f39a72015-10-29 16:54:18 +0100826 final boolean hasRect = data.readInt() != 0;
827 Rect r = null;
828 if (hasRect) {
829 r = Rect.CREATOR.createFromParcel(data);
830 }
Wale Ogunwaleffc11bb2015-10-10 13:05:45 -0700831 final boolean allowResizeInDockedMode = data.readInt() == 1;
Filip Gruszczynski84fa3352016-01-25 16:28:49 -0800832 final boolean preserveWindows = data.readInt() == 1;
833 final boolean animate = data.readInt() == 1;
Wale Ogunwalee75a9ad2016-03-18 20:43:49 -0700834 final int animationDuration = data.readInt();
835 resizeStack(stackId,
836 r, allowResizeInDockedMode, preserveWindows, animate, animationDuration);
Craig Mautnerc00204b2013-03-05 15:02:14 -0800837 reply.writeNoException();
838 return true;
839 }
Robert Carr0d00c2e2016-02-29 17:45:02 -0800840 case RESIZE_PINNED_STACK_TRANSACTION: {
841 data.enforceInterface(IActivityManager.descriptor);
842 final boolean hasBounds = data.readInt() != 0;
843 Rect bounds = null;
844 if (hasBounds) {
845 bounds = Rect.CREATOR.createFromParcel(data);
846 }
847 final boolean hasTempPinnedTaskBounds = data.readInt() != 0;
848 Rect tempPinnedTaskBounds = null;
849 if (hasTempPinnedTaskBounds) {
850 tempPinnedTaskBounds = Rect.CREATOR.createFromParcel(data);
851 }
852 resizePinnedStack(bounds, tempPinnedTaskBounds);
853 return true;
854 }
Jorim Jaggid47e7e12016-03-01 09:57:38 +0100855 case SWAP_DOCKED_AND_FULLSCREEN_STACK: {
856 data.enforceInterface(IActivityManager.descriptor);
857 swapDockedAndFullscreenStack();
858 reply.writeNoException();
859 return true;
860 }
Jorim Jaggidc249c42015-12-15 14:57:31 -0800861 case RESIZE_DOCKED_STACK_TRANSACTION: {
862 data.enforceInterface(IActivityManager.descriptor);
863 final boolean hasBounds = data.readInt() != 0;
864 Rect bounds = null;
865 if (hasBounds) {
866 bounds = Rect.CREATOR.createFromParcel(data);
867 }
868 final boolean hasTempDockedTaskBounds = data.readInt() != 0;
869 Rect tempDockedTaskBounds = null;
870 if (hasTempDockedTaskBounds) {
871 tempDockedTaskBounds = Rect.CREATOR.createFromParcel(data);
872 }
873 final boolean hasTempDockedTaskInsetBounds = data.readInt() != 0;
874 Rect tempDockedTaskInsetBounds = null;
875 if (hasTempDockedTaskInsetBounds) {
876 tempDockedTaskInsetBounds = Rect.CREATOR.createFromParcel(data);
877 }
878 final boolean hasTempOtherTaskBounds = data.readInt() != 0;
879 Rect tempOtherTaskBounds = null;
880 if (hasTempOtherTaskBounds) {
881 tempOtherTaskBounds = Rect.CREATOR.createFromParcel(data);
882 }
883 final boolean hasTempOtherTaskInsetBounds = data.readInt() != 0;
884 Rect tempOtherTaskInsetBounds = null;
885 if (hasTempOtherTaskInsetBounds) {
886 tempOtherTaskInsetBounds = Rect.CREATOR.createFromParcel(data);
887 }
888 resizeDockedStack(bounds, tempDockedTaskBounds, tempDockedTaskInsetBounds,
889 tempOtherTaskBounds, tempOtherTaskInsetBounds);
890 reply.writeNoException();
891 return true;
892 }
893
Wale Ogunwaleddc1cb22015-07-25 19:23:04 -0700894 case POSITION_TASK_IN_STACK_TRANSACTION: {
895 data.enforceInterface(IActivityManager.descriptor);
896 int taskId = data.readInt();
897 int stackId = data.readInt();
898 int position = data.readInt();
899 positionTaskInStack(taskId, stackId, position);
900 reply.writeNoException();
901 return true;
902 }
903
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800904 case GET_ALL_STACK_INFOS_TRANSACTION: {
Craig Mautner5ff12102013-05-24 12:50:15 -0700905 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800906 List<StackInfo> list = getAllStackInfos();
Craig Mautner5ff12102013-05-24 12:50:15 -0700907 reply.writeNoException();
908 reply.writeTypedList(list);
909 return true;
910 }
911
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800912 case GET_STACK_INFO_TRANSACTION: {
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700913 data.enforceInterface(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -0800914 int stackId = data.readInt();
915 StackInfo info = getStackInfo(stackId);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -0700916 reply.writeNoException();
917 if (info != null) {
918 reply.writeInt(1);
919 info.writeToParcel(reply, 0);
920 } else {
921 reply.writeInt(0);
922 }
923 return true;
924 }
925
Winson Chung303e1ff2014-03-07 15:06:19 -0800926 case IS_IN_HOME_STACK_TRANSACTION: {
927 data.enforceInterface(IActivityManager.descriptor);
928 int taskId = data.readInt();
929 boolean isInHomeStack = isInHomeStack(taskId);
930 reply.writeNoException();
931 reply.writeInt(isInHomeStack ? 1 : 0);
932 return true;
933 }
934
Craig Mautnercf910b02013-04-23 11:23:27 -0700935 case SET_FOCUSED_STACK_TRANSACTION: {
936 data.enforceInterface(IActivityManager.descriptor);
937 int stackId = data.readInt();
938 setFocusedStack(stackId);
939 reply.writeNoException();
940 return true;
941 }
942
Winson Chungd16c5652015-01-26 16:11:07 -0800943 case GET_FOCUSED_STACK_ID_TRANSACTION: {
944 data.enforceInterface(IActivityManager.descriptor);
945 int focusedStackId = getFocusedStackId();
946 reply.writeNoException();
947 reply.writeInt(focusedStackId);
948 return true;
949 }
950
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700951 case SET_FOCUSED_TASK_TRANSACTION: {
952 data.enforceInterface(IActivityManager.descriptor);
953 int taskId = data.readInt();
Skuhnef36bb0c2015-08-26 14:26:17 -0700954 setFocusedTask(taskId);
Wale Ogunwalee4a0c572015-06-30 08:40:31 -0700955 reply.writeNoException();
956 return true;
957 }
958
Winson Chung740c3ac2014-11-12 16:14:38 -0800959 case REGISTER_TASK_STACK_LISTENER_TRANSACTION: {
960 data.enforceInterface(IActivityManager.descriptor);
961 IBinder token = data.readStrongBinder();
962 registerTaskStackListener(ITaskStackListener.Stub.asInterface(token));
963 reply.writeNoException();
964 return true;
965 }
966
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800967 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
968 data.enforceInterface(IActivityManager.descriptor);
969 IBinder token = data.readStrongBinder();
970 boolean onlyRoot = data.readInt() != 0;
971 int res = token != null
972 ? getTaskForActivity(token, onlyRoot) : -1;
973 reply.writeNoException();
974 reply.writeInt(res);
975 return true;
976 }
977
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800978 case GET_CONTENT_PROVIDER_TRANSACTION: {
979 data.enforceInterface(IActivityManager.descriptor);
980 IBinder b = data.readStrongBinder();
981 IApplicationThread app = ApplicationThreadNative.asInterface(b);
982 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700983 int userId = data.readInt();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -0700984 boolean stable = data.readInt() != 0;
Jeff Sharkey6d515712012-09-20 16:06:08 -0700985 ContentProviderHolder cph = getContentProvider(app, name, userId, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800986 reply.writeNoException();
987 if (cph != null) {
988 reply.writeInt(1);
989 cph.writeToParcel(reply, 0);
990 } else {
991 reply.writeInt(0);
992 }
993 return true;
994 }
995
Svetoslav Ganov25872aa2012-02-03 19:19:09 -0800996 case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
997 data.enforceInterface(IActivityManager.descriptor);
998 String name = data.readString();
Jeff Sharkey6d515712012-09-20 16:06:08 -0700999 int userId = data.readInt();
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08001000 IBinder token = data.readStrongBinder();
Jeff Sharkey6d515712012-09-20 16:06:08 -07001001 ContentProviderHolder cph = getContentProviderExternal(name, userId, token);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08001002 reply.writeNoException();
1003 if (cph != null) {
1004 reply.writeInt(1);
1005 cph.writeToParcel(reply, 0);
1006 } else {
1007 reply.writeInt(0);
1008 }
1009 return true;
1010 }
1011
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001012 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
1013 data.enforceInterface(IActivityManager.descriptor);
1014 IBinder b = data.readStrongBinder();
1015 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1016 ArrayList<ContentProviderHolder> providers =
1017 data.createTypedArrayList(ContentProviderHolder.CREATOR);
1018 publishContentProviders(app, providers);
1019 reply.writeNoException();
1020 return true;
1021 }
1022
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07001023 case REF_CONTENT_PROVIDER_TRANSACTION: {
1024 data.enforceInterface(IActivityManager.descriptor);
1025 IBinder b = data.readStrongBinder();
1026 int stable = data.readInt();
1027 int unstable = data.readInt();
1028 boolean res = refContentProvider(b, stable, unstable);
1029 reply.writeNoException();
1030 reply.writeInt(res ? 1 : 0);
1031 return true;
1032 }
1033
1034 case UNSTABLE_PROVIDER_DIED_TRANSACTION: {
1035 data.enforceInterface(IActivityManager.descriptor);
1036 IBinder b = data.readStrongBinder();
1037 unstableProviderDied(b);
1038 reply.writeNoException();
1039 return true;
1040 }
1041
Jeff Sharkey7aa76012013-09-30 14:26:27 -07001042 case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: {
1043 data.enforceInterface(IActivityManager.descriptor);
1044 IBinder b = data.readStrongBinder();
1045 appNotRespondingViaProvider(b);
1046 reply.writeNoException();
1047 return true;
1048 }
1049
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001050 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
1051 data.enforceInterface(IActivityManager.descriptor);
1052 IBinder b = data.readStrongBinder();
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07001053 boolean stable = data.readInt() != 0;
1054 removeContentProvider(b, stable);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001055 reply.writeNoException();
1056 return true;
1057 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08001058
1059 case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
1060 data.enforceInterface(IActivityManager.descriptor);
1061 String name = data.readString();
1062 IBinder token = data.readStrongBinder();
1063 removeContentProviderExternal(name, token);
1064 reply.writeNoException();
1065 return true;
1066 }
1067
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07001068 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
1069 data.enforceInterface(IActivityManager.descriptor);
1070 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
1071 PendingIntent pi = getRunningServiceControlPanel(comp);
1072 reply.writeNoException();
1073 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
1074 return true;
1075 }
1076
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001077 case START_SERVICE_TRANSACTION: {
1078 data.enforceInterface(IActivityManager.descriptor);
1079 IBinder b = data.readStrongBinder();
1080 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1081 Intent service = Intent.CREATOR.createFromParcel(data);
1082 String resolvedType = data.readString();
Svet Ganov99b60432015-06-27 13:15:22 -07001083 String callingPackage = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -07001084 int userId = data.readInt();
Svet Ganov99b60432015-06-27 13:15:22 -07001085 ComponentName cn = startService(app, service, resolvedType, callingPackage, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001086 reply.writeNoException();
1087 ComponentName.writeToParcel(cn, reply);
1088 return true;
1089 }
1090
1091 case STOP_SERVICE_TRANSACTION: {
1092 data.enforceInterface(IActivityManager.descriptor);
1093 IBinder b = data.readStrongBinder();
1094 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1095 Intent service = Intent.CREATOR.createFromParcel(data);
1096 String resolvedType = data.readString();
Dianne Hackborn7767eac2012-08-23 18:25:40 -07001097 int userId = data.readInt();
1098 int res = stopService(app, service, resolvedType, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001099 reply.writeNoException();
1100 reply.writeInt(res);
1101 return true;
1102 }
1103
1104 case STOP_SERVICE_TOKEN_TRANSACTION: {
1105 data.enforceInterface(IActivityManager.descriptor);
1106 ComponentName className = ComponentName.readFromParcel(data);
1107 IBinder token = data.readStrongBinder();
1108 int startId = data.readInt();
1109 boolean res = stopServiceToken(className, token, startId);
1110 reply.writeNoException();
1111 reply.writeInt(res ? 1 : 0);
1112 return true;
1113 }
1114
1115 case SET_SERVICE_FOREGROUND_TRANSACTION: {
1116 data.enforceInterface(IActivityManager.descriptor);
1117 ComponentName className = ComponentName.readFromParcel(data);
1118 IBinder token = data.readStrongBinder();
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07001119 int id = data.readInt();
1120 Notification notification = null;
1121 if (data.readInt() != 0) {
1122 notification = Notification.CREATOR.createFromParcel(data);
1123 }
Dianne Hackborn67324c92016-04-18 13:55:25 -07001124 int sflags = data.readInt();
1125 setServiceForeground(className, token, id, notification, sflags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001126 reply.writeNoException();
1127 return true;
1128 }
1129
1130 case BIND_SERVICE_TRANSACTION: {
1131 data.enforceInterface(IActivityManager.descriptor);
1132 IBinder b = data.readStrongBinder();
1133 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1134 IBinder token = data.readStrongBinder();
1135 Intent service = Intent.CREATOR.createFromParcel(data);
1136 String resolvedType = data.readString();
1137 b = data.readStrongBinder();
1138 int fl = data.readInt();
Svet Ganov99b60432015-06-27 13:15:22 -07001139 String callingPackage = data.readString();
Amith Yamasani37ce3a82012-02-06 12:04:42 -08001140 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001141 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
Svet Ganov99b60432015-06-27 13:15:22 -07001142 int res = bindService(app, token, service, resolvedType, conn, fl,
1143 callingPackage, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001144 reply.writeNoException();
1145 reply.writeInt(res);
1146 return true;
1147 }
1148
1149 case UNBIND_SERVICE_TRANSACTION: {
1150 data.enforceInterface(IActivityManager.descriptor);
1151 IBinder b = data.readStrongBinder();
1152 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
1153 boolean res = unbindService(conn);
1154 reply.writeNoException();
1155 reply.writeInt(res ? 1 : 0);
1156 return true;
1157 }
1158
1159 case PUBLISH_SERVICE_TRANSACTION: {
1160 data.enforceInterface(IActivityManager.descriptor);
1161 IBinder token = data.readStrongBinder();
1162 Intent intent = Intent.CREATOR.createFromParcel(data);
1163 IBinder service = data.readStrongBinder();
1164 publishService(token, intent, service);
1165 reply.writeNoException();
1166 return true;
1167 }
1168
1169 case UNBIND_FINISHED_TRANSACTION: {
1170 data.enforceInterface(IActivityManager.descriptor);
1171 IBinder token = data.readStrongBinder();
1172 Intent intent = Intent.CREATOR.createFromParcel(data);
1173 boolean doRebind = data.readInt() != 0;
1174 unbindFinished(token, intent, doRebind);
1175 reply.writeNoException();
1176 return true;
1177 }
1178
1179 case SERVICE_DONE_EXECUTING_TRANSACTION: {
1180 data.enforceInterface(IActivityManager.descriptor);
1181 IBinder token = data.readStrongBinder();
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07001182 int type = data.readInt();
1183 int startId = data.readInt();
1184 int res = data.readInt();
1185 serviceDoneExecuting(token, type, startId, res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001186 reply.writeNoException();
1187 return true;
1188 }
1189
1190 case START_INSTRUMENTATION_TRANSACTION: {
1191 data.enforceInterface(IActivityManager.descriptor);
1192 ComponentName className = ComponentName.readFromParcel(data);
1193 String profileFile = data.readString();
1194 int fl = data.readInt();
1195 Bundle arguments = data.readBundle();
1196 IBinder b = data.readStrongBinder();
1197 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08001198 b = data.readStrongBinder();
1199 IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001200 int userId = data.readInt();
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01001201 String abiOverride = data.readString();
1202 boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId,
1203 abiOverride);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001204 reply.writeNoException();
1205 reply.writeInt(res ? 1 : 0);
1206 return true;
1207 }
1208
1209
1210 case FINISH_INSTRUMENTATION_TRANSACTION: {
1211 data.enforceInterface(IActivityManager.descriptor);
1212 IBinder b = data.readStrongBinder();
1213 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1214 int resultCode = data.readInt();
1215 Bundle results = data.readBundle();
1216 finishInstrumentation(app, resultCode, results);
1217 reply.writeNoException();
1218 return true;
1219 }
1220
1221 case GET_CONFIGURATION_TRANSACTION: {
1222 data.enforceInterface(IActivityManager.descriptor);
1223 Configuration config = getConfiguration();
1224 reply.writeNoException();
1225 config.writeToParcel(reply, 0);
1226 return true;
1227 }
1228
1229 case UPDATE_CONFIGURATION_TRANSACTION: {
1230 data.enforceInterface(IActivityManager.descriptor);
1231 Configuration config = Configuration.CREATOR.createFromParcel(data);
Wale Ogunwale02896ab2016-10-05 09:08:43 -07001232 final boolean updated = updateConfiguration(config);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001233 reply.writeNoException();
Wale Ogunwale02896ab2016-10-05 09:08:43 -07001234 reply.writeInt(updated ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001235 return true;
1236 }
1237
1238 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
1239 data.enforceInterface(IActivityManager.descriptor);
1240 IBinder token = data.readStrongBinder();
1241 int requestedOrientation = data.readInt();
1242 setRequestedOrientation(token, requestedOrientation);
1243 reply.writeNoException();
1244 return true;
1245 }
1246
1247 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
1248 data.enforceInterface(IActivityManager.descriptor);
1249 IBinder token = data.readStrongBinder();
1250 int req = getRequestedOrientation(token);
1251 reply.writeNoException();
1252 reply.writeInt(req);
1253 return true;
1254 }
1255
1256 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
1257 data.enforceInterface(IActivityManager.descriptor);
1258 IBinder token = data.readStrongBinder();
1259 ComponentName cn = getActivityClassForToken(token);
1260 reply.writeNoException();
1261 ComponentName.writeToParcel(cn, reply);
1262 return true;
1263 }
1264
1265 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
1266 data.enforceInterface(IActivityManager.descriptor);
1267 IBinder token = data.readStrongBinder();
1268 reply.writeNoException();
1269 reply.writeString(getPackageForToken(token));
1270 return true;
1271 }
1272
1273 case GET_INTENT_SENDER_TRANSACTION: {
1274 data.enforceInterface(IActivityManager.descriptor);
1275 int type = data.readInt();
1276 String packageName = data.readString();
1277 IBinder token = data.readStrongBinder();
1278 String resultWho = data.readString();
1279 int requestCode = data.readInt();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001280 Intent[] requestIntents;
1281 String[] requestResolvedTypes;
1282 if (data.readInt() != 0) {
1283 requestIntents = data.createTypedArray(Intent.CREATOR);
1284 requestResolvedTypes = data.createStringArray();
1285 } else {
1286 requestIntents = null;
1287 requestResolvedTypes = null;
1288 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001289 int fl = data.readInt();
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07001290 Bundle options = data.readInt() != 0
1291 ? Bundle.CREATOR.createFromParcel(data) : null;
Dianne Hackborn41203752012-08-31 14:05:51 -07001292 int userId = data.readInt();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001293 IIntentSender res = getIntentSender(type, packageName, token,
Dianne Hackborn621e17d2010-11-22 15:59:56 -08001294 resultWho, requestCode, requestIntents,
Dianne Hackborn41203752012-08-31 14:05:51 -07001295 requestResolvedTypes, fl, options, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001296 reply.writeNoException();
1297 reply.writeStrongBinder(res != null ? res.asBinder() : null);
1298 return true;
1299 }
1300
1301 case CANCEL_INTENT_SENDER_TRANSACTION: {
1302 data.enforceInterface(IActivityManager.descriptor);
1303 IIntentSender r = IIntentSender.Stub.asInterface(
1304 data.readStrongBinder());
1305 cancelIntentSender(r);
1306 reply.writeNoException();
1307 return true;
1308 }
1309
1310 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
1311 data.enforceInterface(IActivityManager.descriptor);
1312 IIntentSender r = IIntentSender.Stub.asInterface(
1313 data.readStrongBinder());
1314 String res = getPackageForIntentSender(r);
1315 reply.writeNoException();
1316 reply.writeString(res);
1317 return true;
1318 }
1319
Christopher Tatec4a07d12012-04-06 14:19:13 -07001320 case GET_UID_FOR_INTENT_SENDER_TRANSACTION: {
1321 data.enforceInterface(IActivityManager.descriptor);
1322 IIntentSender r = IIntentSender.Stub.asInterface(
1323 data.readStrongBinder());
1324 int res = getUidForIntentSender(r);
1325 reply.writeNoException();
1326 reply.writeInt(res);
1327 return true;
1328 }
1329
Dianne Hackborn41203752012-08-31 14:05:51 -07001330 case HANDLE_INCOMING_USER_TRANSACTION: {
1331 data.enforceInterface(IActivityManager.descriptor);
1332 int callingPid = data.readInt();
1333 int callingUid = data.readInt();
1334 int userId = data.readInt();
1335 boolean allowAll = data.readInt() != 0 ;
1336 boolean requireFull = data.readInt() != 0;
1337 String name = data.readString();
1338 String callerPackage = data.readString();
1339 int res = handleIncomingUser(callingPid, callingUid, userId, allowAll,
1340 requireFull, name, callerPackage);
1341 reply.writeNoException();
1342 reply.writeInt(res);
1343 return true;
1344 }
1345
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001346 case SET_PROCESS_LIMIT_TRANSACTION: {
1347 data.enforceInterface(IActivityManager.descriptor);
1348 int max = data.readInt();
1349 setProcessLimit(max);
1350 reply.writeNoException();
1351 return true;
1352 }
1353
1354 case GET_PROCESS_LIMIT_TRANSACTION: {
1355 data.enforceInterface(IActivityManager.descriptor);
1356 int limit = getProcessLimit();
1357 reply.writeNoException();
1358 reply.writeInt(limit);
1359 return true;
1360 }
1361
1362 case SET_PROCESS_FOREGROUND_TRANSACTION: {
1363 data.enforceInterface(IActivityManager.descriptor);
1364 IBinder token = data.readStrongBinder();
1365 int pid = data.readInt();
1366 boolean isForeground = data.readInt() != 0;
1367 setProcessForeground(token, pid, isForeground);
1368 reply.writeNoException();
1369 return true;
1370 }
1371
1372 case CHECK_PERMISSION_TRANSACTION: {
1373 data.enforceInterface(IActivityManager.descriptor);
1374 String perm = data.readString();
1375 int pid = data.readInt();
1376 int uid = data.readInt();
1377 int res = checkPermission(perm, pid, uid);
1378 reply.writeNoException();
1379 reply.writeInt(res);
1380 return true;
1381 }
1382
Dianne Hackbornff170242014-11-19 10:59:01 -08001383 case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: {
1384 data.enforceInterface(IActivityManager.descriptor);
1385 String perm = data.readString();
1386 int pid = data.readInt();
1387 int uid = data.readInt();
1388 IBinder token = data.readStrongBinder();
1389 int res = checkPermissionWithToken(perm, pid, uid, token);
1390 reply.writeNoException();
1391 reply.writeInt(res);
1392 return true;
1393 }
1394
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001395 case CHECK_URI_PERMISSION_TRANSACTION: {
1396 data.enforceInterface(IActivityManager.descriptor);
1397 Uri uri = Uri.CREATOR.createFromParcel(data);
1398 int pid = data.readInt();
1399 int uid = data.readInt();
1400 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001401 int userId = data.readInt();
Dianne Hackbornff170242014-11-19 10:59:01 -08001402 IBinder callerToken = data.readStrongBinder();
1403 int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001404 reply.writeNoException();
1405 reply.writeInt(res);
1406 return true;
1407 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001408
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001409 case CLEAR_APP_DATA_TRANSACTION: {
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001410 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001411 String packageName = data.readString();
1412 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
1413 data.readStrongBinder());
Amith Yamasani742a6712011-05-04 14:49:28 -07001414 int userId = data.readInt();
1415 boolean res = clearApplicationUserData(packageName, observer, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001416 reply.writeNoException();
1417 reply.writeInt(res ? 1 : 0);
1418 return true;
1419 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001420
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001421 case GRANT_URI_PERMISSION_TRANSACTION: {
1422 data.enforceInterface(IActivityManager.descriptor);
1423 IBinder b = data.readStrongBinder();
1424 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1425 String targetPkg = data.readString();
1426 Uri uri = Uri.CREATOR.createFromParcel(data);
1427 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001428 int userId = data.readInt();
1429 grantUriPermission(app, targetPkg, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001430 reply.writeNoException();
1431 return true;
1432 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001433
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001434 case REVOKE_URI_PERMISSION_TRANSACTION: {
1435 data.enforceInterface(IActivityManager.descriptor);
1436 IBinder b = data.readStrongBinder();
1437 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1438 Uri uri = Uri.CREATOR.createFromParcel(data);
1439 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001440 int userId = data.readInt();
1441 revokeUriPermission(app, uri, mode, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001442 reply.writeNoException();
1443 return true;
1444 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001445
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001446 case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1447 data.enforceInterface(IActivityManager.descriptor);
1448 Uri uri = Uri.CREATOR.createFromParcel(data);
1449 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001450 int userId = data.readInt();
1451 takePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001452 reply.writeNoException();
1453 return true;
1454 }
1455
1456 case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1457 data.enforceInterface(IActivityManager.descriptor);
1458 Uri uri = Uri.CREATOR.createFromParcel(data);
1459 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01001460 int userId = data.readInt();
1461 releasePersistableUriPermission(uri, mode, userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001462 reply.writeNoException();
1463 return true;
1464 }
1465
1466 case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: {
1467 data.enforceInterface(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07001468 final String packageName = data.readString();
1469 final boolean incoming = data.readInt() != 0;
1470 final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions(
1471 packageName, incoming);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07001472 reply.writeNoException();
1473 perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1474 return true;
1475 }
1476
Felipe Lemef3fa0f82016-01-07 12:08:19 -08001477 case GET_GRANTED_URI_PERMISSIONS_TRANSACTION: {
1478 data.enforceInterface(IActivityManager.descriptor);
1479 final String packageName = data.readString();
1480 final int userId = data.readInt();
1481 final ParceledListSlice<UriPermission> perms = getGrantedUriPermissions(packageName,
1482 userId);
1483 reply.writeNoException();
1484 perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1485 return true;
1486 }
1487
1488 case CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION: {
1489 data.enforceInterface(IActivityManager.descriptor);
1490 final String packageName = data.readString();
1491 final int userId = data.readInt();
1492 clearGrantedUriPermissions(packageName, userId);
1493 reply.writeNoException();
1494 return true;
1495 }
1496
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001497 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
1498 data.enforceInterface(IActivityManager.descriptor);
1499 IBinder b = data.readStrongBinder();
1500 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1501 boolean waiting = data.readInt() != 0;
1502 showWaitingForDebugger(app, waiting);
1503 reply.writeNoException();
1504 return true;
1505 }
1506
1507 case GET_MEMORY_INFO_TRANSACTION: {
1508 data.enforceInterface(IActivityManager.descriptor);
1509 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
1510 getMemoryInfo(mi);
1511 reply.writeNoException();
1512 mi.writeToParcel(reply, 0);
1513 return true;
1514 }
1515
1516 case UNHANDLED_BACK_TRANSACTION: {
1517 data.enforceInterface(IActivityManager.descriptor);
1518 unhandledBack();
1519 reply.writeNoException();
1520 return true;
1521 }
1522
1523 case OPEN_CONTENT_URI_TRANSACTION: {
1524 data.enforceInterface(IActivityManager.descriptor);
1525 Uri uri = Uri.parse(data.readString());
1526 ParcelFileDescriptor pfd = openContentUri(uri);
1527 reply.writeNoException();
1528 if (pfd != null) {
1529 reply.writeInt(1);
1530 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1531 } else {
1532 reply.writeInt(0);
1533 }
1534 return true;
1535 }
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001536
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001537 case SET_LOCK_SCREEN_SHOWN_TRANSACTION: {
1538 data.enforceInterface(IActivityManager.descriptor);
Wale Ogunwale99732942016-05-06 10:13:14 -07001539 final boolean showing = data.readInt() != 0;
1540 final boolean occluded = data.readInt() != 0;
1541 setLockScreenShown(showing, occluded);
Dianne Hackbornff5b1582012-04-12 17:24:07 -07001542 reply.writeNoException();
1543 return true;
1544 }
1545
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001546 case SET_DEBUG_APP_TRANSACTION: {
1547 data.enforceInterface(IActivityManager.descriptor);
1548 String pn = data.readString();
1549 boolean wfd = data.readInt() != 0;
1550 boolean per = data.readInt() != 0;
1551 setDebugApp(pn, wfd, per);
1552 reply.writeNoException();
1553 return true;
1554 }
1555
1556 case SET_ALWAYS_FINISH_TRANSACTION: {
1557 data.enforceInterface(IActivityManager.descriptor);
1558 boolean enabled = data.readInt() != 0;
1559 setAlwaysFinish(enabled);
1560 reply.writeNoException();
1561 return true;
1562 }
1563
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001564 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001565 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07001566 IActivityController watcher = IActivityController.Stub.asInterface(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001567 data.readStrongBinder());
Dianne Hackborn4a18c262016-02-26 17:23:48 -08001568 boolean imAMonkey = data.readInt() != 0;
1569 setActivityController(watcher, imAMonkey);
Sungmin Choicdb86bb2012-12-20 14:08:59 +09001570 reply.writeNoException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001571 return true;
1572 }
1573
Dianne Hackbornb2117d12016-02-16 18:26:35 -08001574 case SET_LENIENT_BACKGROUND_CHECK_TRANSACTION: {
1575 data.enforceInterface(IActivityManager.descriptor);
1576 boolean enabled = data.readInt() != 0;
1577 setLenientBackgroundCheck(enabled);
1578 reply.writeNoException();
1579 return true;
1580 }
1581
Dianne Hackborn970510b2016-02-24 16:56:42 -08001582 case GET_MEMORY_TRIM_LEVEL_TRANSACTION: {
1583 data.enforceInterface(IActivityManager.descriptor);
1584 int level = getMemoryTrimLevel();
1585 reply.writeNoException();
1586 reply.writeInt(level);
1587 return true;
1588 }
1589
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001590 case ENTER_SAFE_MODE_TRANSACTION: {
1591 data.enforceInterface(IActivityManager.descriptor);
1592 enterSafeMode();
1593 reply.writeNoException();
1594 return true;
1595 }
1596
1597 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1598 data.enforceInterface(IActivityManager.descriptor);
1599 IIntentSender is = IIntentSender.Stub.asInterface(
1600 data.readStrongBinder());
Dianne Hackborn099bc622014-01-22 13:39:16 -08001601 int sourceUid = data.readInt();
1602 String sourcePkg = data.readString();
Dianne Hackborn1e383822015-04-10 14:02:33 -07001603 String tag = data.readString();
1604 noteWakeupAlarm(is, sourceUid, sourcePkg, tag);
1605 reply.writeNoException();
1606 return true;
1607 }
1608
1609 case NOTE_ALARM_START_TRANSACTION: {
1610 data.enforceInterface(IActivityManager.descriptor);
1611 IIntentSender is = IIntentSender.Stub.asInterface(
1612 data.readStrongBinder());
1613 int sourceUid = data.readInt();
1614 String tag = data.readString();
1615 noteAlarmStart(is, sourceUid, tag);
1616 reply.writeNoException();
1617 return true;
1618 }
1619
1620 case NOTE_ALARM_FINISH_TRANSACTION: {
1621 data.enforceInterface(IActivityManager.descriptor);
1622 IIntentSender is = IIntentSender.Stub.asInterface(
1623 data.readStrongBinder());
1624 int sourceUid = data.readInt();
1625 String tag = data.readString();
1626 noteAlarmFinish(is, sourceUid, tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001627 reply.writeNoException();
1628 return true;
1629 }
1630
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001631 case KILL_PIDS_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001632 data.enforceInterface(IActivityManager.descriptor);
1633 int[] pids = data.createIntArray();
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07001634 String reason = data.readString();
Dianne Hackborn64825172011-03-02 21:32:58 -08001635 boolean secure = data.readInt() != 0;
1636 boolean res = killPids(pids, reason, secure);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001637 reply.writeNoException();
1638 reply.writeInt(res ? 1 : 0);
1639 return true;
1640 }
1641
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07001642 case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: {
1643 data.enforceInterface(IActivityManager.descriptor);
1644 String reason = data.readString();
1645 boolean res = killProcessesBelowForeground(reason);
1646 reply.writeNoException();
1647 reply.writeInt(res ? 1 : 0);
1648 return true;
1649 }
1650
Dan Egnor60d87622009-12-16 16:32:58 -08001651 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1652 data.enforceInterface(IActivityManager.descriptor);
1653 IBinder app = data.readStrongBinder();
1654 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1655 handleApplicationCrash(app, ci);
1656 reply.writeNoException();
1657 return true;
1658 }
1659
1660 case HANDLE_APPLICATION_WTF_TRANSACTION: {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001661 data.enforceInterface(IActivityManager.descriptor);
1662 IBinder app = data.readStrongBinder();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001663 String tag = data.readString();
Dianne Hackborn52322712014-08-26 22:47:26 -07001664 boolean system = data.readInt() != 0;
Dan Egnorb7f03672009-12-09 16:22:32 -08001665 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
Dianne Hackborn52322712014-08-26 22:47:26 -07001666 boolean res = handleApplicationWtf(app, tag, system, ci);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001667 reply.writeNoException();
Dan Egnor60d87622009-12-16 16:32:58 -08001668 reply.writeInt(res ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001669 return true;
1670 }
Dan Egnorb7f03672009-12-09 16:22:32 -08001671
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001672 case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: {
1673 data.enforceInterface(IActivityManager.descriptor);
1674 IBinder app = data.readStrongBinder();
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07001675 int violationMask = data.readInt();
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07001676 StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data);
1677 handleApplicationStrictModeViolation(app, violationMask, info);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07001678 reply.writeNoException();
1679 return true;
1680 }
1681
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001682 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1683 data.enforceInterface(IActivityManager.descriptor);
1684 int sig = data.readInt();
1685 signalPersistentProcesses(sig);
1686 reply.writeNoException();
1687 return true;
1688 }
1689
Dianne Hackborn03abb812010-01-04 18:43:19 -08001690 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1691 data.enforceInterface(IActivityManager.descriptor);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001692 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001693 int userId = data.readInt();
1694 killBackgroundProcesses(packageName, userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08001695 reply.writeNoException();
1696 return true;
1697 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08001698
1699 case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
1700 data.enforceInterface(IActivityManager.descriptor);
1701 killAllBackgroundProcesses();
1702 reply.writeNoException();
1703 return true;
1704 }
Craig Mautner4cd0c13f2013-04-16 15:55:52 -07001705
Gustav Sennton6258dcd2015-10-30 19:25:37 +00001706 case KILL_PACKAGE_DEPENDENTS_TRANSACTION: {
1707 data.enforceInterface(IActivityManager.descriptor);
1708 String packageName = data.readString();
1709 int userId = data.readInt();
1710 killPackageDependents(packageName, userId);
1711 reply.writeNoException();
1712 return true;
1713 }
1714
Dianne Hackborn03abb812010-01-04 18:43:19 -08001715 case FORCE_STOP_PACKAGE_TRANSACTION: {
1716 data.enforceInterface(IActivityManager.descriptor);
1717 String packageName = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001718 int userId = data.readInt();
1719 forceStopPackage(packageName, userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001720 reply.writeNoException();
1721 return true;
1722 }
Dianne Hackborn27ff9132012-03-06 14:57:58 -08001723
1724 case GET_MY_MEMORY_STATE_TRANSACTION: {
1725 data.enforceInterface(IActivityManager.descriptor);
1726 ActivityManager.RunningAppProcessInfo info =
1727 new ActivityManager.RunningAppProcessInfo();
1728 getMyMemoryState(info);
1729 reply.writeNoException();
1730 info.writeToParcel(reply, 0);
1731 return true;
1732 }
1733
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001734 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1735 data.enforceInterface(IActivityManager.descriptor);
1736 ConfigurationInfo config = getDeviceConfigurationInfo();
1737 reply.writeNoException();
1738 config.writeToParcel(reply, 0);
1739 return true;
1740 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001741
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001742 case PROFILE_CONTROL_TRANSACTION: {
1743 data.enforceInterface(IActivityManager.descriptor);
1744 String process = data.readString();
Dianne Hackborn1676c852012-09-10 14:52:30 -07001745 int userId = data.readInt();
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001746 boolean start = data.readInt() != 0;
Romain Guy9a8c5ce2011-07-21 18:04:29 -07001747 int profileType = data.readInt();
Jeff Hao1b012d32014-08-20 10:35:34 -07001748 ProfilerInfo profilerInfo = data.readInt() != 0
1749 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
1750 boolean res = profileControl(process, userId, start, profilerInfo, profileType);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08001751 reply.writeNoException();
1752 reply.writeInt(res ? 1 : 0);
1753 return true;
1754 }
Jeff Hao1b012d32014-08-20 10:35:34 -07001755
Dianne Hackborn55280a92009-05-07 15:53:46 -07001756 case SHUTDOWN_TRANSACTION: {
1757 data.enforceInterface(IActivityManager.descriptor);
1758 boolean res = shutdown(data.readInt());
1759 reply.writeNoException();
1760 reply.writeInt(res ? 1 : 0);
1761 return true;
1762 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001763
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001764 case STOP_APP_SWITCHES_TRANSACTION: {
1765 data.enforceInterface(IActivityManager.descriptor);
1766 stopAppSwitches();
1767 reply.writeNoException();
1768 return true;
1769 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001770
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07001771 case RESUME_APP_SWITCHES_TRANSACTION: {
1772 data.enforceInterface(IActivityManager.descriptor);
1773 resumeAppSwitches();
1774 reply.writeNoException();
1775 return true;
1776 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001777
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001778 case PEEK_SERVICE_TRANSACTION: {
1779 data.enforceInterface(IActivityManager.descriptor);
1780 Intent service = Intent.CREATOR.createFromParcel(data);
1781 String resolvedType = data.readString();
Svet Ganov99b60432015-06-27 13:15:22 -07001782 String callingPackage = data.readString();
1783 IBinder binder = peekService(service, resolvedType, callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001784 reply.writeNoException();
1785 reply.writeStrongBinder(binder);
1786 return true;
1787 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001788
Christopher Tate181fafa2009-05-14 11:12:14 -07001789 case START_BACKUP_AGENT_TRANSACTION: {
1790 data.enforceInterface(IActivityManager.descriptor);
Christopher Tatec58054f2016-06-13 15:17:54 -07001791 String packageName = data.readString();
Christopher Tate181fafa2009-05-14 11:12:14 -07001792 int backupRestoreMode = data.readInt();
Christopher Tatec58054f2016-06-13 15:17:54 -07001793 int userId = data.readInt();
1794 boolean success = bindBackupAgent(packageName, backupRestoreMode, userId);
Christopher Tate181fafa2009-05-14 11:12:14 -07001795 reply.writeNoException();
1796 reply.writeInt(success ? 1 : 0);
1797 return true;
1798 }
1799
1800 case BACKUP_AGENT_CREATED_TRANSACTION: {
1801 data.enforceInterface(IActivityManager.descriptor);
1802 String packageName = data.readString();
1803 IBinder agent = data.readStrongBinder();
1804 backupAgentCreated(packageName, agent);
1805 reply.writeNoException();
1806 return true;
1807 }
1808
1809 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1810 data.enforceInterface(IActivityManager.descriptor);
1811 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1812 unbindBackupAgent(info);
1813 reply.writeNoException();
1814 return true;
1815 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001816
1817 case ADD_PACKAGE_DEPENDENCY_TRANSACTION: {
1818 data.enforceInterface(IActivityManager.descriptor);
1819 String packageName = data.readString();
1820 addPackageDependency(packageName);
1821 reply.writeNoException();
1822 return true;
1823 }
1824
Jeff Sharkey85f449e2016-06-23 09:26:00 -06001825 case KILL_APPLICATION_TRANSACTION: {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001826 data.enforceInterface(IActivityManager.descriptor);
1827 String pkg = data.readString();
Jeff Sharkey85f449e2016-06-23 09:26:00 -06001828 int appId = data.readInt();
1829 int userId = data.readInt();
Dianne Hackborn21d9b562013-05-28 17:46:59 -07001830 String reason = data.readString();
Jeff Sharkey85f449e2016-06-23 09:26:00 -06001831 killApplication(pkg, appId, userId, reason);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07001832 reply.writeNoException();
1833 return true;
1834 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07001835
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07001836 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1837 data.enforceInterface(IActivityManager.descriptor);
1838 String reason = data.readString();
1839 closeSystemDialogs(reason);
1840 reply.writeNoException();
1841 return true;
1842 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001843
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001844 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1845 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001846 int[] pids = data.createIntArray();
1847 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001848 reply.writeNoException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07001849 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07001850 return true;
1851 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07001852
1853 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1854 data.enforceInterface(IActivityManager.descriptor);
1855 String processName = data.readString();
1856 int uid = data.readInt();
1857 killApplicationProcess(processName, uid);
1858 reply.writeNoException();
1859 return true;
1860 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001861
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001862 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1863 data.enforceInterface(IActivityManager.descriptor);
1864 IBinder token = data.readStrongBinder();
1865 String packageName = data.readString();
1866 int enterAnim = data.readInt();
1867 int exitAnim = data.readInt();
1868 overridePendingTransition(token, packageName, enterAnim, exitAnim);
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001869 reply.writeNoException();
1870 return true;
1871 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001872
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001873 case IS_USER_A_MONKEY_TRANSACTION: {
1874 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001875 boolean areThey = isUserAMonkey();
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08001876 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001877 reply.writeInt(areThey ? 1 : 0);
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07001878 return true;
1879 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001880
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07001881 case SET_USER_IS_MONKEY_TRANSACTION: {
1882 data.enforceInterface(IActivityManager.descriptor);
1883 final boolean monkey = (data.readInt() == 1);
1884 setUserIsMonkey(monkey);
1885 reply.writeNoException();
1886 return true;
1887 }
1888
Dianne Hackborn860755f2010-06-03 18:47:52 -07001889 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1890 data.enforceInterface(IActivityManager.descriptor);
1891 finishHeavyWeightApp();
1892 reply.writeNoException();
1893 return true;
1894 }
Daniel Sandler69a48172010-06-23 16:29:36 -04001895
1896 case IS_IMMERSIVE_TRANSACTION: {
1897 data.enforceInterface(IActivityManager.descriptor);
1898 IBinder token = data.readStrongBinder();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001899 boolean isit = isImmersive(token);
Daniel Sandler69a48172010-06-23 16:29:36 -04001900 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001901 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001902 return true;
1903 }
1904
Craig Mautnerd61dc202014-07-07 11:09:11 -07001905 case IS_TOP_OF_TASK_TRANSACTION: {
1906 data.enforceInterface(IActivityManager.descriptor);
1907 IBinder token = data.readStrongBinder();
1908 final boolean isTopOfTask = isTopOfTask(token);
1909 reply.writeNoException();
1910 reply.writeInt(isTopOfTask ? 1 : 0);
1911 return true;
1912 }
1913
Craig Mautner5eda9b32013-07-02 11:58:16 -07001914 case CONVERT_FROM_TRANSLUCENT_TRANSACTION: {
Craig Mautner4addfc52013-06-25 08:05:45 -07001915 data.enforceInterface(IActivityManager.descriptor);
1916 IBinder token = data.readStrongBinder();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001917 boolean converted = convertFromTranslucent(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001918 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001919 reply.writeInt(converted ? 1 : 0);
Craig Mautner5eda9b32013-07-02 11:58:16 -07001920 return true;
1921 }
1922
1923 case CONVERT_TO_TRANSLUCENT_TRANSACTION: {
1924 data.enforceInterface(IActivityManager.descriptor);
1925 IBinder token = data.readStrongBinder();
Craig Mautner233ceee2014-05-09 17:05:11 -07001926 final Bundle bundle;
1927 if (data.readInt() == 0) {
1928 bundle = null;
1929 } else {
1930 bundle = data.readBundle();
1931 }
Chong Zhang280d3322015-11-03 17:27:26 -08001932 final ActivityOptions options = ActivityOptions.fromBundle(bundle);
Craig Mautner233ceee2014-05-09 17:05:11 -07001933 boolean converted = convertToTranslucent(token, options);
Craig Mautner4addfc52013-06-25 08:05:45 -07001934 reply.writeNoException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07001935 reply.writeInt(converted ? 1 : 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07001936 return true;
1937 }
1938
Craig Mautner233ceee2014-05-09 17:05:11 -07001939 case GET_ACTIVITY_OPTIONS_TRANSACTION: {
1940 data.enforceInterface(IActivityManager.descriptor);
1941 IBinder token = data.readStrongBinder();
1942 final ActivityOptions options = getActivityOptions(token);
1943 reply.writeNoException();
1944 reply.writeBundle(options == null ? null : options.toBundle());
1945 return true;
1946 }
1947
Daniel Sandler69a48172010-06-23 16:29:36 -04001948 case SET_IMMERSIVE_TRANSACTION: {
1949 data.enforceInterface(IActivityManager.descriptor);
1950 IBinder token = data.readStrongBinder();
1951 boolean imm = data.readInt() == 1;
1952 setImmersive(token, imm);
1953 reply.writeNoException();
1954 return true;
1955 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07001956
Daniel Sandler69a48172010-06-23 16:29:36 -04001957 case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
1958 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn7e269642010-08-25 19:50:20 -07001959 boolean isit = isTopActivityImmersive();
Daniel Sandler69a48172010-06-23 16:29:36 -04001960 reply.writeNoException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07001961 reply.writeInt(isit ? 1 : 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04001962 return true;
1963 }
1964
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07001965 case CRASH_APPLICATION_TRANSACTION: {
1966 data.enforceInterface(IActivityManager.descriptor);
1967 int uid = data.readInt();
1968 int initialPid = data.readInt();
1969 String packageName = data.readString();
1970 String message = data.readString();
1971 crashApplication(uid, initialPid, packageName, message);
1972 reply.writeNoException();
1973 return true;
1974 }
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001975
1976 case GET_PROVIDER_MIME_TYPE_TRANSACTION: {
1977 data.enforceInterface(IActivityManager.descriptor);
1978 Uri uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07001979 int userId = data.readInt();
1980 String type = getProviderMimeType(uri, userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07001981 reply.writeNoException();
1982 reply.writeString(type);
1983 return true;
1984 }
1985
Dianne Hackborn7e269642010-08-25 19:50:20 -07001986 case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
1987 data.enforceInterface(IActivityManager.descriptor);
1988 String name = data.readString();
1989 IBinder perm = newUriPermissionOwner(name);
1990 reply.writeNoException();
1991 reply.writeStrongBinder(perm);
1992 return true;
1993 }
1994
Vladislav Kaznacheevb23a7572015-12-18 12:23:43 -08001995 case GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION: {
1996 data.enforceInterface(IActivityManager.descriptor);
1997 IBinder activityToken = data.readStrongBinder();
1998 IBinder perm = getUriPermissionOwnerForActivity(activityToken);
1999 reply.writeNoException();
2000 reply.writeStrongBinder(perm);
2001 return true;
2002 }
2003
Dianne Hackborn7e269642010-08-25 19:50:20 -07002004 case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
2005 data.enforceInterface(IActivityManager.descriptor);
2006 IBinder owner = data.readStrongBinder();
2007 int fromUid = data.readInt();
2008 String targetPkg = data.readString();
2009 Uri uri = Uri.CREATOR.createFromParcel(data);
2010 int mode = data.readInt();
Nicolas Prevotf1939902014-06-25 09:29:02 +01002011 int sourceUserId = data.readInt();
2012 int targetUserId = data.readInt();
2013 grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId,
2014 targetUserId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07002015 reply.writeNoException();
2016 return true;
2017 }
2018
2019 case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
2020 data.enforceInterface(IActivityManager.descriptor);
2021 IBinder owner = data.readStrongBinder();
2022 Uri uri = null;
2023 if (data.readInt() != 0) {
Nicolas Prevotd85fc722014-04-16 19:52:08 +01002024 uri = Uri.CREATOR.createFromParcel(data);
Dianne Hackborn7e269642010-08-25 19:50:20 -07002025 }
2026 int mode = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01002027 int userId = data.readInt();
2028 revokeUriPermissionFromOwner(owner, uri, mode, userId);
Dianne Hackborn7e269642010-08-25 19:50:20 -07002029 reply.writeNoException();
2030 return true;
2031 }
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07002032
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07002033 case CHECK_GRANT_URI_PERMISSION_TRANSACTION: {
2034 data.enforceInterface(IActivityManager.descriptor);
2035 int callingUid = data.readInt();
2036 String targetPkg = data.readString();
2037 Uri uri = Uri.CREATOR.createFromParcel(data);
2038 int modeFlags = data.readInt();
Nicolas Prevotd85fc722014-04-16 19:52:08 +01002039 int userId = data.readInt();
2040 int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07002041 reply.writeNoException();
2042 reply.writeInt(res);
2043 return true;
2044 }
2045
Andy McFadden824c5102010-07-09 16:26:57 -07002046 case DUMP_HEAP_TRANSACTION: {
2047 data.enforceInterface(IActivityManager.descriptor);
2048 String process = data.readString();
Dianne Hackbornb12e1352012-09-26 11:39:20 -07002049 int userId = data.readInt();
Andy McFadden824c5102010-07-09 16:26:57 -07002050 boolean managed = data.readInt() != 0;
2051 String path = data.readString();
2052 ParcelFileDescriptor fd = data.readInt() != 0
Amith Yamasanic2be0d62013-09-23 11:16:28 -07002053 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
Dianne Hackborn1676c852012-09-10 14:52:30 -07002054 boolean res = dumpHeap(process, userId, managed, path, fd);
Andy McFadden824c5102010-07-09 16:26:57 -07002055 reply.writeNoException();
2056 reply.writeInt(res ? 1 : 0);
2057 return true;
2058 }
2059
Dianne Hackborn621e17d2010-11-22 15:59:56 -08002060 case START_ACTIVITIES_TRANSACTION:
2061 {
2062 data.enforceInterface(IActivityManager.descriptor);
2063 IBinder b = data.readStrongBinder();
2064 IApplicationThread app = ApplicationThreadNative.asInterface(b);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002065 String callingPackage = data.readString();
Dianne Hackborn621e17d2010-11-22 15:59:56 -08002066 Intent[] intents = data.createTypedArray(Intent.CREATOR);
2067 String[] resolvedTypes = data.createStringArray();
2068 IBinder resultTo = data.readStrongBinder();
Dianne Hackborna4972e92012-03-14 10:38:05 -07002069 Bundle options = data.readInt() != 0
2070 ? Bundle.CREATOR.createFromParcel(data) : null;
Amith Yamasaniea7e9152012-09-24 16:11:18 -07002071 int userId = data.readInt();
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002072 int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07002073 options, userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08002074 reply.writeNoException();
2075 reply.writeInt(result);
2076 return true;
2077 }
2078
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07002079 case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
2080 {
2081 data.enforceInterface(IActivityManager.descriptor);
2082 int mode = getFrontActivityScreenCompatMode();
2083 reply.writeNoException();
2084 reply.writeInt(mode);
2085 return true;
2086 }
2087
2088 case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
2089 {
2090 data.enforceInterface(IActivityManager.descriptor);
2091 int mode = data.readInt();
2092 setFrontActivityScreenCompatMode(mode);
2093 reply.writeNoException();
2094 reply.writeInt(mode);
2095 return true;
2096 }
2097
2098 case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
2099 {
2100 data.enforceInterface(IActivityManager.descriptor);
2101 String pkg = data.readString();
2102 int mode = getPackageScreenCompatMode(pkg);
2103 reply.writeNoException();
2104 reply.writeInt(mode);
2105 return true;
2106 }
2107
Dianne Hackborne2515ee2011-04-27 18:52:56 -04002108 case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
2109 {
2110 data.enforceInterface(IActivityManager.descriptor);
2111 String pkg = data.readString();
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07002112 int mode = data.readInt();
2113 setPackageScreenCompatMode(pkg, mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04002114 reply.writeNoException();
2115 return true;
2116 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07002117
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002118 case SWITCH_USER_TRANSACTION: {
2119 data.enforceInterface(IActivityManager.descriptor);
2120 int userid = data.readInt();
2121 boolean result = switchUser(userid);
2122 reply.writeNoException();
2123 reply.writeInt(result ? 1 : 0);
2124 return true;
2125 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07002126
Kenny Guy08488bf2014-02-21 17:40:37 +00002127 case START_USER_IN_BACKGROUND_TRANSACTION: {
2128 data.enforceInterface(IActivityManager.descriptor);
2129 int userid = data.readInt();
2130 boolean result = startUserInBackground(userid);
2131 reply.writeNoException();
2132 reply.writeInt(result ? 1 : 0);
2133 return true;
2134 }
2135
Jeff Sharkeyba512352015-11-12 20:17:45 -08002136 case UNLOCK_USER_TRANSACTION: {
2137 data.enforceInterface(IActivityManager.descriptor);
2138 int userId = data.readInt();
2139 byte[] token = data.createByteArray();
Paul Crowleyfaeb3eb2016-02-08 15:58:29 +00002140 byte[] secret = data.createByteArray();
Jeff Sharkeybd91e2f2016-03-22 15:32:31 -06002141 IProgressListener listener = IProgressListener.Stub
2142 .asInterface(data.readStrongBinder());
2143 boolean result = unlockUser(userId, token, secret, listener);
Jeff Sharkeyba512352015-11-12 20:17:45 -08002144 reply.writeNoException();
2145 reply.writeInt(result ? 1 : 0);
2146 return true;
2147 }
2148
Dianne Hackborn80a4af22012-08-27 19:18:31 -07002149 case STOP_USER_TRANSACTION: {
2150 data.enforceInterface(IActivityManager.descriptor);
2151 int userid = data.readInt();
Fyodor Kupolov9cbfc9e2015-10-07 15:52:33 -07002152 boolean force = data.readInt() != 0;
Dianne Hackborn80a4af22012-08-27 19:18:31 -07002153 IStopUserCallback callback = IStopUserCallback.Stub.asInterface(
2154 data.readStrongBinder());
Fyodor Kupolov9cbfc9e2015-10-07 15:52:33 -07002155 int result = stopUser(userid, force, callback);
Dianne Hackborn80a4af22012-08-27 19:18:31 -07002156 reply.writeNoException();
2157 reply.writeInt(result);
2158 return true;
2159 }
2160
Amith Yamasani52f1d752012-03-28 18:19:29 -07002161 case GET_CURRENT_USER_TRANSACTION: {
2162 data.enforceInterface(IActivityManager.descriptor);
2163 UserInfo userInfo = getCurrentUser();
2164 reply.writeNoException();
2165 userInfo.writeToParcel(reply, 0);
2166 return true;
2167 }
2168
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002169 case IS_USER_RUNNING_TRANSACTION: {
2170 data.enforceInterface(IActivityManager.descriptor);
2171 int userid = data.readInt();
Jeff Sharkeye17ac152015-11-06 22:40:29 -08002172 int _flags = data.readInt();
2173 boolean result = isUserRunning(userid, _flags);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07002174 reply.writeNoException();
2175 reply.writeInt(result ? 1 : 0);
2176 return true;
2177 }
2178
Dianne Hackbornc72fc672012-09-20 13:12:03 -07002179 case GET_RUNNING_USER_IDS_TRANSACTION: {
2180 data.enforceInterface(IActivityManager.descriptor);
2181 int[] result = getRunningUserIds();
2182 reply.writeNoException();
2183 reply.writeIntArray(result);
2184 return true;
2185 }
2186
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07002187 case REMOVE_TASK_TRANSACTION:
2188 {
2189 data.enforceInterface(IActivityManager.descriptor);
2190 int taskId = data.readInt();
Wale Ogunwaled54b5782014-10-23 15:55:23 -07002191 boolean result = removeTask(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07002192 reply.writeNoException();
2193 reply.writeInt(result ? 1 : 0);
2194 return true;
2195 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002196
Jeff Sharkeya4620792011-05-20 15:29:23 -07002197 case REGISTER_PROCESS_OBSERVER_TRANSACTION: {
2198 data.enforceInterface(IActivityManager.descriptor);
2199 IProcessObserver observer = IProcessObserver.Stub.asInterface(
2200 data.readStrongBinder());
2201 registerProcessObserver(observer);
2202 return true;
2203 }
2204
2205 case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: {
2206 data.enforceInterface(IActivityManager.descriptor);
2207 IProcessObserver observer = IProcessObserver.Stub.asInterface(
2208 data.readStrongBinder());
2209 unregisterProcessObserver(observer);
2210 return true;
2211 }
2212
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07002213 case REGISTER_UID_OBSERVER_TRANSACTION: {
2214 data.enforceInterface(IActivityManager.descriptor);
2215 IUidObserver observer = IUidObserver.Stub.asInterface(
2216 data.readStrongBinder());
Dianne Hackbornbef28fe2015-10-29 17:57:11 -07002217 int which = data.readInt();
2218 registerUidObserver(observer, which);
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07002219 return true;
2220 }
2221
2222 case UNREGISTER_UID_OBSERVER_TRANSACTION: {
2223 data.enforceInterface(IActivityManager.descriptor);
2224 IUidObserver observer = IUidObserver.Stub.asInterface(
2225 data.readStrongBinder());
2226 unregisterUidObserver(observer);
2227 return true;
2228 }
2229
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07002230 case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
2231 {
2232 data.enforceInterface(IActivityManager.descriptor);
2233 String pkg = data.readString();
2234 boolean ask = getPackageAskScreenCompat(pkg);
2235 reply.writeNoException();
2236 reply.writeInt(ask ? 1 : 0);
2237 return true;
2238 }
2239
2240 case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
2241 {
2242 data.enforceInterface(IActivityManager.descriptor);
2243 String pkg = data.readString();
2244 boolean ask = data.readInt() != 0;
2245 setPackageAskScreenCompat(pkg, ask);
2246 reply.writeNoException();
2247 return true;
2248 }
2249
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002250 case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: {
2251 data.enforceInterface(IActivityManager.descriptor);
2252 IIntentSender r = IIntentSender.Stub.asInterface(
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002253 data.readStrongBinder());
Dianne Hackborn6c418d52011-06-29 14:05:33 -07002254 boolean res = isIntentSenderTargetedToPackage(r);
2255 reply.writeNoException();
2256 reply.writeInt(res ? 1 : 0);
2257 return true;
2258 }
2259
Dianne Hackborn1927ae82012-06-22 15:21:36 -07002260 case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: {
2261 data.enforceInterface(IActivityManager.descriptor);
2262 IIntentSender r = IIntentSender.Stub.asInterface(
2263 data.readStrongBinder());
2264 boolean res = isIntentSenderAnActivity(r);
2265 reply.writeNoException();
2266 reply.writeInt(res ? 1 : 0);
2267 return true;
2268 }
2269
Dianne Hackborn81038902012-11-26 17:04:09 -08002270 case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: {
2271 data.enforceInterface(IActivityManager.descriptor);
2272 IIntentSender r = IIntentSender.Stub.asInterface(
2273 data.readStrongBinder());
2274 Intent intent = getIntentForIntentSender(r);
2275 reply.writeNoException();
2276 if (intent != null) {
2277 reply.writeInt(1);
2278 intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2279 } else {
2280 reply.writeInt(0);
2281 }
2282 return true;
2283 }
2284
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08002285 case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: {
2286 data.enforceInterface(IActivityManager.descriptor);
2287 IIntentSender r = IIntentSender.Stub.asInterface(
2288 data.readStrongBinder());
2289 String prefix = data.readString();
2290 String tag = getTagForIntentSender(r, prefix);
2291 reply.writeNoException();
2292 reply.writeString(tag);
2293 return true;
2294 }
2295
Dianne Hackborn31ca8542011-07-19 14:58:28 -07002296 case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
2297 data.enforceInterface(IActivityManager.descriptor);
2298 Configuration config = Configuration.CREATOR.createFromParcel(data);
2299 updatePersistentConfiguration(config);
2300 reply.writeNoException();
2301 return true;
2302 }
2303
Dianne Hackbornb437e092011-08-05 17:50:29 -07002304 case GET_PROCESS_PSS_TRANSACTION: {
2305 data.enforceInterface(IActivityManager.descriptor);
2306 int[] pids = data.createIntArray();
2307 long[] pss = getProcessPss(pids);
2308 reply.writeNoException();
2309 reply.writeLongArray(pss);
2310 return true;
2311 }
2312
Dianne Hackborn661cd522011-08-22 00:26:20 -07002313 case SHOW_BOOT_MESSAGE_TRANSACTION: {
2314 data.enforceInterface(IActivityManager.descriptor);
2315 CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
2316 boolean always = data.readInt() != 0;
2317 showBootMessage(msg, always);
2318 reply.writeNoException();
2319 return true;
2320 }
2321
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002322 case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002323 data.enforceInterface(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02002324 keyguardWaitingForActivityDrawn();
Dianne Hackborn90c52de2011-09-23 12:57:44 -07002325 reply.writeNoException();
2326 return true;
2327 }
2328
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07002329 case KEYGUARD_GOING_AWAY_TRANSACTION: {
2330 data.enforceInterface(IActivityManager.descriptor);
Adrian Roosd5c2db62016-03-08 16:11:31 -08002331 keyguardGoingAway(data.readInt());
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07002332 reply.writeNoException();
2333 return true;
2334 }
2335
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002336 case SHOULD_UP_RECREATE_TASK_TRANSACTION: {
Adam Powelldd8fab22012-03-22 17:47:27 -07002337 data.enforceInterface(IActivityManager.descriptor);
2338 IBinder token = data.readStrongBinder();
2339 String destAffinity = data.readString();
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07002340 boolean res = shouldUpRecreateTask(token, destAffinity);
Adam Powelldd8fab22012-03-22 17:47:27 -07002341 reply.writeNoException();
2342 reply.writeInt(res ? 1 : 0);
2343 return true;
2344 }
2345
2346 case NAVIGATE_UP_TO_TRANSACTION: {
2347 data.enforceInterface(IActivityManager.descriptor);
2348 IBinder token = data.readStrongBinder();
2349 Intent target = Intent.CREATOR.createFromParcel(data);
2350 int resultCode = data.readInt();
2351 Intent resultData = null;
2352 if (data.readInt() != 0) {
2353 resultData = Intent.CREATOR.createFromParcel(data);
2354 }
2355 boolean res = navigateUpTo(token, target, resultCode, resultData);
2356 reply.writeNoException();
2357 reply.writeInt(res ? 1 : 0);
2358 return true;
2359 }
2360
Dianne Hackborn5320eb82012-05-18 12:05:04 -07002361 case GET_LAUNCHED_FROM_UID_TRANSACTION: {
2362 data.enforceInterface(IActivityManager.descriptor);
2363 IBinder token = data.readStrongBinder();
2364 int res = getLaunchedFromUid(token);
2365 reply.writeNoException();
2366 reply.writeInt(res);
2367 return true;
2368 }
2369
Dianne Hackbornf265ea92013-01-31 15:00:51 -08002370 case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: {
2371 data.enforceInterface(IActivityManager.descriptor);
2372 IBinder token = data.readStrongBinder();
2373 String res = getLaunchedFromPackage(token);
2374 reply.writeNoException();
2375 reply.writeString(res);
2376 return true;
2377 }
2378
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002379 case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2380 data.enforceInterface(IActivityManager.descriptor);
2381 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2382 data.readStrongBinder());
Fyodor Kupolov0b77ef92016-06-20 17:16:52 -07002383 String name = data.readString();
2384 registerUserSwitchObserver(observer, name);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002385 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002386 return true;
2387 }
2388
2389 case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2390 data.enforceInterface(IActivityManager.descriptor);
2391 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2392 data.readStrongBinder());
2393 unregisterUserSwitchObserver(observer);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002394 reply.writeNoException();
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07002395 return true;
2396 }
2397
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002398 case REQUEST_BUG_REPORT_TRANSACTION: {
2399 data.enforceInterface(IActivityManager.descriptor);
Michal Karpinski3da5c972015-12-11 18:16:30 +00002400 int bugreportType = data.readInt();
2401 requestBugReport(bugreportType);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002402 reply.writeNoException();
2403 return true;
2404 }
2405
2406 case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: {
2407 data.enforceInterface(IActivityManager.descriptor);
2408 int pid = data.readInt();
2409 boolean aboveSystem = data.readInt() != 0;
Jeff Brownbd181bb2013-09-10 16:44:24 -07002410 String reason = data.readString();
2411 long res = inputDispatchingTimedOut(pid, aboveSystem, reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07002412 reply.writeNoException();
2413 reply.writeLong(res);
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07002414 return true;
2415 }
2416
Adam Skorydfc7fd72013-08-05 19:23:41 -07002417 case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002418 data.enforceInterface(IActivityManager.descriptor);
2419 int requestType = data.readInt();
Adam Skorydfc7fd72013-08-05 19:23:41 -07002420 Bundle res = getAssistContextExtras(requestType);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002421 reply.writeNoException();
2422 reply.writeBundle(res);
2423 return true;
2424 }
2425
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002426 case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
2427 data.enforceInterface(IActivityManager.descriptor);
2428 int requestType = data.readInt();
2429 IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder());
Amith Yamasanie8222e52016-04-08 15:28:47 -07002430 Bundle receiverExtras = data.readBundle();
Dianne Hackborn17f69352015-07-17 18:04:14 -07002431 IBinder activityToken = data.readStrongBinder();
Amith Yamasanie8222e52016-04-08 15:28:47 -07002432 boolean focused = data.readInt() == 1;
Amith Yamasani4f128e42016-05-10 11:44:12 -07002433 boolean newSessionId = data.readInt() == 1;
Amith Yamasanie8222e52016-04-08 15:28:47 -07002434 boolean res = requestAssistContextExtras(requestType, receiver, receiverExtras,
Amith Yamasani4f128e42016-05-10 11:44:12 -07002435 activityToken, focused, newSessionId);
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002436 reply.writeNoException();
Dianne Hackborn17f69352015-07-17 18:04:14 -07002437 reply.writeInt(res ? 1 : 0);
Dianne Hackbornae6688b2015-02-11 17:02:41 -08002438 return true;
2439 }
2440
Adam Skorydfc7fd72013-08-05 19:23:41 -07002441 case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002442 data.enforceInterface(IActivityManager.descriptor);
2443 IBinder token = data.readStrongBinder();
2444 Bundle extras = data.readBundle();
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07002445 AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data);
2446 AssistContent content = AssistContent.CREATOR.createFromParcel(data);
Dianne Hackborna3acdb32015-06-08 17:07:40 -07002447 Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null;
2448 reportAssistContextExtras(token, extras, structure, content, referrer);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08002449 reply.writeNoException();
2450 return true;
2451 }
2452
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002453 case LAUNCH_ASSIST_INTENT_TRANSACTION: {
2454 data.enforceInterface(IActivityManager.descriptor);
2455 Intent intent = Intent.CREATOR.createFromParcel(data);
2456 int requestType = data.readInt();
2457 String hint = data.readString();
2458 int userHandle = data.readInt();
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07002459 Bundle args = data.readBundle();
2460 boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args);
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07002461 reply.writeNoException();
2462 reply.writeInt(res ? 1 : 0);
2463 return true;
2464 }
2465
Benjamin Franzc200f442015-06-25 18:20:04 +01002466 case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: {
2467 data.enforceInterface(IActivityManager.descriptor);
Dianne Hackborn17f69352015-07-17 18:04:14 -07002468 boolean res = isAssistDataAllowedOnCurrentActivity();
2469 reply.writeNoException();
2470 reply.writeInt(res ? 1 : 0);
2471 return true;
2472 }
2473
2474 case SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION: {
2475 data.enforceInterface(IActivityManager.descriptor);
2476 IBinder token = data.readStrongBinder();
2477 Bundle args = data.readBundle();
2478 boolean res = showAssistFromActivity(token, args);
Benjamin Franzc200f442015-06-25 18:20:04 +01002479 reply.writeNoException();
2480 reply.writeInt(res ? 1 : 0);
2481 return true;
2482 }
2483
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002484 case KILL_UID_TRANSACTION: {
2485 data.enforceInterface(IActivityManager.descriptor);
Svetoslavaa41add2015-08-06 15:03:55 -07002486 int appId = data.readInt();
2487 int userId = data.readInt();
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002488 String reason = data.readString();
Svetoslavaa41add2015-08-06 15:03:55 -07002489 killUid(appId, userId, reason);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07002490 reply.writeNoException();
2491 return true;
2492 }
2493
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07002494 case HANG_TRANSACTION: {
2495 data.enforceInterface(IActivityManager.descriptor);
2496 IBinder who = data.readStrongBinder();
2497 boolean allowRestart = data.readInt() != 0;
2498 hang(who, allowRestart);
2499 reply.writeNoException();
2500 return true;
2501 }
2502
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07002503 case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: {
2504 data.enforceInterface(IActivityManager.descriptor);
2505 IBinder token = data.readStrongBinder();
2506 reportActivityFullyDrawn(token);
2507 reply.writeNoException();
2508 return true;
2509 }
2510
Craig Mautner5eda9b32013-07-02 11:58:16 -07002511 case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: {
2512 data.enforceInterface(IActivityManager.descriptor);
2513 IBinder token = data.readStrongBinder();
2514 notifyActivityDrawn(token);
2515 reply.writeNoException();
2516 return true;
2517 }
Dianne Hackborn57a7f592013-07-22 18:21:32 -07002518
2519 case RESTART_TRANSACTION: {
2520 data.enforceInterface(IActivityManager.descriptor);
2521 restart();
2522 reply.writeNoException();
2523 return true;
2524 }
Jeff Sharkey08da7a12013-08-11 20:53:18 -07002525
Dianne Hackborn35f72be2013-09-16 10:57:39 -07002526 case PERFORM_IDLE_MAINTENANCE_TRANSACTION: {
2527 data.enforceInterface(IActivityManager.descriptor);
2528 performIdleMaintenance();
2529 reply.writeNoException();
2530 return true;
2531 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002532
Todd Kennedyca4d8422015-01-15 15:19:22 -08002533 case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: {
Craig Mautner4a1cb222013-12-04 16:14:06 -08002534 data.enforceInterface(IActivityManager.descriptor);
2535 IBinder parentActivityToken = data.readStrongBinder();
2536 IActivityContainerCallback callback =
Craig Mautnere3a00d72014-04-16 08:31:19 -07002537 IActivityContainerCallback.Stub.asInterface(data.readStrongBinder());
Craig Mautner4a1cb222013-12-04 16:14:06 -08002538 IActivityContainer activityContainer =
Todd Kennedyca4d8422015-01-15 15:19:22 -08002539 createVirtualActivityContainer(parentActivityToken, callback);
Craig Mautner4a1cb222013-12-04 16:14:06 -08002540 reply.writeNoException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08002541 if (activityContainer != null) {
2542 reply.writeInt(1);
2543 reply.writeStrongBinder(activityContainer.asBinder());
2544 } else {
2545 reply.writeInt(0);
2546 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08002547 return true;
2548 }
2549
Craig Mautner95da1082014-02-24 17:54:35 -08002550 case DELETE_ACTIVITY_CONTAINER_TRANSACTION: {
2551 data.enforceInterface(IActivityManager.descriptor);
2552 IActivityContainer activityContainer =
2553 IActivityContainer.Stub.asInterface(data.readStrongBinder());
2554 deleteActivityContainer(activityContainer);
2555 reply.writeNoException();
2556 return true;
2557 }
2558
Todd Kennedy4900bf92015-01-16 16:05:14 -08002559 case CREATE_STACK_ON_DISPLAY: {
2560 data.enforceInterface(IActivityManager.descriptor);
2561 int displayId = data.readInt();
2562 IActivityContainer activityContainer = createStackOnDisplay(displayId);
2563 reply.writeNoException();
2564 if (activityContainer != null) {
2565 reply.writeInt(1);
2566 reply.writeStrongBinder(activityContainer.asBinder());
2567 } else {
2568 reply.writeInt(0);
2569 }
2570 return true;
2571 }
2572
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002573 case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: {
Craig Mautnere0a38842013-12-16 16:14:02 -08002574 data.enforceInterface(IActivityManager.descriptor);
2575 IBinder activityToken = data.readStrongBinder();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002576 int displayId = getActivityDisplayId(activityToken);
Craig Mautnere0a38842013-12-16 16:14:02 -08002577 reply.writeNoException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08002578 reply.writeInt(displayId);
Craig Mautnere0a38842013-12-16 16:14:02 -08002579 return true;
2580 }
2581
Craig Mautneraea74a52014-03-08 14:23:10 -08002582 case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: {
2583 data.enforceInterface(IActivityManager.descriptor);
2584 final int taskId = data.readInt();
2585 startLockTaskMode(taskId);
2586 reply.writeNoException();
2587 return true;
2588 }
2589
2590 case START_LOCK_TASK_BY_TOKEN_TRANSACTION: {
2591 data.enforceInterface(IActivityManager.descriptor);
2592 IBinder token = data.readStrongBinder();
2593 startLockTaskMode(token);
2594 reply.writeNoException();
2595 return true;
2596 }
2597
Andrii Kulian0f051f52016-04-14 00:41:51 -07002598 case START_SYSTEM_LOCK_TASK_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002599 data.enforceInterface(IActivityManager.descriptor);
Andrii Kulian0f051f52016-04-14 00:41:51 -07002600 int taskId = data.readInt();
2601 startSystemLockTaskMode(taskId);
Jason Monk62515be2014-05-21 16:06:19 -04002602 reply.writeNoException();
2603 return true;
2604 }
2605
Craig Mautneraea74a52014-03-08 14:23:10 -08002606 case STOP_LOCK_TASK_MODE_TRANSACTION: {
2607 data.enforceInterface(IActivityManager.descriptor);
2608 stopLockTaskMode();
2609 reply.writeNoException();
2610 return true;
2611 }
2612
Andrii Kulian0f051f52016-04-14 00:41:51 -07002613 case STOP_SYSTEM_LOCK_TASK_TRANSACTION: {
Jason Monk62515be2014-05-21 16:06:19 -04002614 data.enforceInterface(IActivityManager.descriptor);
Andrii Kulian0f051f52016-04-14 00:41:51 -07002615 stopSystemLockTaskMode();
Jason Monk62515be2014-05-21 16:06:19 -04002616 reply.writeNoException();
2617 return true;
2618 }
2619
Craig Mautneraea74a52014-03-08 14:23:10 -08002620 case IS_IN_LOCK_TASK_MODE_TRANSACTION: {
2621 data.enforceInterface(IActivityManager.descriptor);
2622 final boolean isInLockTaskMode = isInLockTaskMode();
2623 reply.writeNoException();
2624 reply.writeInt(isInLockTaskMode ? 1 : 0);
2625 return true;
2626 }
Craig Mautner2fbd7542014-03-21 09:34:07 -07002627
Benjamin Franz43261142015-02-11 15:59:44 +00002628 case GET_LOCK_TASK_MODE_STATE_TRANSACTION: {
2629 data.enforceInterface(IActivityManager.descriptor);
2630 final int lockTaskModeState = getLockTaskModeState();
2631 reply.writeNoException();
2632 reply.writeInt(lockTaskModeState);
2633 return true;
2634 }
2635
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07002636 case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: {
2637 data.enforceInterface(IActivityManager.descriptor);
2638 final IBinder token = data.readStrongBinder();
2639 showLockTaskEscapeMessage(token);
2640 reply.writeNoException();
2641 return true;
2642 }
2643
Winson Chunga449dc02014-05-16 11:15:04 -07002644 case SET_TASK_DESCRIPTION_TRANSACTION: {
Craig Mautner2fbd7542014-03-21 09:34:07 -07002645 data.enforceInterface(IActivityManager.descriptor);
2646 IBinder token = data.readStrongBinder();
Winson Chunga449dc02014-05-16 11:15:04 -07002647 ActivityManager.TaskDescription values =
2648 ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
2649 setTaskDescription(token, values);
Craig Mautner2fbd7542014-03-21 09:34:07 -07002650 reply.writeNoException();
2651 return true;
2652 }
Craig Mautneree2e45a2014-06-27 12:10:03 -07002653
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08002654 case SET_TASK_RESIZEABLE_TRANSACTION: {
2655 data.enforceInterface(IActivityManager.descriptor);
Wale Ogunwaleb1faf602016-01-27 09:12:31 -08002656 final int taskId = data.readInt();
2657 final int resizeableMode = data.readInt();
2658 setTaskResizeable(taskId, resizeableMode);
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08002659 reply.writeNoException();
2660 return true;
2661 }
2662
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002663 case RESIZE_TASK_TRANSACTION: {
2664 data.enforceInterface(IActivityManager.descriptor);
2665 int taskId = data.readInt();
Chong Zhang87b21722015-09-21 15:39:51 -07002666 int resizeMode = data.readInt();
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002667 Rect r = Rect.CREATOR.createFromParcel(data);
Chong Zhang87b21722015-09-21 15:39:51 -07002668 resizeTask(taskId, r, resizeMode);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08002669 reply.writeNoException();
2670 return true;
2671 }
2672
Wale Ogunwalee4a0c572015-06-30 08:40:31 -07002673 case GET_TASK_BOUNDS_TRANSACTION: {
2674 data.enforceInterface(IActivityManager.descriptor);
2675 int taskId = data.readInt();
2676 Rect r = getTaskBounds(taskId);
2677 reply.writeNoException();
2678 r.writeToParcel(reply, 0);
2679 return true;
2680 }
2681
Craig Mautner648f69b2014-09-18 14:16:26 -07002682 case GET_TASK_DESCRIPTION_ICON_TRANSACTION: {
2683 data.enforceInterface(IActivityManager.descriptor);
2684 String filename = data.readString();
Suprabh Shukla23593142015-11-03 17:31:15 -08002685 int userId = data.readInt();
2686 Bitmap icon = getTaskDescriptionIcon(filename, userId);
Craig Mautner648f69b2014-09-18 14:16:26 -07002687 reply.writeNoException();
2688 if (icon == null) {
2689 reply.writeInt(0);
2690 } else {
2691 reply.writeInt(1);
2692 icon.writeToParcel(reply, 0);
2693 }
2694 return true;
2695 }
2696
Winson Chung044d5292014-11-06 11:05:19 -08002697 case START_IN_PLACE_ANIMATION_TRANSACTION: {
2698 data.enforceInterface(IActivityManager.descriptor);
2699 final Bundle bundle;
2700 if (data.readInt() == 0) {
2701 bundle = null;
2702 } else {
2703 bundle = data.readBundle();
2704 }
Chong Zhang280d3322015-11-03 17:27:26 -08002705 final ActivityOptions options = ActivityOptions.fromBundle(bundle);
Winson Chung044d5292014-11-06 11:05:19 -08002706 startInPlaceAnimationOnFrontMostApplication(options);
2707 reply.writeNoException();
2708 return true;
2709 }
2710
Jose Lima4b6c6692014-08-12 17:41:12 -07002711 case REQUEST_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002712 data.enforceInterface(IActivityManager.descriptor);
2713 IBinder token = data.readStrongBinder();
2714 boolean enable = data.readInt() > 0;
Jose Lima4b6c6692014-08-12 17:41:12 -07002715 boolean success = requestVisibleBehind(token, enable);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002716 reply.writeNoException();
2717 reply.writeInt(success ? 1 : 0);
2718 return true;
2719 }
2720
Jose Lima4b6c6692014-08-12 17:41:12 -07002721 case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002722 data.enforceInterface(IActivityManager.descriptor);
2723 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002724 final boolean enabled = isBackgroundVisibleBehind(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002725 reply.writeNoException();
2726 reply.writeInt(enabled ? 1 : 0);
2727 return true;
2728 }
2729
Jose Lima4b6c6692014-08-12 17:41:12 -07002730 case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: {
Craig Mautneree2e45a2014-06-27 12:10:03 -07002731 data.enforceInterface(IActivityManager.descriptor);
2732 IBinder token = data.readStrongBinder();
Jose Lima4b6c6692014-08-12 17:41:12 -07002733 backgroundResourcesReleased(token);
Craig Mautneree2e45a2014-06-27 12:10:03 -07002734 reply.writeNoException();
2735 return true;
2736 }
Craig Mautnerbb742462014-07-07 15:28:55 -07002737
2738 case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: {
2739 data.enforceInterface(IActivityManager.descriptor);
2740 IBinder token = data.readStrongBinder();
2741 notifyLaunchTaskBehindComplete(token);
2742 reply.writeNoException();
2743 return true;
2744 }
Craig Mautner8746a472014-07-24 15:12:54 -07002745
2746 case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: {
2747 data.enforceInterface(IActivityManager.descriptor);
2748 IBinder token = data.readStrongBinder();
2749 notifyEnterAnimationComplete(token);
2750 reply.writeNoException();
2751 return true;
2752 }
Craig Mautner6e2f3952014-09-09 14:26:41 -07002753
2754 case BOOT_ANIMATION_COMPLETE_TRANSACTION: {
2755 data.enforceInterface(IActivityManager.descriptor);
2756 bootAnimationComplete();
2757 reply.writeNoException();
2758 return true;
2759 }
Wale Ogunwale18795a22014-12-03 11:38:33 -08002760
Jeff Sharkey605eb792014-11-04 13:34:06 -08002761 case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: {
2762 data.enforceInterface(IActivityManager.descriptor);
2763 final int uid = data.readInt();
2764 final byte[] firstPacket = data.createByteArray();
2765 notifyCleartextNetwork(uid, firstPacket);
2766 reply.writeNoException();
2767 return true;
2768 }
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002769
2770 case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: {
2771 data.enforceInterface(IActivityManager.descriptor);
2772 String procName = data.readString();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002773 int uid = data.readInt();
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002774 long maxMemSize = data.readLong();
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07002775 String reportPackage = data.readString();
2776 setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08002777 reply.writeNoException();
2778 return true;
2779 }
2780
2781 case DUMP_HEAP_FINISHED_TRANSACTION: {
2782 data.enforceInterface(IActivityManager.descriptor);
2783 String path = data.readString();
2784 dumpHeapFinished(path);
2785 reply.writeNoException();
2786 return true;
2787 }
Dianne Hackborn3d07c942015-03-13 18:02:54 -07002788
2789 case SET_VOICE_KEEP_AWAKE_TRANSACTION: {
2790 data.enforceInterface(IActivityManager.descriptor);
2791 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
2792 data.readStrongBinder());
2793 boolean keepAwake = data.readInt() != 0;
2794 setVoiceKeepAwake(session, keepAwake);
2795 reply.writeNoException();
2796 return true;
2797 }
Craig Mautnere5600772015-04-03 21:36:37 -07002798
2799 case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: {
2800 data.enforceInterface(IActivityManager.descriptor);
2801 int userId = data.readInt();
2802 String[] packages = data.readStringArray();
2803 updateLockTaskPackages(userId, packages);
2804 reply.writeNoException();
2805 return true;
2806 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07002807
Makoto Onuki219bbaf2015-11-12 01:38:47 +00002808 case UPDATE_DEVICE_OWNER_TRANSACTION: {
2809 data.enforceInterface(IActivityManager.descriptor);
2810 String packageName = data.readString();
2811 updateDeviceOwner(packageName);
2812 reply.writeNoException();
2813 return true;
2814 }
2815
Dianne Hackborn1e383822015-04-10 14:02:33 -07002816 case GET_PACKAGE_PROCESS_STATE_TRANSACTION: {
2817 data.enforceInterface(IActivityManager.descriptor);
2818 String pkg = data.readString();
Adam Lesinskic30454c2015-06-24 13:24:35 -07002819 String callingPackage = data.readString();
2820 int res = getPackageProcessState(pkg, callingPackage);
Dianne Hackborn1e383822015-04-10 14:02:33 -07002821 reply.writeNoException();
2822 reply.writeInt(res);
2823 return true;
2824 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07002825
2826 case SET_PROCESS_MEMORY_TRIM_TRANSACTION: {
2827 data.enforceInterface(IActivityManager.descriptor);
2828 String process = data.readString();
2829 int userId = data.readInt();
2830 int level = data.readInt();
2831 boolean res = setProcessMemoryTrimLevel(process, userId, level);
2832 reply.writeNoException();
2833 reply.writeInt(res ? 1 : 0);
2834 return true;
2835 }
Rahul Chaturvedi52613f92015-06-17 23:54:08 -04002836
Dianne Hackbornfb81d092015-08-03 17:14:46 -07002837 case IS_ROOT_VOICE_INTERACTION_TRANSACTION: {
2838 data.enforceInterface(IActivityManager.descriptor);
2839 IBinder token = data.readStrongBinder();
2840 boolean res = isRootVoiceInteraction(token);
2841 reply.writeNoException();
2842 reply.writeInt(res ? 1 : 0);
2843 return true;
2844 }
Ian Pedowitza3710842015-08-03 23:36:15 -07002845
Rahul Chaturvedi52613f92015-06-17 23:54:08 -04002846 case START_BINDER_TRACKING_TRANSACTION: {
2847 data.enforceInterface(IActivityManager.descriptor);
2848 boolean res = startBinderTracking();
2849 reply.writeNoException();
2850 reply.writeInt(res ? 1 : 0);
2851 return true;
2852 }
2853
2854 case STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION: {
2855 data.enforceInterface(IActivityManager.descriptor);
2856 ParcelFileDescriptor fd = data.readInt() != 0
2857 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
2858 boolean res = stopBinderTrackingAndDump(fd);
2859 reply.writeNoException();
2860 reply.writeInt(res ? 1 : 0);
2861 return true;
2862 }
Wale Ogunwale868a5e12015-08-02 16:19:20 -07002863 case GET_ACTIVITY_STACK_ID_TRANSACTION: {
2864 data.enforceInterface(IActivityManager.descriptor);
2865 IBinder token = data.readStrongBinder();
2866 int stackId = getActivityStackId(token);
2867 reply.writeNoException();
2868 reply.writeInt(stackId);
2869 return true;
2870 }
Filip Gruszczynski411c06f2016-01-07 09:44:44 -08002871 case EXIT_FREEFORM_MODE_TRANSACTION: {
Wale Ogunwale868a5e12015-08-02 16:19:20 -07002872 data.enforceInterface(IActivityManager.descriptor);
2873 IBinder token = data.readStrongBinder();
Filip Gruszczynski411c06f2016-01-07 09:44:44 -08002874 exitFreeformMode(token);
Wale Ogunwale868a5e12015-08-02 16:19:20 -07002875 reply.writeNoException();
2876 return true;
2877 }
Filip Gruszczynski23493322015-07-29 17:02:59 -07002878 case REPORT_SIZE_CONFIGURATIONS: {
2879 data.enforceInterface(IActivityManager.descriptor);
2880 IBinder token = data.readStrongBinder();
Filip Gruszczynski20aa0ae2015-10-30 10:08:27 -07002881 int[] horizontal = readIntArray(data);
2882 int[] vertical = readIntArray(data);
2883 int[] smallest = readIntArray(data);
2884 reportSizeConfigurations(token, horizontal, vertical, smallest);
Filip Gruszczynski23493322015-07-29 17:02:59 -07002885 return true;
2886 }
Wale Ogunwale83301a92015-09-24 15:54:08 -07002887 case SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION: {
2888 data.enforceInterface(IActivityManager.descriptor);
2889 final boolean suppress = data.readInt() == 1;
2890 suppressResizeConfigChanges(suppress);
2891 reply.writeNoException();
2892 return true;
2893 }
Filip Gruszczynskib3da8342015-12-10 16:40:01 -08002894 case MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION: {
Filip Gruszczynski57b6cce2015-10-06 09:50:51 -07002895 data.enforceInterface(IActivityManager.descriptor);
2896 final int stackId = data.readInt();
Wale Ogunwale9101d262016-01-15 08:56:11 -08002897 final boolean onTop = data.readInt() == 1;
2898 moveTasksToFullscreenStack(stackId, onTop);
Filip Gruszczynski57b6cce2015-10-06 09:50:51 -07002899 reply.writeNoException();
2900 return true;
2901 }
Dianne Hackbornbef28fe2015-10-29 17:57:11 -07002902 case GET_APP_START_MODE_TRANSACTION: {
2903 data.enforceInterface(IActivityManager.descriptor);
2904 final int uid = data.readInt();
2905 final String pkg = data.readString();
2906 int res = getAppStartMode(uid, pkg);
2907 reply.writeNoException();
2908 reply.writeInt(res);
2909 return true;
2910 }
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -08002911 case IN_MULTI_WINDOW_TRANSACTION: {
Wale Ogunwale5f986092015-12-04 15:35:38 -08002912 data.enforceInterface(IActivityManager.descriptor);
2913 final IBinder token = data.readStrongBinder();
Andrii Kulian933076d2016-03-29 17:04:42 -07002914 final boolean inMultiWindow = isInMultiWindowMode(token);
Wale Ogunwale5f986092015-12-04 15:35:38 -08002915 reply.writeNoException();
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -08002916 reply.writeInt(inMultiWindow ? 1 : 0);
Wale Ogunwale5f986092015-12-04 15:35:38 -08002917 return true;
2918 }
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -08002919 case IN_PICTURE_IN_PICTURE_TRANSACTION: {
Wale Ogunwale5f986092015-12-04 15:35:38 -08002920 data.enforceInterface(IActivityManager.descriptor);
2921 final IBinder token = data.readStrongBinder();
Andrii Kulian933076d2016-03-29 17:04:42 -07002922 final boolean inPip = isInPictureInPictureMode(token);
Wale Ogunwale5f986092015-12-04 15:35:38 -08002923 reply.writeNoException();
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -08002924 reply.writeInt(inPip ? 1 : 0);
Wale Ogunwale5f986092015-12-04 15:35:38 -08002925 return true;
2926 }
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -08002927 case ENTER_PICTURE_IN_PICTURE_TRANSACTION: {
Wale Ogunwale9c604c72015-12-06 18:42:57 -08002928 data.enforceInterface(IActivityManager.descriptor);
2929 final IBinder token = data.readStrongBinder();
Andrii Kulian933076d2016-03-29 17:04:42 -07002930 enterPictureInPictureMode(token);
Wale Ogunwale9c604c72015-12-06 18:42:57 -08002931 reply.writeNoException();
2932 return true;
2933 }
Ruben Brunkdd18a0b2015-12-04 16:16:31 -08002934 case SET_VR_MODE_TRANSACTION: {
2935 data.enforceInterface(IActivityManager.descriptor);
2936 final IBinder token = data.readStrongBinder();
2937 final boolean enable = data.readInt() == 1;
Ruben Brunke24b9a62016-02-16 21:38:24 -08002938 final ComponentName packageName = ComponentName.CREATOR.createFromParcel(data);
2939 int res = setVrMode(token, enable, packageName);
Ruben Brunkdd18a0b2015-12-04 16:16:31 -08002940 reply.writeNoException();
Ruben Brunke24b9a62016-02-16 21:38:24 -08002941 reply.writeInt(res);
2942 return true;
2943 }
2944 case IS_VR_PACKAGE_ENABLED_TRANSACTION: {
2945 data.enforceInterface(IActivityManager.descriptor);
2946 final ComponentName packageName = ComponentName.CREATOR.createFromParcel(data);
2947 boolean res = isVrModePackageEnabled(packageName);
2948 reply.writeNoException();
2949 reply.writeInt(res ? 1 : 0);
Ruben Brunkdd18a0b2015-12-04 16:16:31 -08002950 return true;
2951 }
Christopher Tate63fec3e2015-12-11 18:35:28 -08002952 case IS_APP_FOREGROUND_TRANSACTION: {
2953 data.enforceInterface(IActivityManager.descriptor);
2954 final int userHandle = data.readInt();
2955 final boolean isForeground = isAppForeground(userHandle);
2956 reply.writeNoException();
2957 reply.writeInt(isForeground ? 1 : 0);
2958 return true;
2959 }
Wale Ogunwale480dca02016-02-06 13:58:29 -08002960 case NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION: {
2961 data.enforceInterface(IActivityManager.descriptor);
2962 reply.writeNoException();
2963 return true;
2964 }
Wale Ogunwale06e8ee02016-02-12 12:56:32 -08002965 case REMOVE_STACK: {
2966 data.enforceInterface(IActivityManager.descriptor);
2967 final int stackId = data.readInt();
2968 removeStack(stackId);
2969 reply.writeNoException();
2970 return true;
2971 }
Tony Mak9c6e8ce2016-03-21 12:07:16 +00002972 case NOTIFY_LOCKED_PROFILE: {
2973 data.enforceInterface(IActivityManager.descriptor);
2974 final int userId = data.readInt();
2975 notifyLockedProfile(userId);
2976 reply.writeNoException();
2977 return true;
2978 }
Tony Mak646fe992016-04-21 16:43:08 +01002979 case START_CONFIRM_DEVICE_CREDENTIAL_INTENT: {
2980 data.enforceInterface(IActivityManager.descriptor);
2981 final Intent intent = Intent.CREATOR.createFromParcel(data);
2982 startConfirmDeviceCredentialIntent(intent);
2983 reply.writeNoException();
2984 return true;
2985 }
Christopher Tate27d92e42016-05-06 11:25:11 -07002986 case SEND_IDLE_JOB_TRIGGER_TRANSACTION: {
2987 data.enforceInterface(IActivityManager.descriptor);
2988 sendIdleJobTrigger();
2989 reply.writeNoException();
2990 return true;
2991 }
Dianne Hackborn0c4e6a82016-05-13 17:37:08 -07002992 case SEND_INTENT_SENDER_TRANSACTION: {
2993 data.enforceInterface(IActivityManager.descriptor);
2994 IIntentSender sender = IIntentSender.Stub.asInterface(data.readStrongBinder());
2995 int scode = data.readInt();
2996 Intent intent = data.readInt() != 0 ? Intent.CREATOR.createFromParcel(data) : null;
2997 String resolvedType = data.readString();
2998 IIntentReceiver finishedReceiver = IIntentReceiver.Stub.asInterface(
2999 data.readStrongBinder());
3000 String requiredPermission = data.readString();
3001 Bundle options = data.readInt() != 0 ? Bundle.CREATOR.createFromParcel(data) : null;
3002 int result = sendIntentSender(sender, scode, intent, resolvedType, finishedReceiver,
3003 requiredPermission, options);
3004 reply.writeNoException();
3005 reply.writeInt(result);
3006 return true;
3007 }
Srinath Sridharane535a582016-06-27 18:13:47 -07003008 case SET_VR_THREAD_TRANSACTION: {
3009 data.enforceInterface(IActivityManager.descriptor);
3010 final int tid = data.readInt();
3011 setVrThread(tid);
3012 reply.writeNoException();
3013 return true;
3014 }
Tim Murray33eb07f2016-06-10 10:03:20 -07003015 case SET_RENDER_THREAD_TRANSACTION: {
3016 data.enforceInterface(IActivityManager.descriptor);
3017 final int tid = data.readInt();
3018 setRenderThread(tid);
3019 reply.writeNoException();
3020 return true;
3021 }
Jorim Jaggif6782ee2016-07-22 11:40:00 +02003022 case SET_HAS_TOP_UI: {
3023 data.enforceInterface(IActivityManager.descriptor);
3024 final boolean hasTopUi = data.readInt() != 0;
3025 setHasTopUi(hasTopUi);
3026 reply.writeNoException();
3027 return true;
3028 }
Rubin Xu89927b32016-07-28 14:34:26 +01003029 case CAN_BYPASS_WORK_CHALLENGE: {
3030 data.enforceInterface(IActivityManager.descriptor);
3031 final PendingIntent intent = PendingIntent.CREATOR.createFromParcel(data);
3032 final boolean result = canBypassWorkChallenge(intent);
3033 reply.writeNoException();
3034 reply.writeInt(result ? 1 : 0);
3035 return true;
3036 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003037 }
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08003038
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003039 return super.onTransact(code, data, reply, flags);
3040 }
3041
Filip Gruszczynski20aa0ae2015-10-30 10:08:27 -07003042 private int[] readIntArray(Parcel data) {
3043 int[] smallest = null;
3044 int smallestSize = data.readInt();
3045 if (smallestSize > 0) {
3046 smallest = new int[smallestSize];
3047 data.readIntArray(smallest);
3048 }
3049 return smallest;
3050 }
3051
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08003052 public IBinder asBinder() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003053 return this;
3054 }
3055
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08003056 private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
3057 protected IActivityManager create() {
3058 IBinder b = ServiceManager.getService("activity");
Joe Onorato43a17652011-04-06 19:22:23 -07003059 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08003060 Log.v("ActivityManager", "default service binder = " + b);
3061 }
3062 IActivityManager am = asInterface(b);
Joe Onorato43a17652011-04-06 19:22:23 -07003063 if (false) {
Brad Fitzpatrick663f4f32010-11-23 19:15:24 -08003064 Log.v("ActivityManager", "default service = " + am);
3065 }
3066 return am;
3067 }
3068 };
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003069}
3070
3071class ActivityManagerProxy implements IActivityManager
3072{
3073 public ActivityManagerProxy(IBinder remote)
3074 {
3075 mRemote = remote;
3076 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08003077
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003078 public IBinder asBinder()
3079 {
3080 return mRemote;
3081 }
Siva Velusamy92a8b222012-03-09 16:24:04 -08003082
Dianne Hackbornf265ea92013-01-31 15:00:51 -08003083 public int startActivity(IApplicationThread caller, String callingPackage, Intent intent,
Dianne Hackborna4972e92012-03-14 10:38:05 -07003084 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07003085 int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003086 Parcel data = Parcel.obtain();
3087 Parcel reply = Parcel.obtain();
3088 data.writeInterfaceToken(IActivityManager.descriptor);
3089 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08003090 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003091 intent.writeToParcel(data, 0);
3092 data.writeString(resolvedType);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003093 data.writeStrongBinder(resultTo);
3094 data.writeString(resultWho);
3095 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07003096 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07003097 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003098 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07003099 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003100 } else {
3101 data.writeInt(0);
3102 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07003103 if (options != null) {
3104 data.writeInt(1);
3105 options.writeToParcel(data, 0);
3106 } else {
3107 data.writeInt(0);
3108 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003109 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
3110 reply.readException();
3111 int result = reply.readInt();
3112 reply.recycle();
3113 data.recycle();
3114 return result;
3115 }
Amith Yamasani82644082012-08-03 13:09:11 -07003116
Dianne Hackbornf265ea92013-01-31 15:00:51 -08003117 public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent,
Amith Yamasani82644082012-08-03 13:09:11 -07003118 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Jeff Hao1b012d32014-08-20 10:35:34 -07003119 int startFlags, ProfilerInfo profilerInfo, Bundle options,
3120 int userId) throws RemoteException {
Amith Yamasani82644082012-08-03 13:09:11 -07003121 Parcel data = Parcel.obtain();
3122 Parcel reply = Parcel.obtain();
3123 data.writeInterfaceToken(IActivityManager.descriptor);
3124 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08003125 data.writeString(callingPackage);
Amith Yamasani82644082012-08-03 13:09:11 -07003126 intent.writeToParcel(data, 0);
3127 data.writeString(resolvedType);
3128 data.writeStrongBinder(resultTo);
3129 data.writeString(resultWho);
3130 data.writeInt(requestCode);
3131 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07003132 if (profilerInfo != null) {
Amith Yamasani82644082012-08-03 13:09:11 -07003133 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07003134 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Amith Yamasani82644082012-08-03 13:09:11 -07003135 } else {
3136 data.writeInt(0);
3137 }
3138 if (options != null) {
3139 data.writeInt(1);
3140 options.writeToParcel(data, 0);
3141 } else {
3142 data.writeInt(0);
3143 }
3144 data.writeInt(userId);
3145 mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0);
3146 reply.readException();
3147 int result = reply.readInt();
3148 reply.recycle();
3149 data.recycle();
3150 return result;
3151 }
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07003152 public int startActivityAsCaller(IApplicationThread caller, String callingPackage,
3153 Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna7cfbe02015-07-16 10:52:52 -07003154 int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity,
3155 int userId) throws RemoteException {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07003156 Parcel data = Parcel.obtain();
3157 Parcel reply = Parcel.obtain();
3158 data.writeInterfaceToken(IActivityManager.descriptor);
3159 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3160 data.writeString(callingPackage);
3161 intent.writeToParcel(data, 0);
3162 data.writeString(resolvedType);
3163 data.writeStrongBinder(resultTo);
3164 data.writeString(resultWho);
3165 data.writeInt(requestCode);
3166 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07003167 if (profilerInfo != null) {
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07003168 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07003169 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07003170 } else {
3171 data.writeInt(0);
3172 }
3173 if (options != null) {
3174 data.writeInt(1);
3175 options.writeToParcel(data, 0);
3176 } else {
3177 data.writeInt(0);
3178 }
Dianne Hackborna7cfbe02015-07-16 10:52:52 -07003179 data.writeInt(ignoreTargetSecurity ? 1 : 0);
Jeff Sharkey97978802014-10-14 10:48:18 -07003180 data.writeInt(userId);
Dianne Hackborn028ceeb2014-08-17 17:45:48 -07003181 mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0);
3182 reply.readException();
3183 int result = reply.readInt();
3184 reply.recycle();
3185 data.recycle();
3186 return result;
3187 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08003188 public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage,
3189 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Jeff Hao1b012d32014-08-20 10:35:34 -07003190 int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options,
3191 int userId) throws RemoteException {
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08003192 Parcel data = Parcel.obtain();
3193 Parcel reply = Parcel.obtain();
3194 data.writeInterfaceToken(IActivityManager.descriptor);
3195 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08003196 data.writeString(callingPackage);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08003197 intent.writeToParcel(data, 0);
3198 data.writeString(resolvedType);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08003199 data.writeStrongBinder(resultTo);
3200 data.writeString(resultWho);
3201 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07003202 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07003203 if (profilerInfo != null) {
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003204 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07003205 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003206 } else {
3207 data.writeInt(0);
3208 }
Dianne Hackborna4972e92012-03-14 10:38:05 -07003209 if (options != null) {
3210 data.writeInt(1);
3211 options.writeToParcel(data, 0);
3212 } else {
3213 data.writeInt(0);
3214 }
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07003215 data.writeInt(userId);
Dianne Hackborn8f7f35e2010-02-25 18:48:12 -08003216 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
3217 reply.readException();
3218 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
3219 reply.recycle();
3220 data.recycle();
3221 return result;
3222 }
Dianne Hackbornf265ea92013-01-31 15:00:51 -08003223 public int startActivityWithConfig(IApplicationThread caller, String callingPackage,
3224 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
Dianne Hackborna4972e92012-03-14 10:38:05 -07003225 int requestCode, int startFlags, Configuration config,
Dianne Hackborn41203752012-08-31 14:05:51 -07003226 Bundle options, int userId) throws RemoteException {
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07003227 Parcel data = Parcel.obtain();
3228 Parcel reply = Parcel.obtain();
3229 data.writeInterfaceToken(IActivityManager.descriptor);
3230 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08003231 data.writeString(callingPackage);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07003232 intent.writeToParcel(data, 0);
3233 data.writeString(resolvedType);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07003234 data.writeStrongBinder(resultTo);
3235 data.writeString(resultWho);
3236 data.writeInt(requestCode);
Dianne Hackborna4972e92012-03-14 10:38:05 -07003237 data.writeInt(startFlags);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07003238 config.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07003239 if (options != null) {
3240 data.writeInt(1);
3241 options.writeToParcel(data, 0);
3242 } else {
3243 data.writeInt(0);
3244 }
Dianne Hackborn41203752012-08-31 14:05:51 -07003245 data.writeInt(userId);
Nicolas Prevot011aaa12016-09-14 17:01:53 +01003246 mRemote.transact(START_ACTIVITY_WITH_CONFIG_TRANSACTION, data, reply, 0);
Dianne Hackborn2ccda4d2010-03-22 21:49:15 -07003247 reply.readException();
3248 int result = reply.readInt();
3249 reply.recycle();
3250 data.recycle();
3251 return result;
3252 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07003253 public int startActivityIntentSender(IApplicationThread caller,
3254 IntentSender intent, Intent fillInIntent, String resolvedType,
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07003255 IBinder resultTo, String resultWho, int requestCode,
Dianne Hackborna4972e92012-03-14 10:38:05 -07003256 int flagsMask, int flagsValues, Bundle options) throws RemoteException {
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07003257 Parcel data = Parcel.obtain();
3258 Parcel reply = Parcel.obtain();
3259 data.writeInterfaceToken(IActivityManager.descriptor);
3260 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3261 intent.writeToParcel(data, 0);
3262 if (fillInIntent != null) {
3263 data.writeInt(1);
3264 fillInIntent.writeToParcel(data, 0);
3265 } else {
3266 data.writeInt(0);
3267 }
3268 data.writeString(resolvedType);
3269 data.writeStrongBinder(resultTo);
3270 data.writeString(resultWho);
3271 data.writeInt(requestCode);
3272 data.writeInt(flagsMask);
3273 data.writeInt(flagsValues);
Dianne Hackborna4972e92012-03-14 10:38:05 -07003274 if (options != null) {
3275 data.writeInt(1);
3276 options.writeToParcel(data, 0);
3277 } else {
3278 data.writeInt(0);
3279 }
Dianne Hackbornfa82f222009-09-17 15:14:12 -07003280 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackbornbcbcaa72009-09-10 10:54:46 -07003281 reply.readException();
3282 int result = reply.readInt();
3283 reply.recycle();
3284 data.recycle();
3285 return result;
3286 }
Dianne Hackborn91097de2014-04-04 18:02:06 -07003287 public int startVoiceActivity(String callingPackage, int callingPid, int callingUid,
3288 Intent intent, String resolvedType, IVoiceInteractionSession session,
Jeff Hao1b012d32014-08-20 10:35:34 -07003289 IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo,
3290 Bundle options, int userId) throws RemoteException {
Dianne Hackborn91097de2014-04-04 18:02:06 -07003291 Parcel data = Parcel.obtain();
3292 Parcel reply = Parcel.obtain();
3293 data.writeInterfaceToken(IActivityManager.descriptor);
3294 data.writeString(callingPackage);
3295 data.writeInt(callingPid);
3296 data.writeInt(callingUid);
3297 intent.writeToParcel(data, 0);
3298 data.writeString(resolvedType);
3299 data.writeStrongBinder(session.asBinder());
3300 data.writeStrongBinder(interactor.asBinder());
3301 data.writeInt(startFlags);
Jeff Hao1b012d32014-08-20 10:35:34 -07003302 if (profilerInfo != null) {
Dianne Hackborn91097de2014-04-04 18:02:06 -07003303 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07003304 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn91097de2014-04-04 18:02:06 -07003305 } else {
3306 data.writeInt(0);
3307 }
3308 if (options != null) {
3309 data.writeInt(1);
3310 options.writeToParcel(data, 0);
3311 } else {
3312 data.writeInt(0);
3313 }
3314 data.writeInt(userId);
3315 mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0);
3316 reply.readException();
3317 int result = reply.readInt();
3318 reply.recycle();
3319 data.recycle();
3320 return result;
3321 }
Amith Yamasani0af6fa72016-01-17 15:36:19 -08003322
3323 public void startLocalVoiceInteraction(IBinder callingActivity, Bundle options)
3324 throws RemoteException {
3325 Parcel data = Parcel.obtain();
3326 Parcel reply = Parcel.obtain();
3327 data.writeInterfaceToken(IActivityManager.descriptor);
3328 data.writeStrongBinder(callingActivity);
3329 data.writeBundle(options);
3330 mRemote.transact(START_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0);
3331 reply.readException();
3332 reply.recycle();
3333 data.recycle();
3334 }
3335
3336 public void stopLocalVoiceInteraction(IBinder callingActivity) throws RemoteException {
3337 Parcel data = Parcel.obtain();
3338 Parcel reply = Parcel.obtain();
3339 data.writeInterfaceToken(IActivityManager.descriptor);
3340 data.writeStrongBinder(callingActivity);
3341 mRemote.transact(STOP_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0);
3342 reply.readException();
3343 reply.recycle();
3344 data.recycle();
3345 }
3346
3347 public boolean supportsLocalVoiceInteraction() throws RemoteException {
3348 Parcel data = Parcel.obtain();
3349 Parcel reply = Parcel.obtain();
3350 data.writeInterfaceToken(IActivityManager.descriptor);
3351 mRemote.transact(SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0);
3352 reply.readException();
3353 int result = reply.readInt();
3354 reply.recycle();
3355 data.recycle();
3356 return result != 0;
3357 }
3358
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003359 public boolean startNextMatchingActivity(IBinder callingActivity,
Dianne Hackborna4972e92012-03-14 10:38:05 -07003360 Intent intent, Bundle options) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003361 Parcel data = Parcel.obtain();
3362 Parcel reply = Parcel.obtain();
3363 data.writeInterfaceToken(IActivityManager.descriptor);
3364 data.writeStrongBinder(callingActivity);
3365 intent.writeToParcel(data, 0);
Dianne Hackborna4972e92012-03-14 10:38:05 -07003366 if (options != null) {
3367 data.writeInt(1);
3368 options.writeToParcel(data, 0);
3369 } else {
3370 data.writeInt(0);
3371 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003372 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
3373 reply.readException();
3374 int result = reply.readInt();
3375 reply.recycle();
3376 data.recycle();
3377 return result != 0;
3378 }
Wale Ogunwale854809c2015-12-27 16:18:19 -08003379 public int startActivityFromRecents(int taskId, Bundle options)
Wale Ogunwale7e8184b2015-10-05 14:37:03 -07003380 throws RemoteException {
Craig Mautnerdc00cbe2014-07-20 17:48:47 -07003381 Parcel data = Parcel.obtain();
3382 Parcel reply = Parcel.obtain();
3383 data.writeInterfaceToken(IActivityManager.descriptor);
3384 data.writeInt(taskId);
3385 if (options == null) {
3386 data.writeInt(0);
3387 } else {
3388 data.writeInt(1);
3389 options.writeToParcel(data, 0);
3390 }
3391 mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0);
3392 reply.readException();
3393 int result = reply.readInt();
3394 reply.recycle();
3395 data.recycle();
3396 return result;
3397 }
Wale Ogunwaleba7881c2015-08-01 19:28:29 -07003398 public boolean finishActivity(IBinder token, int resultCode, Intent resultData, int finishTask)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003399 throws RemoteException {
3400 Parcel data = Parcel.obtain();
3401 Parcel reply = Parcel.obtain();
3402 data.writeInterfaceToken(IActivityManager.descriptor);
3403 data.writeStrongBinder(token);
3404 data.writeInt(resultCode);
3405 if (resultData != null) {
3406 data.writeInt(1);
3407 resultData.writeToParcel(data, 0);
3408 } else {
3409 data.writeInt(0);
3410 }
Wale Ogunwaleba7881c2015-08-01 19:28:29 -07003411 data.writeInt(finishTask);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003412 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
3413 reply.readException();
3414 boolean res = reply.readInt() != 0;
3415 data.recycle();
3416 reply.recycle();
3417 return res;
3418 }
3419 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
3420 {
3421 Parcel data = Parcel.obtain();
3422 Parcel reply = Parcel.obtain();
3423 data.writeInterfaceToken(IActivityManager.descriptor);
3424 data.writeStrongBinder(token);
3425 data.writeString(resultWho);
3426 data.writeInt(requestCode);
3427 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
3428 reply.readException();
3429 data.recycle();
3430 reply.recycle();
3431 }
Dianne Hackbornecc5a9c2012-04-26 18:56:09 -07003432 public boolean finishActivityAffinity(IBinder token) throws RemoteException {
3433 Parcel data = Parcel.obtain();
3434 Parcel reply = Parcel.obtain();
3435 data.writeInterfaceToken(IActivityManager.descriptor);
3436 data.writeStrongBinder(token);
3437 mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0);
3438 reply.readException();
3439 boolean res = reply.readInt() != 0;
3440 data.recycle();
3441 reply.recycle();
3442 return res;
3443 }
Dianne Hackborn6ea0d0a2014-07-02 16:23:21 -07003444 public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException {
3445 Parcel data = Parcel.obtain();
3446 Parcel reply = Parcel.obtain();
3447 data.writeInterfaceToken(IActivityManager.descriptor);
3448 data.writeStrongBinder(session.asBinder());
3449 mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0);
3450 reply.readException();
3451 data.recycle();
3452 reply.recycle();
3453 }
Chong Zhangfec694e2016-08-09 12:57:38 -07003454 public void requestActivityRelaunch(IBinder token) throws RemoteException {
3455 Parcel data = Parcel.obtain();
3456 Parcel reply = Parcel.obtain();
3457 data.writeInterfaceToken(IActivityManager.descriptor);
3458 data.writeStrongBinder(token);
3459 mRemote.transact(REQUEST_ACTIVITY_RELAUNCH, data, reply, 0);
3460 reply.readException();
3461 data.recycle();
3462 reply.recycle();
3463 }
Dianne Hackborn89ad4562014-08-24 16:45:38 -07003464 public boolean releaseActivityInstance(IBinder token) throws RemoteException {
3465 Parcel data = Parcel.obtain();
3466 Parcel reply = Parcel.obtain();
3467 data.writeInterfaceToken(IActivityManager.descriptor);
3468 data.writeStrongBinder(token);
3469 mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0);
3470 reply.readException();
3471 boolean res = reply.readInt() != 0;
3472 data.recycle();
3473 reply.recycle();
3474 return res;
3475 }
3476 public void releaseSomeActivities(IApplicationThread app) throws RemoteException {
3477 Parcel data = Parcel.obtain();
3478 Parcel reply = Parcel.obtain();
3479 data.writeInterfaceToken(IActivityManager.descriptor);
3480 data.writeStrongBinder(app.asBinder());
3481 mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0);
3482 reply.readException();
3483 data.recycle();
3484 reply.recycle();
3485 }
Dianne Hackborn061d58a2010-03-12 15:07:06 -08003486 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
3487 Parcel data = Parcel.obtain();
3488 Parcel reply = Parcel.obtain();
3489 data.writeInterfaceToken(IActivityManager.descriptor);
3490 data.writeStrongBinder(token);
3491 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
3492 reply.readException();
3493 boolean res = reply.readInt() != 0;
3494 data.recycle();
3495 reply.recycle();
3496 return res;
3497 }
Dianne Hackborn6c418d52011-06-29 14:05:33 -07003498 public Intent registerReceiver(IApplicationThread caller, String packageName,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003499 IIntentReceiver receiver,
Dianne Hackborn20e80982012-08-31 19:00:44 -07003500 IntentFilter filter, String perm, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003501 {
3502 Parcel data = Parcel.obtain();
3503 Parcel reply = Parcel.obtain();
3504 data.writeInterfaceToken(IActivityManager.descriptor);
3505 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackborn6c418d52011-06-29 14:05:33 -07003506 data.writeString(packageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003507 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
3508 filter.writeToParcel(data, 0);
3509 data.writeString(perm);
Dianne Hackborn20e80982012-08-31 19:00:44 -07003510 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003511 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
3512 reply.readException();
3513 Intent intent = null;
3514 int haveIntent = reply.readInt();
3515 if (haveIntent != 0) {
3516 intent = Intent.CREATOR.createFromParcel(reply);
3517 }
3518 reply.recycle();
3519 data.recycle();
3520 return intent;
3521 }
3522 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
3523 {
3524 Parcel data = Parcel.obtain();
3525 Parcel reply = Parcel.obtain();
3526 data.writeInterfaceToken(IActivityManager.descriptor);
3527 data.writeStrongBinder(receiver.asBinder());
3528 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
3529 reply.readException();
3530 data.recycle();
3531 reply.recycle();
3532 }
3533 public int broadcastIntent(IApplicationThread caller,
Dianne Hackborna750a632015-06-16 17:18:23 -07003534 Intent intent, String resolvedType, IIntentReceiver resultTo,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003535 int resultCode, String resultData, Bundle map,
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -07003536 String[] requiredPermissions, int appOp, Bundle options, boolean serialized,
Amith Yamasani742a6712011-05-04 14:49:28 -07003537 boolean sticky, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003538 {
3539 Parcel data = Parcel.obtain();
3540 Parcel reply = Parcel.obtain();
3541 data.writeInterfaceToken(IActivityManager.descriptor);
3542 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3543 intent.writeToParcel(data, 0);
3544 data.writeString(resolvedType);
3545 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
3546 data.writeInt(resultCode);
3547 data.writeString(resultData);
3548 data.writeBundle(map);
Fyodor Kupolovd4fd8c72015-07-13 19:19:25 -07003549 data.writeStringArray(requiredPermissions);
Dianne Hackbornf51f6122013-02-04 18:23:34 -08003550 data.writeInt(appOp);
Dianne Hackborna750a632015-06-16 17:18:23 -07003551 data.writeBundle(options);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003552 data.writeInt(serialized ? 1 : 0);
3553 data.writeInt(sticky ? 1 : 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003554 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003555 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
3556 reply.readException();
3557 int res = reply.readInt();
3558 reply.recycle();
3559 data.recycle();
3560 return res;
3561 }
Amith Yamasani742a6712011-05-04 14:49:28 -07003562 public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
3563 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003564 {
3565 Parcel data = Parcel.obtain();
3566 Parcel reply = Parcel.obtain();
3567 data.writeInterfaceToken(IActivityManager.descriptor);
3568 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3569 intent.writeToParcel(data, 0);
Amith Yamasani742a6712011-05-04 14:49:28 -07003570 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003571 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
3572 reply.readException();
3573 data.recycle();
3574 reply.recycle();
3575 }
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003576 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map,
3577 boolean abortBroadcast, int flags) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003578 {
3579 Parcel data = Parcel.obtain();
3580 Parcel reply = Parcel.obtain();
3581 data.writeInterfaceToken(IActivityManager.descriptor);
3582 data.writeStrongBinder(who);
3583 data.writeInt(resultCode);
3584 data.writeString(resultData);
3585 data.writeBundle(map);
3586 data.writeInt(abortBroadcast ? 1 : 0);
riddle_hsu1f5ac4d2015-01-03 15:38:21 +08003587 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003588 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3589 reply.readException();
3590 data.recycle();
3591 reply.recycle();
3592 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003593 public void attachApplication(IApplicationThread app) throws RemoteException
3594 {
3595 Parcel data = Parcel.obtain();
3596 Parcel reply = Parcel.obtain();
3597 data.writeInterfaceToken(IActivityManager.descriptor);
3598 data.writeStrongBinder(app.asBinder());
3599 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
3600 reply.readException();
3601 data.recycle();
3602 reply.recycle();
3603 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003604 public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
3605 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003606 {
3607 Parcel data = Parcel.obtain();
3608 Parcel reply = Parcel.obtain();
3609 data.writeInterfaceToken(IActivityManager.descriptor);
3610 data.writeStrongBinder(token);
Dianne Hackborne88846e2009-09-30 21:34:25 -07003611 if (config != null) {
3612 data.writeInt(1);
3613 config.writeToParcel(data, 0);
3614 } else {
3615 data.writeInt(0);
3616 }
Dianne Hackborn62f20ec2011-08-15 17:40:28 -07003617 data.writeInt(stopProfiling ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003618 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3619 reply.readException();
3620 data.recycle();
3621 reply.recycle();
3622 }
Dianne Hackbornad9b32112012-09-17 15:35:01 -07003623 public void activityResumed(IBinder token) throws RemoteException
3624 {
3625 Parcel data = Parcel.obtain();
3626 Parcel reply = Parcel.obtain();
3627 data.writeInterfaceToken(IActivityManager.descriptor);
3628 data.writeStrongBinder(token);
3629 mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0);
3630 reply.readException();
3631 data.recycle();
3632 reply.recycle();
3633 }
Dianne Hackborna4e102e2014-09-04 22:52:27 -07003634 public void activityPaused(IBinder token) throws RemoteException
Dianne Hackborn0aae2d42010-12-07 23:51:29 -08003635 {
3636 Parcel data = Parcel.obtain();
3637 Parcel reply = Parcel.obtain();
3638 data.writeInterfaceToken(IActivityManager.descriptor);
3639 data.writeStrongBinder(token);
3640 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
3641 reply.readException();
3642 data.recycle();
3643 reply.recycle();
3644 }
3645 public void activityStopped(IBinder token, Bundle state,
Craig Mautnera0026042014-04-23 11:45:37 -07003646 PersistableBundle persistentState, CharSequence description) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003647 {
3648 Parcel data = Parcel.obtain();
3649 Parcel reply = Parcel.obtain();
3650 data.writeInterfaceToken(IActivityManager.descriptor);
3651 data.writeStrongBinder(token);
3652 data.writeBundle(state);
Craig Mautnera0026042014-04-23 11:45:37 -07003653 data.writePersistableBundle(persistentState);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003654 TextUtils.writeToParcel(description, data, 0);
3655 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3656 reply.readException();
3657 data.recycle();
3658 reply.recycle();
3659 }
Dianne Hackborn4eba96b2011-01-21 13:34:36 -08003660 public void activitySlept(IBinder token) throws RemoteException
3661 {
3662 Parcel data = Parcel.obtain();
3663 Parcel reply = Parcel.obtain();
3664 data.writeInterfaceToken(IActivityManager.descriptor);
3665 data.writeStrongBinder(token);
3666 mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3667 reply.readException();
3668 data.recycle();
3669 reply.recycle();
3670 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003671 public void activityDestroyed(IBinder token) throws RemoteException
3672 {
3673 Parcel data = Parcel.obtain();
3674 Parcel reply = Parcel.obtain();
3675 data.writeInterfaceToken(IActivityManager.descriptor);
3676 data.writeStrongBinder(token);
3677 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3678 reply.readException();
3679 data.recycle();
3680 reply.recycle();
3681 }
Jorim Jaggife89d122015-12-22 16:28:44 +01003682 public void activityRelaunched(IBinder token) throws RemoteException
3683 {
3684 Parcel data = Parcel.obtain();
3685 Parcel reply = Parcel.obtain();
3686 data.writeInterfaceToken(IActivityManager.descriptor);
3687 data.writeStrongBinder(token);
3688 mRemote.transact(ACTIVITY_RELAUNCHED_TRANSACTION, data, reply, 0);
3689 reply.readException();
3690 data.recycle();
3691 reply.recycle();
3692 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003693 public String getCallingPackage(IBinder token) throws RemoteException
3694 {
3695 Parcel data = Parcel.obtain();
3696 Parcel reply = Parcel.obtain();
3697 data.writeInterfaceToken(IActivityManager.descriptor);
3698 data.writeStrongBinder(token);
3699 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
3700 reply.readException();
3701 String res = reply.readString();
3702 data.recycle();
3703 reply.recycle();
3704 return res;
3705 }
3706 public ComponentName getCallingActivity(IBinder token)
3707 throws RemoteException {
3708 Parcel data = Parcel.obtain();
3709 Parcel reply = Parcel.obtain();
3710 data.writeInterfaceToken(IActivityManager.descriptor);
3711 data.writeStrongBinder(token);
3712 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
3713 reply.readException();
3714 ComponentName res = ComponentName.readFromParcel(reply);
3715 data.recycle();
3716 reply.recycle();
3717 return res;
3718 }
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003719 public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException {
Winson Chung1147c402014-05-14 11:05:00 -07003720 Parcel data = Parcel.obtain();
3721 Parcel reply = Parcel.obtain();
3722 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn885fbe52014-08-23 15:23:58 -07003723 data.writeString(callingPackage);
Winson Chung1147c402014-05-14 11:05:00 -07003724 mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0);
3725 reply.readException();
3726 ArrayList<IAppTask> list = null;
3727 int N = reply.readInt();
3728 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003729 list = new ArrayList<>();
Winson Chung1147c402014-05-14 11:05:00 -07003730 while (N > 0) {
3731 IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder());
3732 list.add(task);
3733 N--;
3734 }
3735 }
3736 data.recycle();
3737 reply.recycle();
3738 return list;
3739 }
Dianne Hackbornaec68bb2014-08-20 15:25:13 -07003740 public int addAppTask(IBinder activityToken, Intent intent,
3741 ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException {
3742 Parcel data = Parcel.obtain();
3743 Parcel reply = Parcel.obtain();
3744 data.writeInterfaceToken(IActivityManager.descriptor);
3745 data.writeStrongBinder(activityToken);
3746 intent.writeToParcel(data, 0);
3747 description.writeToParcel(data, 0);
3748 thumbnail.writeToParcel(data, 0);
3749 mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0);
3750 reply.readException();
3751 int res = reply.readInt();
3752 data.recycle();
3753 reply.recycle();
3754 return res;
3755 }
3756 public Point getAppTaskThumbnailSize() throws RemoteException {
3757 Parcel data = Parcel.obtain();
3758 Parcel reply = Parcel.obtain();
3759 data.writeInterfaceToken(IActivityManager.descriptor);
3760 mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0);
3761 reply.readException();
3762 Point size = Point.CREATOR.createFromParcel(reply);
3763 data.recycle();
3764 reply.recycle();
3765 return size;
3766 }
Todd Kennedye635f662015-01-20 10:36:49 -08003767 public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags)
3768 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003769 Parcel data = Parcel.obtain();
3770 Parcel reply = Parcel.obtain();
3771 data.writeInterfaceToken(IActivityManager.descriptor);
3772 data.writeInt(maxNum);
3773 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003774 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
3775 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003776 ArrayList<ActivityManager.RunningTaskInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003777 int N = reply.readInt();
3778 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003779 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003780 while (N > 0) {
3781 ActivityManager.RunningTaskInfo info =
3782 ActivityManager.RunningTaskInfo.CREATOR
Winson Chung1147c402014-05-14 11:05:00 -07003783 .createFromParcel(reply);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003784 list.add(info);
3785 N--;
3786 }
3787 }
3788 data.recycle();
3789 reply.recycle();
3790 return list;
3791 }
Jeff Sharkey479212c2016-06-29 16:00:55 -06003792 public ParceledListSlice<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
Amith Yamasani82644082012-08-03 13:09:11 -07003793 int flags, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003794 Parcel data = Parcel.obtain();
3795 Parcel reply = Parcel.obtain();
3796 data.writeInterfaceToken(IActivityManager.descriptor);
3797 data.writeInt(maxNum);
3798 data.writeInt(flags);
Amith Yamasani82644082012-08-03 13:09:11 -07003799 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003800 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
3801 reply.readException();
Jeff Sharkey479212c2016-06-29 16:00:55 -06003802 final ParceledListSlice<ActivityManager.RecentTaskInfo> list = ParceledListSlice.CREATOR
3803 .createFromParcel(reply);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003804 data.recycle();
3805 reply.recycle();
3806 return list;
3807 }
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003808 public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException {
Dianne Hackbornd94df452011-02-16 18:53:31 -08003809 Parcel data = Parcel.obtain();
3810 Parcel reply = Parcel.obtain();
3811 data.writeInterfaceToken(IActivityManager.descriptor);
3812 data.writeInt(id);
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003813 mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003814 reply.readException();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003815 ActivityManager.TaskThumbnail taskThumbnail = null;
Dianne Hackbornd94df452011-02-16 18:53:31 -08003816 if (reply.readInt() != 0) {
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003817 taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply);
Dianne Hackbornd94df452011-02-16 18:53:31 -08003818 }
3819 data.recycle();
3820 reply.recycle();
Craig Mautnerc0ffce52014-07-01 12:38:52 -07003821 return taskThumbnail;
Dianne Hackborn15491c62012-09-19 10:59:14 -07003822 }
Todd Kennedye635f662015-01-20 10:36:49 -08003823 public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags)
3824 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003825 Parcel data = Parcel.obtain();
3826 Parcel reply = Parcel.obtain();
3827 data.writeInterfaceToken(IActivityManager.descriptor);
3828 data.writeInt(maxNum);
3829 data.writeInt(flags);
3830 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
3831 reply.readException();
Todd Kennedye635f662015-01-20 10:36:49 -08003832 ArrayList<ActivityManager.RunningServiceInfo> list = null;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003833 int N = reply.readInt();
3834 if (N >= 0) {
Todd Kennedye635f662015-01-20 10:36:49 -08003835 list = new ArrayList<>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003836 while (N > 0) {
3837 ActivityManager.RunningServiceInfo info =
3838 ActivityManager.RunningServiceInfo.CREATOR
3839 .createFromParcel(reply);
3840 list.add(info);
3841 N--;
3842 }
3843 }
3844 data.recycle();
3845 reply.recycle();
3846 return list;
3847 }
3848 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
3849 throws RemoteException {
3850 Parcel data = Parcel.obtain();
3851 Parcel reply = Parcel.obtain();
3852 data.writeInterfaceToken(IActivityManager.descriptor);
3853 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
3854 reply.readException();
3855 ArrayList<ActivityManager.ProcessErrorStateInfo> list
3856 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
3857 data.recycle();
3858 reply.recycle();
3859 return list;
3860 }
3861 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
3862 throws RemoteException {
3863 Parcel data = Parcel.obtain();
3864 Parcel reply = Parcel.obtain();
3865 data.writeInterfaceToken(IActivityManager.descriptor);
3866 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
3867 reply.readException();
3868 ArrayList<ActivityManager.RunningAppProcessInfo> list
3869 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
3870 data.recycle();
3871 reply.recycle();
3872 return list;
3873 }
Suchi Amalapurapuf7f5dda2010-03-23 10:34:28 -07003874 public List<ApplicationInfo> getRunningExternalApplications()
3875 throws RemoteException {
3876 Parcel data = Parcel.obtain();
3877 Parcel reply = Parcel.obtain();
3878 data.writeInterfaceToken(IActivityManager.descriptor);
3879 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
3880 reply.readException();
3881 ArrayList<ApplicationInfo> list
3882 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
3883 data.recycle();
3884 reply.recycle();
3885 return list;
3886 }
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003887 public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003888 {
3889 Parcel data = Parcel.obtain();
3890 Parcel reply = Parcel.obtain();
3891 data.writeInterfaceToken(IActivityManager.descriptor);
3892 data.writeInt(task);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08003893 data.writeInt(flags);
Dianne Hackborn8078d8c2012-03-20 11:11:26 -07003894 if (options != null) {
3895 data.writeInt(1);
3896 options.writeToParcel(data, 0);
3897 } else {
3898 data.writeInt(0);
3899 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003900 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
3901 reply.readException();
3902 data.recycle();
3903 reply.recycle();
3904 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003905 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
3906 throws RemoteException {
3907 Parcel data = Parcel.obtain();
3908 Parcel reply = Parcel.obtain();
3909 data.writeInterfaceToken(IActivityManager.descriptor);
3910 data.writeStrongBinder(token);
3911 data.writeInt(nonRoot ? 1 : 0);
3912 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
3913 reply.readException();
3914 boolean res = reply.readInt() != 0;
3915 data.recycle();
3916 reply.recycle();
3917 return res;
3918 }
3919 public void moveTaskBackwards(int task) throws RemoteException
3920 {
3921 Parcel data = Parcel.obtain();
3922 Parcel reply = Parcel.obtain();
3923 data.writeInterfaceToken(IActivityManager.descriptor);
3924 data.writeInt(task);
3925 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
3926 reply.readException();
3927 data.recycle();
3928 reply.recycle();
3929 }
Craig Mautnerc00204b2013-03-05 15:02:14 -08003930 @Override
Craig Mautnerc00204b2013-03-05 15:02:14 -08003931 public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException
3932 {
3933 Parcel data = Parcel.obtain();
3934 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003935 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerc00204b2013-03-05 15:02:14 -08003936 data.writeInt(taskId);
3937 data.writeInt(stackId);
3938 data.writeInt(toTop ? 1 : 0);
3939 mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0);
3940 reply.readException();
3941 data.recycle();
3942 reply.recycle();
3943 }
3944 @Override
Chong Zhange4fbd322016-03-01 14:44:03 -08003945 public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate,
Wale Ogunwalea4d92a02016-05-01 16:02:16 -07003946 Rect initialBounds, boolean moveHomeStackFront) throws RemoteException
Wale Ogunwale59a73ca2015-09-14 12:54:50 -07003947 {
3948 Parcel data = Parcel.obtain();
3949 Parcel reply = Parcel.obtain();
3950 data.writeInterfaceToken(IActivityManager.descriptor);
3951 data.writeInt(taskId);
3952 data.writeInt(createMode);
3953 data.writeInt(toTop ? 1 : 0);
Jorim Jaggi030979c2015-11-20 15:14:43 -08003954 data.writeInt(animate ? 1 : 0);
Jorim Jaggi9ea2f7b2015-11-23 18:08:28 -08003955 if (initialBounds != null) {
3956 data.writeInt(1);
3957 initialBounds.writeToParcel(data, 0);
3958 } else {
3959 data.writeInt(0);
3960 }
Wale Ogunwalea4d92a02016-05-01 16:02:16 -07003961 data.writeInt(moveHomeStackFront ? 1 : 0);
Wale Ogunwale59a73ca2015-09-14 12:54:50 -07003962 mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0);
3963 reply.readException();
Chong Zhange4fbd322016-03-01 14:44:03 -08003964 boolean res = reply.readInt() > 0;
Wale Ogunwale59a73ca2015-09-14 12:54:50 -07003965 data.recycle();
3966 reply.recycle();
Chong Zhange4fbd322016-03-01 14:44:03 -08003967 return res;
Wale Ogunwale59a73ca2015-09-14 12:54:50 -07003968 }
3969 @Override
Wale Ogunwale079a0042015-10-24 11:44:07 -07003970 public boolean moveTopActivityToPinnedStack(int stackId, Rect r)
3971 throws RemoteException
3972 {
3973 Parcel data = Parcel.obtain();
3974 Parcel reply = Parcel.obtain();
3975 data.writeInterfaceToken(IActivityManager.descriptor);
3976 data.writeInt(stackId);
3977 r.writeToParcel(data, 0);
Dianne Hackbornbef28fe2015-10-29 17:57:11 -07003978 mRemote.transact(MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION, data, reply, 0);
Wale Ogunwale079a0042015-10-24 11:44:07 -07003979 reply.readException();
3980 final boolean res = reply.readInt() != 0;
3981 data.recycle();
3982 reply.recycle();
3983 return res;
3984 }
3985 @Override
Filip Gruszczynski84fa3352016-01-25 16:28:49 -08003986 public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode,
Wale Ogunwalee75a9ad2016-03-18 20:43:49 -07003987 boolean preserveWindows, boolean animate, int animationDuration)
3988 throws RemoteException {
Craig Mautnerc00204b2013-03-05 15:02:14 -08003989 Parcel data = Parcel.obtain();
3990 Parcel reply = Parcel.obtain();
Craig Mautner967212c2013-04-13 21:10:58 -07003991 data.writeInterfaceToken(IActivityManager.descriptor);
Wale Ogunwaleb34a7ad2015-08-14 11:05:30 -07003992 data.writeInt(stackId);
Jorim Jaggi61f39a72015-10-29 16:54:18 +01003993 if (r != null) {
3994 data.writeInt(1);
3995 r.writeToParcel(data, 0);
3996 } else {
3997 data.writeInt(0);
3998 }
Wale Ogunwaleffc11bb2015-10-10 13:05:45 -07003999 data.writeInt(allowResizeInDockedMode ? 1 : 0);
Filip Gruszczynski84fa3352016-01-25 16:28:49 -08004000 data.writeInt(preserveWindows ? 1 : 0);
4001 data.writeInt(animate ? 1 : 0);
Wale Ogunwalee75a9ad2016-03-18 20:43:49 -07004002 data.writeInt(animationDuration);
Dianne Hackborn1e383822015-04-10 14:02:33 -07004003 mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0);
Craig Mautnerc00204b2013-03-05 15:02:14 -08004004 reply.readException();
4005 data.recycle();
4006 reply.recycle();
4007 }
Craig Mautner967212c2013-04-13 21:10:58 -07004008 @Override
Jorim Jaggid47e7e12016-03-01 09:57:38 +01004009 public void swapDockedAndFullscreenStack() throws RemoteException
4010 {
4011 Parcel data = Parcel.obtain();
4012 Parcel reply = Parcel.obtain();
4013 data.writeInterfaceToken(IActivityManager.descriptor);
4014 mRemote.transact(SWAP_DOCKED_AND_FULLSCREEN_STACK, data, reply, 0);
4015 reply.readException();
4016 data.recycle();
4017 reply.recycle();
4018 }
4019 @Override
Jorim Jaggidc249c42015-12-15 14:57:31 -08004020 public void resizeDockedStack(Rect dockedBounds, Rect tempDockedTaskBounds,
4021 Rect tempDockedTaskInsetBounds,
4022 Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds)
4023 throws RemoteException
4024 {
4025 Parcel data = Parcel.obtain();
4026 Parcel reply = Parcel.obtain();
4027 data.writeInterfaceToken(IActivityManager.descriptor);
4028 if (dockedBounds != null) {
4029 data.writeInt(1);
4030 dockedBounds.writeToParcel(data, 0);
4031 } else {
4032 data.writeInt(0);
4033 }
4034 if (tempDockedTaskBounds != null) {
4035 data.writeInt(1);
4036 tempDockedTaskBounds.writeToParcel(data, 0);
4037 } else {
4038 data.writeInt(0);
4039 }
4040 if (tempDockedTaskInsetBounds != null) {
4041 data.writeInt(1);
4042 tempDockedTaskInsetBounds.writeToParcel(data, 0);
4043 } else {
4044 data.writeInt(0);
4045 }
4046 if (tempOtherTaskBounds != null) {
4047 data.writeInt(1);
4048 tempOtherTaskBounds.writeToParcel(data, 0);
4049 } else {
4050 data.writeInt(0);
4051 }
4052 if (tempOtherTaskInsetBounds != null) {
4053 data.writeInt(1);
4054 tempOtherTaskInsetBounds.writeToParcel(data, 0);
4055 } else {
4056 data.writeInt(0);
4057 }
4058 mRemote.transact(RESIZE_DOCKED_STACK_TRANSACTION, data, reply, 0);
4059 reply.readException();
4060 data.recycle();
4061 reply.recycle();
4062 }
Robert Carr0d00c2e2016-02-29 17:45:02 -08004063
4064 @Override
4065 public void resizePinnedStack(Rect pinnedBounds, Rect tempPinnedTaskBounds) throws RemoteException
4066 {
4067 Parcel data = Parcel.obtain();
4068 Parcel reply = Parcel.obtain();
4069 data.writeInterfaceToken(IActivityManager.descriptor);
4070 if (pinnedBounds != null) {
4071 data.writeInt(1);
4072 pinnedBounds.writeToParcel(data, 0);
4073 } else {
4074 data.writeInt(0);
4075 }
4076 if (tempPinnedTaskBounds != null) {
4077 data.writeInt(1);
4078 tempPinnedTaskBounds.writeToParcel(data, 0);
4079 } else {
4080 data.writeInt(0);
4081 }
4082 mRemote.transact(RESIZE_PINNED_STACK_TRANSACTION, data, reply, 0);
4083 reply.readException();
4084 data.recycle();
4085 reply.recycle();
4086 }
4087
Jorim Jaggidc249c42015-12-15 14:57:31 -08004088 @Override
Wale Ogunwaleddc1cb22015-07-25 19:23:04 -07004089 public void positionTaskInStack(int taskId, int stackId, int position) throws RemoteException
4090 {
4091 Parcel data = Parcel.obtain();
4092 Parcel reply = Parcel.obtain();
4093 data.writeInterfaceToken(IActivityManager.descriptor);
4094 data.writeInt(taskId);
4095 data.writeInt(stackId);
4096 data.writeInt(position);
4097 mRemote.transact(POSITION_TASK_IN_STACK_TRANSACTION, data, reply, 0);
4098 reply.readException();
4099 data.recycle();
4100 reply.recycle();
4101 }
4102 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08004103 public List<StackInfo> getAllStackInfos() throws RemoteException
Craig Mautner5ff12102013-05-24 12:50:15 -07004104 {
4105 Parcel data = Parcel.obtain();
4106 Parcel reply = Parcel.obtain();
4107 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08004108 mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0);
Craig Mautner5ff12102013-05-24 12:50:15 -07004109 reply.readException();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08004110 ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR);
Craig Mautner967212c2013-04-13 21:10:58 -07004111 data.recycle();
4112 reply.recycle();
4113 return list;
4114 }
Craig Mautnercf910b02013-04-23 11:23:27 -07004115 @Override
Craig Mautnerbdc748af2013-12-02 14:08:25 -08004116 public StackInfo getStackInfo(int stackId) throws RemoteException
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07004117 {
4118 Parcel data = Parcel.obtain();
4119 Parcel reply = Parcel.obtain();
4120 data.writeInterfaceToken(IActivityManager.descriptor);
Craig Mautnerbdc748af2013-12-02 14:08:25 -08004121 data.writeInt(stackId);
4122 mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07004123 reply.readException();
4124 int res = reply.readInt();
Craig Mautnerbdc748af2013-12-02 14:08:25 -08004125 StackInfo info = null;
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07004126 if (res != 0) {
Craig Mautnerbdc748af2013-12-02 14:08:25 -08004127 info = StackInfo.CREATOR.createFromParcel(reply);
Craig Mautnerfd1ce8d2013-06-17 16:15:42 -07004128 }
4129 data.recycle();
4130 reply.recycle();
4131 return info;
4132 }
4133 @Override
Winson Chung303e1ff2014-03-07 15:06:19 -08004134 public boolean isInHomeStack(int taskId) throws RemoteException {
4135 Parcel data = Parcel.obtain();
4136 Parcel reply = Parcel.obtain();
4137 data.writeInterfaceToken(IActivityManager.descriptor);
4138 data.writeInt(taskId);
4139 mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0);
4140 reply.readException();
4141 boolean isInHomeStack = reply.readInt() > 0;
4142 data.recycle();
4143 reply.recycle();
4144 return isInHomeStack;
4145 }
4146 @Override
Craig Mautnercf910b02013-04-23 11:23:27 -07004147 public void setFocusedStack(int stackId) throws RemoteException
4148 {
4149 Parcel data = Parcel.obtain();
4150 Parcel reply = Parcel.obtain();
4151 data.writeInterfaceToken(IActivityManager.descriptor);
4152 data.writeInt(stackId);
Dianne Hackborn1e383822015-04-10 14:02:33 -07004153 mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0);
Craig Mautnercf910b02013-04-23 11:23:27 -07004154 reply.readException();
4155 data.recycle();
4156 reply.recycle();
4157 }
Winson Chung740c3ac2014-11-12 16:14:38 -08004158 @Override
Winson Chungd16c5652015-01-26 16:11:07 -08004159 public int getFocusedStackId() throws RemoteException {
4160 Parcel data = Parcel.obtain();
4161 Parcel reply = Parcel.obtain();
4162 data.writeInterfaceToken(IActivityManager.descriptor);
4163 mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0);
4164 reply.readException();
4165 int focusedStackId = reply.readInt();
4166 data.recycle();
4167 reply.recycle();
4168 return focusedStackId;
4169 }
4170 @Override
Wale Ogunwalee4a0c572015-06-30 08:40:31 -07004171 public void setFocusedTask(int taskId) throws RemoteException
4172 {
4173 Parcel data = Parcel.obtain();
4174 Parcel reply = Parcel.obtain();
4175 data.writeInterfaceToken(IActivityManager.descriptor);
4176 data.writeInt(taskId);
4177 mRemote.transact(SET_FOCUSED_TASK_TRANSACTION, data, reply, 0);
4178 reply.readException();
4179 data.recycle();
4180 reply.recycle();
4181 }
4182 @Override
Winson Chung740c3ac2014-11-12 16:14:38 -08004183 public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException
4184 {
4185 Parcel data = Parcel.obtain();
4186 Parcel reply = Parcel.obtain();
4187 data.writeInterfaceToken(IActivityManager.descriptor);
4188 data.writeStrongBinder(listener.asBinder());
Dianne Hackborn1e383822015-04-10 14:02:33 -07004189 mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0);
Winson Chung740c3ac2014-11-12 16:14:38 -08004190 reply.readException();
4191 data.recycle();
4192 reply.recycle();
4193 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004194 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
4195 {
4196 Parcel data = Parcel.obtain();
4197 Parcel reply = Parcel.obtain();
4198 data.writeInterfaceToken(IActivityManager.descriptor);
4199 data.writeStrongBinder(token);
4200 data.writeInt(onlyRoot ? 1 : 0);
4201 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
4202 reply.readException();
4203 int res = reply.readInt();
4204 data.recycle();
4205 reply.recycle();
4206 return res;
4207 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004208 public ContentProviderHolder getContentProvider(IApplicationThread caller,
Jeff Sharkey6d515712012-09-20 16:06:08 -07004209 String name, int userId, boolean stable) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004210 Parcel data = Parcel.obtain();
4211 Parcel reply = Parcel.obtain();
4212 data.writeInterfaceToken(IActivityManager.descriptor);
4213 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
4214 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07004215 data.writeInt(userId);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07004216 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004217 mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
4218 reply.readException();
4219 int res = reply.readInt();
4220 ContentProviderHolder cph = null;
4221 if (res != 0) {
4222 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
4223 }
4224 data.recycle();
4225 reply.recycle();
4226 return cph;
4227 }
Jeff Sharkey6d515712012-09-20 16:06:08 -07004228 public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token)
4229 throws RemoteException {
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08004230 Parcel data = Parcel.obtain();
4231 Parcel reply = Parcel.obtain();
4232 data.writeInterfaceToken(IActivityManager.descriptor);
4233 data.writeString(name);
Jeff Sharkey6d515712012-09-20 16:06:08 -07004234 data.writeInt(userId);
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08004235 data.writeStrongBinder(token);
4236 mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
4237 reply.readException();
4238 int res = reply.readInt();
4239 ContentProviderHolder cph = null;
4240 if (res != 0) {
4241 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
4242 }
4243 data.recycle();
4244 reply.recycle();
4245 return cph;
4246 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004247 public void publishContentProviders(IApplicationThread caller,
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07004248 List<ContentProviderHolder> providers) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004249 {
4250 Parcel data = Parcel.obtain();
4251 Parcel reply = Parcel.obtain();
4252 data.writeInterfaceToken(IActivityManager.descriptor);
4253 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
4254 data.writeTypedList(providers);
4255 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
4256 reply.readException();
4257 data.recycle();
4258 reply.recycle();
4259 }
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07004260 public boolean refContentProvider(IBinder connection, int stable, int unstable)
4261 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004262 Parcel data = Parcel.obtain();
4263 Parcel reply = Parcel.obtain();
4264 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07004265 data.writeStrongBinder(connection);
4266 data.writeInt(stable);
4267 data.writeInt(unstable);
4268 mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
4269 reply.readException();
4270 boolean res = reply.readInt() != 0;
4271 data.recycle();
4272 reply.recycle();
4273 return res;
4274 }
Jeff Sharkey7aa76012013-09-30 14:26:27 -07004275
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07004276 public void unstableProviderDied(IBinder connection) throws RemoteException {
4277 Parcel data = Parcel.obtain();
4278 Parcel reply = Parcel.obtain();
4279 data.writeInterfaceToken(IActivityManager.descriptor);
4280 data.writeStrongBinder(connection);
4281 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0);
4282 reply.readException();
4283 data.recycle();
4284 reply.recycle();
4285 }
4286
Jeff Sharkey7aa76012013-09-30 14:26:27 -07004287 @Override
4288 public void appNotRespondingViaProvider(IBinder connection) throws RemoteException {
4289 Parcel data = Parcel.obtain();
4290 Parcel reply = Parcel.obtain();
4291 data.writeInterfaceToken(IActivityManager.descriptor);
4292 data.writeStrongBinder(connection);
4293 mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0);
4294 reply.readException();
4295 data.recycle();
4296 reply.recycle();
4297 }
4298
Dianne Hackborn6ae8d182012-05-23 13:12:42 -07004299 public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException {
4300 Parcel data = Parcel.obtain();
4301 Parcel reply = Parcel.obtain();
4302 data.writeInterfaceToken(IActivityManager.descriptor);
4303 data.writeStrongBinder(connection);
4304 data.writeInt(stable ? 1 : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004305 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
4306 reply.readException();
4307 data.recycle();
4308 reply.recycle();
4309 }
Svetoslav Ganov25872aa2012-02-03 19:19:09 -08004310
4311 public void removeContentProviderExternal(String name, IBinder token) throws RemoteException {
4312 Parcel data = Parcel.obtain();
4313 Parcel reply = Parcel.obtain();
4314 data.writeInterfaceToken(IActivityManager.descriptor);
4315 data.writeString(name);
4316 data.writeStrongBinder(token);
4317 mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
4318 reply.readException();
4319 data.recycle();
4320 reply.recycle();
4321 }
4322
Dianne Hackborndd9b82c2009-09-03 00:18:47 -07004323 public PendingIntent getRunningServiceControlPanel(ComponentName service)
4324 throws RemoteException
4325 {
4326 Parcel data = Parcel.obtain();
4327 Parcel reply = Parcel.obtain();
4328 data.writeInterfaceToken(IActivityManager.descriptor);
4329 service.writeToParcel(data, 0);
4330 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
4331 reply.readException();
4332 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
4333 data.recycle();
4334 reply.recycle();
4335 return res;
4336 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004337
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004338 public ComponentName startService(IApplicationThread caller, Intent service,
Svet Ganov99b60432015-06-27 13:15:22 -07004339 String resolvedType, String callingPackage, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004340 {
4341 Parcel data = Parcel.obtain();
4342 Parcel reply = Parcel.obtain();
4343 data.writeInterfaceToken(IActivityManager.descriptor);
4344 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
4345 service.writeToParcel(data, 0);
4346 data.writeString(resolvedType);
Svet Ganov99b60432015-06-27 13:15:22 -07004347 data.writeString(callingPackage);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07004348 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004349 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
4350 reply.readException();
4351 ComponentName res = ComponentName.readFromParcel(reply);
4352 data.recycle();
4353 reply.recycle();
4354 return res;
4355 }
4356 public int stopService(IApplicationThread caller, Intent service,
Dianne Hackborn7767eac2012-08-23 18:25:40 -07004357 String resolvedType, int userId) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004358 {
4359 Parcel data = Parcel.obtain();
4360 Parcel reply = Parcel.obtain();
4361 data.writeInterfaceToken(IActivityManager.descriptor);
4362 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
4363 service.writeToParcel(data, 0);
4364 data.writeString(resolvedType);
Dianne Hackborn7767eac2012-08-23 18:25:40 -07004365 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004366 mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0);
4367 reply.readException();
4368 int res = reply.readInt();
4369 reply.recycle();
4370 data.recycle();
4371 return res;
4372 }
4373 public boolean stopServiceToken(ComponentName className, IBinder token,
4374 int startId) throws RemoteException {
4375 Parcel data = Parcel.obtain();
4376 Parcel reply = Parcel.obtain();
4377 data.writeInterfaceToken(IActivityManager.descriptor);
4378 ComponentName.writeToParcel(className, data);
4379 data.writeStrongBinder(token);
4380 data.writeInt(startId);
4381 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
4382 reply.readException();
4383 boolean res = reply.readInt() != 0;
4384 data.recycle();
4385 reply.recycle();
4386 return res;
4387 }
4388 public void setServiceForeground(ComponentName className, IBinder token,
Dianne Hackborn67324c92016-04-18 13:55:25 -07004389 int id, Notification notification, int flags) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004390 Parcel data = Parcel.obtain();
4391 Parcel reply = Parcel.obtain();
4392 data.writeInterfaceToken(IActivityManager.descriptor);
4393 ComponentName.writeToParcel(className, data);
4394 data.writeStrongBinder(token);
Dianne Hackbornd8a43f62009-08-17 23:33:56 -07004395 data.writeInt(id);
4396 if (notification != null) {
4397 data.writeInt(1);
4398 notification.writeToParcel(data, 0);
4399 } else {
4400 data.writeInt(0);
4401 }
Dianne Hackborn67324c92016-04-18 13:55:25 -07004402 data.writeInt(flags);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004403 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
4404 reply.readException();
4405 data.recycle();
4406 reply.recycle();
4407 }
4408 public int bindService(IApplicationThread caller, IBinder token,
4409 Intent service, String resolvedType, IServiceConnection connection,
Svet Ganov99b60432015-06-27 13:15:22 -07004410 int flags, String callingPackage, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004411 Parcel data = Parcel.obtain();
4412 Parcel reply = Parcel.obtain();
4413 data.writeInterfaceToken(IActivityManager.descriptor);
4414 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
4415 data.writeStrongBinder(token);
4416 service.writeToParcel(data, 0);
4417 data.writeString(resolvedType);
4418 data.writeStrongBinder(connection.asBinder());
4419 data.writeInt(flags);
Svet Ganov99b60432015-06-27 13:15:22 -07004420 data.writeString(callingPackage);
Amith Yamasani37ce3a82012-02-06 12:04:42 -08004421 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004422 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
4423 reply.readException();
4424 int res = reply.readInt();
4425 data.recycle();
4426 reply.recycle();
4427 return res;
4428 }
4429 public boolean unbindService(IServiceConnection connection) throws RemoteException
4430 {
4431 Parcel data = Parcel.obtain();
4432 Parcel reply = Parcel.obtain();
4433 data.writeInterfaceToken(IActivityManager.descriptor);
4434 data.writeStrongBinder(connection.asBinder());
4435 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
4436 reply.readException();
4437 boolean res = reply.readInt() != 0;
4438 data.recycle();
4439 reply.recycle();
4440 return res;
4441 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004442
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004443 public void publishService(IBinder token,
4444 Intent intent, IBinder service) throws RemoteException {
4445 Parcel data = Parcel.obtain();
4446 Parcel reply = Parcel.obtain();
4447 data.writeInterfaceToken(IActivityManager.descriptor);
4448 data.writeStrongBinder(token);
4449 intent.writeToParcel(data, 0);
4450 data.writeStrongBinder(service);
4451 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
4452 reply.readException();
4453 data.recycle();
4454 reply.recycle();
4455 }
4456
4457 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
4458 throws RemoteException {
4459 Parcel data = Parcel.obtain();
4460 Parcel reply = Parcel.obtain();
4461 data.writeInterfaceToken(IActivityManager.descriptor);
4462 data.writeStrongBinder(token);
4463 intent.writeToParcel(data, 0);
4464 data.writeInt(doRebind ? 1 : 0);
4465 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
4466 reply.readException();
4467 data.recycle();
4468 reply.recycle();
4469 }
4470
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07004471 public void serviceDoneExecuting(IBinder token, int type, int startId,
4472 int res) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004473 Parcel data = Parcel.obtain();
4474 Parcel reply = Parcel.obtain();
4475 data.writeInterfaceToken(IActivityManager.descriptor);
4476 data.writeStrongBinder(token);
Dianne Hackbornf6f9f2d2009-08-21 16:26:03 -07004477 data.writeInt(type);
4478 data.writeInt(startId);
4479 data.writeInt(res);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004480 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
4481 reply.readException();
4482 data.recycle();
4483 reply.recycle();
4484 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07004485
Svet Ganov99b60432015-06-27 13:15:22 -07004486 public IBinder peekService(Intent service, String resolvedType, String callingPackage)
4487 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004488 Parcel data = Parcel.obtain();
4489 Parcel reply = Parcel.obtain();
4490 data.writeInterfaceToken(IActivityManager.descriptor);
4491 service.writeToParcel(data, 0);
4492 data.writeString(resolvedType);
Svet Ganov99b60432015-06-27 13:15:22 -07004493 data.writeString(callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004494 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
4495 reply.readException();
4496 IBinder binder = reply.readStrongBinder();
4497 reply.recycle();
4498 data.recycle();
4499 return binder;
4500 }
4501
Christopher Tatec58054f2016-06-13 15:17:54 -07004502 public boolean bindBackupAgent(String packageName, int backupRestoreMode, int userId)
Christopher Tate181fafa2009-05-14 11:12:14 -07004503 throws RemoteException {
4504 Parcel data = Parcel.obtain();
4505 Parcel reply = Parcel.obtain();
4506 data.writeInterfaceToken(IActivityManager.descriptor);
Christopher Tatec58054f2016-06-13 15:17:54 -07004507 data.writeString(packageName);
Christopher Tate181fafa2009-05-14 11:12:14 -07004508 data.writeInt(backupRestoreMode);
Christopher Tatec58054f2016-06-13 15:17:54 -07004509 data.writeInt(userId);
Christopher Tate181fafa2009-05-14 11:12:14 -07004510 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
4511 reply.readException();
4512 boolean success = reply.readInt() != 0;
4513 reply.recycle();
4514 data.recycle();
4515 return success;
4516 }
4517
Christopher Tate346acb12012-10-15 19:20:25 -07004518 public void clearPendingBackup() throws RemoteException {
4519 Parcel data = Parcel.obtain();
4520 Parcel reply = Parcel.obtain();
4521 data.writeInterfaceToken(IActivityManager.descriptor);
4522 mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0);
4523 reply.recycle();
4524 data.recycle();
4525 }
4526
Christopher Tate181fafa2009-05-14 11:12:14 -07004527 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
4528 Parcel data = Parcel.obtain();
4529 Parcel reply = Parcel.obtain();
4530 data.writeInterfaceToken(IActivityManager.descriptor);
4531 data.writeString(packageName);
4532 data.writeStrongBinder(agent);
4533 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
4534 reply.recycle();
4535 data.recycle();
4536 }
4537
4538 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
4539 Parcel data = Parcel.obtain();
4540 Parcel reply = Parcel.obtain();
4541 data.writeInterfaceToken(IActivityManager.descriptor);
4542 app.writeToParcel(data, 0);
4543 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
4544 reply.readException();
4545 reply.recycle();
4546 data.recycle();
4547 }
4548
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004549 public boolean startInstrumentation(ComponentName className, String profileFile,
Svetoslav Ganov80943d82013-01-02 10:25:37 -08004550 int flags, Bundle arguments, IInstrumentationWatcher watcher,
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01004551 IUiAutomationConnection connection, int userId, String instructionSet)
4552 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004553 Parcel data = Parcel.obtain();
4554 Parcel reply = Parcel.obtain();
4555 data.writeInterfaceToken(IActivityManager.descriptor);
4556 ComponentName.writeToParcel(className, data);
4557 data.writeString(profileFile);
4558 data.writeInt(flags);
4559 data.writeBundle(arguments);
4560 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Svetoslav Ganov80943d82013-01-02 10:25:37 -08004561 data.writeStrongBinder(connection != null ? connection.asBinder() : null);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07004562 data.writeInt(userId);
Narayan Kamath8dcfefd2014-05-15 18:12:59 +01004563 data.writeString(instructionSet);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004564 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
4565 reply.readException();
4566 boolean res = reply.readInt() != 0;
4567 reply.recycle();
4568 data.recycle();
4569 return res;
4570 }
4571
4572 public void finishInstrumentation(IApplicationThread target,
4573 int resultCode, Bundle results) throws RemoteException {
4574 Parcel data = Parcel.obtain();
4575 Parcel reply = Parcel.obtain();
4576 data.writeInterfaceToken(IActivityManager.descriptor);
4577 data.writeStrongBinder(target != null ? target.asBinder() : null);
4578 data.writeInt(resultCode);
4579 data.writeBundle(results);
4580 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
4581 reply.readException();
4582 data.recycle();
4583 reply.recycle();
4584 }
4585 public Configuration getConfiguration() throws RemoteException
4586 {
4587 Parcel data = Parcel.obtain();
4588 Parcel reply = Parcel.obtain();
4589 data.writeInterfaceToken(IActivityManager.descriptor);
4590 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
4591 reply.readException();
4592 Configuration res = Configuration.CREATOR.createFromParcel(reply);
4593 reply.recycle();
4594 data.recycle();
4595 return res;
4596 }
Wale Ogunwale02896ab2016-10-05 09:08:43 -07004597 public boolean updateConfiguration(Configuration values) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004598 {
4599 Parcel data = Parcel.obtain();
4600 Parcel reply = Parcel.obtain();
4601 data.writeInterfaceToken(IActivityManager.descriptor);
4602 values.writeToParcel(data, 0);
4603 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
4604 reply.readException();
Wale Ogunwale02896ab2016-10-05 09:08:43 -07004605 boolean updated = reply.readInt() == 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004606 data.recycle();
4607 reply.recycle();
Wale Ogunwale02896ab2016-10-05 09:08:43 -07004608 return updated;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004609 }
4610 public void setRequestedOrientation(IBinder token, int requestedOrientation)
4611 throws RemoteException {
4612 Parcel data = Parcel.obtain();
4613 Parcel reply = Parcel.obtain();
4614 data.writeInterfaceToken(IActivityManager.descriptor);
4615 data.writeStrongBinder(token);
4616 data.writeInt(requestedOrientation);
4617 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
4618 reply.readException();
4619 data.recycle();
4620 reply.recycle();
4621 }
4622 public int getRequestedOrientation(IBinder token) throws RemoteException {
4623 Parcel data = Parcel.obtain();
4624 Parcel reply = Parcel.obtain();
4625 data.writeInterfaceToken(IActivityManager.descriptor);
4626 data.writeStrongBinder(token);
4627 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
4628 reply.readException();
4629 int res = reply.readInt();
4630 data.recycle();
4631 reply.recycle();
4632 return res;
4633 }
4634 public ComponentName getActivityClassForToken(IBinder token)
4635 throws RemoteException {
4636 Parcel data = Parcel.obtain();
4637 Parcel reply = Parcel.obtain();
4638 data.writeInterfaceToken(IActivityManager.descriptor);
4639 data.writeStrongBinder(token);
4640 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
4641 reply.readException();
4642 ComponentName res = ComponentName.readFromParcel(reply);
4643 data.recycle();
4644 reply.recycle();
4645 return res;
4646 }
4647 public String getPackageForToken(IBinder token) throws RemoteException
4648 {
4649 Parcel data = Parcel.obtain();
4650 Parcel reply = Parcel.obtain();
4651 data.writeInterfaceToken(IActivityManager.descriptor);
4652 data.writeStrongBinder(token);
4653 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
4654 reply.readException();
4655 String res = reply.readString();
4656 data.recycle();
4657 reply.recycle();
4658 return res;
4659 }
4660 public IIntentSender getIntentSender(int type,
4661 String packageName, IBinder token, String resultWho,
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07004662 int requestCode, Intent[] intents, String[] resolvedTypes, int flags,
Dianne Hackborn41203752012-08-31 14:05:51 -07004663 Bundle options, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004664 Parcel data = Parcel.obtain();
4665 Parcel reply = Parcel.obtain();
4666 data.writeInterfaceToken(IActivityManager.descriptor);
4667 data.writeInt(type);
4668 data.writeString(packageName);
4669 data.writeStrongBinder(token);
4670 data.writeString(resultWho);
4671 data.writeInt(requestCode);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004672 if (intents != null) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004673 data.writeInt(1);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08004674 data.writeTypedArray(intents, 0);
4675 data.writeStringArray(resolvedTypes);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004676 } else {
4677 data.writeInt(0);
4678 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004679 data.writeInt(flags);
Dianne Hackborn7a2195c2012-03-19 17:38:00 -07004680 if (options != null) {
4681 data.writeInt(1);
4682 options.writeToParcel(data, 0);
4683 } else {
4684 data.writeInt(0);
4685 }
Dianne Hackborn41203752012-08-31 14:05:51 -07004686 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004687 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
4688 reply.readException();
4689 IIntentSender res = IIntentSender.Stub.asInterface(
Dianne Hackbornff170242014-11-19 10:59:01 -08004690 reply.readStrongBinder());
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004691 data.recycle();
4692 reply.recycle();
4693 return res;
4694 }
4695 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
4696 Parcel data = Parcel.obtain();
4697 Parcel reply = Parcel.obtain();
4698 data.writeInterfaceToken(IActivityManager.descriptor);
4699 data.writeStrongBinder(sender.asBinder());
4700 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
4701 reply.readException();
4702 data.recycle();
4703 reply.recycle();
4704 }
4705 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
4706 Parcel data = Parcel.obtain();
4707 Parcel reply = Parcel.obtain();
4708 data.writeInterfaceToken(IActivityManager.descriptor);
4709 data.writeStrongBinder(sender.asBinder());
4710 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4711 reply.readException();
4712 String res = reply.readString();
4713 data.recycle();
4714 reply.recycle();
4715 return res;
4716 }
Christopher Tatec4a07d12012-04-06 14:19:13 -07004717 public int getUidForIntentSender(IIntentSender sender) throws RemoteException {
4718 Parcel data = Parcel.obtain();
4719 Parcel reply = Parcel.obtain();
4720 data.writeInterfaceToken(IActivityManager.descriptor);
4721 data.writeStrongBinder(sender.asBinder());
4722 mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4723 reply.readException();
4724 int res = reply.readInt();
4725 data.recycle();
4726 reply.recycle();
4727 return res;
4728 }
Dianne Hackborn41203752012-08-31 14:05:51 -07004729 public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
4730 boolean requireFull, String name, String callerPackage) throws RemoteException {
4731 Parcel data = Parcel.obtain();
4732 Parcel reply = Parcel.obtain();
4733 data.writeInterfaceToken(IActivityManager.descriptor);
4734 data.writeInt(callingPid);
4735 data.writeInt(callingUid);
4736 data.writeInt(userId);
4737 data.writeInt(allowAll ? 1 : 0);
4738 data.writeInt(requireFull ? 1 : 0);
4739 data.writeString(name);
4740 data.writeString(callerPackage);
4741 mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0);
4742 reply.readException();
4743 int res = reply.readInt();
4744 data.recycle();
4745 reply.recycle();
4746 return res;
4747 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004748 public void setProcessLimit(int max) throws RemoteException
4749 {
4750 Parcel data = Parcel.obtain();
4751 Parcel reply = Parcel.obtain();
4752 data.writeInterfaceToken(IActivityManager.descriptor);
4753 data.writeInt(max);
4754 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4755 reply.readException();
4756 data.recycle();
4757 reply.recycle();
4758 }
4759 public int getProcessLimit() throws RemoteException
4760 {
4761 Parcel data = Parcel.obtain();
4762 Parcel reply = Parcel.obtain();
4763 data.writeInterfaceToken(IActivityManager.descriptor);
4764 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4765 reply.readException();
4766 int res = reply.readInt();
4767 data.recycle();
4768 reply.recycle();
4769 return res;
4770 }
4771 public void setProcessForeground(IBinder token, int pid,
4772 boolean isForeground) throws RemoteException {
4773 Parcel data = Parcel.obtain();
4774 Parcel reply = Parcel.obtain();
4775 data.writeInterfaceToken(IActivityManager.descriptor);
4776 data.writeStrongBinder(token);
4777 data.writeInt(pid);
4778 data.writeInt(isForeground ? 1 : 0);
4779 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
4780 reply.readException();
4781 data.recycle();
4782 reply.recycle();
4783 }
4784 public int checkPermission(String permission, int pid, int uid)
4785 throws RemoteException {
4786 Parcel data = Parcel.obtain();
4787 Parcel reply = Parcel.obtain();
4788 data.writeInterfaceToken(IActivityManager.descriptor);
4789 data.writeString(permission);
4790 data.writeInt(pid);
4791 data.writeInt(uid);
4792 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
4793 reply.readException();
4794 int res = reply.readInt();
4795 data.recycle();
4796 reply.recycle();
4797 return res;
4798 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004799 public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken)
4800 throws RemoteException {
4801 Parcel data = Parcel.obtain();
4802 Parcel reply = Parcel.obtain();
4803 data.writeInterfaceToken(IActivityManager.descriptor);
4804 data.writeString(permission);
4805 data.writeInt(pid);
4806 data.writeInt(uid);
4807 data.writeStrongBinder(callerToken);
4808 mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0);
4809 reply.readException();
4810 int res = reply.readInt();
4811 data.recycle();
4812 reply.recycle();
4813 return res;
4814 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004815 public boolean clearApplicationUserData(final String packageName,
Amith Yamasani742a6712011-05-04 14:49:28 -07004816 final IPackageDataObserver observer, final int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004817 Parcel data = Parcel.obtain();
4818 Parcel reply = Parcel.obtain();
4819 data.writeInterfaceToken(IActivityManager.descriptor);
4820 data.writeString(packageName);
Christopher Tate31b65f92013-09-09 14:17:27 -07004821 data.writeStrongBinder((observer != null) ? observer.asBinder() : null);
Amith Yamasani742a6712011-05-04 14:49:28 -07004822 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004823 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
4824 reply.readException();
4825 boolean res = reply.readInt() != 0;
4826 data.recycle();
4827 reply.recycle();
4828 return res;
4829 }
Dianne Hackbornff170242014-11-19 10:59:01 -08004830 public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId,
4831 IBinder callerToken) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004832 Parcel data = Parcel.obtain();
4833 Parcel reply = Parcel.obtain();
4834 data.writeInterfaceToken(IActivityManager.descriptor);
4835 uri.writeToParcel(data, 0);
4836 data.writeInt(pid);
4837 data.writeInt(uid);
4838 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004839 data.writeInt(userId);
Dianne Hackbornff170242014-11-19 10:59:01 -08004840 data.writeStrongBinder(callerToken);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004841 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
4842 reply.readException();
4843 int res = reply.readInt();
4844 data.recycle();
4845 reply.recycle();
4846 return res;
4847 }
4848 public void grantUriPermission(IApplicationThread caller, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004849 Uri uri, int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004850 Parcel data = Parcel.obtain();
4851 Parcel reply = Parcel.obtain();
4852 data.writeInterfaceToken(IActivityManager.descriptor);
4853 data.writeStrongBinder(caller.asBinder());
4854 data.writeString(targetPkg);
4855 uri.writeToParcel(data, 0);
4856 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004857 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004858 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4859 reply.readException();
4860 data.recycle();
4861 reply.recycle();
4862 }
4863 public void revokeUriPermission(IApplicationThread caller, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004864 int mode, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004865 Parcel data = Parcel.obtain();
4866 Parcel reply = Parcel.obtain();
4867 data.writeInterfaceToken(IActivityManager.descriptor);
4868 data.writeStrongBinder(caller.asBinder());
4869 uri.writeToParcel(data, 0);
4870 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004871 data.writeInt(userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004872 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4873 reply.readException();
4874 data.recycle();
4875 reply.recycle();
4876 }
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004877
4878 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004879 public void takePersistableUriPermission(Uri uri, int mode, int userId)
4880 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004881 Parcel data = Parcel.obtain();
4882 Parcel reply = Parcel.obtain();
4883 data.writeInterfaceToken(IActivityManager.descriptor);
4884 uri.writeToParcel(data, 0);
4885 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004886 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004887 mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4888 reply.readException();
4889 data.recycle();
4890 reply.recycle();
4891 }
4892
4893 @Override
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004894 public void releasePersistableUriPermission(Uri uri, int mode, int userId)
4895 throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004896 Parcel data = Parcel.obtain();
4897 Parcel reply = Parcel.obtain();
4898 data.writeInterfaceToken(IActivityManager.descriptor);
4899 uri.writeToParcel(data, 0);
4900 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01004901 data.writeInt(userId);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004902 mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4903 reply.readException();
4904 data.recycle();
4905 reply.recycle();
4906 }
4907
4908 @Override
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004909 public ParceledListSlice<UriPermission> getPersistedUriPermissions(
4910 String packageName, boolean incoming) throws RemoteException {
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004911 Parcel data = Parcel.obtain();
4912 Parcel reply = Parcel.obtain();
4913 data.writeInterfaceToken(IActivityManager.descriptor);
Jeff Sharkeybcaac0a2013-10-09 14:21:08 -07004914 data.writeString(packageName);
4915 data.writeInt(incoming ? 1 : 0);
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004916 mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
4917 reply.readException();
Felipe Lemef3fa0f82016-01-07 12:08:19 -08004918 @SuppressWarnings("unchecked")
Jeff Sharkeye66c1772013-09-20 14:30:59 -07004919 final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel(
4920 reply);
4921 data.recycle();
4922 reply.recycle();
4923 return perms;
4924 }
4925
Felipe Lemef3fa0f82016-01-07 12:08:19 -08004926 @Override
4927 public ParceledListSlice<UriPermission> getGrantedUriPermissions(String packageName, int userId)
4928 throws RemoteException {
4929 Parcel data = Parcel.obtain();
4930 Parcel reply = Parcel.obtain();
4931 data.writeInterfaceToken(IActivityManager.descriptor);
4932 data.writeString(packageName);
4933 data.writeInt(userId);
4934 mRemote.transact(GET_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
4935 reply.readException();
4936 @SuppressWarnings("unchecked")
4937 final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel(
4938 reply);
4939 data.recycle();
4940 reply.recycle();
4941 return perms;
4942 }
4943
4944 @Override
4945 public void clearGrantedUriPermissions(String packageName, int userId) throws RemoteException {
4946 Parcel data = Parcel.obtain();
4947 Parcel reply = Parcel.obtain();
4948 data.writeInterfaceToken(IActivityManager.descriptor);
4949 data.writeString(packageName);
4950 data.writeInt(userId);
4951 mRemote.transact(CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
4952 reply.readException();
4953 data.recycle();
4954 reply.recycle();
4955 }
4956
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004957 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
4958 throws RemoteException {
4959 Parcel data = Parcel.obtain();
4960 Parcel reply = Parcel.obtain();
4961 data.writeInterfaceToken(IActivityManager.descriptor);
4962 data.writeStrongBinder(who.asBinder());
4963 data.writeInt(waiting ? 1 : 0);
4964 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
4965 reply.readException();
4966 data.recycle();
4967 reply.recycle();
4968 }
4969 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
4970 Parcel data = Parcel.obtain();
4971 Parcel reply = Parcel.obtain();
4972 data.writeInterfaceToken(IActivityManager.descriptor);
4973 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
4974 reply.readException();
4975 outInfo.readFromParcel(reply);
4976 data.recycle();
4977 reply.recycle();
4978 }
4979 public void unhandledBack() throws RemoteException
4980 {
4981 Parcel data = Parcel.obtain();
4982 Parcel reply = Parcel.obtain();
4983 data.writeInterfaceToken(IActivityManager.descriptor);
4984 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
4985 reply.readException();
4986 data.recycle();
4987 reply.recycle();
4988 }
4989 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
4990 {
4991 Parcel data = Parcel.obtain();
4992 Parcel reply = Parcel.obtain();
4993 data.writeInterfaceToken(IActivityManager.descriptor);
4994 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
4995 reply.readException();
4996 ParcelFileDescriptor pfd = null;
4997 if (reply.readInt() != 0) {
4998 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
4999 }
5000 data.recycle();
5001 reply.recycle();
5002 return pfd;
5003 }
Wale Ogunwale99732942016-05-06 10:13:14 -07005004 public void setLockScreenShown(boolean showing, boolean occluded) throws RemoteException
Dianne Hackbornff5b1582012-04-12 17:24:07 -07005005 {
5006 Parcel data = Parcel.obtain();
5007 Parcel reply = Parcel.obtain();
5008 data.writeInterfaceToken(IActivityManager.descriptor);
Wale Ogunwale99732942016-05-06 10:13:14 -07005009 data.writeInt(showing ? 1 : 0);
5010 data.writeInt(occluded ? 1 : 0);
Dianne Hackbornff5b1582012-04-12 17:24:07 -07005011 mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0);
5012 reply.readException();
5013 data.recycle();
5014 reply.recycle();
5015 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005016 public void setDebugApp(
5017 String packageName, boolean waitForDebugger, boolean persistent)
5018 throws RemoteException
5019 {
5020 Parcel data = Parcel.obtain();
5021 Parcel reply = Parcel.obtain();
5022 data.writeInterfaceToken(IActivityManager.descriptor);
5023 data.writeString(packageName);
5024 data.writeInt(waitForDebugger ? 1 : 0);
5025 data.writeInt(persistent ? 1 : 0);
5026 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
5027 reply.readException();
5028 data.recycle();
5029 reply.recycle();
5030 }
5031 public void setAlwaysFinish(boolean enabled) throws RemoteException
5032 {
5033 Parcel data = Parcel.obtain();
5034 Parcel reply = Parcel.obtain();
5035 data.writeInterfaceToken(IActivityManager.descriptor);
5036 data.writeInt(enabled ? 1 : 0);
5037 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
5038 reply.readException();
5039 data.recycle();
5040 reply.recycle();
5041 }
Dianne Hackborn4a18c262016-02-26 17:23:48 -08005042 public void setActivityController(IActivityController watcher, boolean imAMonkey)
5043 throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005044 {
5045 Parcel data = Parcel.obtain();
5046 Parcel reply = Parcel.obtain();
5047 data.writeInterfaceToken(IActivityManager.descriptor);
5048 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
Dianne Hackborn4a18c262016-02-26 17:23:48 -08005049 data.writeInt(imAMonkey ? 1 : 0);
Dianne Hackbornb06ea702009-07-13 13:07:51 -07005050 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005051 reply.readException();
5052 data.recycle();
5053 reply.recycle();
5054 }
Dianne Hackbornb2117d12016-02-16 18:26:35 -08005055 public void setLenientBackgroundCheck(boolean enabled) throws RemoteException
5056 {
5057 Parcel data = Parcel.obtain();
5058 Parcel reply = Parcel.obtain();
5059 data.writeInterfaceToken(IActivityManager.descriptor);
5060 data.writeInt(enabled ? 1 : 0);
5061 mRemote.transact(SET_LENIENT_BACKGROUND_CHECK_TRANSACTION, data, reply, 0);
5062 reply.readException();
5063 data.recycle();
5064 reply.recycle();
5065 }
Dianne Hackborn970510b2016-02-24 16:56:42 -08005066 public int getMemoryTrimLevel() throws RemoteException
5067 {
5068 Parcel data = Parcel.obtain();
5069 Parcel reply = Parcel.obtain();
5070 data.writeInterfaceToken(IActivityManager.descriptor);
5071 mRemote.transact(GET_MEMORY_TRIM_LEVEL_TRANSACTION, data, reply, 0);
5072 reply.readException();
5073 int level = reply.readInt();
5074 data.recycle();
5075 reply.recycle();
5076 return level;
5077 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005078 public void enterSafeMode() throws RemoteException {
5079 Parcel data = Parcel.obtain();
5080 data.writeInterfaceToken(IActivityManager.descriptor);
5081 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
5082 data.recycle();
5083 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07005084 public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag)
Dianne Hackborn099bc622014-01-22 13:39:16 -08005085 throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005086 Parcel data = Parcel.obtain();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005087 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn099bc622014-01-22 13:39:16 -08005088 data.writeStrongBinder(sender.asBinder());
5089 data.writeInt(sourceUid);
5090 data.writeString(sourcePkg);
Dianne Hackborn1e383822015-04-10 14:02:33 -07005091 data.writeString(tag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005092 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
5093 data.recycle();
5094 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07005095 public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag)
5096 throws RemoteException {
5097 Parcel data = Parcel.obtain();
5098 data.writeInterfaceToken(IActivityManager.descriptor);
5099 data.writeStrongBinder(sender.asBinder());
5100 data.writeInt(sourceUid);
5101 data.writeString(tag);
5102 mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0);
5103 data.recycle();
5104 }
5105 public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag)
5106 throws RemoteException {
5107 Parcel data = Parcel.obtain();
5108 data.writeInterfaceToken(IActivityManager.descriptor);
5109 data.writeStrongBinder(sender.asBinder());
5110 data.writeInt(sourceUid);
5111 data.writeString(tag);
5112 mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0);
5113 data.recycle();
5114 }
Dianne Hackborn64825172011-03-02 21:32:58 -08005115 public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005116 Parcel data = Parcel.obtain();
5117 Parcel reply = Parcel.obtain();
5118 data.writeInterfaceToken(IActivityManager.descriptor);
5119 data.writeIntArray(pids);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07005120 data.writeString(reason);
Dianne Hackborn64825172011-03-02 21:32:58 -08005121 data.writeInt(secure ? 1 : 0);
Suchi Amalapurapue99bb5f2010-03-19 14:36:49 -07005122 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07005123 reply.readException();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005124 boolean res = reply.readInt() != 0;
5125 data.recycle();
5126 reply.recycle();
5127 return res;
5128 }
Jeff Sharkeyb9a07012012-03-22 17:00:04 -07005129 @Override
5130 public boolean killProcessesBelowForeground(String reason) throws RemoteException {
5131 Parcel data = Parcel.obtain();
5132 Parcel reply = Parcel.obtain();
5133 data.writeInterfaceToken(IActivityManager.descriptor);
5134 data.writeString(reason);
5135 mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0);
5136 boolean res = reply.readInt() != 0;
5137 data.recycle();
5138 reply.recycle();
5139 return res;
5140 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005141 public boolean testIsSystemReady()
5142 {
5143 /* this base class version is never called */
5144 return true;
5145 }
Dan Egnor60d87622009-12-16 16:32:58 -08005146 public void handleApplicationCrash(IBinder app,
5147 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
5148 {
5149 Parcel data = Parcel.obtain();
5150 Parcel reply = Parcel.obtain();
5151 data.writeInterfaceToken(IActivityManager.descriptor);
5152 data.writeStrongBinder(app);
5153 crashInfo.writeToParcel(data, 0);
5154 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
5155 reply.readException();
5156 reply.recycle();
5157 data.recycle();
5158 }
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07005159
Dianne Hackborn52322712014-08-26 22:47:26 -07005160 public boolean handleApplicationWtf(IBinder app, String tag, boolean system,
Dan Egnorb7f03672009-12-09 16:22:32 -08005161 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005162 {
5163 Parcel data = Parcel.obtain();
5164 Parcel reply = Parcel.obtain();
5165 data.writeInterfaceToken(IActivityManager.descriptor);
5166 data.writeStrongBinder(app);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005167 data.writeString(tag);
Dianne Hackborn52322712014-08-26 22:47:26 -07005168 data.writeInt(system ? 1 : 0);
Dan Egnorb7f03672009-12-09 16:22:32 -08005169 crashInfo.writeToParcel(data, 0);
Dan Egnor60d87622009-12-16 16:32:58 -08005170 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005171 reply.readException();
Dan Egnor60d87622009-12-16 16:32:58 -08005172 boolean res = reply.readInt() != 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005173 reply.recycle();
5174 data.recycle();
Dan Egnor60d87622009-12-16 16:32:58 -08005175 return res;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005176 }
Dan Egnorb7f03672009-12-09 16:22:32 -08005177
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07005178 public void handleApplicationStrictModeViolation(IBinder app,
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07005179 int violationMask,
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07005180 StrictMode.ViolationInfo info) throws RemoteException
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07005181 {
5182 Parcel data = Parcel.obtain();
5183 Parcel reply = Parcel.obtain();
5184 data.writeInterfaceToken(IActivityManager.descriptor);
5185 data.writeStrongBinder(app);
Brad Fitzpatrick46d42382010-06-11 13:57:58 -07005186 data.writeInt(violationMask);
Brad Fitzpatrickcb9ceb12010-07-29 14:29:02 -07005187 info.writeToParcel(data, 0);
Brad Fitzpatrick438d0592010-06-10 12:19:19 -07005188 mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0);
5189 reply.readException();
5190 reply.recycle();
5191 data.recycle();
5192 }
5193
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005194 public void signalPersistentProcesses(int sig) throws RemoteException {
5195 Parcel data = Parcel.obtain();
5196 Parcel reply = Parcel.obtain();
5197 data.writeInterfaceToken(IActivityManager.descriptor);
5198 data.writeInt(sig);
5199 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
5200 reply.readException();
5201 data.recycle();
5202 reply.recycle();
5203 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08005204
Dianne Hackborn1676c852012-09-10 14:52:30 -07005205 public void killBackgroundProcesses(String packageName, int userId) throws RemoteException {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005206 Parcel data = Parcel.obtain();
5207 Parcel reply = Parcel.obtain();
5208 data.writeInterfaceToken(IActivityManager.descriptor);
5209 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07005210 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08005211 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
5212 reply.readException();
5213 data.recycle();
5214 reply.recycle();
5215 }
Dianne Hackborne4d4fbc2011-11-08 11:53:28 -08005216
5217 public void killAllBackgroundProcesses() throws RemoteException {
5218 Parcel data = Parcel.obtain();
5219 Parcel reply = Parcel.obtain();
5220 data.writeInterfaceToken(IActivityManager.descriptor);
5221 mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
5222 reply.readException();
5223 data.recycle();
5224 reply.recycle();
5225 }
5226
Gustav Sennton6258dcd2015-10-30 19:25:37 +00005227 public void killPackageDependents(String packageName, int userId) throws RemoteException {
5228 Parcel data = Parcel.obtain();
5229 Parcel reply = Parcel.obtain();
5230 data.writeInterfaceToken(IActivityManager.descriptor);
5231 data.writeString(packageName);
5232 data.writeInt(userId);
5233 mRemote.transact(KILL_PACKAGE_DEPENDENTS_TRANSACTION, data, reply, 0);
5234 reply.readException();
5235 data.recycle();
5236 reply.recycle();
5237 }
5238
Dianne Hackborn1676c852012-09-10 14:52:30 -07005239 public void forceStopPackage(String packageName, int userId) throws RemoteException {
Dianne Hackborn03abb812010-01-04 18:43:19 -08005240 Parcel data = Parcel.obtain();
5241 Parcel reply = Parcel.obtain();
5242 data.writeInterfaceToken(IActivityManager.descriptor);
5243 data.writeString(packageName);
Dianne Hackborn1676c852012-09-10 14:52:30 -07005244 data.writeInt(userId);
Dianne Hackborn03abb812010-01-04 18:43:19 -08005245 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005246 reply.readException();
5247 data.recycle();
5248 reply.recycle();
5249 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07005250
Dianne Hackborn27ff9132012-03-06 14:57:58 -08005251 public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
5252 throws RemoteException
5253 {
5254 Parcel data = Parcel.obtain();
5255 Parcel reply = Parcel.obtain();
5256 data.writeInterfaceToken(IActivityManager.descriptor);
5257 mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0);
5258 reply.readException();
5259 outInfo.readFromParcel(reply);
5260 reply.recycle();
5261 data.recycle();
5262 }
5263
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005264 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
5265 {
5266 Parcel data = Parcel.obtain();
5267 Parcel reply = Parcel.obtain();
5268 data.writeInterfaceToken(IActivityManager.descriptor);
5269 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
5270 reply.readException();
5271 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
5272 reply.recycle();
5273 data.recycle();
5274 return res;
5275 }
Jeff Hao1b012d32014-08-20 10:35:34 -07005276
Dianne Hackborn1676c852012-09-10 14:52:30 -07005277 public boolean profileControl(String process, int userId, boolean start,
Jeff Hao1b012d32014-08-20 10:35:34 -07005278 ProfilerInfo profilerInfo, int profileType) throws RemoteException
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08005279 {
5280 Parcel data = Parcel.obtain();
5281 Parcel reply = Parcel.obtain();
5282 data.writeInterfaceToken(IActivityManager.descriptor);
5283 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07005284 data.writeInt(userId);
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08005285 data.writeInt(start ? 1 : 0);
Romain Guy9a8c5ce2011-07-21 18:04:29 -07005286 data.writeInt(profileType);
Jeff Hao1b012d32014-08-20 10:35:34 -07005287 if (profilerInfo != null) {
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07005288 data.writeInt(1);
Jeff Hao1b012d32014-08-20 10:35:34 -07005289 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
Dianne Hackborn9c8dd552009-06-23 19:22:52 -07005290 } else {
5291 data.writeInt(0);
5292 }
The Android Open Source Projectf5b4b982009-03-05 20:00:43 -08005293 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
5294 reply.readException();
5295 boolean res = reply.readInt() != 0;
5296 reply.recycle();
5297 data.recycle();
5298 return res;
5299 }
Jeff Hao1b012d32014-08-20 10:35:34 -07005300
Dianne Hackborn55280a92009-05-07 15:53:46 -07005301 public boolean shutdown(int timeout) throws RemoteException
5302 {
5303 Parcel data = Parcel.obtain();
5304 Parcel reply = Parcel.obtain();
5305 data.writeInterfaceToken(IActivityManager.descriptor);
5306 data.writeInt(timeout);
5307 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
5308 reply.readException();
5309 boolean res = reply.readInt() != 0;
5310 reply.recycle();
5311 data.recycle();
5312 return res;
5313 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07005314
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07005315 public void stopAppSwitches() throws RemoteException {
5316 Parcel data = Parcel.obtain();
5317 Parcel reply = Parcel.obtain();
5318 data.writeInterfaceToken(IActivityManager.descriptor);
5319 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
5320 reply.readException();
5321 reply.recycle();
5322 data.recycle();
5323 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07005324
Dianne Hackborn95fc68f2009-05-19 18:37:45 -07005325 public void resumeAppSwitches() throws RemoteException {
5326 Parcel data = Parcel.obtain();
5327 Parcel reply = Parcel.obtain();
5328 data.writeInterfaceToken(IActivityManager.descriptor);
5329 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
5330 reply.readException();
5331 reply.recycle();
5332 data.recycle();
5333 }
Dianne Hackbornfee756f2014-07-16 17:31:10 -07005334
5335 public void addPackageDependency(String packageName) throws RemoteException {
5336 Parcel data = Parcel.obtain();
5337 Parcel reply = Parcel.obtain();
5338 data.writeInterfaceToken(IActivityManager.descriptor);
5339 data.writeString(packageName);
5340 mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0);
5341 reply.readException();
5342 data.recycle();
5343 reply.recycle();
5344 }
5345
Jeff Sharkey85f449e2016-06-23 09:26:00 -06005346 public void killApplication(String pkg, int appId, int userId, String reason)
Dianne Hackborn21d9b562013-05-28 17:46:59 -07005347 throws RemoteException {
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07005348 Parcel data = Parcel.obtain();
5349 Parcel reply = Parcel.obtain();
5350 data.writeInterfaceToken(IActivityManager.descriptor);
5351 data.writeString(pkg);
Jeff Sharkey85f449e2016-06-23 09:26:00 -06005352 data.writeInt(appId);
5353 data.writeInt(userId);
Dianne Hackborn21d9b562013-05-28 17:46:59 -07005354 data.writeString(reason);
Jeff Sharkey85f449e2016-06-23 09:26:00 -06005355 mRemote.transact(KILL_APPLICATION_TRANSACTION, data, reply, 0);
Suchi Amalapurapu261e66a2009-07-27 15:21:34 -07005356 reply.readException();
5357 data.recycle();
5358 reply.recycle();
5359 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07005360
Dianne Hackborna6ddc8a2009-07-28 17:49:55 -07005361 public void closeSystemDialogs(String reason) throws RemoteException {
5362 Parcel data = Parcel.obtain();
5363 Parcel reply = Parcel.obtain();
5364 data.writeInterfaceToken(IActivityManager.descriptor);
5365 data.writeString(reason);
5366 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
5367 reply.readException();
5368 data.recycle();
5369 reply.recycle();
5370 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07005371
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07005372 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
Dianne Hackborn3025ef32009-08-31 21:31:47 -07005373 throws RemoteException {
5374 Parcel data = Parcel.obtain();
5375 Parcel reply = Parcel.obtain();
5376 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07005377 data.writeIntArray(pids);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07005378 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
5379 reply.readException();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07005380 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
Dianne Hackborn3025ef32009-08-31 21:31:47 -07005381 data.recycle();
5382 reply.recycle();
Dianne Hackborn4f21c4c2009-09-17 10:24:05 -07005383 return res;
Dianne Hackborn3025ef32009-08-31 21:31:47 -07005384 }
Christopher Tate5e1ab332009-09-01 20:32:49 -07005385
5386 public void killApplicationProcess(String processName, int uid) throws RemoteException {
5387 Parcel data = Parcel.obtain();
5388 Parcel reply = Parcel.obtain();
5389 data.writeInterfaceToken(IActivityManager.descriptor);
5390 data.writeString(processName);
5391 data.writeInt(uid);
5392 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
5393 reply.readException();
5394 data.recycle();
5395 reply.recycle();
5396 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07005397
Dianne Hackborn3b3e1452009-09-24 19:22:12 -07005398 public void overridePendingTransition(IBinder token, String packageName,
5399 int enterAnim, int exitAnim) throws RemoteException {
5400 Parcel data = Parcel.obtain();
5401 Parcel reply = Parcel.obtain();
5402 data.writeInterfaceToken(IActivityManager.descriptor);
5403 data.writeStrongBinder(token);
5404 data.writeString(packageName);
5405 data.writeInt(enterAnim);
5406 data.writeInt(exitAnim);
5407 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
5408 reply.readException();
5409 data.recycle();
5410 reply.recycle();
5411 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07005412
Dianne Hackborn9327f4f2010-01-29 10:38:29 -08005413 public boolean isUserAMonkey() throws RemoteException {
5414 Parcel data = Parcel.obtain();
5415 Parcel reply = Parcel.obtain();
5416 data.writeInterfaceToken(IActivityManager.descriptor);
5417 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
5418 reply.readException();
5419 boolean res = reply.readInt() != 0;
5420 data.recycle();
5421 reply.recycle();
5422 return res;
5423 }
Adam Momtaz8f6f1f42013-04-10 12:42:58 -07005424
5425 public void setUserIsMonkey(boolean monkey) throws RemoteException {
5426 Parcel data = Parcel.obtain();
5427 Parcel reply = Parcel.obtain();
5428 data.writeInterfaceToken(IActivityManager.descriptor);
5429 data.writeInt(monkey ? 1 : 0);
5430 mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0);
5431 reply.readException();
5432 data.recycle();
5433 reply.recycle();
5434 }
5435
Dianne Hackborn860755f2010-06-03 18:47:52 -07005436 public void finishHeavyWeightApp() throws RemoteException {
5437 Parcel data = Parcel.obtain();
5438 Parcel reply = Parcel.obtain();
5439 data.writeInterfaceToken(IActivityManager.descriptor);
5440 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
5441 reply.readException();
5442 data.recycle();
5443 reply.recycle();
5444 }
Craig Mautner4addfc52013-06-25 08:05:45 -07005445
Craig Mautnerbc57cd12013-08-19 15:47:42 -07005446 public boolean convertFromTranslucent(IBinder token)
Craig Mautner4addfc52013-06-25 08:05:45 -07005447 throws RemoteException {
5448 Parcel data = Parcel.obtain();
5449 Parcel reply = Parcel.obtain();
5450 data.writeInterfaceToken(IActivityManager.descriptor);
5451 data.writeStrongBinder(token);
Craig Mautner5eda9b32013-07-02 11:58:16 -07005452 mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0);
5453 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07005454 boolean res = reply.readInt() != 0;
Craig Mautner5eda9b32013-07-02 11:58:16 -07005455 data.recycle();
5456 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07005457 return res;
Craig Mautner5eda9b32013-07-02 11:58:16 -07005458 }
5459
Craig Mautner233ceee2014-05-09 17:05:11 -07005460 public boolean convertToTranslucent(IBinder token, ActivityOptions options)
Craig Mautner5eda9b32013-07-02 11:58:16 -07005461 throws RemoteException {
5462 Parcel data = Parcel.obtain();
5463 Parcel reply = Parcel.obtain();
5464 data.writeInterfaceToken(IActivityManager.descriptor);
5465 data.writeStrongBinder(token);
Craig Mautner233ceee2014-05-09 17:05:11 -07005466 if (options == null) {
5467 data.writeInt(0);
5468 } else {
5469 data.writeInt(1);
5470 data.writeBundle(options.toBundle());
5471 }
Craig Mautner5eda9b32013-07-02 11:58:16 -07005472 mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0);
Craig Mautner4addfc52013-06-25 08:05:45 -07005473 reply.readException();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07005474 boolean res = reply.readInt() != 0;
Craig Mautner4addfc52013-06-25 08:05:45 -07005475 data.recycle();
5476 reply.recycle();
Craig Mautnerbc57cd12013-08-19 15:47:42 -07005477 return res;
Craig Mautner4addfc52013-06-25 08:05:45 -07005478 }
5479
Craig Mautner233ceee2014-05-09 17:05:11 -07005480 public ActivityOptions getActivityOptions(IBinder token) throws RemoteException {
5481 Parcel data = Parcel.obtain();
5482 Parcel reply = Parcel.obtain();
5483 data.writeInterfaceToken(IActivityManager.descriptor);
5484 data.writeStrongBinder(token);
5485 mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0);
5486 reply.readException();
Chong Zhang280d3322015-11-03 17:27:26 -08005487 ActivityOptions options = ActivityOptions.fromBundle(reply.readBundle());
Craig Mautner233ceee2014-05-09 17:05:11 -07005488 data.recycle();
5489 reply.recycle();
5490 return options;
5491 }
5492
Daniel Sandler69a48172010-06-23 16:29:36 -04005493 public void setImmersive(IBinder token, boolean immersive)
5494 throws RemoteException {
5495 Parcel data = Parcel.obtain();
5496 Parcel reply = Parcel.obtain();
5497 data.writeInterfaceToken(IActivityManager.descriptor);
5498 data.writeStrongBinder(token);
5499 data.writeInt(immersive ? 1 : 0);
5500 mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
5501 reply.readException();
5502 data.recycle();
5503 reply.recycle();
5504 }
5505
5506 public boolean isImmersive(IBinder token)
5507 throws RemoteException {
5508 Parcel data = Parcel.obtain();
5509 Parcel reply = Parcel.obtain();
5510 data.writeInterfaceToken(IActivityManager.descriptor);
5511 data.writeStrongBinder(token);
5512 mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04005513 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07005514 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04005515 data.recycle();
5516 reply.recycle();
5517 return res;
5518 }
5519
Craig Mautnerd61dc202014-07-07 11:09:11 -07005520 public boolean isTopOfTask(IBinder token) throws RemoteException {
5521 Parcel data = Parcel.obtain();
5522 Parcel reply = Parcel.obtain();
5523 data.writeInterfaceToken(IActivityManager.descriptor);
5524 data.writeStrongBinder(token);
5525 mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0);
5526 reply.readException();
5527 boolean res = reply.readInt() == 1;
5528 data.recycle();
5529 reply.recycle();
5530 return res;
5531 }
5532
Daniel Sandler69a48172010-06-23 16:29:36 -04005533 public boolean isTopActivityImmersive()
5534 throws RemoteException {
5535 Parcel data = Parcel.obtain();
5536 Parcel reply = Parcel.obtain();
5537 data.writeInterfaceToken(IActivityManager.descriptor);
5538 mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
Daniel Sandler69a48172010-06-23 16:29:36 -04005539 reply.readException();
Dianne Hackborn7e269642010-08-25 19:50:20 -07005540 boolean res = reply.readInt() == 1;
Daniel Sandler69a48172010-06-23 16:29:36 -04005541 data.recycle();
5542 reply.recycle();
5543 return res;
5544 }
5545
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -07005546 public void crashApplication(int uid, int initialPid, String packageName,
5547 String message) throws RemoteException {
5548 Parcel data = Parcel.obtain();
5549 Parcel reply = Parcel.obtain();
5550 data.writeInterfaceToken(IActivityManager.descriptor);
5551 data.writeInt(uid);
5552 data.writeInt(initialPid);
5553 data.writeString(packageName);
5554 data.writeString(message);
5555 mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0);
5556 reply.readException();
5557 data.recycle();
5558 reply.recycle();
5559 }
Andy McFadden824c5102010-07-09 16:26:57 -07005560
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005561 public String getProviderMimeType(Uri uri, int userId) throws RemoteException {
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07005562 Parcel data = Parcel.obtain();
5563 Parcel reply = Parcel.obtain();
5564 data.writeInterfaceToken(IActivityManager.descriptor);
5565 uri.writeToParcel(data, 0);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005566 data.writeInt(userId);
Dianne Hackborncca1f0e2010-09-26 18:34:53 -07005567 mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0);
5568 reply.readException();
5569 String res = reply.readString();
5570 data.recycle();
5571 reply.recycle();
5572 return res;
5573 }
5574
Dianne Hackborn7e269642010-08-25 19:50:20 -07005575 public IBinder newUriPermissionOwner(String name)
5576 throws RemoteException {
5577 Parcel data = Parcel.obtain();
5578 Parcel reply = Parcel.obtain();
5579 data.writeInterfaceToken(IActivityManager.descriptor);
5580 data.writeString(name);
5581 mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
5582 reply.readException();
5583 IBinder res = reply.readStrongBinder();
5584 data.recycle();
5585 reply.recycle();
5586 return res;
5587 }
5588
Vladislav Kaznacheevb23a7572015-12-18 12:23:43 -08005589 public IBinder getUriPermissionOwnerForActivity(IBinder activityToken) throws RemoteException {
5590 Parcel data = Parcel.obtain();
5591 Parcel reply = Parcel.obtain();
5592 data.writeInterfaceToken(IActivityManager.descriptor);
5593 data.writeStrongBinder(activityToken);
5594 mRemote.transact(GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
5595 reply.readException();
5596 IBinder res = reply.readStrongBinder();
5597 data.recycle();
5598 reply.recycle();
5599 return res;
5600 }
5601
Dianne Hackborn7e269642010-08-25 19:50:20 -07005602 public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
Nicolas Prevotf1939902014-06-25 09:29:02 +01005603 Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07005604 Parcel data = Parcel.obtain();
5605 Parcel reply = Parcel.obtain();
5606 data.writeInterfaceToken(IActivityManager.descriptor);
5607 data.writeStrongBinder(owner);
5608 data.writeInt(fromUid);
5609 data.writeString(targetPkg);
5610 uri.writeToParcel(data, 0);
5611 data.writeInt(mode);
Nicolas Prevotf1939902014-06-25 09:29:02 +01005612 data.writeInt(sourceUserId);
5613 data.writeInt(targetUserId);
Nicolas Prevot011aaa12016-09-14 17:01:53 +01005614 mRemote.transact(GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION, data, reply, 0);
Dianne Hackborn7e269642010-08-25 19:50:20 -07005615 reply.readException();
5616 data.recycle();
5617 reply.recycle();
5618 }
5619
5620 public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01005621 int mode, int userId) throws RemoteException {
Dianne Hackborn7e269642010-08-25 19:50:20 -07005622 Parcel data = Parcel.obtain();
5623 Parcel reply = Parcel.obtain();
5624 data.writeInterfaceToken(IActivityManager.descriptor);
5625 data.writeStrongBinder(owner);
5626 if (uri != null) {
5627 data.writeInt(1);
5628 uri.writeToParcel(data, 0);
5629 } else {
5630 data.writeInt(0);
5631 }
5632 data.writeInt(mode);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01005633 data.writeInt(userId);
Nicolas Prevot011aaa12016-09-14 17:01:53 +01005634 mRemote.transact(REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION, data, reply, 0);
Dianne Hackborn7e269642010-08-25 19:50:20 -07005635 reply.readException();
5636 data.recycle();
5637 reply.recycle();
5638 }
Dianne Hackbornc8f84972010-08-25 23:14:44 -07005639
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07005640 public int checkGrantUriPermission(int callingUid, String targetPkg,
Nicolas Prevotd85fc722014-04-16 19:52:08 +01005641 Uri uri, int modeFlags, int userId) throws RemoteException {
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07005642 Parcel data = Parcel.obtain();
5643 Parcel reply = Parcel.obtain();
5644 data.writeInterfaceToken(IActivityManager.descriptor);
5645 data.writeInt(callingUid);
5646 data.writeString(targetPkg);
5647 uri.writeToParcel(data, 0);
5648 data.writeInt(modeFlags);
Nicolas Prevotd85fc722014-04-16 19:52:08 +01005649 data.writeInt(userId);
Dianne Hackborn90f4aaf2010-09-27 14:58:44 -07005650 mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
5651 reply.readException();
5652 int res = reply.readInt();
5653 data.recycle();
5654 reply.recycle();
5655 return res;
5656 }
5657
Dianne Hackborn1676c852012-09-10 14:52:30 -07005658 public boolean dumpHeap(String process, int userId, boolean managed,
Andy McFadden824c5102010-07-09 16:26:57 -07005659 String path, ParcelFileDescriptor fd) throws RemoteException {
5660 Parcel data = Parcel.obtain();
5661 Parcel reply = Parcel.obtain();
5662 data.writeInterfaceToken(IActivityManager.descriptor);
5663 data.writeString(process);
Dianne Hackborn1676c852012-09-10 14:52:30 -07005664 data.writeInt(userId);
Andy McFadden824c5102010-07-09 16:26:57 -07005665 data.writeInt(managed ? 1 : 0);
5666 data.writeString(path);
5667 if (fd != null) {
5668 data.writeInt(1);
5669 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
5670 } else {
5671 data.writeInt(0);
5672 }
5673 mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
5674 reply.readException();
5675 boolean res = reply.readInt() != 0;
5676 reply.recycle();
5677 data.recycle();
5678 return res;
5679 }
Stefan Kuhne16045c22015-06-05 07:18:06 -07005680
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005681 public int startActivities(IApplicationThread caller, String callingPackage,
Dianne Hackborna4972e92012-03-14 10:38:05 -07005682 Intent[] intents, String[] resolvedTypes, IBinder resultTo,
Amith Yamasaniea7e9152012-09-24 16:11:18 -07005683 Bundle options, int userId) throws RemoteException {
Dianne Hackborn621e17d2010-11-22 15:59:56 -08005684 Parcel data = Parcel.obtain();
5685 Parcel reply = Parcel.obtain();
5686 data.writeInterfaceToken(IActivityManager.descriptor);
5687 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
Dianne Hackbornf265ea92013-01-31 15:00:51 -08005688 data.writeString(callingPackage);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08005689 data.writeTypedArray(intents, 0);
5690 data.writeStringArray(resolvedTypes);
5691 data.writeStrongBinder(resultTo);
Dianne Hackborna4972e92012-03-14 10:38:05 -07005692 if (options != null) {
5693 data.writeInt(1);
5694 options.writeToParcel(data, 0);
5695 } else {
5696 data.writeInt(0);
5697 }
Amith Yamasaniea7e9152012-09-24 16:11:18 -07005698 data.writeInt(userId);
Dianne Hackborn621e17d2010-11-22 15:59:56 -08005699 mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0);
5700 reply.readException();
5701 int result = reply.readInt();
5702 reply.recycle();
5703 data.recycle();
5704 return result;
5705 }
5706
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07005707 public int getFrontActivityScreenCompatMode() throws RemoteException {
5708 Parcel data = Parcel.obtain();
5709 Parcel reply = Parcel.obtain();
5710 data.writeInterfaceToken(IActivityManager.descriptor);
5711 mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
5712 reply.readException();
5713 int mode = reply.readInt();
5714 reply.recycle();
5715 data.recycle();
5716 return mode;
5717 }
5718
5719 public void setFrontActivityScreenCompatMode(int mode) throws RemoteException {
5720 Parcel data = Parcel.obtain();
5721 Parcel reply = Parcel.obtain();
5722 data.writeInterfaceToken(IActivityManager.descriptor);
5723 data.writeInt(mode);
5724 mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
5725 reply.readException();
5726 reply.recycle();
5727 data.recycle();
5728 }
5729
5730 public int getPackageScreenCompatMode(String packageName) throws RemoteException {
5731 Parcel data = Parcel.obtain();
5732 Parcel reply = Parcel.obtain();
5733 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07005734 data.writeString(packageName);
5735 mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07005736 reply.readException();
5737 int mode = reply.readInt();
5738 reply.recycle();
5739 data.recycle();
5740 return mode;
5741 }
5742
5743 public void setPackageScreenCompatMode(String packageName, int mode)
Dianne Hackborne2515ee2011-04-27 18:52:56 -04005744 throws RemoteException {
5745 Parcel data = Parcel.obtain();
5746 Parcel reply = Parcel.obtain();
5747 data.writeInterfaceToken(IActivityManager.descriptor);
5748 data.writeString(packageName);
Dianne Hackborn0f1de9a2011-05-11 17:34:49 -07005749 data.writeInt(mode);
Dianne Hackborne2515ee2011-04-27 18:52:56 -04005750 mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
5751 reply.readException();
5752 reply.recycle();
5753 data.recycle();
5754 }
5755
Dianne Hackborn36cd41f2011-05-25 21:00:46 -07005756 public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
5757 Parcel data = Parcel.obtain();
5758 Parcel reply = Parcel.obtain();
5759 data.writeInterfaceToken(IActivityManager.descriptor);
5760 data.writeString(packageName);
5761 mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
5762 reply.readException();
5763 boolean ask = reply.readInt() != 0;
5764 reply.recycle();
5765 data.recycle();
5766 return ask;
5767 }
5768
5769 public void setPackageAskScreenCompat(String packageName, boolean ask)
5770 throws RemoteException {
5771 Parcel data = Parcel.obtain();
5772 Parcel reply = Parcel.obtain();
5773 data.writeInterfaceToken(IActivityManager.descriptor);
5774 data.writeString(packageName);
5775 data.writeInt(ask ? 1 : 0);
5776 mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
5777 reply.readException();
5778 reply.recycle();
5779 data.recycle();
5780 }
5781
Amith Yamasani4b2e9342011-03-31 12:38:53 -07005782 public boolean switchUser(int userid) throws RemoteException {
5783 Parcel data = Parcel.obtain();
5784 Parcel reply = Parcel.obtain();
5785 data.writeInterfaceToken(IActivityManager.descriptor);
5786 data.writeInt(userid);
5787 mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0);
5788 reply.readException();
5789 boolean result = reply.readInt() != 0;
5790 reply.recycle();
5791 data.recycle();
5792 return result;
5793 }
Amith Yamasani52f1d752012-03-28 18:19:29 -07005794
Kenny Guy08488bf2014-02-21 17:40:37 +00005795 public boolean startUserInBackground(int userid) throws RemoteException {
5796 Parcel data = Parcel.obtain();
5797 Parcel reply = Parcel.obtain();
5798 data.writeInterfaceToken(IActivityManager.descriptor);
5799 data.writeInt(userid);
5800 mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0);
5801 reply.readException();
5802 boolean result = reply.readInt() != 0;
5803 reply.recycle();
5804 data.recycle();
5805 return result;
5806 }
5807
Jeff Sharkeybd91e2f2016-03-22 15:32:31 -06005808 public boolean unlockUser(int userId, byte[] token, byte[] secret, IProgressListener listener)
5809 throws RemoteException {
Jeff Sharkeyba512352015-11-12 20:17:45 -08005810 Parcel data = Parcel.obtain();
5811 Parcel reply = Parcel.obtain();
5812 data.writeInterfaceToken(IActivityManager.descriptor);
5813 data.writeInt(userId);
5814 data.writeByteArray(token);
Paul Crowleyfaeb3eb2016-02-08 15:58:29 +00005815 data.writeByteArray(secret);
Jeff Sharkeybd91e2f2016-03-22 15:32:31 -06005816 data.writeStrongInterface(listener);
Jeff Sharkeyba512352015-11-12 20:17:45 -08005817 mRemote.transact(IActivityManager.UNLOCK_USER_TRANSACTION, data, reply, 0);
5818 reply.readException();
5819 boolean result = reply.readInt() != 0;
5820 reply.recycle();
5821 data.recycle();
5822 return result;
5823 }
5824
Fyodor Kupolov9cbfc9e2015-10-07 15:52:33 -07005825 public int stopUser(int userid, boolean force, IStopUserCallback callback)
5826 throws RemoteException {
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005827 Parcel data = Parcel.obtain();
5828 Parcel reply = Parcel.obtain();
5829 data.writeInterfaceToken(IActivityManager.descriptor);
5830 data.writeInt(userid);
Fyodor Kupolov9cbfc9e2015-10-07 15:52:33 -07005831 data.writeInt(force ? 1 : 0);
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005832 data.writeStrongInterface(callback);
5833 mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0);
5834 reply.readException();
5835 int result = reply.readInt();
5836 reply.recycle();
5837 data.recycle();
5838 return result;
5839 }
5840
Amith Yamasani52f1d752012-03-28 18:19:29 -07005841 public UserInfo getCurrentUser() throws RemoteException {
5842 Parcel data = Parcel.obtain();
5843 Parcel reply = Parcel.obtain();
5844 data.writeInterfaceToken(IActivityManager.descriptor);
Dianne Hackborn80a4af22012-08-27 19:18:31 -07005845 mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0);
Amith Yamasani52f1d752012-03-28 18:19:29 -07005846 reply.readException();
5847 UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply);
5848 reply.recycle();
5849 data.recycle();
5850 return userInfo;
5851 }
5852
Jeff Sharkeye17ac152015-11-06 22:40:29 -08005853 public boolean isUserRunning(int userid, int flags) throws RemoteException {
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005854 Parcel data = Parcel.obtain();
5855 Parcel reply = Parcel.obtain();
5856 data.writeInterfaceToken(IActivityManager.descriptor);
5857 data.writeInt(userid);
Jeff Sharkeye17ac152015-11-06 22:40:29 -08005858 data.writeInt(flags);
Dianne Hackborn5e03e2c2012-09-06 14:21:19 -07005859 mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0);
5860 reply.readException();
5861 boolean result = reply.readInt() != 0;
5862 reply.recycle();
5863 data.recycle();
5864 return result;
5865 }
5866
Dianne Hackbornc72fc672012-09-20 13:12:03 -07005867 public int[] getRunningUserIds() throws RemoteException {
5868 Parcel data = Parcel.obtain();
5869 Parcel reply = Parcel.obtain();
5870 data.writeInterfaceToken(IActivityManager.descriptor);
5871 mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0);
5872 reply.readException();
5873 int[] result = reply.createIntArray();
5874 reply.recycle();
5875 data.recycle();
5876 return result;
5877 }
5878
Wale Ogunwaled54b5782014-10-23 15:55:23 -07005879 public boolean removeTask(int taskId) throws RemoteException {
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005880 Parcel data = Parcel.obtain();
5881 Parcel reply = Parcel.obtain();
5882 data.writeInterfaceToken(IActivityManager.descriptor);
5883 data.writeInt(taskId);
Dianne Hackborn0c5001d2011-04-12 18:16:08 -07005884 mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
5885 reply.readException();
5886 boolean result = reply.readInt() != 0;
5887 reply.recycle();
5888 data.recycle();
5889 return result;
5890 }
Amith Yamasani4b2e9342011-03-31 12:38:53 -07005891
Jeff Sharkeya4620792011-05-20 15:29:23 -07005892 public void registerProcessObserver(IProcessObserver observer) throws RemoteException {
5893 Parcel data = Parcel.obtain();
5894 Parcel reply = Parcel.obtain();
5895 data.writeInterfaceToken(IActivityManager.descriptor);
5896 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5897 mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5898 reply.readException();
5899 data.recycle();
5900 reply.recycle();
5901 }
5902
5903 public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException {
5904 Parcel data = Parcel.obtain();
5905 Parcel reply = Parcel.obtain();
5906 data.writeInterfaceToken(IActivityManager.descriptor);
5907 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5908 mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5909 reply.readException();
5910 data.recycle();
5911 reply.recycle();
5912 }
5913
Dianne Hackbornbef28fe2015-10-29 17:57:11 -07005914 public void registerUidObserver(IUidObserver observer, int which) throws RemoteException {
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07005915 Parcel data = Parcel.obtain();
5916 Parcel reply = Parcel.obtain();
5917 data.writeInterfaceToken(IActivityManager.descriptor);
5918 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
Dianne Hackbornbef28fe2015-10-29 17:57:11 -07005919 data.writeInt(which);
Dianne Hackbornd23e0d62015-05-15 16:36:12 -07005920 mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0);
5921 reply.readException();
5922 data.recycle();
5923 reply.recycle();
5924 }
5925
5926 public void unregisterUidObserver(IUidObserver observer) throws RemoteException {
5927 Parcel data = Parcel.obtain();
5928 Parcel reply = Parcel.obtain();
5929 data.writeInterfaceToken(IActivityManager.descriptor);
5930 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5931 mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0);
5932 reply.readException();
5933 data.recycle();
5934 reply.recycle();
5935 }
5936
Dianne Hackborn6c418d52011-06-29 14:05:33 -07005937 public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException {
5938 Parcel data = Parcel.obtain();
5939 Parcel reply = Parcel.obtain();
5940 data.writeInterfaceToken(IActivityManager.descriptor);
5941 data.writeStrongBinder(sender.asBinder());
5942 mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0);
5943 reply.readException();
5944 boolean res = reply.readInt() != 0;
5945 data.recycle();
5946 reply.recycle();
5947 return res;
5948 }
5949
Dianne Hackborn1927ae82012-06-22 15:21:36 -07005950 public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException {
5951 Parcel data = Parcel.obtain();
5952 Parcel reply = Parcel.obtain();
5953 data.writeInterfaceToken(IActivityManager.descriptor);
5954 data.writeStrongBinder(sender.asBinder());
5955 mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0);
5956 reply.readException();
5957 boolean res = reply.readInt() != 0;
5958 data.recycle();
5959 reply.recycle();
5960 return res;
5961 }
5962
Dianne Hackborn81038902012-11-26 17:04:09 -08005963 public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException {
5964 Parcel data = Parcel.obtain();
5965 Parcel reply = Parcel.obtain();
5966 data.writeInterfaceToken(IActivityManager.descriptor);
5967 data.writeStrongBinder(sender.asBinder());
5968 mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5969 reply.readException();
5970 Intent res = reply.readInt() != 0
5971 ? Intent.CREATOR.createFromParcel(reply) : null;
5972 data.recycle();
5973 reply.recycle();
5974 return res;
5975 }
5976
Dianne Hackborna1f1a3c2014-02-24 18:12:28 -08005977 public String getTagForIntentSender(IIntentSender sender, String prefix)
5978 throws RemoteException {
5979 Parcel data = Parcel.obtain();
5980 Parcel reply = Parcel.obtain();
5981 data.writeInterfaceToken(IActivityManager.descriptor);
5982 data.writeStrongBinder(sender.asBinder());
5983 data.writeString(prefix);
5984 mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5985 reply.readException();
5986 String res = reply.readString();
5987 data.recycle();
5988 reply.recycle();
5989 return res;
5990 }
5991
Dianne Hackborn31ca8542011-07-19 14:58:28 -07005992 public void updatePersistentConfiguration(Configuration values) throws RemoteException
5993 {
5994 Parcel data = Parcel.obtain();
5995 Parcel reply = Parcel.obtain();
5996 data.writeInterfaceToken(IActivityManager.descriptor);
5997 values.writeToParcel(data, 0);
5998 mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0);
5999 reply.readException();
6000 data.recycle();
6001 reply.recycle();
6002 }
6003
Dianne Hackbornb437e092011-08-05 17:50:29 -07006004 public long[] getProcessPss(int[] pids) throws RemoteException {
6005 Parcel data = Parcel.obtain();
6006 Parcel reply = Parcel.obtain();
6007 data.writeInterfaceToken(IActivityManager.descriptor);
6008 data.writeIntArray(pids);
6009 mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0);
6010 reply.readException();
6011 long[] res = reply.createLongArray();
6012 data.recycle();
6013 reply.recycle();
6014 return res;
6015 }
6016
Dianne Hackborn661cd522011-08-22 00:26:20 -07006017 public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
6018 Parcel data = Parcel.obtain();
6019 Parcel reply = Parcel.obtain();
6020 data.writeInterfaceToken(IActivityManager.descriptor);
6021 TextUtils.writeToParcel(msg, data, 0);
6022 data.writeInt(always ? 1 : 0);
6023 mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
6024 reply.readException();
6025 data.recycle();
6026 reply.recycle();
6027 }
6028
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02006029 public void keyguardWaitingForActivityDrawn() throws RemoteException {
Dianne Hackborn90c52de2011-09-23 12:57:44 -07006030 Parcel data = Parcel.obtain();
6031 Parcel reply = Parcel.obtain();
6032 data.writeInterfaceToken(IActivityManager.descriptor);
Jorim Jaggi8de4311c2014-08-11 22:36:20 +02006033 mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
Dianne Hackborn90c52de2011-09-23 12:57:44 -07006034 reply.readException();
6035 data.recycle();
6036 reply.recycle();
6037 }
6038
Adrian Roosd5c2db62016-03-08 16:11:31 -08006039 public void keyguardGoingAway(int flags)
6040 throws RemoteException {
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07006041 Parcel data = Parcel.obtain();
6042 Parcel reply = Parcel.obtain();
6043 data.writeInterfaceToken(IActivityManager.descriptor);
Adrian Roosd5c2db62016-03-08 16:11:31 -08006044 data.writeInt(flags);
Jorim Jaggi827e0fa2015-05-07 11:41:41 -07006045 mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0);
6046 reply.readException();
6047 data.recycle();
6048 reply.recycle();
6049 }
6050
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07006051 public boolean shouldUpRecreateTask(IBinder token, String destAffinity)
Adam Powelldd8fab22012-03-22 17:47:27 -07006052 throws RemoteException {
6053 Parcel data = Parcel.obtain();
6054 Parcel reply = Parcel.obtain();
6055 data.writeInterfaceToken(IActivityManager.descriptor);
6056 data.writeStrongBinder(token);
6057 data.writeString(destAffinity);
Dianne Hackborn6f4d61f2014-08-21 17:50:42 -07006058 mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0);
Adam Powelldd8fab22012-03-22 17:47:27 -07006059 reply.readException();
6060 boolean result = reply.readInt() != 0;
6061 data.recycle();
6062 reply.recycle();
6063 return result;
6064 }
6065
6066 public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData)
6067 throws RemoteException {
6068 Parcel data = Parcel.obtain();
6069 Parcel reply = Parcel.obtain();
6070 data.writeInterfaceToken(IActivityManager.descriptor);
6071 data.writeStrongBinder(token);
6072 target.writeToParcel(data, 0);
6073 data.writeInt(resultCode);
6074 if (resultData != null) {
6075 data.writeInt(1);
6076 resultData.writeToParcel(data, 0);
6077 } else {
6078 data.writeInt(0);
6079 }
6080 mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0);
6081 reply.readException();
6082 boolean result = reply.readInt() != 0;
6083 data.recycle();
6084 reply.recycle();
6085 return result;
6086 }
6087
Dianne Hackborn5320eb82012-05-18 12:05:04 -07006088 public int getLaunchedFromUid(IBinder activityToken) throws RemoteException {
6089 Parcel data = Parcel.obtain();
6090 Parcel reply = Parcel.obtain();
6091 data.writeInterfaceToken(IActivityManager.descriptor);
6092 data.writeStrongBinder(activityToken);
6093 mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0);
6094 reply.readException();
6095 int result = reply.readInt();
6096 data.recycle();
6097 reply.recycle();
6098 return result;
6099 }
6100
Dianne Hackbornf265ea92013-01-31 15:00:51 -08006101 public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException {
6102 Parcel data = Parcel.obtain();
6103 Parcel reply = Parcel.obtain();
6104 data.writeInterfaceToken(IActivityManager.descriptor);
6105 data.writeStrongBinder(activityToken);
6106 mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0);
6107 reply.readException();
6108 String result = reply.readString();
6109 data.recycle();
6110 reply.recycle();
6111 return result;
6112 }
6113
Fyodor Kupolov0b77ef92016-06-20 17:16:52 -07006114 public void registerUserSwitchObserver(IUserSwitchObserver observer,
6115 String name) throws RemoteException {
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07006116 Parcel data = Parcel.obtain();
6117 Parcel reply = Parcel.obtain();
6118 data.writeInterfaceToken(IActivityManager.descriptor);
6119 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
Fyodor Kupolov0b77ef92016-06-20 17:16:52 -07006120 data.writeString(name);
Dianne Hackborn5dc5a002012-09-15 19:33:48 -07006121 mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
6122 reply.readException();
6123 data.recycle();
6124 reply.recycle();
6125 }
6126
6127 public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
6128 Parcel data = Parcel.obtain();
6129 Parcel reply = Parcel.obtain();
6130 data.writeInterfaceToken(IActivityManager.descriptor);
6131 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
6132 mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
6133 reply.readException();
6134 data.recycle();
6135 reply.recycle();
6136 }
6137
Michal Karpinski3da5c972015-12-11 18:16:30 +00006138 public void requestBugReport(@ActivityManager.BugreportMode int bugreportType)
6139 throws RemoteException {
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07006140 Parcel data = Parcel.obtain();
6141 Parcel reply = Parcel.obtain();
6142 data.writeInterfaceToken(IActivityManager.descriptor);
Michal Karpinski3da5c972015-12-11 18:16:30 +00006143 data.writeInt(bugreportType);
Dianne Hackbornd4ac8d72012-09-27 23:20:10 -07006144 mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0);
6145 reply.readException();
6146 data.recycle();
6147 reply.recycle();
6148 }
6149
Jeff Brownbd181bb2013-09-10 16:44:24 -07006150 public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason)
6151 throws RemoteException {
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07006152 Parcel data = Parcel.obtain();
6153 Parcel reply = Parcel.obtain();
6154 data.writeInterfaceToken(IActivityManager.descriptor);
6155 data.writeInt(pid);
6156 data.writeInt(aboveSystem ? 1 : 0);
Jeff Brownbd181bb2013-09-10 16:44:24 -07006157 data.writeString(reason);
Dianne Hackborn5fe7e2a2012-10-04 11:58:16 -07006158 mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0);
6159 reply.readException();
6160 long res = reply.readInt();
6161 data.recycle();
6162 reply.recycle();
6163 return res;
6164 }
6165
Adam Skorydfc7fd72013-08-05 19:23:41 -07006166 public Bundle getAssistContextExtras(int requestType) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08006167 Parcel data = Parcel.obtain();
6168 Parcel reply = Parcel.obtain();
6169 data.writeInterfaceToken(IActivityManager.descriptor);
6170 data.writeInt(requestType);
Adam Skorydfc7fd72013-08-05 19:23:41 -07006171 mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08006172 reply.readException();
6173 Bundle res = reply.readBundle();
6174 data.recycle();
6175 reply.recycle();
6176 return res;
6177 }
6178
Dianne Hackborn17f69352015-07-17 18:04:14 -07006179 public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver,
Amith Yamasanie8222e52016-04-08 15:28:47 -07006180 Bundle receiverExtras,
Amith Yamasani4f128e42016-05-10 11:44:12 -07006181 IBinder activityToken, boolean focused, boolean newSessionId) throws RemoteException {
Dianne Hackbornae6688b2015-02-11 17:02:41 -08006182 Parcel data = Parcel.obtain();
6183 Parcel reply = Parcel.obtain();
6184 data.writeInterfaceToken(IActivityManager.descriptor);
6185 data.writeInt(requestType);
6186 data.writeStrongBinder(receiver.asBinder());
Amith Yamasanie8222e52016-04-08 15:28:47 -07006187 data.writeBundle(receiverExtras);
Dianne Hackborn17f69352015-07-17 18:04:14 -07006188 data.writeStrongBinder(activityToken);
Amith Yamasanie8222e52016-04-08 15:28:47 -07006189 data.writeInt(focused ? 1 : 0);
Amith Yamasani4f128e42016-05-10 11:44:12 -07006190 data.writeInt(newSessionId ? 1 : 0);
Dianne Hackbornae6688b2015-02-11 17:02:41 -08006191 mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
6192 reply.readException();
Dianne Hackborn17f69352015-07-17 18:04:14 -07006193 boolean res = reply.readInt() != 0;
Dianne Hackbornae6688b2015-02-11 17:02:41 -08006194 data.recycle();
6195 reply.recycle();
Dianne Hackborn17f69352015-07-17 18:04:14 -07006196 return res;
Dianne Hackbornae6688b2015-02-11 17:02:41 -08006197 }
6198
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07006199 public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure,
Dianne Hackborna3acdb32015-06-08 17:07:40 -07006200 AssistContent content, Uri referrer) throws RemoteException {
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08006201 Parcel data = Parcel.obtain();
6202 Parcel reply = Parcel.obtain();
6203 data.writeInterfaceToken(IActivityManager.descriptor);
6204 data.writeStrongBinder(token);
6205 data.writeBundle(extras);
Dianne Hackborn09d57fe2015-05-27 18:05:52 -07006206 structure.writeToParcel(data, 0);
6207 content.writeToParcel(data, 0);
Dianne Hackborna3acdb32015-06-08 17:07:40 -07006208 if (referrer != null) {
6209 data.writeInt(1);
6210 referrer.writeToParcel(data, 0);
6211 } else {
6212 data.writeInt(0);
6213 }
Adam Skorydfc7fd72013-08-05 19:23:41 -07006214 mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
Dianne Hackbornf9c5e0f2013-01-23 14:39:13 -08006215 reply.readException();
6216 data.recycle();
6217 reply.recycle();
6218 }
6219
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07006220 public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle,
6221 Bundle args) throws RemoteException {
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07006222 Parcel data = Parcel.obtain();
6223 Parcel reply = Parcel.obtain();
6224 data.writeInterfaceToken(IActivityManager.descriptor);
6225 intent.writeToParcel(data, 0);
6226 data.writeInt(requestType);
6227 data.writeString(hint);
6228 data.writeInt(userHandle);
Tim Kilbourn0e5f1102015-06-05 16:18:09 -07006229 data.writeBundle(args);
Dianne Hackbornfdf5b352014-10-08 17:43:48 -07006230 mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0);
6231 reply.readException();
6232 boolean res = reply.readInt() != 0;
6233 data.recycle();
6234 reply.recycle();
6235 return res;
6236 }
6237
Dianne Hackborn17f69352015-07-17 18:04:14 -07006238 public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException {
Benjamin Franzc200f442015-06-25 18:20:04 +01006239 Parcel data = Parcel.obtain();
6240 Parcel reply = Parcel.obtain();
6241 data.writeInterfaceToken(IActivityManager.descriptor);
6242 mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0);
6243 reply.readException();
6244 boolean res = reply.readInt() != 0;
6245 data.recycle();
6246 reply.recycle();
6247 return res;
6248 }
6249
Dianne Hackborn17f69352015-07-17 18:04:14 -07006250 public boolean showAssistFromActivity(IBinder token, Bundle args) throws RemoteException {
6251 Parcel data = Parcel.obtain();
6252 Parcel reply = Parcel.obtain();
6253 data.writeInterfaceToken(IActivityManager.descriptor);
6254 data.writeStrongBinder(token);
6255 data.writeBundle(args);
6256 mRemote.transact(SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION, data, reply, 0);
6257 reply.readException();
6258 boolean res = reply.readInt() != 0;
6259 data.recycle();
6260 reply.recycle();
6261 return res;
6262 }
6263
Svetoslavaa41add2015-08-06 15:03:55 -07006264 public void killUid(int appId, int userId, String reason) throws RemoteException {
Dianne Hackbornf1b78242013-04-08 22:28:59 -07006265 Parcel data = Parcel.obtain();
6266 Parcel reply = Parcel.obtain();
6267 data.writeInterfaceToken(IActivityManager.descriptor);
Svetoslavaa41add2015-08-06 15:03:55 -07006268 data.writeInt(appId);
6269 data.writeInt(userId);
Dianne Hackbornf1b78242013-04-08 22:28:59 -07006270 data.writeString(reason);
6271 mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0);
6272 reply.readException();
6273 data.recycle();
6274 reply.recycle();
6275 }
6276
Dianne Hackborn8bd64df2013-05-06 16:07:26 -07006277 public void hang(IBinder who, boolean allowRestart) throws RemoteException {
6278 Parcel data = Parcel.obtain();
6279 Parcel reply = Parcel.obtain();
6280 data.writeInterfaceToken(IActivityManager.descriptor);
6281 data.writeStrongBinder(who);
6282 data.writeInt(allowRestart ? 1 : 0);
6283 mRemote.transact(HANG_TRANSACTION, data, reply, 0);
6284 reply.readException();
6285 data.recycle();
6286 reply.recycle();
6287 }
6288
Dianne Hackborn2286cdc2013-07-01 19:10:06 -07006289 public void reportActivityFullyDrawn(IBinder token) throws RemoteException {
6290 Parcel data = Parcel.obtain();
6291 Parcel reply = Parcel.obtain();
6292 data.writeInterfaceToken(IActivityManager.descriptor);
6293 data.writeStrongBinder(token);
6294 mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0);
6295 reply.readException();
6296 data.recycle();
6297 reply.recycle();
6298 }
6299
Craig Mautner5eda9b32013-07-02 11:58:16 -07006300 public void notifyActivityDrawn(IBinder token) throws RemoteException {
6301 Parcel data = Parcel.obtain();
6302 Parcel reply = Parcel.obtain();
6303 data.writeInterfaceToken(IActivityManager.descriptor);
6304 data.writeStrongBinder(token);
6305 mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
6306 reply.readException();
6307 data.recycle();
6308 reply.recycle();
6309 }
6310
Dianne Hackborn57a7f592013-07-22 18:21:32 -07006311 public void restart() throws RemoteException {
6312 Parcel data = Parcel.obtain();
6313 Parcel reply = Parcel.obtain();
6314 data.writeInterfaceToken(IActivityManager.descriptor);
6315 mRemote.transact(RESTART_TRANSACTION, data, reply, 0);
6316 reply.readException();
6317 data.recycle();
6318 reply.recycle();
6319 }
6320
Dianne Hackborn35f72be2013-09-16 10:57:39 -07006321 public void performIdleMaintenance() throws RemoteException {
6322 Parcel data = Parcel.obtain();
6323 Parcel reply = Parcel.obtain();
6324 data.writeInterfaceToken(IActivityManager.descriptor);
6325 mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0);
6326 reply.readException();
6327 data.recycle();
6328 reply.recycle();
6329 }
6330
Christopher Tate27d92e42016-05-06 11:25:11 -07006331 public void sendIdleJobTrigger() throws RemoteException {
6332 Parcel data = Parcel.obtain();
6333 Parcel reply = Parcel.obtain();
6334 data.writeInterfaceToken(IActivityManager.descriptor);
6335 mRemote.transact(SEND_IDLE_JOB_TRIGGER_TRANSACTION, data, reply, 0);
6336 reply.readException();
6337 data.recycle();
6338 reply.recycle();
6339 }
6340
Todd Kennedyca4d8422015-01-15 15:19:22 -08006341 public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken,
Craig Mautner4a1cb222013-12-04 16:14:06 -08006342 IActivityContainerCallback callback) throws RemoteException {
6343 Parcel data = Parcel.obtain();
6344 Parcel reply = Parcel.obtain();
6345 data.writeInterfaceToken(IActivityManager.descriptor);
6346 data.writeStrongBinder(parentActivityToken);
Craig Mautnere3a00d72014-04-16 08:31:19 -07006347 data.writeStrongBinder(callback == null ? null : callback.asBinder());
Todd Kennedyca4d8422015-01-15 15:19:22 -08006348 mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
Craig Mautner4a1cb222013-12-04 16:14:06 -08006349 reply.readException();
Craig Mautnerbd503a42014-01-10 10:16:43 -08006350 final int result = reply.readInt();
6351 final IActivityContainer res;
6352 if (result == 1) {
6353 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
6354 } else {
6355 res = null;
6356 }
Craig Mautner4a1cb222013-12-04 16:14:06 -08006357 data.recycle();
6358 reply.recycle();
6359 return res;
6360 }
6361
Craig Mautner95da1082014-02-24 17:54:35 -08006362 public void deleteActivityContainer(IActivityContainer activityContainer)
6363 throws RemoteException {
6364 Parcel data = Parcel.obtain();
6365 Parcel reply = Parcel.obtain();
6366 data.writeInterfaceToken(IActivityManager.descriptor);
6367 data.writeStrongBinder(activityContainer.asBinder());
6368 mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
6369 reply.readException();
6370 data.recycle();
6371 reply.recycle();
6372 }
6373
Rahul Chaturvedi52613f92015-06-17 23:54:08 -04006374 public boolean startBinderTracking() throws RemoteException {
6375 Parcel data = Parcel.obtain();
6376 Parcel reply = Parcel.obtain();
6377 data.writeInterfaceToken(IActivityManager.descriptor);
6378 mRemote.transact(START_BINDER_TRACKING_TRANSACTION, data, reply, 0);
6379 reply.readException();
6380 boolean res = reply.readInt() != 0;
6381 reply.recycle();
6382 data.recycle();
6383 return res;
6384 }
6385
6386 public boolean stopBinderTrackingAndDump(ParcelFileDescriptor fd) throws RemoteException {
6387 Parcel data = Parcel.obtain();
6388 Parcel reply = Parcel.obtain();
6389 data.writeInterfaceToken(IActivityManager.descriptor);
6390 if (fd != null) {
6391 data.writeInt(1);
6392 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
6393 } else {
6394 data.writeInt(0);
6395 }
6396 mRemote.transact(STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION, data, reply, 0);
6397 reply.readException();
6398 boolean res = reply.readInt() != 0;
6399 reply.recycle();
6400 data.recycle();
6401 return res;
6402 }
6403
Ruben Brunke24b9a62016-02-16 21:38:24 -08006404 public int setVrMode(IBinder token, boolean enabled, ComponentName packageName)
6405 throws RemoteException {
Ruben Brunkdd18a0b2015-12-04 16:16:31 -08006406 Parcel data = Parcel.obtain();
6407 Parcel reply = Parcel.obtain();
6408 data.writeInterfaceToken(IActivityManager.descriptor);
6409 data.writeStrongBinder(token);
6410 data.writeInt(enabled ? 1 : 0);
Ruben Brunke24b9a62016-02-16 21:38:24 -08006411 packageName.writeToParcel(data, 0);
Ruben Brunkdd18a0b2015-12-04 16:16:31 -08006412 mRemote.transact(SET_VR_MODE_TRANSACTION, data, reply, 0);
6413 reply.readException();
Ruben Brunke24b9a62016-02-16 21:38:24 -08006414 int res = reply.readInt();
Ruben Brunkdd18a0b2015-12-04 16:16:31 -08006415 data.recycle();
6416 reply.recycle();
Ruben Brunke24b9a62016-02-16 21:38:24 -08006417 return res;
6418 }
6419
6420 public boolean isVrModePackageEnabled(ComponentName packageName)
6421 throws RemoteException {
6422 Parcel data = Parcel.obtain();
6423 Parcel reply = Parcel.obtain();
6424 data.writeInterfaceToken(IActivityManager.descriptor);
6425 packageName.writeToParcel(data, 0);
6426 mRemote.transact(IS_VR_PACKAGE_ENABLED_TRANSACTION, data, reply, 0);
6427 reply.readException();
6428 int res = reply.readInt();
6429 data.recycle();
6430 reply.recycle();
6431 return res == 1;
Ruben Brunkdd18a0b2015-12-04 16:16:31 -08006432 }
6433
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08006434 @Override
Todd Kennedy4900bf92015-01-16 16:05:14 -08006435 public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException {
6436 Parcel data = Parcel.obtain();
6437 Parcel reply = Parcel.obtain();
6438 data.writeInterfaceToken(IActivityManager.descriptor);
6439 data.writeInt(displayId);
6440 mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0);
6441 reply.readException();
6442 final int result = reply.readInt();
6443 final IActivityContainer res;
6444 if (result == 1) {
6445 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
6446 } else {
6447 res = null;
6448 }
6449 data.recycle();
6450 reply.recycle();
6451 return res;
6452 }
6453
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08006454 @Override
6455 public int getActivityDisplayId(IBinder activityToken)
Craig Mautnere0a38842013-12-16 16:14:02 -08006456 throws RemoteException {
6457 Parcel data = Parcel.obtain();
6458 Parcel reply = Parcel.obtain();
6459 data.writeInterfaceToken(IActivityManager.descriptor);
6460 data.writeStrongBinder(activityToken);
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08006461 mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0);
Craig Mautnere0a38842013-12-16 16:14:02 -08006462 reply.readException();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08006463 final int displayId = reply.readInt();
Craig Mautnere0a38842013-12-16 16:14:02 -08006464 data.recycle();
6465 reply.recycle();
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08006466 return displayId;
Craig Mautnere0a38842013-12-16 16:14:02 -08006467 }
6468
Craig Mautneraa7e3ed2015-02-17 10:17:21 -08006469 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08006470 public void startLockTaskMode(int taskId) throws RemoteException {
6471 Parcel data = Parcel.obtain();
6472 Parcel reply = Parcel.obtain();
6473 data.writeInterfaceToken(IActivityManager.descriptor);
6474 data.writeInt(taskId);
6475 mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0);
6476 reply.readException();
6477 data.recycle();
6478 reply.recycle();
6479 }
6480
6481 @Override
6482 public void startLockTaskMode(IBinder token) throws RemoteException {
6483 Parcel data = Parcel.obtain();
6484 Parcel reply = Parcel.obtain();
6485 data.writeInterfaceToken(IActivityManager.descriptor);
6486 data.writeStrongBinder(token);
6487 mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0);
6488 reply.readException();
6489 data.recycle();
6490 reply.recycle();
6491 }
6492
6493 @Override
Andrii Kulian0f051f52016-04-14 00:41:51 -07006494 public void startSystemLockTaskMode(int taskId) throws RemoteException {
Jason Monk62515be2014-05-21 16:06:19 -04006495 Parcel data = Parcel.obtain();
6496 Parcel reply = Parcel.obtain();
6497 data.writeInterfaceToken(IActivityManager.descriptor);
Andrii Kulian0f051f52016-04-14 00:41:51 -07006498 data.writeInt(taskId);
6499 mRemote.transact(START_SYSTEM_LOCK_TASK_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04006500 reply.readException();
6501 data.recycle();
6502 reply.recycle();
6503 }
6504
6505 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08006506 public void stopLockTaskMode() throws RemoteException {
6507 Parcel data = Parcel.obtain();
6508 Parcel reply = Parcel.obtain();
6509 data.writeInterfaceToken(IActivityManager.descriptor);
6510 mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
6511 reply.readException();
6512 data.recycle();
6513 reply.recycle();
6514 }
6515
6516 @Override
Andrii Kulian0f051f52016-04-14 00:41:51 -07006517 public void stopSystemLockTaskMode() throws RemoteException {
Jason Monk62515be2014-05-21 16:06:19 -04006518 Parcel data = Parcel.obtain();
6519 Parcel reply = Parcel.obtain();
6520 data.writeInterfaceToken(IActivityManager.descriptor);
Andrii Kulian0f051f52016-04-14 00:41:51 -07006521 mRemote.transact(STOP_SYSTEM_LOCK_TASK_TRANSACTION, data, reply, 0);
Jason Monk62515be2014-05-21 16:06:19 -04006522 reply.readException();
6523 data.recycle();
6524 reply.recycle();
6525 }
6526
6527 @Override
Craig Mautneraea74a52014-03-08 14:23:10 -08006528 public boolean isInLockTaskMode() throws RemoteException {
6529 Parcel data = Parcel.obtain();
6530 Parcel reply = Parcel.obtain();
6531 data.writeInterfaceToken(IActivityManager.descriptor);
6532 mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
6533 reply.readException();
6534 boolean isInLockTaskMode = reply.readInt() == 1;
6535 data.recycle();
6536 reply.recycle();
6537 return isInLockTaskMode;
6538 }
6539
Craig Mautner688b5102014-03-27 16:55:03 -07006540 @Override
Benjamin Franz43261142015-02-11 15:59:44 +00006541 public int getLockTaskModeState() throws RemoteException {
6542 Parcel data = Parcel.obtain();
6543 Parcel reply = Parcel.obtain();
6544 data.writeInterfaceToken(IActivityManager.descriptor);
6545 mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0);
6546 reply.readException();
6547 int lockTaskModeState = reply.readInt();
6548 data.recycle();
6549 reply.recycle();
6550 return lockTaskModeState;
6551 }
6552
6553 @Override
Craig Mautnerc21ae9e2015-04-15 09:45:42 -07006554 public void showLockTaskEscapeMessage(IBinder token) throws RemoteException {
6555 Parcel data = Parcel.obtain();
6556 Parcel reply = Parcel.obtain();
6557 data.writeInterfaceToken(IActivityManager.descriptor);
6558 data.writeStrongBinder(token);
6559 mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply,
6560 IBinder.FLAG_ONEWAY);
6561 reply.readException();
6562 data.recycle();
6563 reply.recycle();
6564 }
6565
6566 @Override
Winson Chunga449dc02014-05-16 11:15:04 -07006567 public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values)
Winson Chung03a9bae2014-05-02 09:56:12 -07006568 throws RemoteException {
Craig Mautner2fbd7542014-03-21 09:34:07 -07006569 Parcel data = Parcel.obtain();
6570 Parcel reply = Parcel.obtain();
6571 data.writeInterfaceToken(IActivityManager.descriptor);
6572 data.writeStrongBinder(token);
Winson Chung03a9bae2014-05-02 09:56:12 -07006573 values.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006574 mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0);
Craig Mautner2fbd7542014-03-21 09:34:07 -07006575 reply.readException();
6576 data.recycle();
6577 reply.recycle();
6578 }
6579
Craig Mautneree2e45a2014-06-27 12:10:03 -07006580 @Override
Wale Ogunwaleb1faf602016-01-27 09:12:31 -08006581 public void setTaskResizeable(int taskId, int resizeableMode) throws RemoteException {
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08006582 Parcel data = Parcel.obtain();
6583 Parcel reply = Parcel.obtain();
6584 data.writeInterfaceToken(IActivityManager.descriptor);
6585 data.writeInt(taskId);
Wale Ogunwaleb1faf602016-01-27 09:12:31 -08006586 data.writeInt(resizeableMode);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006587 mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0);
Wale Ogunwale9d3de4c2015-02-01 16:49:44 -08006588 reply.readException();
6589 data.recycle();
6590 reply.recycle();
6591 }
6592
6593 @Override
Chong Zhang87b21722015-09-21 15:39:51 -07006594 public void resizeTask(int taskId, Rect r, int resizeMode) throws RemoteException
Wale Ogunwale53a29a92015-02-23 15:42:52 -08006595 {
6596 Parcel data = Parcel.obtain();
6597 Parcel reply = Parcel.obtain();
6598 data.writeInterfaceToken(IActivityManager.descriptor);
6599 data.writeInt(taskId);
Chong Zhang87b21722015-09-21 15:39:51 -07006600 data.writeInt(resizeMode);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08006601 r.writeToParcel(data, 0);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006602 mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0);
Wale Ogunwale53a29a92015-02-23 15:42:52 -08006603 reply.readException();
6604 data.recycle();
6605 reply.recycle();
6606 }
6607
6608 @Override
Wale Ogunwalee4a0c572015-06-30 08:40:31 -07006609 public Rect getTaskBounds(int taskId) throws RemoteException
6610 {
6611 Parcel data = Parcel.obtain();
6612 Parcel reply = Parcel.obtain();
6613 data.writeInterfaceToken(IActivityManager.descriptor);
6614 data.writeInt(taskId);
6615 mRemote.transact(GET_TASK_BOUNDS_TRANSACTION, data, reply, 0);
6616 reply.readException();
6617 Rect rect = Rect.CREATOR.createFromParcel(reply);
6618 data.recycle();
6619 reply.recycle();
6620 return rect;
6621 }
6622
6623 @Override
Suprabh Shukla23593142015-11-03 17:31:15 -08006624 public Bitmap getTaskDescriptionIcon(String filename, int userId) throws RemoteException {
Craig Mautner648f69b2014-09-18 14:16:26 -07006625 Parcel data = Parcel.obtain();
6626 Parcel reply = Parcel.obtain();
6627 data.writeInterfaceToken(IActivityManager.descriptor);
6628 data.writeString(filename);
Suprabh Shukla23593142015-11-03 17:31:15 -08006629 data.writeInt(userId);
Craig Mautner648f69b2014-09-18 14:16:26 -07006630 mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0);
6631 reply.readException();
6632 final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply);
6633 data.recycle();
6634 reply.recycle();
6635 return icon;
6636 }
6637
6638 @Override
Winson Chung044d5292014-11-06 11:05:19 -08006639 public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options)
6640 throws RemoteException {
6641 Parcel data = Parcel.obtain();
6642 Parcel reply = Parcel.obtain();
6643 data.writeInterfaceToken(IActivityManager.descriptor);
6644 if (options == null) {
6645 data.writeInt(0);
6646 } else {
6647 data.writeInt(1);
6648 data.writeBundle(options.toBundle());
6649 }
Dianne Hackborn1e383822015-04-10 14:02:33 -07006650 mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0);
Winson Chung044d5292014-11-06 11:05:19 -08006651 reply.readException();
6652 data.recycle();
6653 reply.recycle();
6654 }
6655
6656 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07006657 public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07006658 Parcel data = Parcel.obtain();
6659 Parcel reply = Parcel.obtain();
6660 data.writeInterfaceToken(IActivityManager.descriptor);
6661 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07006662 data.writeInt(visible ? 1 : 0);
6663 mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07006664 reply.readException();
6665 boolean success = reply.readInt() > 0;
6666 data.recycle();
6667 reply.recycle();
6668 return success;
6669 }
6670
6671 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07006672 public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07006673 Parcel data = Parcel.obtain();
6674 Parcel reply = Parcel.obtain();
6675 data.writeInterfaceToken(IActivityManager.descriptor);
6676 data.writeStrongBinder(token);
Jose Lima4b6c6692014-08-12 17:41:12 -07006677 mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07006678 reply.readException();
Jose Lima4b6c6692014-08-12 17:41:12 -07006679 final boolean visible = reply.readInt() > 0;
Craig Mautneree2e45a2014-06-27 12:10:03 -07006680 data.recycle();
6681 reply.recycle();
Jose Lima4b6c6692014-08-12 17:41:12 -07006682 return visible;
Craig Mautneree2e45a2014-06-27 12:10:03 -07006683 }
6684
6685 @Override
Jose Lima4b6c6692014-08-12 17:41:12 -07006686 public void backgroundResourcesReleased(IBinder token) throws RemoteException {
Craig Mautneree2e45a2014-06-27 12:10:03 -07006687 Parcel data = Parcel.obtain();
6688 Parcel reply = Parcel.obtain();
6689 data.writeInterfaceToken(IActivityManager.descriptor);
6690 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006691 mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0);
Craig Mautnerbb742462014-07-07 15:28:55 -07006692 reply.readException();
6693 data.recycle();
6694 reply.recycle();
6695 }
6696
6697 @Override
6698 public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException {
6699 Parcel data = Parcel.obtain();
6700 Parcel reply = Parcel.obtain();
6701 data.writeInterfaceToken(IActivityManager.descriptor);
6702 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006703 mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautneree2e45a2014-06-27 12:10:03 -07006704 reply.readException();
6705 data.recycle();
6706 reply.recycle();
6707 }
6708
Craig Mautner8746a472014-07-24 15:12:54 -07006709 @Override
6710 public void notifyEnterAnimationComplete(IBinder token) throws RemoteException {
6711 Parcel data = Parcel.obtain();
6712 Parcel reply = Parcel.obtain();
6713 data.writeInterfaceToken(IActivityManager.descriptor);
6714 data.writeStrongBinder(token);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006715 mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
Craig Mautner8746a472014-07-24 15:12:54 -07006716 reply.readException();
6717 data.recycle();
6718 reply.recycle();
6719 }
6720
Craig Mautner6e2f3952014-09-09 14:26:41 -07006721 @Override
6722 public void bootAnimationComplete() throws RemoteException {
6723 Parcel data = Parcel.obtain();
6724 Parcel reply = Parcel.obtain();
6725 data.writeInterfaceToken(IActivityManager.descriptor);
6726 mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
6727 reply.readException();
6728 data.recycle();
6729 reply.recycle();
6730 }
6731
Wale Ogunwale18795a22014-12-03 11:38:33 -08006732 @Override
Jeff Sharkey605eb792014-11-04 13:34:06 -08006733 public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException {
6734 Parcel data = Parcel.obtain();
6735 Parcel reply = Parcel.obtain();
6736 data.writeInterfaceToken(IActivityManager.descriptor);
6737 data.writeInt(uid);
6738 data.writeByteArray(firstPacket);
6739 mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0);
6740 reply.readException();
6741 data.recycle();
6742 reply.recycle();
6743 }
6744
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08006745 @Override
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07006746 public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize,
6747 String reportPackage) throws RemoteException {
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08006748 Parcel data = Parcel.obtain();
6749 Parcel reply = Parcel.obtain();
6750 data.writeInterfaceToken(IActivityManager.descriptor);
6751 data.writeString(processName);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07006752 data.writeInt(uid);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08006753 data.writeLong(maxMemSize);
Dianne Hackbornd59a5d52015-04-04 14:52:14 -07006754 data.writeString(reportPackage);
Dianne Hackbornb9a5e4a2015-03-03 17:04:12 -08006755 mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0);
6756 reply.readException();
6757 data.recycle();
6758 reply.recycle();
6759 }
6760
6761 @Override
6762 public void dumpHeapFinished(String path) throws RemoteException {
6763 Parcel data = Parcel.obtain();
6764 Parcel reply = Parcel.obtain();
6765 data.writeInterfaceToken(IActivityManager.descriptor);
6766 data.writeString(path);
6767 mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0);
6768 reply.readException();
6769 data.recycle();
6770 reply.recycle();
6771 }
6772
Dianne Hackborn3d07c942015-03-13 18:02:54 -07006773 @Override
6774 public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake)
6775 throws RemoteException {
6776 Parcel data = Parcel.obtain();
6777 Parcel reply = Parcel.obtain();
6778 data.writeInterfaceToken(IActivityManager.descriptor);
6779 data.writeStrongBinder(session.asBinder());
6780 data.writeInt(keepAwake ? 1 : 0);
6781 mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0);
6782 reply.readException();
6783 data.recycle();
6784 reply.recycle();
6785 }
6786
Craig Mautnere5600772015-04-03 21:36:37 -07006787 @Override
6788 public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException {
6789 Parcel data = Parcel.obtain();
6790 Parcel reply = Parcel.obtain();
6791 data.writeInterfaceToken(IActivityManager.descriptor);
6792 data.writeInt(userId);
6793 data.writeStringArray(packages);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006794 mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0);
Craig Mautnere5600772015-04-03 21:36:37 -07006795 reply.readException();
6796 data.recycle();
6797 reply.recycle();
6798 }
6799
Dianne Hackborn1e383822015-04-10 14:02:33 -07006800 @Override
Makoto Onuki219bbaf2015-11-12 01:38:47 +00006801 public void updateDeviceOwner(String packageName) throws RemoteException {
6802 Parcel data = Parcel.obtain();
6803 Parcel reply = Parcel.obtain();
6804 data.writeInterfaceToken(IActivityManager.descriptor);
6805 data.writeString(packageName);
6806 mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0);
6807 reply.readException();
6808 data.recycle();
6809 reply.recycle();
6810 }
6811
6812 @Override
Adam Lesinskic30454c2015-06-24 13:24:35 -07006813 public int getPackageProcessState(String packageName, String callingPackage)
6814 throws RemoteException {
Dianne Hackborn1e383822015-04-10 14:02:33 -07006815 Parcel data = Parcel.obtain();
6816 Parcel reply = Parcel.obtain();
6817 data.writeInterfaceToken(IActivityManager.descriptor);
6818 data.writeString(packageName);
Adam Lesinskic30454c2015-06-24 13:24:35 -07006819 data.writeString(callingPackage);
Dianne Hackborn1e383822015-04-10 14:02:33 -07006820 mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0);
6821 reply.readException();
6822 int res = reply.readInt();
6823 data.recycle();
6824 reply.recycle();
6825 return res;
6826 }
6827
Stefan Kuhne16045c22015-06-05 07:18:06 -07006828 @Override
6829 public boolean setProcessMemoryTrimLevel(String process, int userId, int level)
6830 throws RemoteException {
6831 Parcel data = Parcel.obtain();
6832 Parcel reply = Parcel.obtain();
6833 data.writeInterfaceToken(IActivityManager.descriptor);
6834 data.writeString(process);
6835 data.writeInt(userId);
6836 data.writeInt(level);
6837 mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0);
6838 reply.readException();
6839 int res = reply.readInt();
6840 data.recycle();
6841 reply.recycle();
6842 return res != 0;
6843 }
6844
Dianne Hackbornfb81d092015-08-03 17:14:46 -07006845 @Override
6846 public boolean isRootVoiceInteraction(IBinder token) throws RemoteException {
6847 Parcel data = Parcel.obtain();
6848 Parcel reply = Parcel.obtain();
6849 data.writeInterfaceToken(IActivityManager.descriptor);
6850 data.writeStrongBinder(token);
6851 mRemote.transact(IS_ROOT_VOICE_INTERACTION_TRANSACTION, data, reply, 0);
6852 reply.readException();
6853 int res = reply.readInt();
6854 data.recycle();
6855 reply.recycle();
6856 return res != 0;
6857 }
6858
Wale Ogunwale868a5e12015-08-02 16:19:20 -07006859 @Override
Filip Gruszczynski411c06f2016-01-07 09:44:44 -08006860 public void exitFreeformMode(IBinder token) throws RemoteException {
Wale Ogunwale868a5e12015-08-02 16:19:20 -07006861 Parcel data = Parcel.obtain();
6862 Parcel reply = Parcel.obtain();
6863 data.writeInterfaceToken(IActivityManager.descriptor);
6864 data.writeStrongBinder(token);
Filip Gruszczynski411c06f2016-01-07 09:44:44 -08006865 mRemote.transact(EXIT_FREEFORM_MODE_TRANSACTION, data, reply, 0);
Wale Ogunwale868a5e12015-08-02 16:19:20 -07006866 reply.readException();
6867 data.recycle();
6868 reply.recycle();
6869 }
6870
6871 @Override
6872 public int getActivityStackId(IBinder token) throws RemoteException {
6873 Parcel data = Parcel.obtain();
6874 Parcel reply = Parcel.obtain();
6875 data.writeInterfaceToken(IActivityManager.descriptor);
6876 data.writeStrongBinder(token);
6877 mRemote.transact(GET_ACTIVITY_STACK_ID_TRANSACTION, data, reply, 0);
6878 reply.readException();
6879 int stackId = reply.readInt();
6880 data.recycle();
6881 reply.recycle();
6882 return stackId;
6883 }
6884
Filip Gruszczynski23493322015-07-29 17:02:59 -07006885 @Override
6886 public void reportSizeConfigurations(IBinder token, int[] horizontalSizeConfiguration,
Filip Gruszczynski20aa0ae2015-10-30 10:08:27 -07006887 int[] verticalSizeConfigurations, int[] smallestSizeConfigurations)
6888 throws RemoteException {
Filip Gruszczynski23493322015-07-29 17:02:59 -07006889 Parcel data = Parcel.obtain();
6890 Parcel reply = Parcel.obtain();
6891 data.writeInterfaceToken(IActivityManager.descriptor);
6892 data.writeStrongBinder(token);
Filip Gruszczynski20aa0ae2015-10-30 10:08:27 -07006893 writeIntArray(horizontalSizeConfiguration, data);
6894 writeIntArray(verticalSizeConfigurations, data);
6895 writeIntArray(smallestSizeConfigurations, data);
Filip Gruszczynski23493322015-07-29 17:02:59 -07006896 mRemote.transact(REPORT_SIZE_CONFIGURATIONS, data, reply, 0);
6897 reply.readException();
6898 data.recycle();
6899 reply.recycle();
6900 }
6901
Filip Gruszczynski20aa0ae2015-10-30 10:08:27 -07006902 private static void writeIntArray(int[] array, Parcel data) {
6903 if (array == null) {
6904 data.writeInt(0);
6905 } else {
6906 data.writeInt(array.length);
6907 data.writeIntArray(array);
6908 }
6909 }
6910
Wale Ogunwale83301a92015-09-24 15:54:08 -07006911 @Override
6912 public void suppressResizeConfigChanges(boolean suppress) throws RemoteException {
6913 Parcel data = Parcel.obtain();
6914 Parcel reply = Parcel.obtain();
6915 data.writeInterfaceToken(IActivityManager.descriptor);
6916 data.writeInt(suppress ? 1 : 0);
6917 mRemote.transact(SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION, data, reply, 0);
6918 reply.readException();
6919 data.recycle();
6920 reply.recycle();
6921 }
6922
Filip Gruszczynski57b6cce2015-10-06 09:50:51 -07006923 @Override
Wale Ogunwale9101d262016-01-15 08:56:11 -08006924 public void moveTasksToFullscreenStack(int fromStackId, boolean onTop) throws RemoteException {
Filip Gruszczynski57b6cce2015-10-06 09:50:51 -07006925 Parcel data = Parcel.obtain();
6926 Parcel reply = Parcel.obtain();
6927 data.writeInterfaceToken(IActivityManager.descriptor);
Filip Gruszczynskib3da8342015-12-10 16:40:01 -08006928 data.writeInt(fromStackId);
Wale Ogunwale9101d262016-01-15 08:56:11 -08006929 data.writeInt(onTop ? 1 : 0);
Filip Gruszczynskib3da8342015-12-10 16:40:01 -08006930 mRemote.transact(MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION, data, reply, 0);
Filip Gruszczynski57b6cce2015-10-06 09:50:51 -07006931 reply.readException();
6932 data.recycle();
6933 reply.recycle();
6934 }
6935
Dianne Hackbornbef28fe2015-10-29 17:57:11 -07006936 @Override
6937 public int getAppStartMode(int uid, String packageName) throws RemoteException {
6938 Parcel data = Parcel.obtain();
6939 Parcel reply = Parcel.obtain();
6940 data.writeInterfaceToken(IActivityManager.descriptor);
6941 data.writeInt(uid);
6942 data.writeString(packageName);
6943 mRemote.transact(GET_APP_START_MODE_TRANSACTION, data, reply, 0);
6944 reply.readException();
6945 int res = reply.readInt();
6946 data.recycle();
6947 reply.recycle();
6948 return res;
6949 }
6950
Wale Ogunwale5f986092015-12-04 15:35:38 -08006951 @Override
Andrii Kulian933076d2016-03-29 17:04:42 -07006952 public boolean isInMultiWindowMode(IBinder token) throws RemoteException {
Wale Ogunwale5f986092015-12-04 15:35:38 -08006953 Parcel data = Parcel.obtain();
6954 Parcel reply = Parcel.obtain();
6955 data.writeInterfaceToken(IActivityManager.descriptor);
6956 data.writeStrongBinder(token);
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -08006957 mRemote.transact(IN_MULTI_WINDOW_TRANSACTION, data, reply, 0);
Wale Ogunwale5f986092015-12-04 15:35:38 -08006958 reply.readException();
6959 final boolean multiWindowMode = reply.readInt() == 1 ? true : false;
6960 data.recycle();
6961 reply.recycle();
6962 return multiWindowMode;
6963 }
6964
6965 @Override
Andrii Kulian933076d2016-03-29 17:04:42 -07006966 public boolean isInPictureInPictureMode(IBinder token) throws RemoteException {
Wale Ogunwale5f986092015-12-04 15:35:38 -08006967 Parcel data = Parcel.obtain();
6968 Parcel reply = Parcel.obtain();
6969 data.writeInterfaceToken(IActivityManager.descriptor);
6970 data.writeStrongBinder(token);
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -08006971 mRemote.transact(IN_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0);
Wale Ogunwale5f986092015-12-04 15:35:38 -08006972 reply.readException();
6973 final boolean pipMode = reply.readInt() == 1 ? true : false;
6974 data.recycle();
6975 reply.recycle();
6976 return pipMode;
6977 }
6978
Wale Ogunwale9c604c72015-12-06 18:42:57 -08006979 @Override
Andrii Kulian933076d2016-03-29 17:04:42 -07006980 public void enterPictureInPictureMode(IBinder token) throws RemoteException {
Wale Ogunwale9c604c72015-12-06 18:42:57 -08006981 Parcel data = Parcel.obtain();
6982 Parcel reply = Parcel.obtain();
6983 data.writeInterfaceToken(IActivityManager.descriptor);
6984 data.writeStrongBinder(token);
Wale Ogunwale3b93a4d2016-01-29 17:46:53 -08006985 mRemote.transact(ENTER_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0);
Wale Ogunwale9c604c72015-12-06 18:42:57 -08006986 reply.readException();
6987 data.recycle();
6988 reply.recycle();
6989 }
6990
Christopher Tate63fec3e2015-12-11 18:35:28 -08006991 @Override
6992 public boolean isAppForeground(int uid) throws RemoteException {
6993 Parcel data = Parcel.obtain();
6994 Parcel reply = Parcel.obtain();
6995 data.writeInterfaceToken(IActivityManager.descriptor);
6996 data.writeInt(uid);
6997 mRemote.transact(IS_APP_FOREGROUND_TRANSACTION, data, reply, 0);
6998 final boolean isForeground = reply.readInt() == 1 ? true : false;
6999 data.recycle();
7000 reply.recycle();
7001 return isForeground;
7002 };
7003
Wale Ogunwale480dca02016-02-06 13:58:29 -08007004 @Override
7005 public void notifyPinnedStackAnimationEnded() throws RemoteException {
7006 Parcel data = Parcel.obtain();
7007 Parcel reply = Parcel.obtain();
7008 data.writeInterfaceToken(IActivityManager.descriptor);
7009 mRemote.transact(NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION, data, reply, 0);
7010 data.recycle();
7011 reply.recycle();
7012 };
7013
Wale Ogunwale06e8ee02016-02-12 12:56:32 -08007014 @Override
7015 public void removeStack(int stackId) throws RemoteException {
7016 Parcel data = Parcel.obtain();
7017 Parcel reply = Parcel.obtain();
7018 data.writeInterfaceToken(IActivityManager.descriptor);
7019 data.writeInt(stackId);
7020 mRemote.transact(REMOVE_STACK, data, reply, 0);
7021 reply.readException();
7022 data.recycle();
7023 reply.recycle();
7024 }
7025
Felipe Lemea1b79bf2016-05-24 13:06:54 -07007026 @Override
7027 public void notifyLockedProfile(@UserIdInt int userId) throws RemoteException {
Tony Mak9c6e8ce2016-03-21 12:07:16 +00007028 Parcel data = Parcel.obtain();
7029 Parcel reply = Parcel.obtain();
7030 data.writeInterfaceToken(IActivityManager.descriptor);
7031 data.writeInt(userId);
7032 mRemote.transact(NOTIFY_LOCKED_PROFILE, data, reply, 0);
7033 reply.readException();
7034 data.recycle();
7035 reply.recycle();
7036 }
7037
Felipe Lemea1b79bf2016-05-24 13:06:54 -07007038 @Override
Tony Mak646fe992016-04-21 16:43:08 +01007039 public void startConfirmDeviceCredentialIntent(Intent intent) throws RemoteException {
7040 Parcel data = Parcel.obtain();
7041 Parcel reply = Parcel.obtain();
7042 data.writeInterfaceToken(IActivityManager.descriptor);
7043 intent.writeToParcel(data, 0);
7044 mRemote.transact(START_CONFIRM_DEVICE_CREDENTIAL_INTENT, data, reply, 0);
7045 reply.readException();
7046 data.recycle();
7047 reply.recycle();
7048 }
7049
Felipe Lemea1b79bf2016-05-24 13:06:54 -07007050 @Override
Dianne Hackborn0c4e6a82016-05-13 17:37:08 -07007051 public int sendIntentSender(IIntentSender target, int code, Intent intent, String resolvedType,
7052 IIntentReceiver finishedReceiver, String requiredPermission, Bundle options)
7053 throws RemoteException {
7054 Parcel data = Parcel.obtain();
7055 Parcel reply = Parcel.obtain();
7056 data.writeInterfaceToken(IActivityManager.descriptor);
7057 data.writeStrongBinder(target.asBinder());
7058 data.writeInt(code);
7059 if ((intent!=null)) {
7060 data.writeInt(1);
7061 intent.writeToParcel(data, 0);
7062 }
7063 else {
7064 data.writeInt(0);
7065 }
7066 data.writeString(resolvedType);
7067 data.writeStrongBinder((((finishedReceiver!=null))?(finishedReceiver.asBinder()):(null)));
7068 data.writeString(requiredPermission);
7069 if ((options!=null)) {
7070 data.writeInt(1);
7071 options.writeToParcel(data, 0);
7072 }
7073 else {
7074 data.writeInt(0);
7075 }
7076 mRemote.transact(SEND_INTENT_SENDER_TRANSACTION, data, reply, 0);
Dianne Hackborn5035d292016-05-23 14:39:45 -07007077 reply.readException();
Dianne Hackborn0c4e6a82016-05-13 17:37:08 -07007078 final int res = reply.readInt();
7079 data.recycle();
7080 reply.recycle();
7081 return res;
7082 }
7083
Srinath Sridharane535a582016-06-27 18:13:47 -07007084 @Override
7085 public void setVrThread(int tid)
Tim Murray33eb07f2016-06-10 10:03:20 -07007086 throws RemoteException {
Srinath Sridharane535a582016-06-27 18:13:47 -07007087 Parcel data = Parcel.obtain();
7088 Parcel reply = Parcel.obtain();
7089 data.writeInterfaceToken(IActivityManager.descriptor);
7090 data.writeInt(tid);
7091 mRemote.transact(SET_VR_THREAD_TRANSACTION, data, reply, 0);
7092 reply.readException();
7093 data.recycle();
7094 reply.recycle();
7095 return;
7096 }
7097
Tim Murray33eb07f2016-06-10 10:03:20 -07007098 public void setRenderThread(int tid)
7099 throws RemoteException {
7100 Parcel data = Parcel.obtain();
7101 Parcel reply = Parcel.obtain();
7102 data.writeInterfaceToken(IActivityManager.descriptor);
7103 data.writeInt(tid);
7104 mRemote.transact(SET_RENDER_THREAD_TRANSACTION, data, reply, 0);
7105 reply.readException();
7106 data.recycle();
7107 reply.recycle();
7108 return;
7109 }
7110
Jorim Jaggif6782ee2016-07-22 11:40:00 +02007111 public void setHasTopUi(boolean hasTopUi)
7112 throws RemoteException {
7113 Parcel data = Parcel.obtain();
7114 Parcel reply = Parcel.obtain();
7115 data.writeInterfaceToken(IActivityManager.descriptor);
7116 data.writeInt(hasTopUi ? 1 : 0);
7117 mRemote.transact(SET_HAS_TOP_UI, data, reply, 0);
7118 reply.readException();
7119 data.recycle();
7120 reply.recycle();
7121 return;
7122 }
Rubin Xu89927b32016-07-28 14:34:26 +01007123 @Override
7124 public boolean canBypassWorkChallenge(PendingIntent intent)
7125 throws RemoteException {
7126 Parcel data = Parcel.obtain();
7127 Parcel reply = Parcel.obtain();
7128 data.writeInterfaceToken(IActivityManager.descriptor);
7129 intent.writeToParcel(data, 0);
7130 mRemote.transact(CAN_BYPASS_WORK_CHALLENGE, data, reply, 0);
7131 reply.readException();
7132 final int result = reply.readInt();
7133 data.recycle();
7134 reply.recycle();
7135 return result != 0;
7136 }
Jorim Jaggif6782ee2016-07-22 11:40:00 +02007137
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007138 private IBinder mRemote;
7139}