2 * Copyright (C) 2006 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 import android.annotation.UserIdInt;
20 import android.app.ActivityManager.StackInfo;
21 import android.app.assist.AssistContent;
22 import android.app.assist.AssistStructure;
23 import android.content.ComponentName;
24 import android.content.IIntentReceiver;
25 import android.content.IIntentSender;
26 import android.content.Intent;
27 import android.content.IntentFilter;
28 import android.content.IntentSender;
29 import android.content.UriPermission;
30 import android.content.pm.ApplicationInfo;
31 import android.content.pm.ConfigurationInfo;
32 import android.content.pm.IPackageDataObserver;
33 import android.content.pm.ParceledListSlice;
34 import android.content.pm.UserInfo;
35 import android.content.res.Configuration;
36 import android.graphics.Bitmap;
37 import android.graphics.Point;
38 import android.graphics.Rect;
39 import android.net.Uri;
40 import android.os.Binder;
41 import android.os.Bundle;
42 import android.os.Debug;
43 import android.os.IBinder;
44 import android.os.IProgressListener;
45 import android.os.Parcel;
46 import android.os.ParcelFileDescriptor;
47 import android.os.Parcelable;
48 import android.os.PersistableBundle;
49 import android.os.RemoteException;
50 import android.os.ServiceManager;
51 import android.os.StrictMode;
52 import android.service.voice.IVoiceInteractionSession;
53 import android.text.TextUtils;
54 import android.util.Log;
55 import android.util.Singleton;
56 import com.android.internal.app.IVoiceInteractor;
57 import com.android.internal.os.IResultReceiver;
59 import java.util.ArrayList;
60 import java.util.List;
63 public abstract class ActivityManagerNative extends Binder implements IActivityManager
66 * Cast a Binder object into an activity manager interface, generating
69 static public IActivityManager asInterface(IBinder obj) {
74 (IActivityManager)obj.queryLocalInterface(descriptor);
79 return new ActivityManagerProxy(obj);
83 * Retrieve the system's default/global activity manager.
85 static public IActivityManager getDefault() {
86 return gDefault.get();
90 * Convenience for checking whether the system is ready. For internal use only.
92 static public boolean isSystemReady() {
94 sSystemReady = getDefault().testIsSystemReady();
98 static volatile boolean sSystemReady = false;
100 static public void broadcastStickyIntent(Intent intent, String permission, int userId) {
101 broadcastStickyIntent(intent, permission, AppOpsManager.OP_NONE, userId);
105 * Convenience for sending a sticky broadcast. For internal use only.
106 * If you don't care about permission, use null.
108 static public void broadcastStickyIntent(Intent intent, String permission, int appOp,
111 getDefault().broadcastIntent(
112 null, intent, null, null, Activity.RESULT_OK, null, null,
113 null /*permission*/, appOp, null, false, true, userId);
114 } catch (RemoteException ex) {
118 static public void noteWakeupAlarm(PendingIntent ps, int sourceUid, String sourcePkg,
121 getDefault().noteWakeupAlarm((ps != null) ? ps.getTarget() : null,
122 sourceUid, sourcePkg, tag);
123 } catch (RemoteException ex) {
127 static public void noteAlarmStart(PendingIntent ps, int sourceUid, String tag) {
129 getDefault().noteAlarmStart((ps != null) ? ps.getTarget() : null, sourceUid, tag);
130 } catch (RemoteException ex) {
134 static public void noteAlarmFinish(PendingIntent ps, int sourceUid, String tag) {
136 getDefault().noteAlarmFinish((ps != null) ? ps.getTarget() : null, sourceUid, tag);
137 } catch (RemoteException ex) {
141 public ActivityManagerNative() {
142 attachInterface(this, descriptor);
146 public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
147 throws RemoteException {
149 case START_ACTIVITY_TRANSACTION:
151 data.enforceInterface(IActivityManager.descriptor);
152 IBinder b = data.readStrongBinder();
153 IApplicationThread app = ApplicationThreadNative.asInterface(b);
154 String callingPackage = data.readString();
155 Intent intent = Intent.CREATOR.createFromParcel(data);
156 String resolvedType = data.readString();
157 IBinder resultTo = data.readStrongBinder();
158 String resultWho = data.readString();
159 int requestCode = data.readInt();
160 int startFlags = data.readInt();
161 ProfilerInfo profilerInfo = data.readInt() != 0
162 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
163 Bundle options = data.readInt() != 0
164 ? Bundle.CREATOR.createFromParcel(data) : null;
165 int result = startActivity(app, callingPackage, intent, resolvedType,
166 resultTo, resultWho, requestCode, startFlags, profilerInfo, options);
167 reply.writeNoException();
168 reply.writeInt(result);
172 case START_ACTIVITY_AS_USER_TRANSACTION:
174 data.enforceInterface(IActivityManager.descriptor);
175 IBinder b = data.readStrongBinder();
176 IApplicationThread app = ApplicationThreadNative.asInterface(b);
177 String callingPackage = data.readString();
178 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();
184 ProfilerInfo profilerInfo = data.readInt() != 0
185 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
186 Bundle options = data.readInt() != 0
187 ? Bundle.CREATOR.createFromParcel(data) : null;
188 int userId = data.readInt();
189 int result = startActivityAsUser(app, callingPackage, intent, resolvedType,
190 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
191 reply.writeNoException();
192 reply.writeInt(result);
196 case START_ACTIVITY_AS_CALLER_TRANSACTION:
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();
208 ProfilerInfo profilerInfo = data.readInt() != 0
209 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
210 Bundle options = data.readInt() != 0
211 ? Bundle.CREATOR.createFromParcel(data) : null;
212 boolean ignoreTargetSecurity = data.readInt() != 0;
213 int userId = data.readInt();
214 int result = startActivityAsCaller(app, callingPackage, intent, resolvedType,
215 resultTo, resultWho, requestCode, startFlags, profilerInfo, options,
216 ignoreTargetSecurity, userId);
217 reply.writeNoException();
218 reply.writeInt(result);
222 case START_ACTIVITY_AND_WAIT_TRANSACTION:
224 data.enforceInterface(IActivityManager.descriptor);
225 IBinder b = data.readStrongBinder();
226 IApplicationThread app = ApplicationThreadNative.asInterface(b);
227 String callingPackage = data.readString();
228 Intent intent = Intent.CREATOR.createFromParcel(data);
229 String resolvedType = data.readString();
230 IBinder resultTo = data.readStrongBinder();
231 String resultWho = data.readString();
232 int requestCode = data.readInt();
233 int startFlags = data.readInt();
234 ProfilerInfo profilerInfo = data.readInt() != 0
235 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
236 Bundle options = data.readInt() != 0
237 ? Bundle.CREATOR.createFromParcel(data) : null;
238 int userId = data.readInt();
239 WaitResult result = startActivityAndWait(app, callingPackage, intent, resolvedType,
240 resultTo, resultWho, requestCode, startFlags, profilerInfo, options, userId);
241 reply.writeNoException();
242 result.writeToParcel(reply, 0);
246 case START_ACTIVITY_WITH_CONFIG_TRANSACTION:
248 data.enforceInterface(IActivityManager.descriptor);
249 IBinder b = data.readStrongBinder();
250 IApplicationThread app = ApplicationThreadNative.asInterface(b);
251 String callingPackage = data.readString();
252 Intent intent = Intent.CREATOR.createFromParcel(data);
253 String resolvedType = data.readString();
254 IBinder resultTo = data.readStrongBinder();
255 String resultWho = data.readString();
256 int requestCode = data.readInt();
257 int startFlags = data.readInt();
258 Configuration config = Configuration.CREATOR.createFromParcel(data);
259 Bundle options = data.readInt() != 0
260 ? Bundle.CREATOR.createFromParcel(data) : null;
261 int userId = data.readInt();
262 int result = startActivityWithConfig(app, callingPackage, intent, resolvedType,
263 resultTo, resultWho, requestCode, startFlags, config, options, userId);
264 reply.writeNoException();
265 reply.writeInt(result);
269 case START_ACTIVITY_INTENT_SENDER_TRANSACTION:
271 data.enforceInterface(IActivityManager.descriptor);
272 IBinder b = data.readStrongBinder();
273 IApplicationThread app = ApplicationThreadNative.asInterface(b);
274 IntentSender intent = IntentSender.CREATOR.createFromParcel(data);
275 Intent fillInIntent = null;
276 if (data.readInt() != 0) {
277 fillInIntent = Intent.CREATOR.createFromParcel(data);
279 String resolvedType = data.readString();
280 IBinder resultTo = data.readStrongBinder();
281 String resultWho = data.readString();
282 int requestCode = data.readInt();
283 int flagsMask = data.readInt();
284 int flagsValues = data.readInt();
285 Bundle options = data.readInt() != 0
286 ? Bundle.CREATOR.createFromParcel(data) : null;
287 int result = startActivityIntentSender(app, intent,
288 fillInIntent, resolvedType, resultTo, resultWho,
289 requestCode, flagsMask, flagsValues, options);
290 reply.writeNoException();
291 reply.writeInt(result);
295 case START_VOICE_ACTIVITY_TRANSACTION:
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();
308 ProfilerInfo profilerInfo = data.readInt() != 0
309 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
310 Bundle options = data.readInt() != 0
311 ? Bundle.CREATOR.createFromParcel(data) : null;
312 int userId = data.readInt();
313 int result = startVoiceActivity(callingPackage, callingPid, callingUid, intent,
314 resolvedType, session, interactor, startFlags, profilerInfo, options, userId);
315 reply.writeNoException();
316 reply.writeInt(result);
320 case START_LOCAL_VOICE_INTERACTION_TRANSACTION:
322 data.enforceInterface(IActivityManager.descriptor);
323 IBinder token = data.readStrongBinder();
324 Bundle options = data.readBundle();
325 startLocalVoiceInteraction(token, options);
326 reply.writeNoException();
330 case STOP_LOCAL_VOICE_INTERACTION_TRANSACTION:
332 data.enforceInterface(IActivityManager.descriptor);
333 IBinder token = data.readStrongBinder();
334 stopLocalVoiceInteraction(token);
335 reply.writeNoException();
339 case SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION:
341 data.enforceInterface(IActivityManager.descriptor);
342 boolean result = supportsLocalVoiceInteraction();
343 reply.writeNoException();
344 reply.writeInt(result? 1 : 0);
348 case START_NEXT_MATCHING_ACTIVITY_TRANSACTION:
350 data.enforceInterface(IActivityManager.descriptor);
351 IBinder callingActivity = data.readStrongBinder();
352 Intent intent = Intent.CREATOR.createFromParcel(data);
353 Bundle options = data.readInt() != 0
354 ? Bundle.CREATOR.createFromParcel(data) : null;
355 boolean result = startNextMatchingActivity(callingActivity, intent, options);
356 reply.writeNoException();
357 reply.writeInt(result ? 1 : 0);
361 case START_ACTIVITY_FROM_RECENTS_TRANSACTION:
363 data.enforceInterface(IActivityManager.descriptor);
364 final int taskId = data.readInt();
365 final Bundle options =
366 data.readInt() == 0 ? null : Bundle.CREATOR.createFromParcel(data);
367 final int result = startActivityFromRecents(taskId, options);
368 reply.writeNoException();
369 reply.writeInt(result);
373 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);
381 int finishTask = data.readInt();
382 boolean res = finishActivity(token, resultCode, resultData, finishTask);
383 reply.writeNoException();
384 reply.writeInt(res ? 1 : 0);
388 case FINISH_SUB_ACTIVITY_TRANSACTION: {
389 data.enforceInterface(IActivityManager.descriptor);
390 IBinder token = data.readStrongBinder();
391 String resultWho = data.readString();
392 int requestCode = data.readInt();
393 finishSubActivity(token, resultWho, requestCode);
394 reply.writeNoException();
398 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);
407 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();
416 case RELEASE_ACTIVITY_INSTANCE_TRANSACTION: {
417 data.enforceInterface(IActivityManager.descriptor);
418 IBinder token = data.readStrongBinder();
419 boolean res = releaseActivityInstance(token);
420 reply.writeNoException();
421 reply.writeInt(res ? 1 : 0);
425 case RELEASE_SOME_ACTIVITIES_TRANSACTION: {
426 data.enforceInterface(IActivityManager.descriptor);
427 IApplicationThread app = ApplicationThreadNative.asInterface(data.readStrongBinder());
428 releaseSomeActivities(app);
429 reply.writeNoException();
433 case WILL_ACTIVITY_BE_VISIBLE_TRANSACTION: {
434 data.enforceInterface(IActivityManager.descriptor);
435 IBinder token = data.readStrongBinder();
436 boolean res = willActivityBeVisible(token);
437 reply.writeNoException();
438 reply.writeInt(res ? 1 : 0);
442 case REGISTER_RECEIVER_TRANSACTION:
444 data.enforceInterface(IActivityManager.descriptor);
445 IBinder b = data.readStrongBinder();
446 IApplicationThread app =
447 b != null ? ApplicationThreadNative.asInterface(b) : null;
448 String packageName = data.readString();
449 b = data.readStrongBinder();
451 = b != null ? IIntentReceiver.Stub.asInterface(b) : null;
452 IntentFilter filter = IntentFilter.CREATOR.createFromParcel(data);
453 String perm = data.readString();
454 int userId = data.readInt();
455 Intent intent = registerReceiver(app, packageName, rec, filter, perm, userId);
456 reply.writeNoException();
457 if (intent != null) {
459 intent.writeToParcel(reply, 0);
466 case UNREGISTER_RECEIVER_TRANSACTION:
468 data.enforceInterface(IActivityManager.descriptor);
469 IBinder b = data.readStrongBinder();
473 IIntentReceiver rec = IIntentReceiver.Stub.asInterface(b);
474 unregisterReceiver(rec);
475 reply.writeNoException();
479 case BROADCAST_INTENT_TRANSACTION:
481 data.enforceInterface(IActivityManager.descriptor);
482 IBinder b = data.readStrongBinder();
483 IApplicationThread app =
484 b != null ? ApplicationThreadNative.asInterface(b) : null;
485 Intent intent = Intent.CREATOR.createFromParcel(data);
486 String resolvedType = data.readString();
487 b = data.readStrongBinder();
488 IIntentReceiver resultTo =
489 b != null ? IIntentReceiver.Stub.asInterface(b) : null;
490 int resultCode = data.readInt();
491 String resultData = data.readString();
492 Bundle resultExtras = data.readBundle();
493 String[] perms = data.readStringArray();
494 int appOp = data.readInt();
495 Bundle options = data.readBundle();
496 boolean serialized = data.readInt() != 0;
497 boolean sticky = data.readInt() != 0;
498 int userId = data.readInt();
499 int res = broadcastIntent(app, intent, resolvedType, resultTo,
500 resultCode, resultData, resultExtras, perms, appOp,
501 options, serialized, sticky, userId);
502 reply.writeNoException();
507 case UNBROADCAST_INTENT_TRANSACTION:
509 data.enforceInterface(IActivityManager.descriptor);
510 IBinder b = data.readStrongBinder();
511 IApplicationThread app = b != null ? ApplicationThreadNative.asInterface(b) : null;
512 Intent intent = Intent.CREATOR.createFromParcel(data);
513 int userId = data.readInt();
514 unbroadcastIntent(app, intent, userId);
515 reply.writeNoException();
519 case FINISH_RECEIVER_TRANSACTION: {
520 data.enforceInterface(IActivityManager.descriptor);
521 IBinder who = data.readStrongBinder();
522 int resultCode = data.readInt();
523 String resultData = data.readString();
524 Bundle resultExtras = data.readBundle();
525 boolean resultAbort = data.readInt() != 0;
526 int intentFlags = data.readInt();
528 finishReceiver(who, resultCode, resultData, resultExtras, resultAbort, intentFlags);
530 reply.writeNoException();
534 case ATTACH_APPLICATION_TRANSACTION: {
535 data.enforceInterface(IActivityManager.descriptor);
536 IApplicationThread app = ApplicationThreadNative.asInterface(
537 data.readStrongBinder());
539 attachApplication(app);
541 reply.writeNoException();
545 case ACTIVITY_IDLE_TRANSACTION: {
546 data.enforceInterface(IActivityManager.descriptor);
547 IBinder token = data.readStrongBinder();
548 Configuration config = null;
549 if (data.readInt() != 0) {
550 config = Configuration.CREATOR.createFromParcel(data);
552 boolean stopProfiling = data.readInt() != 0;
554 activityIdle(token, config, stopProfiling);
556 reply.writeNoException();
560 case ACTIVITY_RESUMED_TRANSACTION: {
561 data.enforceInterface(IActivityManager.descriptor);
562 IBinder token = data.readStrongBinder();
563 activityResumed(token);
564 reply.writeNoException();
568 case ACTIVITY_PAUSED_TRANSACTION: {
569 data.enforceInterface(IActivityManager.descriptor);
570 IBinder token = data.readStrongBinder();
571 activityPaused(token);
572 reply.writeNoException();
576 case ACTIVITY_STOPPED_TRANSACTION: {
577 data.enforceInterface(IActivityManager.descriptor);
578 IBinder token = data.readStrongBinder();
579 Bundle map = data.readBundle();
580 PersistableBundle persistentState = data.readPersistableBundle();
581 CharSequence description = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
582 activityStopped(token, map, persistentState, description);
583 reply.writeNoException();
587 case ACTIVITY_SLEPT_TRANSACTION: {
588 data.enforceInterface(IActivityManager.descriptor);
589 IBinder token = data.readStrongBinder();
590 activitySlept(token);
591 reply.writeNoException();
595 case ACTIVITY_DESTROYED_TRANSACTION: {
596 data.enforceInterface(IActivityManager.descriptor);
597 IBinder token = data.readStrongBinder();
598 activityDestroyed(token);
599 reply.writeNoException();
603 case ACTIVITY_RELAUNCHED_TRANSACTION: {
604 data.enforceInterface(IActivityManager.descriptor);
605 IBinder token = data.readStrongBinder();
606 activityRelaunched(token);
607 reply.writeNoException();
611 case GET_CALLING_PACKAGE_TRANSACTION: {
612 data.enforceInterface(IActivityManager.descriptor);
613 IBinder token = data.readStrongBinder();
614 String res = token != null ? getCallingPackage(token) : null;
615 reply.writeNoException();
616 reply.writeString(res);
620 case GET_CALLING_ACTIVITY_TRANSACTION: {
621 data.enforceInterface(IActivityManager.descriptor);
622 IBinder token = data.readStrongBinder();
623 ComponentName cn = getCallingActivity(token);
624 reply.writeNoException();
625 ComponentName.writeToParcel(cn, reply);
629 case GET_APP_TASKS_TRANSACTION: {
630 data.enforceInterface(IActivityManager.descriptor);
631 String callingPackage = data.readString();
632 List<IAppTask> list = getAppTasks(callingPackage);
633 reply.writeNoException();
634 int N = list != null ? list.size() : -1;
637 for (i=0; i<N; i++) {
638 IAppTask task = list.get(i);
639 reply.writeStrongBinder(task.asBinder());
644 case ADD_APP_TASK_TRANSACTION: {
645 data.enforceInterface(IActivityManager.descriptor);
646 IBinder activityToken = data.readStrongBinder();
647 Intent intent = Intent.CREATOR.createFromParcel(data);
648 ActivityManager.TaskDescription descr
649 = ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
650 Bitmap thumbnail = Bitmap.CREATOR.createFromParcel(data);
651 int res = addAppTask(activityToken, intent, descr, thumbnail);
652 reply.writeNoException();
657 case GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION: {
658 data.enforceInterface(IActivityManager.descriptor);
659 Point size = getAppTaskThumbnailSize();
660 reply.writeNoException();
661 size.writeToParcel(reply, 0);
665 case GET_TASKS_TRANSACTION: {
666 data.enforceInterface(IActivityManager.descriptor);
667 int maxNum = data.readInt();
668 int fl = data.readInt();
669 List<ActivityManager.RunningTaskInfo> list = getTasks(maxNum, fl);
670 reply.writeNoException();
671 int N = list != null ? list.size() : -1;
674 for (i=0; i<N; i++) {
675 ActivityManager.RunningTaskInfo info = list.get(i);
676 info.writeToParcel(reply, 0);
681 case GET_RECENT_TASKS_TRANSACTION: {
682 data.enforceInterface(IActivityManager.descriptor);
683 int maxNum = data.readInt();
684 int fl = data.readInt();
685 int userId = data.readInt();
686 List<ActivityManager.RecentTaskInfo> list = getRecentTasks(maxNum,
688 reply.writeNoException();
689 reply.writeTypedList(list);
693 case GET_TASK_THUMBNAIL_TRANSACTION: {
694 data.enforceInterface(IActivityManager.descriptor);
695 int id = data.readInt();
696 ActivityManager.TaskThumbnail taskThumbnail = getTaskThumbnail(id);
697 reply.writeNoException();
698 if (taskThumbnail != null) {
700 taskThumbnail.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
707 case GET_SERVICES_TRANSACTION: {
708 data.enforceInterface(IActivityManager.descriptor);
709 int maxNum = data.readInt();
710 int fl = data.readInt();
711 List<ActivityManager.RunningServiceInfo> list = getServices(maxNum, fl);
712 reply.writeNoException();
713 int N = list != null ? list.size() : -1;
716 for (i=0; i<N; i++) {
717 ActivityManager.RunningServiceInfo info = list.get(i);
718 info.writeToParcel(reply, 0);
723 case GET_PROCESSES_IN_ERROR_STATE_TRANSACTION: {
724 data.enforceInterface(IActivityManager.descriptor);
725 List<ActivityManager.ProcessErrorStateInfo> list = getProcessesInErrorState();
726 reply.writeNoException();
727 reply.writeTypedList(list);
731 case GET_RUNNING_APP_PROCESSES_TRANSACTION: {
732 data.enforceInterface(IActivityManager.descriptor);
733 List<ActivityManager.RunningAppProcessInfo> list = getRunningAppProcesses();
734 reply.writeNoException();
735 reply.writeTypedList(list);
739 case GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION: {
740 data.enforceInterface(IActivityManager.descriptor);
741 List<ApplicationInfo> list = getRunningExternalApplications();
742 reply.writeNoException();
743 reply.writeTypedList(list);
747 case MOVE_TASK_TO_FRONT_TRANSACTION: {
748 data.enforceInterface(IActivityManager.descriptor);
749 int task = data.readInt();
750 int fl = data.readInt();
751 Bundle options = data.readInt() != 0
752 ? Bundle.CREATOR.createFromParcel(data) : null;
753 moveTaskToFront(task, fl, options);
754 reply.writeNoException();
758 case MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION: {
759 data.enforceInterface(IActivityManager.descriptor);
760 IBinder token = data.readStrongBinder();
761 boolean nonRoot = data.readInt() != 0;
762 boolean res = moveActivityTaskToBack(token, nonRoot);
763 reply.writeNoException();
764 reply.writeInt(res ? 1 : 0);
768 case MOVE_TASK_BACKWARDS_TRANSACTION: {
769 data.enforceInterface(IActivityManager.descriptor);
770 int task = data.readInt();
771 moveTaskBackwards(task);
772 reply.writeNoException();
776 case MOVE_TASK_TO_STACK_TRANSACTION: {
777 data.enforceInterface(IActivityManager.descriptor);
778 int taskId = data.readInt();
779 int stackId = data.readInt();
780 boolean toTop = data.readInt() != 0;
781 moveTaskToStack(taskId, stackId, toTop);
782 reply.writeNoException();
786 case MOVE_TASK_TO_DOCKED_STACK_TRANSACTION: {
787 data.enforceInterface(IActivityManager.descriptor);
788 int taskId = data.readInt();
789 int createMode = data.readInt();
790 boolean toTop = data.readInt() != 0;
791 boolean animate = data.readInt() != 0;
793 boolean hasBounds = data.readInt() != 0;
795 bounds = Rect.CREATOR.createFromParcel(data);
797 final boolean moveHomeStackFront = data.readInt() != 0;
798 final boolean res = moveTaskToDockedStack(
799 taskId, createMode, toTop, animate, bounds, moveHomeStackFront);
800 reply.writeNoException();
801 reply.writeInt(res ? 1 : 0);
805 case MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION: {
806 data.enforceInterface(IActivityManager.descriptor);
807 final int stackId = data.readInt();
808 final Rect r = Rect.CREATOR.createFromParcel(data);
809 final boolean res = moveTopActivityToPinnedStack(stackId, r);
810 reply.writeNoException();
811 reply.writeInt(res ? 1 : 0);
815 case RESIZE_STACK_TRANSACTION: {
816 data.enforceInterface(IActivityManager.descriptor);
817 final int stackId = data.readInt();
818 final boolean hasRect = data.readInt() != 0;
821 r = Rect.CREATOR.createFromParcel(data);
823 final boolean allowResizeInDockedMode = data.readInt() == 1;
824 final boolean preserveWindows = data.readInt() == 1;
825 final boolean animate = data.readInt() == 1;
826 final int animationDuration = data.readInt();
828 r, allowResizeInDockedMode, preserveWindows, animate, animationDuration);
829 reply.writeNoException();
832 case RESIZE_PINNED_STACK_TRANSACTION: {
833 data.enforceInterface(IActivityManager.descriptor);
834 final boolean hasBounds = data.readInt() != 0;
837 bounds = Rect.CREATOR.createFromParcel(data);
839 final boolean hasTempPinnedTaskBounds = data.readInt() != 0;
840 Rect tempPinnedTaskBounds = null;
841 if (hasTempPinnedTaskBounds) {
842 tempPinnedTaskBounds = Rect.CREATOR.createFromParcel(data);
844 resizePinnedStack(bounds, tempPinnedTaskBounds);
847 case SWAP_DOCKED_AND_FULLSCREEN_STACK: {
848 data.enforceInterface(IActivityManager.descriptor);
849 swapDockedAndFullscreenStack();
850 reply.writeNoException();
853 case RESIZE_DOCKED_STACK_TRANSACTION: {
854 data.enforceInterface(IActivityManager.descriptor);
855 final boolean hasBounds = data.readInt() != 0;
858 bounds = Rect.CREATOR.createFromParcel(data);
860 final boolean hasTempDockedTaskBounds = data.readInt() != 0;
861 Rect tempDockedTaskBounds = null;
862 if (hasTempDockedTaskBounds) {
863 tempDockedTaskBounds = Rect.CREATOR.createFromParcel(data);
865 final boolean hasTempDockedTaskInsetBounds = data.readInt() != 0;
866 Rect tempDockedTaskInsetBounds = null;
867 if (hasTempDockedTaskInsetBounds) {
868 tempDockedTaskInsetBounds = Rect.CREATOR.createFromParcel(data);
870 final boolean hasTempOtherTaskBounds = data.readInt() != 0;
871 Rect tempOtherTaskBounds = null;
872 if (hasTempOtherTaskBounds) {
873 tempOtherTaskBounds = Rect.CREATOR.createFromParcel(data);
875 final boolean hasTempOtherTaskInsetBounds = data.readInt() != 0;
876 Rect tempOtherTaskInsetBounds = null;
877 if (hasTempOtherTaskInsetBounds) {
878 tempOtherTaskInsetBounds = Rect.CREATOR.createFromParcel(data);
880 resizeDockedStack(bounds, tempDockedTaskBounds, tempDockedTaskInsetBounds,
881 tempOtherTaskBounds, tempOtherTaskInsetBounds);
882 reply.writeNoException();
886 case POSITION_TASK_IN_STACK_TRANSACTION: {
887 data.enforceInterface(IActivityManager.descriptor);
888 int taskId = data.readInt();
889 int stackId = data.readInt();
890 int position = data.readInt();
891 positionTaskInStack(taskId, stackId, position);
892 reply.writeNoException();
896 case GET_ALL_STACK_INFOS_TRANSACTION: {
897 data.enforceInterface(IActivityManager.descriptor);
898 List<StackInfo> list = getAllStackInfos();
899 reply.writeNoException();
900 reply.writeTypedList(list);
904 case GET_STACK_INFO_TRANSACTION: {
905 data.enforceInterface(IActivityManager.descriptor);
906 int stackId = data.readInt();
907 StackInfo info = getStackInfo(stackId);
908 reply.writeNoException();
911 info.writeToParcel(reply, 0);
918 case IS_IN_HOME_STACK_TRANSACTION: {
919 data.enforceInterface(IActivityManager.descriptor);
920 int taskId = data.readInt();
921 boolean isInHomeStack = isInHomeStack(taskId);
922 reply.writeNoException();
923 reply.writeInt(isInHomeStack ? 1 : 0);
927 case SET_FOCUSED_STACK_TRANSACTION: {
928 data.enforceInterface(IActivityManager.descriptor);
929 int stackId = data.readInt();
930 setFocusedStack(stackId);
931 reply.writeNoException();
935 case GET_FOCUSED_STACK_ID_TRANSACTION: {
936 data.enforceInterface(IActivityManager.descriptor);
937 int focusedStackId = getFocusedStackId();
938 reply.writeNoException();
939 reply.writeInt(focusedStackId);
943 case SET_FOCUSED_TASK_TRANSACTION: {
944 data.enforceInterface(IActivityManager.descriptor);
945 int taskId = data.readInt();
946 setFocusedTask(taskId);
947 reply.writeNoException();
951 case REGISTER_TASK_STACK_LISTENER_TRANSACTION: {
952 data.enforceInterface(IActivityManager.descriptor);
953 IBinder token = data.readStrongBinder();
954 registerTaskStackListener(ITaskStackListener.Stub.asInterface(token));
955 reply.writeNoException();
959 case GET_TASK_FOR_ACTIVITY_TRANSACTION: {
960 data.enforceInterface(IActivityManager.descriptor);
961 IBinder token = data.readStrongBinder();
962 boolean onlyRoot = data.readInt() != 0;
963 int res = token != null
964 ? getTaskForActivity(token, onlyRoot) : -1;
965 reply.writeNoException();
970 case GET_CONTENT_PROVIDER_TRANSACTION: {
971 data.enforceInterface(IActivityManager.descriptor);
972 IBinder b = data.readStrongBinder();
973 IApplicationThread app = ApplicationThreadNative.asInterface(b);
974 String name = data.readString();
975 int userId = data.readInt();
976 boolean stable = data.readInt() != 0;
977 ContentProviderHolder cph = getContentProvider(app, name, userId, stable);
978 reply.writeNoException();
981 cph.writeToParcel(reply, 0);
988 case GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
989 data.enforceInterface(IActivityManager.descriptor);
990 String name = data.readString();
991 int userId = data.readInt();
992 IBinder token = data.readStrongBinder();
993 ContentProviderHolder cph = getContentProviderExternal(name, userId, token);
994 reply.writeNoException();
997 cph.writeToParcel(reply, 0);
1004 case PUBLISH_CONTENT_PROVIDERS_TRANSACTION: {
1005 data.enforceInterface(IActivityManager.descriptor);
1006 IBinder b = data.readStrongBinder();
1007 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1008 ArrayList<ContentProviderHolder> providers =
1009 data.createTypedArrayList(ContentProviderHolder.CREATOR);
1010 publishContentProviders(app, providers);
1011 reply.writeNoException();
1015 case REF_CONTENT_PROVIDER_TRANSACTION: {
1016 data.enforceInterface(IActivityManager.descriptor);
1017 IBinder b = data.readStrongBinder();
1018 int stable = data.readInt();
1019 int unstable = data.readInt();
1020 boolean res = refContentProvider(b, stable, unstable);
1021 reply.writeNoException();
1022 reply.writeInt(res ? 1 : 0);
1026 case UNSTABLE_PROVIDER_DIED_TRANSACTION: {
1027 data.enforceInterface(IActivityManager.descriptor);
1028 IBinder b = data.readStrongBinder();
1029 unstableProviderDied(b);
1030 reply.writeNoException();
1034 case APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION: {
1035 data.enforceInterface(IActivityManager.descriptor);
1036 IBinder b = data.readStrongBinder();
1037 appNotRespondingViaProvider(b);
1038 reply.writeNoException();
1042 case REMOVE_CONTENT_PROVIDER_TRANSACTION: {
1043 data.enforceInterface(IActivityManager.descriptor);
1044 IBinder b = data.readStrongBinder();
1045 boolean stable = data.readInt() != 0;
1046 removeContentProvider(b, stable);
1047 reply.writeNoException();
1051 case REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION: {
1052 data.enforceInterface(IActivityManager.descriptor);
1053 String name = data.readString();
1054 IBinder token = data.readStrongBinder();
1055 removeContentProviderExternal(name, token);
1056 reply.writeNoException();
1060 case GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION: {
1061 data.enforceInterface(IActivityManager.descriptor);
1062 ComponentName comp = ComponentName.CREATOR.createFromParcel(data);
1063 PendingIntent pi = getRunningServiceControlPanel(comp);
1064 reply.writeNoException();
1065 PendingIntent.writePendingIntentOrNullToParcel(pi, reply);
1069 case START_SERVICE_TRANSACTION: {
1070 data.enforceInterface(IActivityManager.descriptor);
1071 IBinder b = data.readStrongBinder();
1072 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1073 Intent service = Intent.CREATOR.createFromParcel(data);
1074 String resolvedType = data.readString();
1075 String callingPackage = data.readString();
1076 int userId = data.readInt();
1077 ComponentName cn = startService(app, service, resolvedType, callingPackage, userId);
1078 reply.writeNoException();
1079 ComponentName.writeToParcel(cn, reply);
1083 case STOP_SERVICE_TRANSACTION: {
1084 data.enforceInterface(IActivityManager.descriptor);
1085 IBinder b = data.readStrongBinder();
1086 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1087 Intent service = Intent.CREATOR.createFromParcel(data);
1088 String resolvedType = data.readString();
1089 int userId = data.readInt();
1090 int res = stopService(app, service, resolvedType, userId);
1091 reply.writeNoException();
1092 reply.writeInt(res);
1096 case STOP_SERVICE_TOKEN_TRANSACTION: {
1097 data.enforceInterface(IActivityManager.descriptor);
1098 ComponentName className = ComponentName.readFromParcel(data);
1099 IBinder token = data.readStrongBinder();
1100 int startId = data.readInt();
1101 boolean res = stopServiceToken(className, token, startId);
1102 reply.writeNoException();
1103 reply.writeInt(res ? 1 : 0);
1107 case SET_SERVICE_FOREGROUND_TRANSACTION: {
1108 data.enforceInterface(IActivityManager.descriptor);
1109 ComponentName className = ComponentName.readFromParcel(data);
1110 IBinder token = data.readStrongBinder();
1111 int id = data.readInt();
1112 Notification notification = null;
1113 if (data.readInt() != 0) {
1114 notification = Notification.CREATOR.createFromParcel(data);
1116 int sflags = data.readInt();
1117 setServiceForeground(className, token, id, notification, sflags);
1118 reply.writeNoException();
1122 case BIND_SERVICE_TRANSACTION: {
1123 data.enforceInterface(IActivityManager.descriptor);
1124 IBinder b = data.readStrongBinder();
1125 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1126 IBinder token = data.readStrongBinder();
1127 Intent service = Intent.CREATOR.createFromParcel(data);
1128 String resolvedType = data.readString();
1129 b = data.readStrongBinder();
1130 int fl = data.readInt();
1131 String callingPackage = data.readString();
1132 int userId = data.readInt();
1133 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
1134 int res = bindService(app, token, service, resolvedType, conn, fl,
1135 callingPackage, userId);
1136 reply.writeNoException();
1137 reply.writeInt(res);
1141 case UNBIND_SERVICE_TRANSACTION: {
1142 data.enforceInterface(IActivityManager.descriptor);
1143 IBinder b = data.readStrongBinder();
1144 IServiceConnection conn = IServiceConnection.Stub.asInterface(b);
1145 boolean res = unbindService(conn);
1146 reply.writeNoException();
1147 reply.writeInt(res ? 1 : 0);
1151 case PUBLISH_SERVICE_TRANSACTION: {
1152 data.enforceInterface(IActivityManager.descriptor);
1153 IBinder token = data.readStrongBinder();
1154 Intent intent = Intent.CREATOR.createFromParcel(data);
1155 IBinder service = data.readStrongBinder();
1156 publishService(token, intent, service);
1157 reply.writeNoException();
1161 case UNBIND_FINISHED_TRANSACTION: {
1162 data.enforceInterface(IActivityManager.descriptor);
1163 IBinder token = data.readStrongBinder();
1164 Intent intent = Intent.CREATOR.createFromParcel(data);
1165 boolean doRebind = data.readInt() != 0;
1166 unbindFinished(token, intent, doRebind);
1167 reply.writeNoException();
1171 case SERVICE_DONE_EXECUTING_TRANSACTION: {
1172 data.enforceInterface(IActivityManager.descriptor);
1173 IBinder token = data.readStrongBinder();
1174 int type = data.readInt();
1175 int startId = data.readInt();
1176 int res = data.readInt();
1177 serviceDoneExecuting(token, type, startId, res);
1178 reply.writeNoException();
1182 case START_INSTRUMENTATION_TRANSACTION: {
1183 data.enforceInterface(IActivityManager.descriptor);
1184 ComponentName className = ComponentName.readFromParcel(data);
1185 String profileFile = data.readString();
1186 int fl = data.readInt();
1187 Bundle arguments = data.readBundle();
1188 IBinder b = data.readStrongBinder();
1189 IInstrumentationWatcher w = IInstrumentationWatcher.Stub.asInterface(b);
1190 b = data.readStrongBinder();
1191 IUiAutomationConnection c = IUiAutomationConnection.Stub.asInterface(b);
1192 int userId = data.readInt();
1193 String abiOverride = data.readString();
1194 boolean res = startInstrumentation(className, profileFile, fl, arguments, w, c, userId,
1196 reply.writeNoException();
1197 reply.writeInt(res ? 1 : 0);
1202 case FINISH_INSTRUMENTATION_TRANSACTION: {
1203 data.enforceInterface(IActivityManager.descriptor);
1204 IBinder b = data.readStrongBinder();
1205 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1206 int resultCode = data.readInt();
1207 Bundle results = data.readBundle();
1208 finishInstrumentation(app, resultCode, results);
1209 reply.writeNoException();
1213 case GET_CONFIGURATION_TRANSACTION: {
1214 data.enforceInterface(IActivityManager.descriptor);
1215 Configuration config = getConfiguration();
1216 reply.writeNoException();
1217 config.writeToParcel(reply, 0);
1221 case UPDATE_CONFIGURATION_TRANSACTION: {
1222 data.enforceInterface(IActivityManager.descriptor);
1223 Configuration config = Configuration.CREATOR.createFromParcel(data);
1224 updateConfiguration(config);
1225 reply.writeNoException();
1229 case SET_REQUESTED_ORIENTATION_TRANSACTION: {
1230 data.enforceInterface(IActivityManager.descriptor);
1231 IBinder token = data.readStrongBinder();
1232 int requestedOrientation = data.readInt();
1233 setRequestedOrientation(token, requestedOrientation);
1234 reply.writeNoException();
1238 case GET_REQUESTED_ORIENTATION_TRANSACTION: {
1239 data.enforceInterface(IActivityManager.descriptor);
1240 IBinder token = data.readStrongBinder();
1241 int req = getRequestedOrientation(token);
1242 reply.writeNoException();
1243 reply.writeInt(req);
1247 case GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION: {
1248 data.enforceInterface(IActivityManager.descriptor);
1249 IBinder token = data.readStrongBinder();
1250 ComponentName cn = getActivityClassForToken(token);
1251 reply.writeNoException();
1252 ComponentName.writeToParcel(cn, reply);
1256 case GET_PACKAGE_FOR_TOKEN_TRANSACTION: {
1257 data.enforceInterface(IActivityManager.descriptor);
1258 IBinder token = data.readStrongBinder();
1259 reply.writeNoException();
1260 reply.writeString(getPackageForToken(token));
1264 case GET_INTENT_SENDER_TRANSACTION: {
1265 data.enforceInterface(IActivityManager.descriptor);
1266 int type = data.readInt();
1267 String packageName = data.readString();
1268 IBinder token = data.readStrongBinder();
1269 String resultWho = data.readString();
1270 int requestCode = data.readInt();
1271 Intent[] requestIntents;
1272 String[] requestResolvedTypes;
1273 if (data.readInt() != 0) {
1274 requestIntents = data.createTypedArray(Intent.CREATOR);
1275 requestResolvedTypes = data.createStringArray();
1277 requestIntents = null;
1278 requestResolvedTypes = null;
1280 int fl = data.readInt();
1281 Bundle options = data.readInt() != 0
1282 ? Bundle.CREATOR.createFromParcel(data) : null;
1283 int userId = data.readInt();
1284 IIntentSender res = getIntentSender(type, packageName, token,
1285 resultWho, requestCode, requestIntents,
1286 requestResolvedTypes, fl, options, userId);
1287 reply.writeNoException();
1288 reply.writeStrongBinder(res != null ? res.asBinder() : null);
1292 case CANCEL_INTENT_SENDER_TRANSACTION: {
1293 data.enforceInterface(IActivityManager.descriptor);
1294 IIntentSender r = IIntentSender.Stub.asInterface(
1295 data.readStrongBinder());
1296 cancelIntentSender(r);
1297 reply.writeNoException();
1301 case GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION: {
1302 data.enforceInterface(IActivityManager.descriptor);
1303 IIntentSender r = IIntentSender.Stub.asInterface(
1304 data.readStrongBinder());
1305 String res = getPackageForIntentSender(r);
1306 reply.writeNoException();
1307 reply.writeString(res);
1311 case GET_UID_FOR_INTENT_SENDER_TRANSACTION: {
1312 data.enforceInterface(IActivityManager.descriptor);
1313 IIntentSender r = IIntentSender.Stub.asInterface(
1314 data.readStrongBinder());
1315 int res = getUidForIntentSender(r);
1316 reply.writeNoException();
1317 reply.writeInt(res);
1321 case HANDLE_INCOMING_USER_TRANSACTION: {
1322 data.enforceInterface(IActivityManager.descriptor);
1323 int callingPid = data.readInt();
1324 int callingUid = data.readInt();
1325 int userId = data.readInt();
1326 boolean allowAll = data.readInt() != 0 ;
1327 boolean requireFull = data.readInt() != 0;
1328 String name = data.readString();
1329 String callerPackage = data.readString();
1330 int res = handleIncomingUser(callingPid, callingUid, userId, allowAll,
1331 requireFull, name, callerPackage);
1332 reply.writeNoException();
1333 reply.writeInt(res);
1337 case SET_PROCESS_LIMIT_TRANSACTION: {
1338 data.enforceInterface(IActivityManager.descriptor);
1339 int max = data.readInt();
1340 setProcessLimit(max);
1341 reply.writeNoException();
1345 case GET_PROCESS_LIMIT_TRANSACTION: {
1346 data.enforceInterface(IActivityManager.descriptor);
1347 int limit = getProcessLimit();
1348 reply.writeNoException();
1349 reply.writeInt(limit);
1353 case SET_PROCESS_FOREGROUND_TRANSACTION: {
1354 data.enforceInterface(IActivityManager.descriptor);
1355 IBinder token = data.readStrongBinder();
1356 int pid = data.readInt();
1357 boolean isForeground = data.readInt() != 0;
1358 setProcessForeground(token, pid, isForeground);
1359 reply.writeNoException();
1363 case CHECK_PERMISSION_TRANSACTION: {
1364 data.enforceInterface(IActivityManager.descriptor);
1365 String perm = data.readString();
1366 int pid = data.readInt();
1367 int uid = data.readInt();
1368 int res = checkPermission(perm, pid, uid);
1369 reply.writeNoException();
1370 reply.writeInt(res);
1374 case CHECK_PERMISSION_WITH_TOKEN_TRANSACTION: {
1375 data.enforceInterface(IActivityManager.descriptor);
1376 String perm = data.readString();
1377 int pid = data.readInt();
1378 int uid = data.readInt();
1379 IBinder token = data.readStrongBinder();
1380 int res = checkPermissionWithToken(perm, pid, uid, token);
1381 reply.writeNoException();
1382 reply.writeInt(res);
1386 case CHECK_URI_PERMISSION_TRANSACTION: {
1387 data.enforceInterface(IActivityManager.descriptor);
1388 Uri uri = Uri.CREATOR.createFromParcel(data);
1389 int pid = data.readInt();
1390 int uid = data.readInt();
1391 int mode = data.readInt();
1392 int userId = data.readInt();
1393 IBinder callerToken = data.readStrongBinder();
1394 int res = checkUriPermission(uri, pid, uid, mode, userId, callerToken);
1395 reply.writeNoException();
1396 reply.writeInt(res);
1400 case CLEAR_APP_DATA_TRANSACTION: {
1401 data.enforceInterface(IActivityManager.descriptor);
1402 String packageName = data.readString();
1403 IPackageDataObserver observer = IPackageDataObserver.Stub.asInterface(
1404 data.readStrongBinder());
1405 int userId = data.readInt();
1406 boolean res = clearApplicationUserData(packageName, observer, userId);
1407 reply.writeNoException();
1408 reply.writeInt(res ? 1 : 0);
1412 case GRANT_URI_PERMISSION_TRANSACTION: {
1413 data.enforceInterface(IActivityManager.descriptor);
1414 IBinder b = data.readStrongBinder();
1415 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1416 String targetPkg = data.readString();
1417 Uri uri = Uri.CREATOR.createFromParcel(data);
1418 int mode = data.readInt();
1419 int userId = data.readInt();
1420 grantUriPermission(app, targetPkg, uri, mode, userId);
1421 reply.writeNoException();
1425 case REVOKE_URI_PERMISSION_TRANSACTION: {
1426 data.enforceInterface(IActivityManager.descriptor);
1427 IBinder b = data.readStrongBinder();
1428 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1429 Uri uri = Uri.CREATOR.createFromParcel(data);
1430 int mode = data.readInt();
1431 int userId = data.readInt();
1432 revokeUriPermission(app, uri, mode, userId);
1433 reply.writeNoException();
1437 case TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1438 data.enforceInterface(IActivityManager.descriptor);
1439 Uri uri = Uri.CREATOR.createFromParcel(data);
1440 int mode = data.readInt();
1441 int userId = data.readInt();
1442 takePersistableUriPermission(uri, mode, userId);
1443 reply.writeNoException();
1447 case RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION: {
1448 data.enforceInterface(IActivityManager.descriptor);
1449 Uri uri = Uri.CREATOR.createFromParcel(data);
1450 int mode = data.readInt();
1451 int userId = data.readInt();
1452 releasePersistableUriPermission(uri, mode, userId);
1453 reply.writeNoException();
1457 case GET_PERSISTED_URI_PERMISSIONS_TRANSACTION: {
1458 data.enforceInterface(IActivityManager.descriptor);
1459 final String packageName = data.readString();
1460 final boolean incoming = data.readInt() != 0;
1461 final ParceledListSlice<UriPermission> perms = getPersistedUriPermissions(
1462 packageName, incoming);
1463 reply.writeNoException();
1464 perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1468 case GET_GRANTED_URI_PERMISSIONS_TRANSACTION: {
1469 data.enforceInterface(IActivityManager.descriptor);
1470 final String packageName = data.readString();
1471 final int userId = data.readInt();
1472 final ParceledListSlice<UriPermission> perms = getGrantedUriPermissions(packageName,
1474 reply.writeNoException();
1475 perms.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1479 case CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION: {
1480 data.enforceInterface(IActivityManager.descriptor);
1481 final String packageName = data.readString();
1482 final int userId = data.readInt();
1483 clearGrantedUriPermissions(packageName, userId);
1484 reply.writeNoException();
1488 case SHOW_WAITING_FOR_DEBUGGER_TRANSACTION: {
1489 data.enforceInterface(IActivityManager.descriptor);
1490 IBinder b = data.readStrongBinder();
1491 IApplicationThread app = ApplicationThreadNative.asInterface(b);
1492 boolean waiting = data.readInt() != 0;
1493 showWaitingForDebugger(app, waiting);
1494 reply.writeNoException();
1498 case GET_MEMORY_INFO_TRANSACTION: {
1499 data.enforceInterface(IActivityManager.descriptor);
1500 ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
1502 reply.writeNoException();
1503 mi.writeToParcel(reply, 0);
1507 case UNHANDLED_BACK_TRANSACTION: {
1508 data.enforceInterface(IActivityManager.descriptor);
1510 reply.writeNoException();
1514 case OPEN_CONTENT_URI_TRANSACTION: {
1515 data.enforceInterface(IActivityManager.descriptor);
1516 Uri uri = Uri.parse(data.readString());
1517 ParcelFileDescriptor pfd = openContentUri(uri);
1518 reply.writeNoException();
1521 pfd.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1528 case SET_LOCK_SCREEN_SHOWN_TRANSACTION: {
1529 data.enforceInterface(IActivityManager.descriptor);
1530 final boolean showing = data.readInt() != 0;
1531 final boolean occluded = data.readInt() != 0;
1532 setLockScreenShown(showing, occluded);
1533 reply.writeNoException();
1537 case SET_DEBUG_APP_TRANSACTION: {
1538 data.enforceInterface(IActivityManager.descriptor);
1539 String pn = data.readString();
1540 boolean wfd = data.readInt() != 0;
1541 boolean per = data.readInt() != 0;
1542 setDebugApp(pn, wfd, per);
1543 reply.writeNoException();
1547 case SET_ALWAYS_FINISH_TRANSACTION: {
1548 data.enforceInterface(IActivityManager.descriptor);
1549 boolean enabled = data.readInt() != 0;
1550 setAlwaysFinish(enabled);
1551 reply.writeNoException();
1555 case SET_ACTIVITY_CONTROLLER_TRANSACTION: {
1556 data.enforceInterface(IActivityManager.descriptor);
1557 IActivityController watcher = IActivityController.Stub.asInterface(
1558 data.readStrongBinder());
1559 boolean imAMonkey = data.readInt() != 0;
1560 setActivityController(watcher, imAMonkey);
1561 reply.writeNoException();
1565 case SET_LENIENT_BACKGROUND_CHECK_TRANSACTION: {
1566 data.enforceInterface(IActivityManager.descriptor);
1567 boolean enabled = data.readInt() != 0;
1568 setLenientBackgroundCheck(enabled);
1569 reply.writeNoException();
1573 case GET_MEMORY_TRIM_LEVEL_TRANSACTION: {
1574 data.enforceInterface(IActivityManager.descriptor);
1575 int level = getMemoryTrimLevel();
1576 reply.writeNoException();
1577 reply.writeInt(level);
1581 case ENTER_SAFE_MODE_TRANSACTION: {
1582 data.enforceInterface(IActivityManager.descriptor);
1584 reply.writeNoException();
1588 case NOTE_WAKEUP_ALARM_TRANSACTION: {
1589 data.enforceInterface(IActivityManager.descriptor);
1590 IIntentSender is = IIntentSender.Stub.asInterface(
1591 data.readStrongBinder());
1592 int sourceUid = data.readInt();
1593 String sourcePkg = data.readString();
1594 String tag = data.readString();
1595 noteWakeupAlarm(is, sourceUid, sourcePkg, tag);
1596 reply.writeNoException();
1600 case NOTE_ALARM_START_TRANSACTION: {
1601 data.enforceInterface(IActivityManager.descriptor);
1602 IIntentSender is = IIntentSender.Stub.asInterface(
1603 data.readStrongBinder());
1604 int sourceUid = data.readInt();
1605 String tag = data.readString();
1606 noteAlarmStart(is, sourceUid, tag);
1607 reply.writeNoException();
1611 case NOTE_ALARM_FINISH_TRANSACTION: {
1612 data.enforceInterface(IActivityManager.descriptor);
1613 IIntentSender is = IIntentSender.Stub.asInterface(
1614 data.readStrongBinder());
1615 int sourceUid = data.readInt();
1616 String tag = data.readString();
1617 noteAlarmFinish(is, sourceUid, tag);
1618 reply.writeNoException();
1622 case KILL_PIDS_TRANSACTION: {
1623 data.enforceInterface(IActivityManager.descriptor);
1624 int[] pids = data.createIntArray();
1625 String reason = data.readString();
1626 boolean secure = data.readInt() != 0;
1627 boolean res = killPids(pids, reason, secure);
1628 reply.writeNoException();
1629 reply.writeInt(res ? 1 : 0);
1633 case KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION: {
1634 data.enforceInterface(IActivityManager.descriptor);
1635 String reason = data.readString();
1636 boolean res = killProcessesBelowForeground(reason);
1637 reply.writeNoException();
1638 reply.writeInt(res ? 1 : 0);
1642 case HANDLE_APPLICATION_CRASH_TRANSACTION: {
1643 data.enforceInterface(IActivityManager.descriptor);
1644 IBinder app = data.readStrongBinder();
1645 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1646 handleApplicationCrash(app, ci);
1647 reply.writeNoException();
1651 case HANDLE_APPLICATION_WTF_TRANSACTION: {
1652 data.enforceInterface(IActivityManager.descriptor);
1653 IBinder app = data.readStrongBinder();
1654 String tag = data.readString();
1655 boolean system = data.readInt() != 0;
1656 ApplicationErrorReport.CrashInfo ci = new ApplicationErrorReport.CrashInfo(data);
1657 boolean res = handleApplicationWtf(app, tag, system, ci);
1658 reply.writeNoException();
1659 reply.writeInt(res ? 1 : 0);
1663 case HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION: {
1664 data.enforceInterface(IActivityManager.descriptor);
1665 IBinder app = data.readStrongBinder();
1666 int violationMask = data.readInt();
1667 StrictMode.ViolationInfo info = new StrictMode.ViolationInfo(data);
1668 handleApplicationStrictModeViolation(app, violationMask, info);
1669 reply.writeNoException();
1673 case SIGNAL_PERSISTENT_PROCESSES_TRANSACTION: {
1674 data.enforceInterface(IActivityManager.descriptor);
1675 int sig = data.readInt();
1676 signalPersistentProcesses(sig);
1677 reply.writeNoException();
1681 case KILL_BACKGROUND_PROCESSES_TRANSACTION: {
1682 data.enforceInterface(IActivityManager.descriptor);
1683 String packageName = data.readString();
1684 int userId = data.readInt();
1685 killBackgroundProcesses(packageName, userId);
1686 reply.writeNoException();
1690 case KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION: {
1691 data.enforceInterface(IActivityManager.descriptor);
1692 killAllBackgroundProcesses();
1693 reply.writeNoException();
1697 case KILL_PACKAGE_DEPENDENTS_TRANSACTION: {
1698 data.enforceInterface(IActivityManager.descriptor);
1699 String packageName = data.readString();
1700 int userId = data.readInt();
1701 killPackageDependents(packageName, userId);
1702 reply.writeNoException();
1706 case FORCE_STOP_PACKAGE_TRANSACTION: {
1707 data.enforceInterface(IActivityManager.descriptor);
1708 String packageName = data.readString();
1709 int userId = data.readInt();
1710 forceStopPackage(packageName, userId);
1711 reply.writeNoException();
1715 case GET_MY_MEMORY_STATE_TRANSACTION: {
1716 data.enforceInterface(IActivityManager.descriptor);
1717 ActivityManager.RunningAppProcessInfo info =
1718 new ActivityManager.RunningAppProcessInfo();
1719 getMyMemoryState(info);
1720 reply.writeNoException();
1721 info.writeToParcel(reply, 0);
1725 case GET_DEVICE_CONFIGURATION_TRANSACTION: {
1726 data.enforceInterface(IActivityManager.descriptor);
1727 ConfigurationInfo config = getDeviceConfigurationInfo();
1728 reply.writeNoException();
1729 config.writeToParcel(reply, 0);
1733 case PROFILE_CONTROL_TRANSACTION: {
1734 data.enforceInterface(IActivityManager.descriptor);
1735 String process = data.readString();
1736 int userId = data.readInt();
1737 boolean start = data.readInt() != 0;
1738 int profileType = data.readInt();
1739 ProfilerInfo profilerInfo = data.readInt() != 0
1740 ? ProfilerInfo.CREATOR.createFromParcel(data) : null;
1741 boolean res = profileControl(process, userId, start, profilerInfo, profileType);
1742 reply.writeNoException();
1743 reply.writeInt(res ? 1 : 0);
1747 case SHUTDOWN_TRANSACTION: {
1748 data.enforceInterface(IActivityManager.descriptor);
1749 boolean res = shutdown(data.readInt());
1750 reply.writeNoException();
1751 reply.writeInt(res ? 1 : 0);
1755 case STOP_APP_SWITCHES_TRANSACTION: {
1756 data.enforceInterface(IActivityManager.descriptor);
1758 reply.writeNoException();
1762 case RESUME_APP_SWITCHES_TRANSACTION: {
1763 data.enforceInterface(IActivityManager.descriptor);
1764 resumeAppSwitches();
1765 reply.writeNoException();
1769 case PEEK_SERVICE_TRANSACTION: {
1770 data.enforceInterface(IActivityManager.descriptor);
1771 Intent service = Intent.CREATOR.createFromParcel(data);
1772 String resolvedType = data.readString();
1773 String callingPackage = data.readString();
1774 IBinder binder = peekService(service, resolvedType, callingPackage);
1775 reply.writeNoException();
1776 reply.writeStrongBinder(binder);
1780 case START_BACKUP_AGENT_TRANSACTION: {
1781 data.enforceInterface(IActivityManager.descriptor);
1782 String packageName = data.readString();
1783 int backupRestoreMode = data.readInt();
1784 int userId = data.readInt();
1785 boolean success = bindBackupAgent(packageName, backupRestoreMode, userId);
1786 reply.writeNoException();
1787 reply.writeInt(success ? 1 : 0);
1791 case BACKUP_AGENT_CREATED_TRANSACTION: {
1792 data.enforceInterface(IActivityManager.descriptor);
1793 String packageName = data.readString();
1794 IBinder agent = data.readStrongBinder();
1795 backupAgentCreated(packageName, agent);
1796 reply.writeNoException();
1800 case UNBIND_BACKUP_AGENT_TRANSACTION: {
1801 data.enforceInterface(IActivityManager.descriptor);
1802 ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
1803 unbindBackupAgent(info);
1804 reply.writeNoException();
1808 case ADD_PACKAGE_DEPENDENCY_TRANSACTION: {
1809 data.enforceInterface(IActivityManager.descriptor);
1810 String packageName = data.readString();
1811 addPackageDependency(packageName);
1812 reply.writeNoException();
1816 case KILL_APPLICATION_TRANSACTION: {
1817 data.enforceInterface(IActivityManager.descriptor);
1818 String pkg = data.readString();
1819 int appId = data.readInt();
1820 int userId = data.readInt();
1821 String reason = data.readString();
1822 killApplication(pkg, appId, userId, reason);
1823 reply.writeNoException();
1827 case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
1828 data.enforceInterface(IActivityManager.descriptor);
1829 String reason = data.readString();
1830 closeSystemDialogs(reason);
1831 reply.writeNoException();
1835 case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
1836 data.enforceInterface(IActivityManager.descriptor);
1837 int[] pids = data.createIntArray();
1838 Debug.MemoryInfo[] res = getProcessMemoryInfo(pids);
1839 reply.writeNoException();
1840 reply.writeTypedArray(res, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
1844 case KILL_APPLICATION_PROCESS_TRANSACTION: {
1845 data.enforceInterface(IActivityManager.descriptor);
1846 String processName = data.readString();
1847 int uid = data.readInt();
1848 killApplicationProcess(processName, uid);
1849 reply.writeNoException();
1853 case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
1854 data.enforceInterface(IActivityManager.descriptor);
1855 IBinder token = data.readStrongBinder();
1856 String packageName = data.readString();
1857 int enterAnim = data.readInt();
1858 int exitAnim = data.readInt();
1859 overridePendingTransition(token, packageName, enterAnim, exitAnim);
1860 reply.writeNoException();
1864 case IS_USER_A_MONKEY_TRANSACTION: {
1865 data.enforceInterface(IActivityManager.descriptor);
1866 boolean areThey = isUserAMonkey();
1867 reply.writeNoException();
1868 reply.writeInt(areThey ? 1 : 0);
1872 case SET_USER_IS_MONKEY_TRANSACTION: {
1873 data.enforceInterface(IActivityManager.descriptor);
1874 final boolean monkey = (data.readInt() == 1);
1875 setUserIsMonkey(monkey);
1876 reply.writeNoException();
1880 case FINISH_HEAVY_WEIGHT_APP_TRANSACTION: {
1881 data.enforceInterface(IActivityManager.descriptor);
1882 finishHeavyWeightApp();
1883 reply.writeNoException();
1887 case IS_IMMERSIVE_TRANSACTION: {
1888 data.enforceInterface(IActivityManager.descriptor);
1889 IBinder token = data.readStrongBinder();
1890 boolean isit = isImmersive(token);
1891 reply.writeNoException();
1892 reply.writeInt(isit ? 1 : 0);
1896 case IS_TOP_OF_TASK_TRANSACTION: {
1897 data.enforceInterface(IActivityManager.descriptor);
1898 IBinder token = data.readStrongBinder();
1899 final boolean isTopOfTask = isTopOfTask(token);
1900 reply.writeNoException();
1901 reply.writeInt(isTopOfTask ? 1 : 0);
1905 case CONVERT_FROM_TRANSLUCENT_TRANSACTION: {
1906 data.enforceInterface(IActivityManager.descriptor);
1907 IBinder token = data.readStrongBinder();
1908 boolean converted = convertFromTranslucent(token);
1909 reply.writeNoException();
1910 reply.writeInt(converted ? 1 : 0);
1914 case CONVERT_TO_TRANSLUCENT_TRANSACTION: {
1915 data.enforceInterface(IActivityManager.descriptor);
1916 IBinder token = data.readStrongBinder();
1917 final Bundle bundle;
1918 if (data.readInt() == 0) {
1921 bundle = data.readBundle();
1923 final ActivityOptions options = ActivityOptions.fromBundle(bundle);
1924 boolean converted = convertToTranslucent(token, options);
1925 reply.writeNoException();
1926 reply.writeInt(converted ? 1 : 0);
1930 case GET_ACTIVITY_OPTIONS_TRANSACTION: {
1931 data.enforceInterface(IActivityManager.descriptor);
1932 IBinder token = data.readStrongBinder();
1933 final ActivityOptions options = getActivityOptions(token);
1934 reply.writeNoException();
1935 reply.writeBundle(options == null ? null : options.toBundle());
1939 case SET_IMMERSIVE_TRANSACTION: {
1940 data.enforceInterface(IActivityManager.descriptor);
1941 IBinder token = data.readStrongBinder();
1942 boolean imm = data.readInt() == 1;
1943 setImmersive(token, imm);
1944 reply.writeNoException();
1948 case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
1949 data.enforceInterface(IActivityManager.descriptor);
1950 boolean isit = isTopActivityImmersive();
1951 reply.writeNoException();
1952 reply.writeInt(isit ? 1 : 0);
1956 case CRASH_APPLICATION_TRANSACTION: {
1957 data.enforceInterface(IActivityManager.descriptor);
1958 int uid = data.readInt();
1959 int initialPid = data.readInt();
1960 String packageName = data.readString();
1961 String message = data.readString();
1962 crashApplication(uid, initialPid, packageName, message);
1963 reply.writeNoException();
1967 case GET_PROVIDER_MIME_TYPE_TRANSACTION: {
1968 data.enforceInterface(IActivityManager.descriptor);
1969 Uri uri = Uri.CREATOR.createFromParcel(data);
1970 int userId = data.readInt();
1971 String type = getProviderMimeType(uri, userId);
1972 reply.writeNoException();
1973 reply.writeString(type);
1977 case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
1978 data.enforceInterface(IActivityManager.descriptor);
1979 String name = data.readString();
1980 IBinder perm = newUriPermissionOwner(name);
1981 reply.writeNoException();
1982 reply.writeStrongBinder(perm);
1986 case GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION: {
1987 data.enforceInterface(IActivityManager.descriptor);
1988 IBinder activityToken = data.readStrongBinder();
1989 IBinder perm = getUriPermissionOwnerForActivity(activityToken);
1990 reply.writeNoException();
1991 reply.writeStrongBinder(perm);
1995 case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
1996 data.enforceInterface(IActivityManager.descriptor);
1997 IBinder owner = data.readStrongBinder();
1998 int fromUid = data.readInt();
1999 String targetPkg = data.readString();
2000 Uri uri = Uri.CREATOR.createFromParcel(data);
2001 int mode = data.readInt();
2002 int sourceUserId = data.readInt();
2003 int targetUserId = data.readInt();
2004 grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode, sourceUserId,
2006 reply.writeNoException();
2010 case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
2011 data.enforceInterface(IActivityManager.descriptor);
2012 IBinder owner = data.readStrongBinder();
2014 if (data.readInt() != 0) {
2015 uri = Uri.CREATOR.createFromParcel(data);
2017 int mode = data.readInt();
2018 int userId = data.readInt();
2019 revokeUriPermissionFromOwner(owner, uri, mode, userId);
2020 reply.writeNoException();
2024 case CHECK_GRANT_URI_PERMISSION_TRANSACTION: {
2025 data.enforceInterface(IActivityManager.descriptor);
2026 int callingUid = data.readInt();
2027 String targetPkg = data.readString();
2028 Uri uri = Uri.CREATOR.createFromParcel(data);
2029 int modeFlags = data.readInt();
2030 int userId = data.readInt();
2031 int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags, userId);
2032 reply.writeNoException();
2033 reply.writeInt(res);
2037 case DUMP_HEAP_TRANSACTION: {
2038 data.enforceInterface(IActivityManager.descriptor);
2039 String process = data.readString();
2040 int userId = data.readInt();
2041 boolean managed = data.readInt() != 0;
2042 String path = data.readString();
2043 ParcelFileDescriptor fd = data.readInt() != 0
2044 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
2045 boolean res = dumpHeap(process, userId, managed, path, fd);
2046 reply.writeNoException();
2047 reply.writeInt(res ? 1 : 0);
2051 case START_ACTIVITIES_TRANSACTION:
2053 data.enforceInterface(IActivityManager.descriptor);
2054 IBinder b = data.readStrongBinder();
2055 IApplicationThread app = ApplicationThreadNative.asInterface(b);
2056 String callingPackage = data.readString();
2057 Intent[] intents = data.createTypedArray(Intent.CREATOR);
2058 String[] resolvedTypes = data.createStringArray();
2059 IBinder resultTo = data.readStrongBinder();
2060 Bundle options = data.readInt() != 0
2061 ? Bundle.CREATOR.createFromParcel(data) : null;
2062 int userId = data.readInt();
2063 int result = startActivities(app, callingPackage, intents, resolvedTypes, resultTo,
2065 reply.writeNoException();
2066 reply.writeInt(result);
2070 case GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
2072 data.enforceInterface(IActivityManager.descriptor);
2073 int mode = getFrontActivityScreenCompatMode();
2074 reply.writeNoException();
2075 reply.writeInt(mode);
2079 case SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION:
2081 data.enforceInterface(IActivityManager.descriptor);
2082 int mode = data.readInt();
2083 setFrontActivityScreenCompatMode(mode);
2084 reply.writeNoException();
2085 reply.writeInt(mode);
2089 case GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
2091 data.enforceInterface(IActivityManager.descriptor);
2092 String pkg = data.readString();
2093 int mode = getPackageScreenCompatMode(pkg);
2094 reply.writeNoException();
2095 reply.writeInt(mode);
2099 case SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION:
2101 data.enforceInterface(IActivityManager.descriptor);
2102 String pkg = data.readString();
2103 int mode = data.readInt();
2104 setPackageScreenCompatMode(pkg, mode);
2105 reply.writeNoException();
2109 case SWITCH_USER_TRANSACTION: {
2110 data.enforceInterface(IActivityManager.descriptor);
2111 int userid = data.readInt();
2112 boolean result = switchUser(userid);
2113 reply.writeNoException();
2114 reply.writeInt(result ? 1 : 0);
2118 case START_USER_IN_BACKGROUND_TRANSACTION: {
2119 data.enforceInterface(IActivityManager.descriptor);
2120 int userid = data.readInt();
2121 boolean result = startUserInBackground(userid);
2122 reply.writeNoException();
2123 reply.writeInt(result ? 1 : 0);
2127 case UNLOCK_USER_TRANSACTION: {
2128 data.enforceInterface(IActivityManager.descriptor);
2129 int userId = data.readInt();
2130 byte[] token = data.createByteArray();
2131 byte[] secret = data.createByteArray();
2132 IProgressListener listener = IProgressListener.Stub
2133 .asInterface(data.readStrongBinder());
2134 boolean result = unlockUser(userId, token, secret, listener);
2135 reply.writeNoException();
2136 reply.writeInt(result ? 1 : 0);
2140 case STOP_USER_TRANSACTION: {
2141 data.enforceInterface(IActivityManager.descriptor);
2142 int userid = data.readInt();
2143 boolean force = data.readInt() != 0;
2144 IStopUserCallback callback = IStopUserCallback.Stub.asInterface(
2145 data.readStrongBinder());
2146 int result = stopUser(userid, force, callback);
2147 reply.writeNoException();
2148 reply.writeInt(result);
2152 case GET_CURRENT_USER_TRANSACTION: {
2153 data.enforceInterface(IActivityManager.descriptor);
2154 UserInfo userInfo = getCurrentUser();
2155 reply.writeNoException();
2156 userInfo.writeToParcel(reply, 0);
2160 case IS_USER_RUNNING_TRANSACTION: {
2161 data.enforceInterface(IActivityManager.descriptor);
2162 int userid = data.readInt();
2163 int _flags = data.readInt();
2164 boolean result = isUserRunning(userid, _flags);
2165 reply.writeNoException();
2166 reply.writeInt(result ? 1 : 0);
2170 case GET_RUNNING_USER_IDS_TRANSACTION: {
2171 data.enforceInterface(IActivityManager.descriptor);
2172 int[] result = getRunningUserIds();
2173 reply.writeNoException();
2174 reply.writeIntArray(result);
2178 case REMOVE_TASK_TRANSACTION:
2180 data.enforceInterface(IActivityManager.descriptor);
2181 int taskId = data.readInt();
2182 boolean result = removeTask(taskId);
2183 reply.writeNoException();
2184 reply.writeInt(result ? 1 : 0);
2188 case REGISTER_PROCESS_OBSERVER_TRANSACTION: {
2189 data.enforceInterface(IActivityManager.descriptor);
2190 IProcessObserver observer = IProcessObserver.Stub.asInterface(
2191 data.readStrongBinder());
2192 registerProcessObserver(observer);
2196 case UNREGISTER_PROCESS_OBSERVER_TRANSACTION: {
2197 data.enforceInterface(IActivityManager.descriptor);
2198 IProcessObserver observer = IProcessObserver.Stub.asInterface(
2199 data.readStrongBinder());
2200 unregisterProcessObserver(observer);
2204 case REGISTER_UID_OBSERVER_TRANSACTION: {
2205 data.enforceInterface(IActivityManager.descriptor);
2206 IUidObserver observer = IUidObserver.Stub.asInterface(
2207 data.readStrongBinder());
2208 int which = data.readInt();
2209 registerUidObserver(observer, which);
2213 case UNREGISTER_UID_OBSERVER_TRANSACTION: {
2214 data.enforceInterface(IActivityManager.descriptor);
2215 IUidObserver observer = IUidObserver.Stub.asInterface(
2216 data.readStrongBinder());
2217 unregisterUidObserver(observer);
2221 case GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
2223 data.enforceInterface(IActivityManager.descriptor);
2224 String pkg = data.readString();
2225 boolean ask = getPackageAskScreenCompat(pkg);
2226 reply.writeNoException();
2227 reply.writeInt(ask ? 1 : 0);
2231 case SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION:
2233 data.enforceInterface(IActivityManager.descriptor);
2234 String pkg = data.readString();
2235 boolean ask = data.readInt() != 0;
2236 setPackageAskScreenCompat(pkg, ask);
2237 reply.writeNoException();
2241 case IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION: {
2242 data.enforceInterface(IActivityManager.descriptor);
2243 IIntentSender r = IIntentSender.Stub.asInterface(
2244 data.readStrongBinder());
2245 boolean res = isIntentSenderTargetedToPackage(r);
2246 reply.writeNoException();
2247 reply.writeInt(res ? 1 : 0);
2251 case IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION: {
2252 data.enforceInterface(IActivityManager.descriptor);
2253 IIntentSender r = IIntentSender.Stub.asInterface(
2254 data.readStrongBinder());
2255 boolean res = isIntentSenderAnActivity(r);
2256 reply.writeNoException();
2257 reply.writeInt(res ? 1 : 0);
2261 case GET_INTENT_FOR_INTENT_SENDER_TRANSACTION: {
2262 data.enforceInterface(IActivityManager.descriptor);
2263 IIntentSender r = IIntentSender.Stub.asInterface(
2264 data.readStrongBinder());
2265 Intent intent = getIntentForIntentSender(r);
2266 reply.writeNoException();
2267 if (intent != null) {
2269 intent.writeToParcel(reply, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
2276 case GET_TAG_FOR_INTENT_SENDER_TRANSACTION: {
2277 data.enforceInterface(IActivityManager.descriptor);
2278 IIntentSender r = IIntentSender.Stub.asInterface(
2279 data.readStrongBinder());
2280 String prefix = data.readString();
2281 String tag = getTagForIntentSender(r, prefix);
2282 reply.writeNoException();
2283 reply.writeString(tag);
2287 case UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION: {
2288 data.enforceInterface(IActivityManager.descriptor);
2289 Configuration config = Configuration.CREATOR.createFromParcel(data);
2290 updatePersistentConfiguration(config);
2291 reply.writeNoException();
2295 case GET_PROCESS_PSS_TRANSACTION: {
2296 data.enforceInterface(IActivityManager.descriptor);
2297 int[] pids = data.createIntArray();
2298 long[] pss = getProcessPss(pids);
2299 reply.writeNoException();
2300 reply.writeLongArray(pss);
2304 case SHOW_BOOT_MESSAGE_TRANSACTION: {
2305 data.enforceInterface(IActivityManager.descriptor);
2306 CharSequence msg = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(data);
2307 boolean always = data.readInt() != 0;
2308 showBootMessage(msg, always);
2309 reply.writeNoException();
2313 case KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION: {
2314 data.enforceInterface(IActivityManager.descriptor);
2315 keyguardWaitingForActivityDrawn();
2316 reply.writeNoException();
2320 case KEYGUARD_GOING_AWAY_TRANSACTION: {
2321 data.enforceInterface(IActivityManager.descriptor);
2322 keyguardGoingAway(data.readInt());
2323 reply.writeNoException();
2327 case SHOULD_UP_RECREATE_TASK_TRANSACTION: {
2328 data.enforceInterface(IActivityManager.descriptor);
2329 IBinder token = data.readStrongBinder();
2330 String destAffinity = data.readString();
2331 boolean res = shouldUpRecreateTask(token, destAffinity);
2332 reply.writeNoException();
2333 reply.writeInt(res ? 1 : 0);
2337 case NAVIGATE_UP_TO_TRANSACTION: {
2338 data.enforceInterface(IActivityManager.descriptor);
2339 IBinder token = data.readStrongBinder();
2340 Intent target = Intent.CREATOR.createFromParcel(data);
2341 int resultCode = data.readInt();
2342 Intent resultData = null;
2343 if (data.readInt() != 0) {
2344 resultData = Intent.CREATOR.createFromParcel(data);
2346 boolean res = navigateUpTo(token, target, resultCode, resultData);
2347 reply.writeNoException();
2348 reply.writeInt(res ? 1 : 0);
2352 case GET_LAUNCHED_FROM_UID_TRANSACTION: {
2353 data.enforceInterface(IActivityManager.descriptor);
2354 IBinder token = data.readStrongBinder();
2355 int res = getLaunchedFromUid(token);
2356 reply.writeNoException();
2357 reply.writeInt(res);
2361 case GET_LAUNCHED_FROM_PACKAGE_TRANSACTION: {
2362 data.enforceInterface(IActivityManager.descriptor);
2363 IBinder token = data.readStrongBinder();
2364 String res = getLaunchedFromPackage(token);
2365 reply.writeNoException();
2366 reply.writeString(res);
2370 case REGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2371 data.enforceInterface(IActivityManager.descriptor);
2372 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2373 data.readStrongBinder());
2374 String name = data.readString();
2375 registerUserSwitchObserver(observer, name);
2376 reply.writeNoException();
2380 case UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION: {
2381 data.enforceInterface(IActivityManager.descriptor);
2382 IUserSwitchObserver observer = IUserSwitchObserver.Stub.asInterface(
2383 data.readStrongBinder());
2384 unregisterUserSwitchObserver(observer);
2385 reply.writeNoException();
2389 case REQUEST_BUG_REPORT_TRANSACTION: {
2390 data.enforceInterface(IActivityManager.descriptor);
2391 int bugreportType = data.readInt();
2392 requestBugReport(bugreportType);
2393 reply.writeNoException();
2397 case INPUT_DISPATCHING_TIMED_OUT_TRANSACTION: {
2398 data.enforceInterface(IActivityManager.descriptor);
2399 int pid = data.readInt();
2400 boolean aboveSystem = data.readInt() != 0;
2401 String reason = data.readString();
2402 long res = inputDispatchingTimedOut(pid, aboveSystem, reason);
2403 reply.writeNoException();
2404 reply.writeLong(res);
2408 case GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
2409 data.enforceInterface(IActivityManager.descriptor);
2410 int requestType = data.readInt();
2411 Bundle res = getAssistContextExtras(requestType);
2412 reply.writeNoException();
2413 reply.writeBundle(res);
2417 case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
2418 data.enforceInterface(IActivityManager.descriptor);
2419 int requestType = data.readInt();
2420 IResultReceiver receiver = IResultReceiver.Stub.asInterface(data.readStrongBinder());
2421 Bundle receiverExtras = data.readBundle();
2422 IBinder activityToken = data.readStrongBinder();
2423 boolean focused = data.readInt() == 1;
2424 boolean newSessionId = data.readInt() == 1;
2425 boolean res = requestAssistContextExtras(requestType, receiver, receiverExtras,
2426 activityToken, focused, newSessionId);
2427 reply.writeNoException();
2428 reply.writeInt(res ? 1 : 0);
2432 case REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION: {
2433 data.enforceInterface(IActivityManager.descriptor);
2434 IBinder token = data.readStrongBinder();
2435 Bundle extras = data.readBundle();
2436 AssistStructure structure = AssistStructure.CREATOR.createFromParcel(data);
2437 AssistContent content = AssistContent.CREATOR.createFromParcel(data);
2438 Uri referrer = data.readInt() != 0 ? Uri.CREATOR.createFromParcel(data) : null;
2439 reportAssistContextExtras(token, extras, structure, content, referrer);
2440 reply.writeNoException();
2444 case LAUNCH_ASSIST_INTENT_TRANSACTION: {
2445 data.enforceInterface(IActivityManager.descriptor);
2446 Intent intent = Intent.CREATOR.createFromParcel(data);
2447 int requestType = data.readInt();
2448 String hint = data.readString();
2449 int userHandle = data.readInt();
2450 Bundle args = data.readBundle();
2451 boolean res = launchAssistIntent(intent, requestType, hint, userHandle, args);
2452 reply.writeNoException();
2453 reply.writeInt(res ? 1 : 0);
2457 case IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION: {
2458 data.enforceInterface(IActivityManager.descriptor);
2459 boolean res = isAssistDataAllowedOnCurrentActivity();
2460 reply.writeNoException();
2461 reply.writeInt(res ? 1 : 0);
2465 case SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION: {
2466 data.enforceInterface(IActivityManager.descriptor);
2467 IBinder token = data.readStrongBinder();
2468 Bundle args = data.readBundle();
2469 boolean res = showAssistFromActivity(token, args);
2470 reply.writeNoException();
2471 reply.writeInt(res ? 1 : 0);
2475 case KILL_UID_TRANSACTION: {
2476 data.enforceInterface(IActivityManager.descriptor);
2477 int appId = data.readInt();
2478 int userId = data.readInt();
2479 String reason = data.readString();
2480 killUid(appId, userId, reason);
2481 reply.writeNoException();
2485 case HANG_TRANSACTION: {
2486 data.enforceInterface(IActivityManager.descriptor);
2487 IBinder who = data.readStrongBinder();
2488 boolean allowRestart = data.readInt() != 0;
2489 hang(who, allowRestart);
2490 reply.writeNoException();
2494 case REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION: {
2495 data.enforceInterface(IActivityManager.descriptor);
2496 IBinder token = data.readStrongBinder();
2497 reportActivityFullyDrawn(token);
2498 reply.writeNoException();
2502 case NOTIFY_ACTIVITY_DRAWN_TRANSACTION: {
2503 data.enforceInterface(IActivityManager.descriptor);
2504 IBinder token = data.readStrongBinder();
2505 notifyActivityDrawn(token);
2506 reply.writeNoException();
2510 case RESTART_TRANSACTION: {
2511 data.enforceInterface(IActivityManager.descriptor);
2513 reply.writeNoException();
2517 case PERFORM_IDLE_MAINTENANCE_TRANSACTION: {
2518 data.enforceInterface(IActivityManager.descriptor);
2519 performIdleMaintenance();
2520 reply.writeNoException();
2524 case CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION: {
2525 data.enforceInterface(IActivityManager.descriptor);
2526 IBinder parentActivityToken = data.readStrongBinder();
2527 IActivityContainerCallback callback =
2528 IActivityContainerCallback.Stub.asInterface(data.readStrongBinder());
2529 IActivityContainer activityContainer =
2530 createVirtualActivityContainer(parentActivityToken, callback);
2531 reply.writeNoException();
2532 if (activityContainer != null) {
2534 reply.writeStrongBinder(activityContainer.asBinder());
2541 case DELETE_ACTIVITY_CONTAINER_TRANSACTION: {
2542 data.enforceInterface(IActivityManager.descriptor);
2543 IActivityContainer activityContainer =
2544 IActivityContainer.Stub.asInterface(data.readStrongBinder());
2545 deleteActivityContainer(activityContainer);
2546 reply.writeNoException();
2550 case CREATE_STACK_ON_DISPLAY: {
2551 data.enforceInterface(IActivityManager.descriptor);
2552 int displayId = data.readInt();
2553 IActivityContainer activityContainer = createStackOnDisplay(displayId);
2554 reply.writeNoException();
2555 if (activityContainer != null) {
2557 reply.writeStrongBinder(activityContainer.asBinder());
2564 case GET_ACTIVITY_DISPLAY_ID_TRANSACTION: {
2565 data.enforceInterface(IActivityManager.descriptor);
2566 IBinder activityToken = data.readStrongBinder();
2567 int displayId = getActivityDisplayId(activityToken);
2568 reply.writeNoException();
2569 reply.writeInt(displayId);
2573 case START_LOCK_TASK_BY_TASK_ID_TRANSACTION: {
2574 data.enforceInterface(IActivityManager.descriptor);
2575 final int taskId = data.readInt();
2576 startLockTaskMode(taskId);
2577 reply.writeNoException();
2581 case START_LOCK_TASK_BY_TOKEN_TRANSACTION: {
2582 data.enforceInterface(IActivityManager.descriptor);
2583 IBinder token = data.readStrongBinder();
2584 startLockTaskMode(token);
2585 reply.writeNoException();
2589 case START_SYSTEM_LOCK_TASK_TRANSACTION: {
2590 data.enforceInterface(IActivityManager.descriptor);
2591 int taskId = data.readInt();
2592 startSystemLockTaskMode(taskId);
2593 reply.writeNoException();
2597 case STOP_LOCK_TASK_MODE_TRANSACTION: {
2598 data.enforceInterface(IActivityManager.descriptor);
2600 reply.writeNoException();
2604 case STOP_SYSTEM_LOCK_TASK_TRANSACTION: {
2605 data.enforceInterface(IActivityManager.descriptor);
2606 stopSystemLockTaskMode();
2607 reply.writeNoException();
2611 case IS_IN_LOCK_TASK_MODE_TRANSACTION: {
2612 data.enforceInterface(IActivityManager.descriptor);
2613 final boolean isInLockTaskMode = isInLockTaskMode();
2614 reply.writeNoException();
2615 reply.writeInt(isInLockTaskMode ? 1 : 0);
2619 case GET_LOCK_TASK_MODE_STATE_TRANSACTION: {
2620 data.enforceInterface(IActivityManager.descriptor);
2621 final int lockTaskModeState = getLockTaskModeState();
2622 reply.writeNoException();
2623 reply.writeInt(lockTaskModeState);
2627 case SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION: {
2628 data.enforceInterface(IActivityManager.descriptor);
2629 final IBinder token = data.readStrongBinder();
2630 showLockTaskEscapeMessage(token);
2631 reply.writeNoException();
2635 case SET_TASK_DESCRIPTION_TRANSACTION: {
2636 data.enforceInterface(IActivityManager.descriptor);
2637 IBinder token = data.readStrongBinder();
2638 ActivityManager.TaskDescription values =
2639 ActivityManager.TaskDescription.CREATOR.createFromParcel(data);
2640 setTaskDescription(token, values);
2641 reply.writeNoException();
2645 case SET_TASK_RESIZEABLE_TRANSACTION: {
2646 data.enforceInterface(IActivityManager.descriptor);
2647 final int taskId = data.readInt();
2648 final int resizeableMode = data.readInt();
2649 setTaskResizeable(taskId, resizeableMode);
2650 reply.writeNoException();
2654 case RESIZE_TASK_TRANSACTION: {
2655 data.enforceInterface(IActivityManager.descriptor);
2656 int taskId = data.readInt();
2657 int resizeMode = data.readInt();
2658 Rect r = Rect.CREATOR.createFromParcel(data);
2659 resizeTask(taskId, r, resizeMode);
2660 reply.writeNoException();
2664 case GET_TASK_BOUNDS_TRANSACTION: {
2665 data.enforceInterface(IActivityManager.descriptor);
2666 int taskId = data.readInt();
2667 Rect r = getTaskBounds(taskId);
2668 reply.writeNoException();
2669 r.writeToParcel(reply, 0);
2673 case GET_TASK_DESCRIPTION_ICON_TRANSACTION: {
2674 data.enforceInterface(IActivityManager.descriptor);
2675 String filename = data.readString();
2676 int userId = data.readInt();
2677 Bitmap icon = getTaskDescriptionIcon(filename, userId);
2678 reply.writeNoException();
2683 icon.writeToParcel(reply, 0);
2688 case START_IN_PLACE_ANIMATION_TRANSACTION: {
2689 data.enforceInterface(IActivityManager.descriptor);
2690 final Bundle bundle;
2691 if (data.readInt() == 0) {
2694 bundle = data.readBundle();
2696 final ActivityOptions options = ActivityOptions.fromBundle(bundle);
2697 startInPlaceAnimationOnFrontMostApplication(options);
2698 reply.writeNoException();
2702 case REQUEST_VISIBLE_BEHIND_TRANSACTION: {
2703 data.enforceInterface(IActivityManager.descriptor);
2704 IBinder token = data.readStrongBinder();
2705 boolean enable = data.readInt() > 0;
2706 boolean success = requestVisibleBehind(token, enable);
2707 reply.writeNoException();
2708 reply.writeInt(success ? 1 : 0);
2712 case IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION: {
2713 data.enforceInterface(IActivityManager.descriptor);
2714 IBinder token = data.readStrongBinder();
2715 final boolean enabled = isBackgroundVisibleBehind(token);
2716 reply.writeNoException();
2717 reply.writeInt(enabled ? 1 : 0);
2721 case BACKGROUND_RESOURCES_RELEASED_TRANSACTION: {
2722 data.enforceInterface(IActivityManager.descriptor);
2723 IBinder token = data.readStrongBinder();
2724 backgroundResourcesReleased(token);
2725 reply.writeNoException();
2729 case NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION: {
2730 data.enforceInterface(IActivityManager.descriptor);
2731 IBinder token = data.readStrongBinder();
2732 notifyLaunchTaskBehindComplete(token);
2733 reply.writeNoException();
2737 case NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION: {
2738 data.enforceInterface(IActivityManager.descriptor);
2739 IBinder token = data.readStrongBinder();
2740 notifyEnterAnimationComplete(token);
2741 reply.writeNoException();
2745 case BOOT_ANIMATION_COMPLETE_TRANSACTION: {
2746 data.enforceInterface(IActivityManager.descriptor);
2747 bootAnimationComplete();
2748 reply.writeNoException();
2752 case NOTIFY_CLEARTEXT_NETWORK_TRANSACTION: {
2753 data.enforceInterface(IActivityManager.descriptor);
2754 final int uid = data.readInt();
2755 final byte[] firstPacket = data.createByteArray();
2756 notifyCleartextNetwork(uid, firstPacket);
2757 reply.writeNoException();
2761 case SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION: {
2762 data.enforceInterface(IActivityManager.descriptor);
2763 String procName = data.readString();
2764 int uid = data.readInt();
2765 long maxMemSize = data.readLong();
2766 String reportPackage = data.readString();
2767 setDumpHeapDebugLimit(procName, uid, maxMemSize, reportPackage);
2768 reply.writeNoException();
2772 case DUMP_HEAP_FINISHED_TRANSACTION: {
2773 data.enforceInterface(IActivityManager.descriptor);
2774 String path = data.readString();
2775 dumpHeapFinished(path);
2776 reply.writeNoException();
2780 case SET_VOICE_KEEP_AWAKE_TRANSACTION: {
2781 data.enforceInterface(IActivityManager.descriptor);
2782 IVoiceInteractionSession session = IVoiceInteractionSession.Stub.asInterface(
2783 data.readStrongBinder());
2784 boolean keepAwake = data.readInt() != 0;
2785 setVoiceKeepAwake(session, keepAwake);
2786 reply.writeNoException();
2790 case UPDATE_LOCK_TASK_PACKAGES_TRANSACTION: {
2791 data.enforceInterface(IActivityManager.descriptor);
2792 int userId = data.readInt();
2793 String[] packages = data.readStringArray();
2794 updateLockTaskPackages(userId, packages);
2795 reply.writeNoException();
2799 case UPDATE_DEVICE_OWNER_TRANSACTION: {
2800 data.enforceInterface(IActivityManager.descriptor);
2801 String packageName = data.readString();
2802 updateDeviceOwner(packageName);
2803 reply.writeNoException();
2807 case GET_PACKAGE_PROCESS_STATE_TRANSACTION: {
2808 data.enforceInterface(IActivityManager.descriptor);
2809 String pkg = data.readString();
2810 String callingPackage = data.readString();
2811 int res = getPackageProcessState(pkg, callingPackage);
2812 reply.writeNoException();
2813 reply.writeInt(res);
2817 case SET_PROCESS_MEMORY_TRIM_TRANSACTION: {
2818 data.enforceInterface(IActivityManager.descriptor);
2819 String process = data.readString();
2820 int userId = data.readInt();
2821 int level = data.readInt();
2822 boolean res = setProcessMemoryTrimLevel(process, userId, level);
2823 reply.writeNoException();
2824 reply.writeInt(res ? 1 : 0);
2828 case IS_ROOT_VOICE_INTERACTION_TRANSACTION: {
2829 data.enforceInterface(IActivityManager.descriptor);
2830 IBinder token = data.readStrongBinder();
2831 boolean res = isRootVoiceInteraction(token);
2832 reply.writeNoException();
2833 reply.writeInt(res ? 1 : 0);
2837 case START_BINDER_TRACKING_TRANSACTION: {
2838 data.enforceInterface(IActivityManager.descriptor);
2839 boolean res = startBinderTracking();
2840 reply.writeNoException();
2841 reply.writeInt(res ? 1 : 0);
2845 case STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION: {
2846 data.enforceInterface(IActivityManager.descriptor);
2847 ParcelFileDescriptor fd = data.readInt() != 0
2848 ? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
2849 boolean res = stopBinderTrackingAndDump(fd);
2850 reply.writeNoException();
2851 reply.writeInt(res ? 1 : 0);
2854 case GET_ACTIVITY_STACK_ID_TRANSACTION: {
2855 data.enforceInterface(IActivityManager.descriptor);
2856 IBinder token = data.readStrongBinder();
2857 int stackId = getActivityStackId(token);
2858 reply.writeNoException();
2859 reply.writeInt(stackId);
2862 case EXIT_FREEFORM_MODE_TRANSACTION: {
2863 data.enforceInterface(IActivityManager.descriptor);
2864 IBinder token = data.readStrongBinder();
2865 exitFreeformMode(token);
2866 reply.writeNoException();
2869 case REPORT_SIZE_CONFIGURATIONS: {
2870 data.enforceInterface(IActivityManager.descriptor);
2871 IBinder token = data.readStrongBinder();
2872 int[] horizontal = readIntArray(data);
2873 int[] vertical = readIntArray(data);
2874 int[] smallest = readIntArray(data);
2875 reportSizeConfigurations(token, horizontal, vertical, smallest);
2878 case SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION: {
2879 data.enforceInterface(IActivityManager.descriptor);
2880 final boolean suppress = data.readInt() == 1;
2881 suppressResizeConfigChanges(suppress);
2882 reply.writeNoException();
2885 case MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION: {
2886 data.enforceInterface(IActivityManager.descriptor);
2887 final int stackId = data.readInt();
2888 final boolean onTop = data.readInt() == 1;
2889 moveTasksToFullscreenStack(stackId, onTop);
2890 reply.writeNoException();
2893 case GET_APP_START_MODE_TRANSACTION: {
2894 data.enforceInterface(IActivityManager.descriptor);
2895 final int uid = data.readInt();
2896 final String pkg = data.readString();
2897 int res = getAppStartMode(uid, pkg);
2898 reply.writeNoException();
2899 reply.writeInt(res);
2902 case IN_MULTI_WINDOW_TRANSACTION: {
2903 data.enforceInterface(IActivityManager.descriptor);
2904 final IBinder token = data.readStrongBinder();
2905 final boolean inMultiWindow = isInMultiWindowMode(token);
2906 reply.writeNoException();
2907 reply.writeInt(inMultiWindow ? 1 : 0);
2910 case IN_PICTURE_IN_PICTURE_TRANSACTION: {
2911 data.enforceInterface(IActivityManager.descriptor);
2912 final IBinder token = data.readStrongBinder();
2913 final boolean inPip = isInPictureInPictureMode(token);
2914 reply.writeNoException();
2915 reply.writeInt(inPip ? 1 : 0);
2918 case ENTER_PICTURE_IN_PICTURE_TRANSACTION: {
2919 data.enforceInterface(IActivityManager.descriptor);
2920 final IBinder token = data.readStrongBinder();
2921 enterPictureInPictureMode(token);
2922 reply.writeNoException();
2925 case SET_VR_MODE_TRANSACTION: {
2926 data.enforceInterface(IActivityManager.descriptor);
2927 final IBinder token = data.readStrongBinder();
2928 final boolean enable = data.readInt() == 1;
2929 final ComponentName packageName = ComponentName.CREATOR.createFromParcel(data);
2930 int res = setVrMode(token, enable, packageName);
2931 reply.writeNoException();
2932 reply.writeInt(res);
2935 case IS_VR_PACKAGE_ENABLED_TRANSACTION: {
2936 data.enforceInterface(IActivityManager.descriptor);
2937 final ComponentName packageName = ComponentName.CREATOR.createFromParcel(data);
2938 boolean res = isVrModePackageEnabled(packageName);
2939 reply.writeNoException();
2940 reply.writeInt(res ? 1 : 0);
2943 case IS_APP_FOREGROUND_TRANSACTION: {
2944 data.enforceInterface(IActivityManager.descriptor);
2945 final int userHandle = data.readInt();
2946 final boolean isForeground = isAppForeground(userHandle);
2947 reply.writeNoException();
2948 reply.writeInt(isForeground ? 1 : 0);
2951 case NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION: {
2952 data.enforceInterface(IActivityManager.descriptor);
2953 reply.writeNoException();
2956 case REMOVE_STACK: {
2957 data.enforceInterface(IActivityManager.descriptor);
2958 final int stackId = data.readInt();
2959 removeStack(stackId);
2960 reply.writeNoException();
2963 case NOTIFY_LOCKED_PROFILE: {
2964 data.enforceInterface(IActivityManager.descriptor);
2965 final int userId = data.readInt();
2966 notifyLockedProfile(userId);
2967 reply.writeNoException();
2970 case START_CONFIRM_DEVICE_CREDENTIAL_INTENT: {
2971 data.enforceInterface(IActivityManager.descriptor);
2972 final Intent intent = Intent.CREATOR.createFromParcel(data);
2973 startConfirmDeviceCredentialIntent(intent);
2974 reply.writeNoException();
2977 case SEND_IDLE_JOB_TRIGGER_TRANSACTION: {
2978 data.enforceInterface(IActivityManager.descriptor);
2979 sendIdleJobTrigger();
2980 reply.writeNoException();
2983 case SEND_INTENT_SENDER_TRANSACTION: {
2984 data.enforceInterface(IActivityManager.descriptor);
2985 IIntentSender sender = IIntentSender.Stub.asInterface(data.readStrongBinder());
2986 int scode = data.readInt();
2987 Intent intent = data.readInt() != 0 ? Intent.CREATOR.createFromParcel(data) : null;
2988 String resolvedType = data.readString();
2989 IIntentReceiver finishedReceiver = IIntentReceiver.Stub.asInterface(
2990 data.readStrongBinder());
2991 String requiredPermission = data.readString();
2992 Bundle options = data.readInt() != 0 ? Bundle.CREATOR.createFromParcel(data) : null;
2993 int result = sendIntentSender(sender, scode, intent, resolvedType, finishedReceiver,
2994 requiredPermission, options);
2995 reply.writeNoException();
2996 reply.writeInt(result);
3001 return super.onTransact(code, data, reply, flags);
3004 private int[] readIntArray(Parcel data) {
3005 int[] smallest = null;
3006 int smallestSize = data.readInt();
3007 if (smallestSize > 0) {
3008 smallest = new int[smallestSize];
3009 data.readIntArray(smallest);
3014 public IBinder asBinder() {
3018 private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {
3019 protected IActivityManager create() {
3020 IBinder b = ServiceManager.getService("activity");
3022 Log.v("ActivityManager", "default service binder = " + b);
3024 IActivityManager am = asInterface(b);
3026 Log.v("ActivityManager", "default service = " + am);
3033 class ActivityManagerProxy implements IActivityManager
3035 public ActivityManagerProxy(IBinder remote)
3040 public IBinder asBinder()
3045 public int startActivity(IApplicationThread caller, String callingPackage, Intent intent,
3046 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
3047 int startFlags, ProfilerInfo profilerInfo, Bundle options) throws RemoteException {
3048 Parcel data = Parcel.obtain();
3049 Parcel reply = Parcel.obtain();
3050 data.writeInterfaceToken(IActivityManager.descriptor);
3051 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3052 data.writeString(callingPackage);
3053 intent.writeToParcel(data, 0);
3054 data.writeString(resolvedType);
3055 data.writeStrongBinder(resultTo);
3056 data.writeString(resultWho);
3057 data.writeInt(requestCode);
3058 data.writeInt(startFlags);
3059 if (profilerInfo != null) {
3061 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
3065 if (options != null) {
3067 options.writeToParcel(data, 0);
3071 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
3072 reply.readException();
3073 int result = reply.readInt();
3079 public int startActivityAsUser(IApplicationThread caller, String callingPackage, Intent intent,
3080 String resolvedType, IBinder resultTo, String resultWho, int requestCode,
3081 int startFlags, ProfilerInfo profilerInfo, Bundle options,
3082 int userId) throws RemoteException {
3083 Parcel data = Parcel.obtain();
3084 Parcel reply = Parcel.obtain();
3085 data.writeInterfaceToken(IActivityManager.descriptor);
3086 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3087 data.writeString(callingPackage);
3088 intent.writeToParcel(data, 0);
3089 data.writeString(resolvedType);
3090 data.writeStrongBinder(resultTo);
3091 data.writeString(resultWho);
3092 data.writeInt(requestCode);
3093 data.writeInt(startFlags);
3094 if (profilerInfo != null) {
3096 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
3100 if (options != null) {
3102 options.writeToParcel(data, 0);
3106 data.writeInt(userId);
3107 mRemote.transact(START_ACTIVITY_AS_USER_TRANSACTION, data, reply, 0);
3108 reply.readException();
3109 int result = reply.readInt();
3114 public int startActivityAsCaller(IApplicationThread caller, String callingPackage,
3115 Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
3116 int startFlags, ProfilerInfo profilerInfo, Bundle options, boolean ignoreTargetSecurity,
3117 int userId) throws RemoteException {
3118 Parcel data = Parcel.obtain();
3119 Parcel reply = Parcel.obtain();
3120 data.writeInterfaceToken(IActivityManager.descriptor);
3121 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3122 data.writeString(callingPackage);
3123 intent.writeToParcel(data, 0);
3124 data.writeString(resolvedType);
3125 data.writeStrongBinder(resultTo);
3126 data.writeString(resultWho);
3127 data.writeInt(requestCode);
3128 data.writeInt(startFlags);
3129 if (profilerInfo != null) {
3131 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
3135 if (options != null) {
3137 options.writeToParcel(data, 0);
3141 data.writeInt(ignoreTargetSecurity ? 1 : 0);
3142 data.writeInt(userId);
3143 mRemote.transact(START_ACTIVITY_AS_CALLER_TRANSACTION, data, reply, 0);
3144 reply.readException();
3145 int result = reply.readInt();
3150 public WaitResult startActivityAndWait(IApplicationThread caller, String callingPackage,
3151 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
3152 int requestCode, int startFlags, ProfilerInfo profilerInfo, Bundle options,
3153 int userId) throws RemoteException {
3154 Parcel data = Parcel.obtain();
3155 Parcel reply = Parcel.obtain();
3156 data.writeInterfaceToken(IActivityManager.descriptor);
3157 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3158 data.writeString(callingPackage);
3159 intent.writeToParcel(data, 0);
3160 data.writeString(resolvedType);
3161 data.writeStrongBinder(resultTo);
3162 data.writeString(resultWho);
3163 data.writeInt(requestCode);
3164 data.writeInt(startFlags);
3165 if (profilerInfo != null) {
3167 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
3171 if (options != null) {
3173 options.writeToParcel(data, 0);
3177 data.writeInt(userId);
3178 mRemote.transact(START_ACTIVITY_AND_WAIT_TRANSACTION, data, reply, 0);
3179 reply.readException();
3180 WaitResult result = WaitResult.CREATOR.createFromParcel(reply);
3185 public int startActivityWithConfig(IApplicationThread caller, String callingPackage,
3186 Intent intent, String resolvedType, IBinder resultTo, String resultWho,
3187 int requestCode, int startFlags, Configuration config,
3188 Bundle options, int userId) throws RemoteException {
3189 Parcel data = Parcel.obtain();
3190 Parcel reply = Parcel.obtain();
3191 data.writeInterfaceToken(IActivityManager.descriptor);
3192 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3193 data.writeString(callingPackage);
3194 intent.writeToParcel(data, 0);
3195 data.writeString(resolvedType);
3196 data.writeStrongBinder(resultTo);
3197 data.writeString(resultWho);
3198 data.writeInt(requestCode);
3199 data.writeInt(startFlags);
3200 config.writeToParcel(data, 0);
3201 if (options != null) {
3203 options.writeToParcel(data, 0);
3207 data.writeInt(userId);
3208 mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);
3209 reply.readException();
3210 int result = reply.readInt();
3215 public int startActivityIntentSender(IApplicationThread caller,
3216 IntentSender intent, Intent fillInIntent, String resolvedType,
3217 IBinder resultTo, String resultWho, int requestCode,
3218 int flagsMask, int flagsValues, Bundle options) throws RemoteException {
3219 Parcel data = Parcel.obtain();
3220 Parcel reply = Parcel.obtain();
3221 data.writeInterfaceToken(IActivityManager.descriptor);
3222 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3223 intent.writeToParcel(data, 0);
3224 if (fillInIntent != null) {
3226 fillInIntent.writeToParcel(data, 0);
3230 data.writeString(resolvedType);
3231 data.writeStrongBinder(resultTo);
3232 data.writeString(resultWho);
3233 data.writeInt(requestCode);
3234 data.writeInt(flagsMask);
3235 data.writeInt(flagsValues);
3236 if (options != null) {
3238 options.writeToParcel(data, 0);
3242 mRemote.transact(START_ACTIVITY_INTENT_SENDER_TRANSACTION, data, reply, 0);
3243 reply.readException();
3244 int result = reply.readInt();
3249 public int startVoiceActivity(String callingPackage, int callingPid, int callingUid,
3250 Intent intent, String resolvedType, IVoiceInteractionSession session,
3251 IVoiceInteractor interactor, int startFlags, ProfilerInfo profilerInfo,
3252 Bundle options, int userId) throws RemoteException {
3253 Parcel data = Parcel.obtain();
3254 Parcel reply = Parcel.obtain();
3255 data.writeInterfaceToken(IActivityManager.descriptor);
3256 data.writeString(callingPackage);
3257 data.writeInt(callingPid);
3258 data.writeInt(callingUid);
3259 intent.writeToParcel(data, 0);
3260 data.writeString(resolvedType);
3261 data.writeStrongBinder(session.asBinder());
3262 data.writeStrongBinder(interactor.asBinder());
3263 data.writeInt(startFlags);
3264 if (profilerInfo != null) {
3266 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
3270 if (options != null) {
3272 options.writeToParcel(data, 0);
3276 data.writeInt(userId);
3277 mRemote.transact(START_VOICE_ACTIVITY_TRANSACTION, data, reply, 0);
3278 reply.readException();
3279 int result = reply.readInt();
3285 public void startLocalVoiceInteraction(IBinder callingActivity, Bundle options)
3286 throws RemoteException {
3287 Parcel data = Parcel.obtain();
3288 Parcel reply = Parcel.obtain();
3289 data.writeInterfaceToken(IActivityManager.descriptor);
3290 data.writeStrongBinder(callingActivity);
3291 data.writeBundle(options);
3292 mRemote.transact(START_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0);
3293 reply.readException();
3298 public void stopLocalVoiceInteraction(IBinder callingActivity) throws RemoteException {
3299 Parcel data = Parcel.obtain();
3300 Parcel reply = Parcel.obtain();
3301 data.writeInterfaceToken(IActivityManager.descriptor);
3302 data.writeStrongBinder(callingActivity);
3303 mRemote.transact(STOP_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0);
3304 reply.readException();
3309 public boolean supportsLocalVoiceInteraction() throws RemoteException {
3310 Parcel data = Parcel.obtain();
3311 Parcel reply = Parcel.obtain();
3312 data.writeInterfaceToken(IActivityManager.descriptor);
3313 mRemote.transact(SUPPORTS_LOCAL_VOICE_INTERACTION_TRANSACTION, data, reply, 0);
3314 reply.readException();
3315 int result = reply.readInt();
3321 public boolean startNextMatchingActivity(IBinder callingActivity,
3322 Intent intent, Bundle options) throws RemoteException {
3323 Parcel data = Parcel.obtain();
3324 Parcel reply = Parcel.obtain();
3325 data.writeInterfaceToken(IActivityManager.descriptor);
3326 data.writeStrongBinder(callingActivity);
3327 intent.writeToParcel(data, 0);
3328 if (options != null) {
3330 options.writeToParcel(data, 0);
3334 mRemote.transact(START_NEXT_MATCHING_ACTIVITY_TRANSACTION, data, reply, 0);
3335 reply.readException();
3336 int result = reply.readInt();
3341 public int startActivityFromRecents(int taskId, Bundle options)
3342 throws RemoteException {
3343 Parcel data = Parcel.obtain();
3344 Parcel reply = Parcel.obtain();
3345 data.writeInterfaceToken(IActivityManager.descriptor);
3346 data.writeInt(taskId);
3347 if (options == null) {
3351 options.writeToParcel(data, 0);
3353 mRemote.transact(START_ACTIVITY_FROM_RECENTS_TRANSACTION, data, reply, 0);
3354 reply.readException();
3355 int result = reply.readInt();
3360 public boolean finishActivity(IBinder token, int resultCode, Intent resultData, int finishTask)
3361 throws RemoteException {
3362 Parcel data = Parcel.obtain();
3363 Parcel reply = Parcel.obtain();
3364 data.writeInterfaceToken(IActivityManager.descriptor);
3365 data.writeStrongBinder(token);
3366 data.writeInt(resultCode);
3367 if (resultData != null) {
3369 resultData.writeToParcel(data, 0);
3373 data.writeInt(finishTask);
3374 mRemote.transact(FINISH_ACTIVITY_TRANSACTION, data, reply, 0);
3375 reply.readException();
3376 boolean res = reply.readInt() != 0;
3381 public void finishSubActivity(IBinder token, String resultWho, int requestCode) throws RemoteException
3383 Parcel data = Parcel.obtain();
3384 Parcel reply = Parcel.obtain();
3385 data.writeInterfaceToken(IActivityManager.descriptor);
3386 data.writeStrongBinder(token);
3387 data.writeString(resultWho);
3388 data.writeInt(requestCode);
3389 mRemote.transact(FINISH_SUB_ACTIVITY_TRANSACTION, data, reply, 0);
3390 reply.readException();
3394 public boolean finishActivityAffinity(IBinder token) throws RemoteException {
3395 Parcel data = Parcel.obtain();
3396 Parcel reply = Parcel.obtain();
3397 data.writeInterfaceToken(IActivityManager.descriptor);
3398 data.writeStrongBinder(token);
3399 mRemote.transact(FINISH_ACTIVITY_AFFINITY_TRANSACTION, data, reply, 0);
3400 reply.readException();
3401 boolean res = reply.readInt() != 0;
3406 public void finishVoiceTask(IVoiceInteractionSession session) throws RemoteException {
3407 Parcel data = Parcel.obtain();
3408 Parcel reply = Parcel.obtain();
3409 data.writeInterfaceToken(IActivityManager.descriptor);
3410 data.writeStrongBinder(session.asBinder());
3411 mRemote.transact(FINISH_VOICE_TASK_TRANSACTION, data, reply, 0);
3412 reply.readException();
3416 public boolean releaseActivityInstance(IBinder token) throws RemoteException {
3417 Parcel data = Parcel.obtain();
3418 Parcel reply = Parcel.obtain();
3419 data.writeInterfaceToken(IActivityManager.descriptor);
3420 data.writeStrongBinder(token);
3421 mRemote.transact(RELEASE_ACTIVITY_INSTANCE_TRANSACTION, data, reply, 0);
3422 reply.readException();
3423 boolean res = reply.readInt() != 0;
3428 public void releaseSomeActivities(IApplicationThread app) throws RemoteException {
3429 Parcel data = Parcel.obtain();
3430 Parcel reply = Parcel.obtain();
3431 data.writeInterfaceToken(IActivityManager.descriptor);
3432 data.writeStrongBinder(app.asBinder());
3433 mRemote.transact(RELEASE_SOME_ACTIVITIES_TRANSACTION, data, reply, 0);
3434 reply.readException();
3438 public boolean willActivityBeVisible(IBinder token) throws RemoteException {
3439 Parcel data = Parcel.obtain();
3440 Parcel reply = Parcel.obtain();
3441 data.writeInterfaceToken(IActivityManager.descriptor);
3442 data.writeStrongBinder(token);
3443 mRemote.transact(WILL_ACTIVITY_BE_VISIBLE_TRANSACTION, data, reply, 0);
3444 reply.readException();
3445 boolean res = reply.readInt() != 0;
3450 public Intent registerReceiver(IApplicationThread caller, String packageName,
3451 IIntentReceiver receiver,
3452 IntentFilter filter, String perm, int userId) throws RemoteException
3454 Parcel data = Parcel.obtain();
3455 Parcel reply = Parcel.obtain();
3456 data.writeInterfaceToken(IActivityManager.descriptor);
3457 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3458 data.writeString(packageName);
3459 data.writeStrongBinder(receiver != null ? receiver.asBinder() : null);
3460 filter.writeToParcel(data, 0);
3461 data.writeString(perm);
3462 data.writeInt(userId);
3463 mRemote.transact(REGISTER_RECEIVER_TRANSACTION, data, reply, 0);
3464 reply.readException();
3465 Intent intent = null;
3466 int haveIntent = reply.readInt();
3467 if (haveIntent != 0) {
3468 intent = Intent.CREATOR.createFromParcel(reply);
3474 public void unregisterReceiver(IIntentReceiver receiver) throws RemoteException
3476 Parcel data = Parcel.obtain();
3477 Parcel reply = Parcel.obtain();
3478 data.writeInterfaceToken(IActivityManager.descriptor);
3479 data.writeStrongBinder(receiver.asBinder());
3480 mRemote.transact(UNREGISTER_RECEIVER_TRANSACTION, data, reply, 0);
3481 reply.readException();
3485 public int broadcastIntent(IApplicationThread caller,
3486 Intent intent, String resolvedType, IIntentReceiver resultTo,
3487 int resultCode, String resultData, Bundle map,
3488 String[] requiredPermissions, int appOp, Bundle options, boolean serialized,
3489 boolean sticky, int userId) throws RemoteException
3491 Parcel data = Parcel.obtain();
3492 Parcel reply = Parcel.obtain();
3493 data.writeInterfaceToken(IActivityManager.descriptor);
3494 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3495 intent.writeToParcel(data, 0);
3496 data.writeString(resolvedType);
3497 data.writeStrongBinder(resultTo != null ? resultTo.asBinder() : null);
3498 data.writeInt(resultCode);
3499 data.writeString(resultData);
3500 data.writeBundle(map);
3501 data.writeStringArray(requiredPermissions);
3502 data.writeInt(appOp);
3503 data.writeBundle(options);
3504 data.writeInt(serialized ? 1 : 0);
3505 data.writeInt(sticky ? 1 : 0);
3506 data.writeInt(userId);
3507 mRemote.transact(BROADCAST_INTENT_TRANSACTION, data, reply, 0);
3508 reply.readException();
3509 int res = reply.readInt();
3514 public void unbroadcastIntent(IApplicationThread caller, Intent intent, int userId)
3515 throws RemoteException
3517 Parcel data = Parcel.obtain();
3518 Parcel reply = Parcel.obtain();
3519 data.writeInterfaceToken(IActivityManager.descriptor);
3520 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
3521 intent.writeToParcel(data, 0);
3522 data.writeInt(userId);
3523 mRemote.transact(UNBROADCAST_INTENT_TRANSACTION, data, reply, 0);
3524 reply.readException();
3528 public void finishReceiver(IBinder who, int resultCode, String resultData, Bundle map,
3529 boolean abortBroadcast, int flags) throws RemoteException
3531 Parcel data = Parcel.obtain();
3532 Parcel reply = Parcel.obtain();
3533 data.writeInterfaceToken(IActivityManager.descriptor);
3534 data.writeStrongBinder(who);
3535 data.writeInt(resultCode);
3536 data.writeString(resultData);
3537 data.writeBundle(map);
3538 data.writeInt(abortBroadcast ? 1 : 0);
3539 data.writeInt(flags);
3540 mRemote.transact(FINISH_RECEIVER_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3541 reply.readException();
3545 public void attachApplication(IApplicationThread app) throws RemoteException
3547 Parcel data = Parcel.obtain();
3548 Parcel reply = Parcel.obtain();
3549 data.writeInterfaceToken(IActivityManager.descriptor);
3550 data.writeStrongBinder(app.asBinder());
3551 mRemote.transact(ATTACH_APPLICATION_TRANSACTION, data, reply, 0);
3552 reply.readException();
3556 public void activityIdle(IBinder token, Configuration config, boolean stopProfiling)
3557 throws RemoteException
3559 Parcel data = Parcel.obtain();
3560 Parcel reply = Parcel.obtain();
3561 data.writeInterfaceToken(IActivityManager.descriptor);
3562 data.writeStrongBinder(token);
3563 if (config != null) {
3565 config.writeToParcel(data, 0);
3569 data.writeInt(stopProfiling ? 1 : 0);
3570 mRemote.transact(ACTIVITY_IDLE_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3571 reply.readException();
3575 public void activityResumed(IBinder token) throws RemoteException
3577 Parcel data = Parcel.obtain();
3578 Parcel reply = Parcel.obtain();
3579 data.writeInterfaceToken(IActivityManager.descriptor);
3580 data.writeStrongBinder(token);
3581 mRemote.transact(ACTIVITY_RESUMED_TRANSACTION, data, reply, 0);
3582 reply.readException();
3586 public void activityPaused(IBinder token) throws RemoteException
3588 Parcel data = Parcel.obtain();
3589 Parcel reply = Parcel.obtain();
3590 data.writeInterfaceToken(IActivityManager.descriptor);
3591 data.writeStrongBinder(token);
3592 mRemote.transact(ACTIVITY_PAUSED_TRANSACTION, data, reply, 0);
3593 reply.readException();
3597 public void activityStopped(IBinder token, Bundle state,
3598 PersistableBundle persistentState, CharSequence description) throws RemoteException
3600 Parcel data = Parcel.obtain();
3601 Parcel reply = Parcel.obtain();
3602 data.writeInterfaceToken(IActivityManager.descriptor);
3603 data.writeStrongBinder(token);
3604 data.writeBundle(state);
3605 data.writePersistableBundle(persistentState);
3606 TextUtils.writeToParcel(description, data, 0);
3607 mRemote.transact(ACTIVITY_STOPPED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3608 reply.readException();
3612 public void activitySlept(IBinder token) throws RemoteException
3614 Parcel data = Parcel.obtain();
3615 Parcel reply = Parcel.obtain();
3616 data.writeInterfaceToken(IActivityManager.descriptor);
3617 data.writeStrongBinder(token);
3618 mRemote.transact(ACTIVITY_SLEPT_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3619 reply.readException();
3623 public void activityDestroyed(IBinder token) throws RemoteException
3625 Parcel data = Parcel.obtain();
3626 Parcel reply = Parcel.obtain();
3627 data.writeInterfaceToken(IActivityManager.descriptor);
3628 data.writeStrongBinder(token);
3629 mRemote.transact(ACTIVITY_DESTROYED_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
3630 reply.readException();
3634 public void activityRelaunched(IBinder token) throws RemoteException
3636 Parcel data = Parcel.obtain();
3637 Parcel reply = Parcel.obtain();
3638 data.writeInterfaceToken(IActivityManager.descriptor);
3639 data.writeStrongBinder(token);
3640 mRemote.transact(ACTIVITY_RELAUNCHED_TRANSACTION, data, reply, 0);
3641 reply.readException();
3645 public String getCallingPackage(IBinder token) throws RemoteException
3647 Parcel data = Parcel.obtain();
3648 Parcel reply = Parcel.obtain();
3649 data.writeInterfaceToken(IActivityManager.descriptor);
3650 data.writeStrongBinder(token);
3651 mRemote.transact(GET_CALLING_PACKAGE_TRANSACTION, data, reply, 0);
3652 reply.readException();
3653 String res = reply.readString();
3658 public ComponentName getCallingActivity(IBinder token)
3659 throws RemoteException {
3660 Parcel data = Parcel.obtain();
3661 Parcel reply = Parcel.obtain();
3662 data.writeInterfaceToken(IActivityManager.descriptor);
3663 data.writeStrongBinder(token);
3664 mRemote.transact(GET_CALLING_ACTIVITY_TRANSACTION, data, reply, 0);
3665 reply.readException();
3666 ComponentName res = ComponentName.readFromParcel(reply);
3671 public List<IAppTask> getAppTasks(String callingPackage) throws RemoteException {
3672 Parcel data = Parcel.obtain();
3673 Parcel reply = Parcel.obtain();
3674 data.writeInterfaceToken(IActivityManager.descriptor);
3675 data.writeString(callingPackage);
3676 mRemote.transact(GET_APP_TASKS_TRANSACTION, data, reply, 0);
3677 reply.readException();
3678 ArrayList<IAppTask> list = null;
3679 int N = reply.readInt();
3681 list = new ArrayList<>();
3683 IAppTask task = IAppTask.Stub.asInterface(reply.readStrongBinder());
3692 public int addAppTask(IBinder activityToken, Intent intent,
3693 ActivityManager.TaskDescription description, Bitmap thumbnail) throws RemoteException {
3694 Parcel data = Parcel.obtain();
3695 Parcel reply = Parcel.obtain();
3696 data.writeInterfaceToken(IActivityManager.descriptor);
3697 data.writeStrongBinder(activityToken);
3698 intent.writeToParcel(data, 0);
3699 description.writeToParcel(data, 0);
3700 thumbnail.writeToParcel(data, 0);
3701 mRemote.transact(ADD_APP_TASK_TRANSACTION, data, reply, 0);
3702 reply.readException();
3703 int res = reply.readInt();
3708 public Point getAppTaskThumbnailSize() throws RemoteException {
3709 Parcel data = Parcel.obtain();
3710 Parcel reply = Parcel.obtain();
3711 data.writeInterfaceToken(IActivityManager.descriptor);
3712 mRemote.transact(GET_APP_TASK_THUMBNAIL_SIZE_TRANSACTION, data, reply, 0);
3713 reply.readException();
3714 Point size = Point.CREATOR.createFromParcel(reply);
3719 public List<ActivityManager.RunningTaskInfo> getTasks(int maxNum, int flags)
3720 throws RemoteException {
3721 Parcel data = Parcel.obtain();
3722 Parcel reply = Parcel.obtain();
3723 data.writeInterfaceToken(IActivityManager.descriptor);
3724 data.writeInt(maxNum);
3725 data.writeInt(flags);
3726 mRemote.transact(GET_TASKS_TRANSACTION, data, reply, 0);
3727 reply.readException();
3728 ArrayList<ActivityManager.RunningTaskInfo> list = null;
3729 int N = reply.readInt();
3731 list = new ArrayList<>();
3733 ActivityManager.RunningTaskInfo info =
3734 ActivityManager.RunningTaskInfo.CREATOR
3735 .createFromParcel(reply);
3744 public List<ActivityManager.RecentTaskInfo> getRecentTasks(int maxNum,
3745 int flags, int userId) throws RemoteException {
3746 Parcel data = Parcel.obtain();
3747 Parcel reply = Parcel.obtain();
3748 data.writeInterfaceToken(IActivityManager.descriptor);
3749 data.writeInt(maxNum);
3750 data.writeInt(flags);
3751 data.writeInt(userId);
3752 mRemote.transact(GET_RECENT_TASKS_TRANSACTION, data, reply, 0);
3753 reply.readException();
3754 ArrayList<ActivityManager.RecentTaskInfo> list
3755 = reply.createTypedArrayList(ActivityManager.RecentTaskInfo.CREATOR);
3760 public ActivityManager.TaskThumbnail getTaskThumbnail(int id) throws RemoteException {
3761 Parcel data = Parcel.obtain();
3762 Parcel reply = Parcel.obtain();
3763 data.writeInterfaceToken(IActivityManager.descriptor);
3765 mRemote.transact(GET_TASK_THUMBNAIL_TRANSACTION, data, reply, 0);
3766 reply.readException();
3767 ActivityManager.TaskThumbnail taskThumbnail = null;
3768 if (reply.readInt() != 0) {
3769 taskThumbnail = ActivityManager.TaskThumbnail.CREATOR.createFromParcel(reply);
3773 return taskThumbnail;
3775 public List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags)
3776 throws RemoteException {
3777 Parcel data = Parcel.obtain();
3778 Parcel reply = Parcel.obtain();
3779 data.writeInterfaceToken(IActivityManager.descriptor);
3780 data.writeInt(maxNum);
3781 data.writeInt(flags);
3782 mRemote.transact(GET_SERVICES_TRANSACTION, data, reply, 0);
3783 reply.readException();
3784 ArrayList<ActivityManager.RunningServiceInfo> list = null;
3785 int N = reply.readInt();
3787 list = new ArrayList<>();
3789 ActivityManager.RunningServiceInfo info =
3790 ActivityManager.RunningServiceInfo.CREATOR
3791 .createFromParcel(reply);
3800 public List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState()
3801 throws RemoteException {
3802 Parcel data = Parcel.obtain();
3803 Parcel reply = Parcel.obtain();
3804 data.writeInterfaceToken(IActivityManager.descriptor);
3805 mRemote.transact(GET_PROCESSES_IN_ERROR_STATE_TRANSACTION, data, reply, 0);
3806 reply.readException();
3807 ArrayList<ActivityManager.ProcessErrorStateInfo> list
3808 = reply.createTypedArrayList(ActivityManager.ProcessErrorStateInfo.CREATOR);
3813 public List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses()
3814 throws RemoteException {
3815 Parcel data = Parcel.obtain();
3816 Parcel reply = Parcel.obtain();
3817 data.writeInterfaceToken(IActivityManager.descriptor);
3818 mRemote.transact(GET_RUNNING_APP_PROCESSES_TRANSACTION, data, reply, 0);
3819 reply.readException();
3820 ArrayList<ActivityManager.RunningAppProcessInfo> list
3821 = reply.createTypedArrayList(ActivityManager.RunningAppProcessInfo.CREATOR);
3826 public List<ApplicationInfo> getRunningExternalApplications()
3827 throws RemoteException {
3828 Parcel data = Parcel.obtain();
3829 Parcel reply = Parcel.obtain();
3830 data.writeInterfaceToken(IActivityManager.descriptor);
3831 mRemote.transact(GET_RUNNING_EXTERNAL_APPLICATIONS_TRANSACTION, data, reply, 0);
3832 reply.readException();
3833 ArrayList<ApplicationInfo> list
3834 = reply.createTypedArrayList(ApplicationInfo.CREATOR);
3839 public void moveTaskToFront(int task, int flags, Bundle options) throws RemoteException
3841 Parcel data = Parcel.obtain();
3842 Parcel reply = Parcel.obtain();
3843 data.writeInterfaceToken(IActivityManager.descriptor);
3844 data.writeInt(task);
3845 data.writeInt(flags);
3846 if (options != null) {
3848 options.writeToParcel(data, 0);
3852 mRemote.transact(MOVE_TASK_TO_FRONT_TRANSACTION, data, reply, 0);
3853 reply.readException();
3857 public boolean moveActivityTaskToBack(IBinder token, boolean nonRoot)
3858 throws RemoteException {
3859 Parcel data = Parcel.obtain();
3860 Parcel reply = Parcel.obtain();
3861 data.writeInterfaceToken(IActivityManager.descriptor);
3862 data.writeStrongBinder(token);
3863 data.writeInt(nonRoot ? 1 : 0);
3864 mRemote.transact(MOVE_ACTIVITY_TASK_TO_BACK_TRANSACTION, data, reply, 0);
3865 reply.readException();
3866 boolean res = reply.readInt() != 0;
3871 public void moveTaskBackwards(int task) throws RemoteException
3873 Parcel data = Parcel.obtain();
3874 Parcel reply = Parcel.obtain();
3875 data.writeInterfaceToken(IActivityManager.descriptor);
3876 data.writeInt(task);
3877 mRemote.transact(MOVE_TASK_BACKWARDS_TRANSACTION, data, reply, 0);
3878 reply.readException();
3883 public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException
3885 Parcel data = Parcel.obtain();
3886 Parcel reply = Parcel.obtain();
3887 data.writeInterfaceToken(IActivityManager.descriptor);
3888 data.writeInt(taskId);
3889 data.writeInt(stackId);
3890 data.writeInt(toTop ? 1 : 0);
3891 mRemote.transact(MOVE_TASK_TO_STACK_TRANSACTION, data, reply, 0);
3892 reply.readException();
3897 public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate,
3898 Rect initialBounds, boolean moveHomeStackFront) throws RemoteException
3900 Parcel data = Parcel.obtain();
3901 Parcel reply = Parcel.obtain();
3902 data.writeInterfaceToken(IActivityManager.descriptor);
3903 data.writeInt(taskId);
3904 data.writeInt(createMode);
3905 data.writeInt(toTop ? 1 : 0);
3906 data.writeInt(animate ? 1 : 0);
3907 if (initialBounds != null) {
3909 initialBounds.writeToParcel(data, 0);
3913 data.writeInt(moveHomeStackFront ? 1 : 0);
3914 mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0);
3915 reply.readException();
3916 boolean res = reply.readInt() > 0;
3922 public boolean moveTopActivityToPinnedStack(int stackId, Rect r)
3923 throws RemoteException
3925 Parcel data = Parcel.obtain();
3926 Parcel reply = Parcel.obtain();
3927 data.writeInterfaceToken(IActivityManager.descriptor);
3928 data.writeInt(stackId);
3929 r.writeToParcel(data, 0);
3930 mRemote.transact(MOVE_TOP_ACTIVITY_TO_PINNED_STACK_TRANSACTION, data, reply, 0);
3931 reply.readException();
3932 final boolean res = reply.readInt() != 0;
3938 public void resizeStack(int stackId, Rect r, boolean allowResizeInDockedMode,
3939 boolean preserveWindows, boolean animate, int animationDuration)
3940 throws RemoteException {
3941 Parcel data = Parcel.obtain();
3942 Parcel reply = Parcel.obtain();
3943 data.writeInterfaceToken(IActivityManager.descriptor);
3944 data.writeInt(stackId);
3947 r.writeToParcel(data, 0);
3951 data.writeInt(allowResizeInDockedMode ? 1 : 0);
3952 data.writeInt(preserveWindows ? 1 : 0);
3953 data.writeInt(animate ? 1 : 0);
3954 data.writeInt(animationDuration);
3955 mRemote.transact(RESIZE_STACK_TRANSACTION, data, reply, 0);
3956 reply.readException();
3961 public void swapDockedAndFullscreenStack() throws RemoteException
3963 Parcel data = Parcel.obtain();
3964 Parcel reply = Parcel.obtain();
3965 data.writeInterfaceToken(IActivityManager.descriptor);
3966 mRemote.transact(SWAP_DOCKED_AND_FULLSCREEN_STACK, data, reply, 0);
3967 reply.readException();
3972 public void resizeDockedStack(Rect dockedBounds, Rect tempDockedTaskBounds,
3973 Rect tempDockedTaskInsetBounds,
3974 Rect tempOtherTaskBounds, Rect tempOtherTaskInsetBounds)
3975 throws RemoteException
3977 Parcel data = Parcel.obtain();
3978 Parcel reply = Parcel.obtain();
3979 data.writeInterfaceToken(IActivityManager.descriptor);
3980 if (dockedBounds != null) {
3982 dockedBounds.writeToParcel(data, 0);
3986 if (tempDockedTaskBounds != null) {
3988 tempDockedTaskBounds.writeToParcel(data, 0);
3992 if (tempDockedTaskInsetBounds != null) {
3994 tempDockedTaskInsetBounds.writeToParcel(data, 0);
3998 if (tempOtherTaskBounds != null) {
4000 tempOtherTaskBounds.writeToParcel(data, 0);
4004 if (tempOtherTaskInsetBounds != null) {
4006 tempOtherTaskInsetBounds.writeToParcel(data, 0);
4010 mRemote.transact(RESIZE_DOCKED_STACK_TRANSACTION, data, reply, 0);
4011 reply.readException();
4017 public void resizePinnedStack(Rect pinnedBounds, Rect tempPinnedTaskBounds) throws RemoteException
4019 Parcel data = Parcel.obtain();
4020 Parcel reply = Parcel.obtain();
4021 data.writeInterfaceToken(IActivityManager.descriptor);
4022 if (pinnedBounds != null) {
4024 pinnedBounds.writeToParcel(data, 0);
4028 if (tempPinnedTaskBounds != null) {
4030 tempPinnedTaskBounds.writeToParcel(data, 0);
4034 mRemote.transact(RESIZE_PINNED_STACK_TRANSACTION, data, reply, 0);
4035 reply.readException();
4041 public void positionTaskInStack(int taskId, int stackId, int position) throws RemoteException
4043 Parcel data = Parcel.obtain();
4044 Parcel reply = Parcel.obtain();
4045 data.writeInterfaceToken(IActivityManager.descriptor);
4046 data.writeInt(taskId);
4047 data.writeInt(stackId);
4048 data.writeInt(position);
4049 mRemote.transact(POSITION_TASK_IN_STACK_TRANSACTION, data, reply, 0);
4050 reply.readException();
4055 public List<StackInfo> getAllStackInfos() throws RemoteException
4057 Parcel data = Parcel.obtain();
4058 Parcel reply = Parcel.obtain();
4059 data.writeInterfaceToken(IActivityManager.descriptor);
4060 mRemote.transact(GET_ALL_STACK_INFOS_TRANSACTION, data, reply, 0);
4061 reply.readException();
4062 ArrayList<StackInfo> list = reply.createTypedArrayList(StackInfo.CREATOR);
4068 public StackInfo getStackInfo(int stackId) throws RemoteException
4070 Parcel data = Parcel.obtain();
4071 Parcel reply = Parcel.obtain();
4072 data.writeInterfaceToken(IActivityManager.descriptor);
4073 data.writeInt(stackId);
4074 mRemote.transact(GET_STACK_INFO_TRANSACTION, data, reply, 0);
4075 reply.readException();
4076 int res = reply.readInt();
4077 StackInfo info = null;
4079 info = StackInfo.CREATOR.createFromParcel(reply);
4086 public boolean isInHomeStack(int taskId) throws RemoteException {
4087 Parcel data = Parcel.obtain();
4088 Parcel reply = Parcel.obtain();
4089 data.writeInterfaceToken(IActivityManager.descriptor);
4090 data.writeInt(taskId);
4091 mRemote.transact(IS_IN_HOME_STACK_TRANSACTION, data, reply, 0);
4092 reply.readException();
4093 boolean isInHomeStack = reply.readInt() > 0;
4096 return isInHomeStack;
4099 public void setFocusedStack(int stackId) throws RemoteException
4101 Parcel data = Parcel.obtain();
4102 Parcel reply = Parcel.obtain();
4103 data.writeInterfaceToken(IActivityManager.descriptor);
4104 data.writeInt(stackId);
4105 mRemote.transact(SET_FOCUSED_STACK_TRANSACTION, data, reply, 0);
4106 reply.readException();
4111 public int getFocusedStackId() throws RemoteException {
4112 Parcel data = Parcel.obtain();
4113 Parcel reply = Parcel.obtain();
4114 data.writeInterfaceToken(IActivityManager.descriptor);
4115 mRemote.transact(GET_FOCUSED_STACK_ID_TRANSACTION, data, reply, 0);
4116 reply.readException();
4117 int focusedStackId = reply.readInt();
4120 return focusedStackId;
4123 public void setFocusedTask(int taskId) throws RemoteException
4125 Parcel data = Parcel.obtain();
4126 Parcel reply = Parcel.obtain();
4127 data.writeInterfaceToken(IActivityManager.descriptor);
4128 data.writeInt(taskId);
4129 mRemote.transact(SET_FOCUSED_TASK_TRANSACTION, data, reply, 0);
4130 reply.readException();
4135 public void registerTaskStackListener(ITaskStackListener listener) throws RemoteException
4137 Parcel data = Parcel.obtain();
4138 Parcel reply = Parcel.obtain();
4139 data.writeInterfaceToken(IActivityManager.descriptor);
4140 data.writeStrongBinder(listener.asBinder());
4141 mRemote.transact(REGISTER_TASK_STACK_LISTENER_TRANSACTION, data, reply, 0);
4142 reply.readException();
4146 public int getTaskForActivity(IBinder token, boolean onlyRoot) throws RemoteException
4148 Parcel data = Parcel.obtain();
4149 Parcel reply = Parcel.obtain();
4150 data.writeInterfaceToken(IActivityManager.descriptor);
4151 data.writeStrongBinder(token);
4152 data.writeInt(onlyRoot ? 1 : 0);
4153 mRemote.transact(GET_TASK_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
4154 reply.readException();
4155 int res = reply.readInt();
4160 public ContentProviderHolder getContentProvider(IApplicationThread caller,
4161 String name, int userId, boolean stable) throws RemoteException {
4162 Parcel data = Parcel.obtain();
4163 Parcel reply = Parcel.obtain();
4164 data.writeInterfaceToken(IActivityManager.descriptor);
4165 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
4166 data.writeString(name);
4167 data.writeInt(userId);
4168 data.writeInt(stable ? 1 : 0);
4169 mRemote.transact(GET_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
4170 reply.readException();
4171 int res = reply.readInt();
4172 ContentProviderHolder cph = null;
4174 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
4180 public ContentProviderHolder getContentProviderExternal(String name, int userId, IBinder token)
4181 throws RemoteException {
4182 Parcel data = Parcel.obtain();
4183 Parcel reply = Parcel.obtain();
4184 data.writeInterfaceToken(IActivityManager.descriptor);
4185 data.writeString(name);
4186 data.writeInt(userId);
4187 data.writeStrongBinder(token);
4188 mRemote.transact(GET_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
4189 reply.readException();
4190 int res = reply.readInt();
4191 ContentProviderHolder cph = null;
4193 cph = ContentProviderHolder.CREATOR.createFromParcel(reply);
4199 public void publishContentProviders(IApplicationThread caller,
4200 List<ContentProviderHolder> providers) throws RemoteException
4202 Parcel data = Parcel.obtain();
4203 Parcel reply = Parcel.obtain();
4204 data.writeInterfaceToken(IActivityManager.descriptor);
4205 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
4206 data.writeTypedList(providers);
4207 mRemote.transact(PUBLISH_CONTENT_PROVIDERS_TRANSACTION, data, reply, 0);
4208 reply.readException();
4212 public boolean refContentProvider(IBinder connection, int stable, int unstable)
4213 throws RemoteException {
4214 Parcel data = Parcel.obtain();
4215 Parcel reply = Parcel.obtain();
4216 data.writeInterfaceToken(IActivityManager.descriptor);
4217 data.writeStrongBinder(connection);
4218 data.writeInt(stable);
4219 data.writeInt(unstable);
4220 mRemote.transact(REF_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
4221 reply.readException();
4222 boolean res = reply.readInt() != 0;
4228 public void unstableProviderDied(IBinder connection) throws RemoteException {
4229 Parcel data = Parcel.obtain();
4230 Parcel reply = Parcel.obtain();
4231 data.writeInterfaceToken(IActivityManager.descriptor);
4232 data.writeStrongBinder(connection);
4233 mRemote.transact(UNSTABLE_PROVIDER_DIED_TRANSACTION, data, reply, 0);
4234 reply.readException();
4240 public void appNotRespondingViaProvider(IBinder connection) throws RemoteException {
4241 Parcel data = Parcel.obtain();
4242 Parcel reply = Parcel.obtain();
4243 data.writeInterfaceToken(IActivityManager.descriptor);
4244 data.writeStrongBinder(connection);
4245 mRemote.transact(APP_NOT_RESPONDING_VIA_PROVIDER_TRANSACTION, data, reply, 0);
4246 reply.readException();
4251 public void removeContentProvider(IBinder connection, boolean stable) throws RemoteException {
4252 Parcel data = Parcel.obtain();
4253 Parcel reply = Parcel.obtain();
4254 data.writeInterfaceToken(IActivityManager.descriptor);
4255 data.writeStrongBinder(connection);
4256 data.writeInt(stable ? 1 : 0);
4257 mRemote.transact(REMOVE_CONTENT_PROVIDER_TRANSACTION, data, reply, 0);
4258 reply.readException();
4263 public void removeContentProviderExternal(String name, IBinder token) throws RemoteException {
4264 Parcel data = Parcel.obtain();
4265 Parcel reply = Parcel.obtain();
4266 data.writeInterfaceToken(IActivityManager.descriptor);
4267 data.writeString(name);
4268 data.writeStrongBinder(token);
4269 mRemote.transact(REMOVE_CONTENT_PROVIDER_EXTERNAL_TRANSACTION, data, reply, 0);
4270 reply.readException();
4275 public PendingIntent getRunningServiceControlPanel(ComponentName service)
4276 throws RemoteException
4278 Parcel data = Parcel.obtain();
4279 Parcel reply = Parcel.obtain();
4280 data.writeInterfaceToken(IActivityManager.descriptor);
4281 service.writeToParcel(data, 0);
4282 mRemote.transact(GET_RUNNING_SERVICE_CONTROL_PANEL_TRANSACTION, data, reply, 0);
4283 reply.readException();
4284 PendingIntent res = PendingIntent.readPendingIntentOrNullFromParcel(reply);
4290 public ComponentName startService(IApplicationThread caller, Intent service,
4291 String resolvedType, String callingPackage, int userId) throws RemoteException
4293 Parcel data = Parcel.obtain();
4294 Parcel reply = Parcel.obtain();
4295 data.writeInterfaceToken(IActivityManager.descriptor);
4296 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
4297 service.writeToParcel(data, 0);
4298 data.writeString(resolvedType);
4299 data.writeString(callingPackage);
4300 data.writeInt(userId);
4301 mRemote.transact(START_SERVICE_TRANSACTION, data, reply, 0);
4302 reply.readException();
4303 ComponentName res = ComponentName.readFromParcel(reply);
4308 public int stopService(IApplicationThread caller, Intent service,
4309 String resolvedType, int userId) throws RemoteException
4311 Parcel data = Parcel.obtain();
4312 Parcel reply = Parcel.obtain();
4313 data.writeInterfaceToken(IActivityManager.descriptor);
4314 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
4315 service.writeToParcel(data, 0);
4316 data.writeString(resolvedType);
4317 data.writeInt(userId);
4318 mRemote.transact(STOP_SERVICE_TRANSACTION, data, reply, 0);
4319 reply.readException();
4320 int res = reply.readInt();
4325 public boolean stopServiceToken(ComponentName className, IBinder token,
4326 int startId) throws RemoteException {
4327 Parcel data = Parcel.obtain();
4328 Parcel reply = Parcel.obtain();
4329 data.writeInterfaceToken(IActivityManager.descriptor);
4330 ComponentName.writeToParcel(className, data);
4331 data.writeStrongBinder(token);
4332 data.writeInt(startId);
4333 mRemote.transact(STOP_SERVICE_TOKEN_TRANSACTION, data, reply, 0);
4334 reply.readException();
4335 boolean res = reply.readInt() != 0;
4340 public void setServiceForeground(ComponentName className, IBinder token,
4341 int id, Notification notification, int flags) throws RemoteException {
4342 Parcel data = Parcel.obtain();
4343 Parcel reply = Parcel.obtain();
4344 data.writeInterfaceToken(IActivityManager.descriptor);
4345 ComponentName.writeToParcel(className, data);
4346 data.writeStrongBinder(token);
4348 if (notification != null) {
4350 notification.writeToParcel(data, 0);
4354 data.writeInt(flags);
4355 mRemote.transact(SET_SERVICE_FOREGROUND_TRANSACTION, data, reply, 0);
4356 reply.readException();
4360 public int bindService(IApplicationThread caller, IBinder token,
4361 Intent service, String resolvedType, IServiceConnection connection,
4362 int flags, String callingPackage, int userId) throws RemoteException {
4363 Parcel data = Parcel.obtain();
4364 Parcel reply = Parcel.obtain();
4365 data.writeInterfaceToken(IActivityManager.descriptor);
4366 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
4367 data.writeStrongBinder(token);
4368 service.writeToParcel(data, 0);
4369 data.writeString(resolvedType);
4370 data.writeStrongBinder(connection.asBinder());
4371 data.writeInt(flags);
4372 data.writeString(callingPackage);
4373 data.writeInt(userId);
4374 mRemote.transact(BIND_SERVICE_TRANSACTION, data, reply, 0);
4375 reply.readException();
4376 int res = reply.readInt();
4381 public boolean unbindService(IServiceConnection connection) throws RemoteException
4383 Parcel data = Parcel.obtain();
4384 Parcel reply = Parcel.obtain();
4385 data.writeInterfaceToken(IActivityManager.descriptor);
4386 data.writeStrongBinder(connection.asBinder());
4387 mRemote.transact(UNBIND_SERVICE_TRANSACTION, data, reply, 0);
4388 reply.readException();
4389 boolean res = reply.readInt() != 0;
4395 public void publishService(IBinder token,
4396 Intent intent, IBinder service) throws RemoteException {
4397 Parcel data = Parcel.obtain();
4398 Parcel reply = Parcel.obtain();
4399 data.writeInterfaceToken(IActivityManager.descriptor);
4400 data.writeStrongBinder(token);
4401 intent.writeToParcel(data, 0);
4402 data.writeStrongBinder(service);
4403 mRemote.transact(PUBLISH_SERVICE_TRANSACTION, data, reply, 0);
4404 reply.readException();
4409 public void unbindFinished(IBinder token, Intent intent, boolean doRebind)
4410 throws RemoteException {
4411 Parcel data = Parcel.obtain();
4412 Parcel reply = Parcel.obtain();
4413 data.writeInterfaceToken(IActivityManager.descriptor);
4414 data.writeStrongBinder(token);
4415 intent.writeToParcel(data, 0);
4416 data.writeInt(doRebind ? 1 : 0);
4417 mRemote.transact(UNBIND_FINISHED_TRANSACTION, data, reply, 0);
4418 reply.readException();
4423 public void serviceDoneExecuting(IBinder token, int type, int startId,
4424 int res) throws RemoteException {
4425 Parcel data = Parcel.obtain();
4426 Parcel reply = Parcel.obtain();
4427 data.writeInterfaceToken(IActivityManager.descriptor);
4428 data.writeStrongBinder(token);
4429 data.writeInt(type);
4430 data.writeInt(startId);
4432 mRemote.transact(SERVICE_DONE_EXECUTING_TRANSACTION, data, reply, IBinder.FLAG_ONEWAY);
4433 reply.readException();
4438 public IBinder peekService(Intent service, String resolvedType, String callingPackage)
4439 throws RemoteException {
4440 Parcel data = Parcel.obtain();
4441 Parcel reply = Parcel.obtain();
4442 data.writeInterfaceToken(IActivityManager.descriptor);
4443 service.writeToParcel(data, 0);
4444 data.writeString(resolvedType);
4445 data.writeString(callingPackage);
4446 mRemote.transact(PEEK_SERVICE_TRANSACTION, data, reply, 0);
4447 reply.readException();
4448 IBinder binder = reply.readStrongBinder();
4454 public boolean bindBackupAgent(String packageName, int backupRestoreMode, int userId)
4455 throws RemoteException {
4456 Parcel data = Parcel.obtain();
4457 Parcel reply = Parcel.obtain();
4458 data.writeInterfaceToken(IActivityManager.descriptor);
4459 data.writeString(packageName);
4460 data.writeInt(backupRestoreMode);
4461 data.writeInt(userId);
4462 mRemote.transact(START_BACKUP_AGENT_TRANSACTION, data, reply, 0);
4463 reply.readException();
4464 boolean success = reply.readInt() != 0;
4470 public void clearPendingBackup() throws RemoteException {
4471 Parcel data = Parcel.obtain();
4472 Parcel reply = Parcel.obtain();
4473 data.writeInterfaceToken(IActivityManager.descriptor);
4474 mRemote.transact(CLEAR_PENDING_BACKUP_TRANSACTION, data, reply, 0);
4479 public void backupAgentCreated(String packageName, IBinder agent) throws RemoteException {
4480 Parcel data = Parcel.obtain();
4481 Parcel reply = Parcel.obtain();
4482 data.writeInterfaceToken(IActivityManager.descriptor);
4483 data.writeString(packageName);
4484 data.writeStrongBinder(agent);
4485 mRemote.transact(BACKUP_AGENT_CREATED_TRANSACTION, data, reply, 0);
4490 public void unbindBackupAgent(ApplicationInfo app) throws RemoteException {
4491 Parcel data = Parcel.obtain();
4492 Parcel reply = Parcel.obtain();
4493 data.writeInterfaceToken(IActivityManager.descriptor);
4494 app.writeToParcel(data, 0);
4495 mRemote.transact(UNBIND_BACKUP_AGENT_TRANSACTION, data, reply, 0);
4496 reply.readException();
4501 public boolean startInstrumentation(ComponentName className, String profileFile,
4502 int flags, Bundle arguments, IInstrumentationWatcher watcher,
4503 IUiAutomationConnection connection, int userId, String instructionSet)
4504 throws RemoteException {
4505 Parcel data = Parcel.obtain();
4506 Parcel reply = Parcel.obtain();
4507 data.writeInterfaceToken(IActivityManager.descriptor);
4508 ComponentName.writeToParcel(className, data);
4509 data.writeString(profileFile);
4510 data.writeInt(flags);
4511 data.writeBundle(arguments);
4512 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
4513 data.writeStrongBinder(connection != null ? connection.asBinder() : null);
4514 data.writeInt(userId);
4515 data.writeString(instructionSet);
4516 mRemote.transact(START_INSTRUMENTATION_TRANSACTION, data, reply, 0);
4517 reply.readException();
4518 boolean res = reply.readInt() != 0;
4524 public void finishInstrumentation(IApplicationThread target,
4525 int resultCode, Bundle results) throws RemoteException {
4526 Parcel data = Parcel.obtain();
4527 Parcel reply = Parcel.obtain();
4528 data.writeInterfaceToken(IActivityManager.descriptor);
4529 data.writeStrongBinder(target != null ? target.asBinder() : null);
4530 data.writeInt(resultCode);
4531 data.writeBundle(results);
4532 mRemote.transact(FINISH_INSTRUMENTATION_TRANSACTION, data, reply, 0);
4533 reply.readException();
4537 public Configuration getConfiguration() throws RemoteException
4539 Parcel data = Parcel.obtain();
4540 Parcel reply = Parcel.obtain();
4541 data.writeInterfaceToken(IActivityManager.descriptor);
4542 mRemote.transact(GET_CONFIGURATION_TRANSACTION, data, reply, 0);
4543 reply.readException();
4544 Configuration res = Configuration.CREATOR.createFromParcel(reply);
4549 public void updateConfiguration(Configuration values) throws RemoteException
4551 Parcel data = Parcel.obtain();
4552 Parcel reply = Parcel.obtain();
4553 data.writeInterfaceToken(IActivityManager.descriptor);
4554 values.writeToParcel(data, 0);
4555 mRemote.transact(UPDATE_CONFIGURATION_TRANSACTION, data, reply, 0);
4556 reply.readException();
4560 public void setRequestedOrientation(IBinder token, int requestedOrientation)
4561 throws RemoteException {
4562 Parcel data = Parcel.obtain();
4563 Parcel reply = Parcel.obtain();
4564 data.writeInterfaceToken(IActivityManager.descriptor);
4565 data.writeStrongBinder(token);
4566 data.writeInt(requestedOrientation);
4567 mRemote.transact(SET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
4568 reply.readException();
4572 public int getRequestedOrientation(IBinder token) throws RemoteException {
4573 Parcel data = Parcel.obtain();
4574 Parcel reply = Parcel.obtain();
4575 data.writeInterfaceToken(IActivityManager.descriptor);
4576 data.writeStrongBinder(token);
4577 mRemote.transact(GET_REQUESTED_ORIENTATION_TRANSACTION, data, reply, 0);
4578 reply.readException();
4579 int res = reply.readInt();
4584 public ComponentName getActivityClassForToken(IBinder token)
4585 throws RemoteException {
4586 Parcel data = Parcel.obtain();
4587 Parcel reply = Parcel.obtain();
4588 data.writeInterfaceToken(IActivityManager.descriptor);
4589 data.writeStrongBinder(token);
4590 mRemote.transact(GET_ACTIVITY_CLASS_FOR_TOKEN_TRANSACTION, data, reply, 0);
4591 reply.readException();
4592 ComponentName res = ComponentName.readFromParcel(reply);
4597 public String getPackageForToken(IBinder token) throws RemoteException
4599 Parcel data = Parcel.obtain();
4600 Parcel reply = Parcel.obtain();
4601 data.writeInterfaceToken(IActivityManager.descriptor);
4602 data.writeStrongBinder(token);
4603 mRemote.transact(GET_PACKAGE_FOR_TOKEN_TRANSACTION, data, reply, 0);
4604 reply.readException();
4605 String res = reply.readString();
4610 public IIntentSender getIntentSender(int type,
4611 String packageName, IBinder token, String resultWho,
4612 int requestCode, Intent[] intents, String[] resolvedTypes, int flags,
4613 Bundle options, int userId) throws RemoteException {
4614 Parcel data = Parcel.obtain();
4615 Parcel reply = Parcel.obtain();
4616 data.writeInterfaceToken(IActivityManager.descriptor);
4617 data.writeInt(type);
4618 data.writeString(packageName);
4619 data.writeStrongBinder(token);
4620 data.writeString(resultWho);
4621 data.writeInt(requestCode);
4622 if (intents != null) {
4624 data.writeTypedArray(intents, 0);
4625 data.writeStringArray(resolvedTypes);
4629 data.writeInt(flags);
4630 if (options != null) {
4632 options.writeToParcel(data, 0);
4636 data.writeInt(userId);
4637 mRemote.transact(GET_INTENT_SENDER_TRANSACTION, data, reply, 0);
4638 reply.readException();
4639 IIntentSender res = IIntentSender.Stub.asInterface(
4640 reply.readStrongBinder());
4645 public void cancelIntentSender(IIntentSender sender) throws RemoteException {
4646 Parcel data = Parcel.obtain();
4647 Parcel reply = Parcel.obtain();
4648 data.writeInterfaceToken(IActivityManager.descriptor);
4649 data.writeStrongBinder(sender.asBinder());
4650 mRemote.transact(CANCEL_INTENT_SENDER_TRANSACTION, data, reply, 0);
4651 reply.readException();
4655 public String getPackageForIntentSender(IIntentSender sender) throws RemoteException {
4656 Parcel data = Parcel.obtain();
4657 Parcel reply = Parcel.obtain();
4658 data.writeInterfaceToken(IActivityManager.descriptor);
4659 data.writeStrongBinder(sender.asBinder());
4660 mRemote.transact(GET_PACKAGE_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4661 reply.readException();
4662 String res = reply.readString();
4667 public int getUidForIntentSender(IIntentSender sender) throws RemoteException {
4668 Parcel data = Parcel.obtain();
4669 Parcel reply = Parcel.obtain();
4670 data.writeInterfaceToken(IActivityManager.descriptor);
4671 data.writeStrongBinder(sender.asBinder());
4672 mRemote.transact(GET_UID_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
4673 reply.readException();
4674 int res = reply.readInt();
4679 public int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
4680 boolean requireFull, String name, String callerPackage) throws RemoteException {
4681 Parcel data = Parcel.obtain();
4682 Parcel reply = Parcel.obtain();
4683 data.writeInterfaceToken(IActivityManager.descriptor);
4684 data.writeInt(callingPid);
4685 data.writeInt(callingUid);
4686 data.writeInt(userId);
4687 data.writeInt(allowAll ? 1 : 0);
4688 data.writeInt(requireFull ? 1 : 0);
4689 data.writeString(name);
4690 data.writeString(callerPackage);
4691 mRemote.transact(HANDLE_INCOMING_USER_TRANSACTION, data, reply, 0);
4692 reply.readException();
4693 int res = reply.readInt();
4698 public void setProcessLimit(int max) throws RemoteException
4700 Parcel data = Parcel.obtain();
4701 Parcel reply = Parcel.obtain();
4702 data.writeInterfaceToken(IActivityManager.descriptor);
4704 mRemote.transact(SET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4705 reply.readException();
4709 public int getProcessLimit() throws RemoteException
4711 Parcel data = Parcel.obtain();
4712 Parcel reply = Parcel.obtain();
4713 data.writeInterfaceToken(IActivityManager.descriptor);
4714 mRemote.transact(GET_PROCESS_LIMIT_TRANSACTION, data, reply, 0);
4715 reply.readException();
4716 int res = reply.readInt();
4721 public void setProcessForeground(IBinder token, int pid,
4722 boolean isForeground) throws RemoteException {
4723 Parcel data = Parcel.obtain();
4724 Parcel reply = Parcel.obtain();
4725 data.writeInterfaceToken(IActivityManager.descriptor);
4726 data.writeStrongBinder(token);
4728 data.writeInt(isForeground ? 1 : 0);
4729 mRemote.transact(SET_PROCESS_FOREGROUND_TRANSACTION, data, reply, 0);
4730 reply.readException();
4734 public int checkPermission(String permission, int pid, int uid)
4735 throws RemoteException {
4736 Parcel data = Parcel.obtain();
4737 Parcel reply = Parcel.obtain();
4738 data.writeInterfaceToken(IActivityManager.descriptor);
4739 data.writeString(permission);
4742 mRemote.transact(CHECK_PERMISSION_TRANSACTION, data, reply, 0);
4743 reply.readException();
4744 int res = reply.readInt();
4749 public int checkPermissionWithToken(String permission, int pid, int uid, IBinder callerToken)
4750 throws RemoteException {
4751 Parcel data = Parcel.obtain();
4752 Parcel reply = Parcel.obtain();
4753 data.writeInterfaceToken(IActivityManager.descriptor);
4754 data.writeString(permission);
4757 data.writeStrongBinder(callerToken);
4758 mRemote.transact(CHECK_PERMISSION_WITH_TOKEN_TRANSACTION, data, reply, 0);
4759 reply.readException();
4760 int res = reply.readInt();
4765 public boolean clearApplicationUserData(final String packageName,
4766 final IPackageDataObserver observer, final int userId) throws RemoteException {
4767 Parcel data = Parcel.obtain();
4768 Parcel reply = Parcel.obtain();
4769 data.writeInterfaceToken(IActivityManager.descriptor);
4770 data.writeString(packageName);
4771 data.writeStrongBinder((observer != null) ? observer.asBinder() : null);
4772 data.writeInt(userId);
4773 mRemote.transact(CLEAR_APP_DATA_TRANSACTION, data, reply, 0);
4774 reply.readException();
4775 boolean res = reply.readInt() != 0;
4780 public int checkUriPermission(Uri uri, int pid, int uid, int mode, int userId,
4781 IBinder callerToken) throws RemoteException {
4782 Parcel data = Parcel.obtain();
4783 Parcel reply = Parcel.obtain();
4784 data.writeInterfaceToken(IActivityManager.descriptor);
4785 uri.writeToParcel(data, 0);
4788 data.writeInt(mode);
4789 data.writeInt(userId);
4790 data.writeStrongBinder(callerToken);
4791 mRemote.transact(CHECK_URI_PERMISSION_TRANSACTION, data, reply, 0);
4792 reply.readException();
4793 int res = reply.readInt();
4798 public void grantUriPermission(IApplicationThread caller, String targetPkg,
4799 Uri uri, int mode, int userId) throws RemoteException {
4800 Parcel data = Parcel.obtain();
4801 Parcel reply = Parcel.obtain();
4802 data.writeInterfaceToken(IActivityManager.descriptor);
4803 data.writeStrongBinder(caller.asBinder());
4804 data.writeString(targetPkg);
4805 uri.writeToParcel(data, 0);
4806 data.writeInt(mode);
4807 data.writeInt(userId);
4808 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
4809 reply.readException();
4813 public void revokeUriPermission(IApplicationThread caller, Uri uri,
4814 int mode, int userId) throws RemoteException {
4815 Parcel data = Parcel.obtain();
4816 Parcel reply = Parcel.obtain();
4817 data.writeInterfaceToken(IActivityManager.descriptor);
4818 data.writeStrongBinder(caller.asBinder());
4819 uri.writeToParcel(data, 0);
4820 data.writeInt(mode);
4821 data.writeInt(userId);
4822 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4823 reply.readException();
4829 public void takePersistableUriPermission(Uri uri, int mode, int userId)
4830 throws RemoteException {
4831 Parcel data = Parcel.obtain();
4832 Parcel reply = Parcel.obtain();
4833 data.writeInterfaceToken(IActivityManager.descriptor);
4834 uri.writeToParcel(data, 0);
4835 data.writeInt(mode);
4836 data.writeInt(userId);
4837 mRemote.transact(TAKE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4838 reply.readException();
4844 public void releasePersistableUriPermission(Uri uri, int mode, int userId)
4845 throws RemoteException {
4846 Parcel data = Parcel.obtain();
4847 Parcel reply = Parcel.obtain();
4848 data.writeInterfaceToken(IActivityManager.descriptor);
4849 uri.writeToParcel(data, 0);
4850 data.writeInt(mode);
4851 data.writeInt(userId);
4852 mRemote.transact(RELEASE_PERSISTABLE_URI_PERMISSION_TRANSACTION, data, reply, 0);
4853 reply.readException();
4859 public ParceledListSlice<UriPermission> getPersistedUriPermissions(
4860 String packageName, boolean incoming) throws RemoteException {
4861 Parcel data = Parcel.obtain();
4862 Parcel reply = Parcel.obtain();
4863 data.writeInterfaceToken(IActivityManager.descriptor);
4864 data.writeString(packageName);
4865 data.writeInt(incoming ? 1 : 0);
4866 mRemote.transact(GET_PERSISTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
4867 reply.readException();
4868 @SuppressWarnings("unchecked")
4869 final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel(
4877 public ParceledListSlice<UriPermission> getGrantedUriPermissions(String packageName, int userId)
4878 throws RemoteException {
4879 Parcel data = Parcel.obtain();
4880 Parcel reply = Parcel.obtain();
4881 data.writeInterfaceToken(IActivityManager.descriptor);
4882 data.writeString(packageName);
4883 data.writeInt(userId);
4884 mRemote.transact(GET_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
4885 reply.readException();
4886 @SuppressWarnings("unchecked")
4887 final ParceledListSlice<UriPermission> perms = ParceledListSlice.CREATOR.createFromParcel(
4895 public void clearGrantedUriPermissions(String packageName, int userId) throws RemoteException {
4896 Parcel data = Parcel.obtain();
4897 Parcel reply = Parcel.obtain();
4898 data.writeInterfaceToken(IActivityManager.descriptor);
4899 data.writeString(packageName);
4900 data.writeInt(userId);
4901 mRemote.transact(CLEAR_GRANTED_URI_PERMISSIONS_TRANSACTION, data, reply, 0);
4902 reply.readException();
4907 public void showWaitingForDebugger(IApplicationThread who, boolean waiting)
4908 throws RemoteException {
4909 Parcel data = Parcel.obtain();
4910 Parcel reply = Parcel.obtain();
4911 data.writeInterfaceToken(IActivityManager.descriptor);
4912 data.writeStrongBinder(who.asBinder());
4913 data.writeInt(waiting ? 1 : 0);
4914 mRemote.transact(SHOW_WAITING_FOR_DEBUGGER_TRANSACTION, data, reply, 0);
4915 reply.readException();
4919 public void getMemoryInfo(ActivityManager.MemoryInfo outInfo) throws RemoteException {
4920 Parcel data = Parcel.obtain();
4921 Parcel reply = Parcel.obtain();
4922 data.writeInterfaceToken(IActivityManager.descriptor);
4923 mRemote.transact(GET_MEMORY_INFO_TRANSACTION, data, reply, 0);
4924 reply.readException();
4925 outInfo.readFromParcel(reply);
4929 public void unhandledBack() throws RemoteException
4931 Parcel data = Parcel.obtain();
4932 Parcel reply = Parcel.obtain();
4933 data.writeInterfaceToken(IActivityManager.descriptor);
4934 mRemote.transact(UNHANDLED_BACK_TRANSACTION, data, reply, 0);
4935 reply.readException();
4939 public ParcelFileDescriptor openContentUri(Uri uri) throws RemoteException
4941 Parcel data = Parcel.obtain();
4942 Parcel reply = Parcel.obtain();
4943 data.writeInterfaceToken(IActivityManager.descriptor);
4944 mRemote.transact(OPEN_CONTENT_URI_TRANSACTION, data, reply, 0);
4945 reply.readException();
4946 ParcelFileDescriptor pfd = null;
4947 if (reply.readInt() != 0) {
4948 pfd = ParcelFileDescriptor.CREATOR.createFromParcel(reply);
4954 public void setLockScreenShown(boolean showing, boolean occluded) throws RemoteException
4956 Parcel data = Parcel.obtain();
4957 Parcel reply = Parcel.obtain();
4958 data.writeInterfaceToken(IActivityManager.descriptor);
4959 data.writeInt(showing ? 1 : 0);
4960 data.writeInt(occluded ? 1 : 0);
4961 mRemote.transact(SET_LOCK_SCREEN_SHOWN_TRANSACTION, data, reply, 0);
4962 reply.readException();
4966 public void setDebugApp(
4967 String packageName, boolean waitForDebugger, boolean persistent)
4968 throws RemoteException
4970 Parcel data = Parcel.obtain();
4971 Parcel reply = Parcel.obtain();
4972 data.writeInterfaceToken(IActivityManager.descriptor);
4973 data.writeString(packageName);
4974 data.writeInt(waitForDebugger ? 1 : 0);
4975 data.writeInt(persistent ? 1 : 0);
4976 mRemote.transact(SET_DEBUG_APP_TRANSACTION, data, reply, 0);
4977 reply.readException();
4981 public void setAlwaysFinish(boolean enabled) throws RemoteException
4983 Parcel data = Parcel.obtain();
4984 Parcel reply = Parcel.obtain();
4985 data.writeInterfaceToken(IActivityManager.descriptor);
4986 data.writeInt(enabled ? 1 : 0);
4987 mRemote.transact(SET_ALWAYS_FINISH_TRANSACTION, data, reply, 0);
4988 reply.readException();
4992 public void setActivityController(IActivityController watcher, boolean imAMonkey)
4993 throws RemoteException
4995 Parcel data = Parcel.obtain();
4996 Parcel reply = Parcel.obtain();
4997 data.writeInterfaceToken(IActivityManager.descriptor);
4998 data.writeStrongBinder(watcher != null ? watcher.asBinder() : null);
4999 data.writeInt(imAMonkey ? 1 : 0);
5000 mRemote.transact(SET_ACTIVITY_CONTROLLER_TRANSACTION, data, reply, 0);
5001 reply.readException();
5005 public void setLenientBackgroundCheck(boolean enabled) throws RemoteException
5007 Parcel data = Parcel.obtain();
5008 Parcel reply = Parcel.obtain();
5009 data.writeInterfaceToken(IActivityManager.descriptor);
5010 data.writeInt(enabled ? 1 : 0);
5011 mRemote.transact(SET_LENIENT_BACKGROUND_CHECK_TRANSACTION, data, reply, 0);
5012 reply.readException();
5016 public int getMemoryTrimLevel() throws RemoteException
5018 Parcel data = Parcel.obtain();
5019 Parcel reply = Parcel.obtain();
5020 data.writeInterfaceToken(IActivityManager.descriptor);
5021 mRemote.transact(GET_MEMORY_TRIM_LEVEL_TRANSACTION, data, reply, 0);
5022 reply.readException();
5023 int level = reply.readInt();
5028 public void enterSafeMode() throws RemoteException {
5029 Parcel data = Parcel.obtain();
5030 data.writeInterfaceToken(IActivityManager.descriptor);
5031 mRemote.transact(ENTER_SAFE_MODE_TRANSACTION, data, null, 0);
5034 public void noteWakeupAlarm(IIntentSender sender, int sourceUid, String sourcePkg, String tag)
5035 throws RemoteException {
5036 Parcel data = Parcel.obtain();
5037 data.writeInterfaceToken(IActivityManager.descriptor);
5038 data.writeStrongBinder(sender.asBinder());
5039 data.writeInt(sourceUid);
5040 data.writeString(sourcePkg);
5041 data.writeString(tag);
5042 mRemote.transact(NOTE_WAKEUP_ALARM_TRANSACTION, data, null, 0);
5045 public void noteAlarmStart(IIntentSender sender, int sourceUid, String tag)
5046 throws RemoteException {
5047 Parcel data = Parcel.obtain();
5048 data.writeInterfaceToken(IActivityManager.descriptor);
5049 data.writeStrongBinder(sender.asBinder());
5050 data.writeInt(sourceUid);
5051 data.writeString(tag);
5052 mRemote.transact(NOTE_ALARM_START_TRANSACTION, data, null, 0);
5055 public void noteAlarmFinish(IIntentSender sender, int sourceUid, String tag)
5056 throws RemoteException {
5057 Parcel data = Parcel.obtain();
5058 data.writeInterfaceToken(IActivityManager.descriptor);
5059 data.writeStrongBinder(sender.asBinder());
5060 data.writeInt(sourceUid);
5061 data.writeString(tag);
5062 mRemote.transact(NOTE_ALARM_FINISH_TRANSACTION, data, null, 0);
5065 public boolean killPids(int[] pids, String reason, boolean secure) throws RemoteException {
5066 Parcel data = Parcel.obtain();
5067 Parcel reply = Parcel.obtain();
5068 data.writeInterfaceToken(IActivityManager.descriptor);
5069 data.writeIntArray(pids);
5070 data.writeString(reason);
5071 data.writeInt(secure ? 1 : 0);
5072 mRemote.transact(KILL_PIDS_TRANSACTION, data, reply, 0);
5073 reply.readException();
5074 boolean res = reply.readInt() != 0;
5080 public boolean killProcessesBelowForeground(String reason) throws RemoteException {
5081 Parcel data = Parcel.obtain();
5082 Parcel reply = Parcel.obtain();
5083 data.writeInterfaceToken(IActivityManager.descriptor);
5084 data.writeString(reason);
5085 mRemote.transact(KILL_PROCESSES_BELOW_FOREGROUND_TRANSACTION, data, reply, 0);
5086 boolean res = reply.readInt() != 0;
5091 public boolean testIsSystemReady()
5093 /* this base class version is never called */
5096 public void handleApplicationCrash(IBinder app,
5097 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
5099 Parcel data = Parcel.obtain();
5100 Parcel reply = Parcel.obtain();
5101 data.writeInterfaceToken(IActivityManager.descriptor);
5102 data.writeStrongBinder(app);
5103 crashInfo.writeToParcel(data, 0);
5104 mRemote.transact(HANDLE_APPLICATION_CRASH_TRANSACTION, data, reply, 0);
5105 reply.readException();
5110 public boolean handleApplicationWtf(IBinder app, String tag, boolean system,
5111 ApplicationErrorReport.CrashInfo crashInfo) throws RemoteException
5113 Parcel data = Parcel.obtain();
5114 Parcel reply = Parcel.obtain();
5115 data.writeInterfaceToken(IActivityManager.descriptor);
5116 data.writeStrongBinder(app);
5117 data.writeString(tag);
5118 data.writeInt(system ? 1 : 0);
5119 crashInfo.writeToParcel(data, 0);
5120 mRemote.transact(HANDLE_APPLICATION_WTF_TRANSACTION, data, reply, 0);
5121 reply.readException();
5122 boolean res = reply.readInt() != 0;
5128 public void handleApplicationStrictModeViolation(IBinder app,
5130 StrictMode.ViolationInfo info) throws RemoteException
5132 Parcel data = Parcel.obtain();
5133 Parcel reply = Parcel.obtain();
5134 data.writeInterfaceToken(IActivityManager.descriptor);
5135 data.writeStrongBinder(app);
5136 data.writeInt(violationMask);
5137 info.writeToParcel(data, 0);
5138 mRemote.transact(HANDLE_APPLICATION_STRICT_MODE_VIOLATION_TRANSACTION, data, reply, 0);
5139 reply.readException();
5144 public void signalPersistentProcesses(int sig) throws RemoteException {
5145 Parcel data = Parcel.obtain();
5146 Parcel reply = Parcel.obtain();
5147 data.writeInterfaceToken(IActivityManager.descriptor);
5149 mRemote.transact(SIGNAL_PERSISTENT_PROCESSES_TRANSACTION, data, reply, 0);
5150 reply.readException();
5155 public void killBackgroundProcesses(String packageName, int userId) throws RemoteException {
5156 Parcel data = Parcel.obtain();
5157 Parcel reply = Parcel.obtain();
5158 data.writeInterfaceToken(IActivityManager.descriptor);
5159 data.writeString(packageName);
5160 data.writeInt(userId);
5161 mRemote.transact(KILL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
5162 reply.readException();
5167 public void killAllBackgroundProcesses() throws RemoteException {
5168 Parcel data = Parcel.obtain();
5169 Parcel reply = Parcel.obtain();
5170 data.writeInterfaceToken(IActivityManager.descriptor);
5171 mRemote.transact(KILL_ALL_BACKGROUND_PROCESSES_TRANSACTION, data, reply, 0);
5172 reply.readException();
5177 public void killPackageDependents(String packageName, int userId) throws RemoteException {
5178 Parcel data = Parcel.obtain();
5179 Parcel reply = Parcel.obtain();
5180 data.writeInterfaceToken(IActivityManager.descriptor);
5181 data.writeString(packageName);
5182 data.writeInt(userId);
5183 mRemote.transact(KILL_PACKAGE_DEPENDENTS_TRANSACTION, data, reply, 0);
5184 reply.readException();
5189 public void forceStopPackage(String packageName, int userId) throws RemoteException {
5190 Parcel data = Parcel.obtain();
5191 Parcel reply = Parcel.obtain();
5192 data.writeInterfaceToken(IActivityManager.descriptor);
5193 data.writeString(packageName);
5194 data.writeInt(userId);
5195 mRemote.transact(FORCE_STOP_PACKAGE_TRANSACTION, data, reply, 0);
5196 reply.readException();
5201 public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
5202 throws RemoteException
5204 Parcel data = Parcel.obtain();
5205 Parcel reply = Parcel.obtain();
5206 data.writeInterfaceToken(IActivityManager.descriptor);
5207 mRemote.transact(GET_MY_MEMORY_STATE_TRANSACTION, data, reply, 0);
5208 reply.readException();
5209 outInfo.readFromParcel(reply);
5214 public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
5216 Parcel data = Parcel.obtain();
5217 Parcel reply = Parcel.obtain();
5218 data.writeInterfaceToken(IActivityManager.descriptor);
5219 mRemote.transact(GET_DEVICE_CONFIGURATION_TRANSACTION, data, reply, 0);
5220 reply.readException();
5221 ConfigurationInfo res = ConfigurationInfo.CREATOR.createFromParcel(reply);
5227 public boolean profileControl(String process, int userId, boolean start,
5228 ProfilerInfo profilerInfo, int profileType) throws RemoteException
5230 Parcel data = Parcel.obtain();
5231 Parcel reply = Parcel.obtain();
5232 data.writeInterfaceToken(IActivityManager.descriptor);
5233 data.writeString(process);
5234 data.writeInt(userId);
5235 data.writeInt(start ? 1 : 0);
5236 data.writeInt(profileType);
5237 if (profilerInfo != null) {
5239 profilerInfo.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
5243 mRemote.transact(PROFILE_CONTROL_TRANSACTION, data, reply, 0);
5244 reply.readException();
5245 boolean res = reply.readInt() != 0;
5251 public boolean shutdown(int timeout) throws RemoteException
5253 Parcel data = Parcel.obtain();
5254 Parcel reply = Parcel.obtain();
5255 data.writeInterfaceToken(IActivityManager.descriptor);
5256 data.writeInt(timeout);
5257 mRemote.transact(SHUTDOWN_TRANSACTION, data, reply, 0);
5258 reply.readException();
5259 boolean res = reply.readInt() != 0;
5265 public void stopAppSwitches() throws RemoteException {
5266 Parcel data = Parcel.obtain();
5267 Parcel reply = Parcel.obtain();
5268 data.writeInterfaceToken(IActivityManager.descriptor);
5269 mRemote.transact(STOP_APP_SWITCHES_TRANSACTION, data, reply, 0);
5270 reply.readException();
5275 public void resumeAppSwitches() throws RemoteException {
5276 Parcel data = Parcel.obtain();
5277 Parcel reply = Parcel.obtain();
5278 data.writeInterfaceToken(IActivityManager.descriptor);
5279 mRemote.transact(RESUME_APP_SWITCHES_TRANSACTION, data, reply, 0);
5280 reply.readException();
5285 public void addPackageDependency(String packageName) throws RemoteException {
5286 Parcel data = Parcel.obtain();
5287 Parcel reply = Parcel.obtain();
5288 data.writeInterfaceToken(IActivityManager.descriptor);
5289 data.writeString(packageName);
5290 mRemote.transact(ADD_PACKAGE_DEPENDENCY_TRANSACTION, data, reply, 0);
5291 reply.readException();
5296 public void killApplication(String pkg, int appId, int userId, String reason)
5297 throws RemoteException {
5298 Parcel data = Parcel.obtain();
5299 Parcel reply = Parcel.obtain();
5300 data.writeInterfaceToken(IActivityManager.descriptor);
5301 data.writeString(pkg);
5302 data.writeInt(appId);
5303 data.writeInt(userId);
5304 data.writeString(reason);
5305 mRemote.transact(KILL_APPLICATION_TRANSACTION, data, reply, 0);
5306 reply.readException();
5311 public void closeSystemDialogs(String reason) throws RemoteException {
5312 Parcel data = Parcel.obtain();
5313 Parcel reply = Parcel.obtain();
5314 data.writeInterfaceToken(IActivityManager.descriptor);
5315 data.writeString(reason);
5316 mRemote.transact(CLOSE_SYSTEM_DIALOGS_TRANSACTION, data, reply, 0);
5317 reply.readException();
5322 public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
5323 throws RemoteException {
5324 Parcel data = Parcel.obtain();
5325 Parcel reply = Parcel.obtain();
5326 data.writeInterfaceToken(IActivityManager.descriptor);
5327 data.writeIntArray(pids);
5328 mRemote.transact(GET_PROCESS_MEMORY_INFO_TRANSACTION, data, reply, 0);
5329 reply.readException();
5330 Debug.MemoryInfo[] res = reply.createTypedArray(Debug.MemoryInfo.CREATOR);
5336 public void killApplicationProcess(String processName, int uid) throws RemoteException {
5337 Parcel data = Parcel.obtain();
5338 Parcel reply = Parcel.obtain();
5339 data.writeInterfaceToken(IActivityManager.descriptor);
5340 data.writeString(processName);
5342 mRemote.transact(KILL_APPLICATION_PROCESS_TRANSACTION, data, reply, 0);
5343 reply.readException();
5348 public void overridePendingTransition(IBinder token, String packageName,
5349 int enterAnim, int exitAnim) throws RemoteException {
5350 Parcel data = Parcel.obtain();
5351 Parcel reply = Parcel.obtain();
5352 data.writeInterfaceToken(IActivityManager.descriptor);
5353 data.writeStrongBinder(token);
5354 data.writeString(packageName);
5355 data.writeInt(enterAnim);
5356 data.writeInt(exitAnim);
5357 mRemote.transact(OVERRIDE_PENDING_TRANSITION_TRANSACTION, data, reply, 0);
5358 reply.readException();
5363 public boolean isUserAMonkey() throws RemoteException {
5364 Parcel data = Parcel.obtain();
5365 Parcel reply = Parcel.obtain();
5366 data.writeInterfaceToken(IActivityManager.descriptor);
5367 mRemote.transact(IS_USER_A_MONKEY_TRANSACTION, data, reply, 0);
5368 reply.readException();
5369 boolean res = reply.readInt() != 0;
5375 public void setUserIsMonkey(boolean monkey) throws RemoteException {
5376 Parcel data = Parcel.obtain();
5377 Parcel reply = Parcel.obtain();
5378 data.writeInterfaceToken(IActivityManager.descriptor);
5379 data.writeInt(monkey ? 1 : 0);
5380 mRemote.transact(SET_USER_IS_MONKEY_TRANSACTION, data, reply, 0);
5381 reply.readException();
5386 public void finishHeavyWeightApp() throws RemoteException {
5387 Parcel data = Parcel.obtain();
5388 Parcel reply = Parcel.obtain();
5389 data.writeInterfaceToken(IActivityManager.descriptor);
5390 mRemote.transact(FINISH_HEAVY_WEIGHT_APP_TRANSACTION, data, reply, 0);
5391 reply.readException();
5396 public boolean convertFromTranslucent(IBinder token)
5397 throws RemoteException {
5398 Parcel data = Parcel.obtain();
5399 Parcel reply = Parcel.obtain();
5400 data.writeInterfaceToken(IActivityManager.descriptor);
5401 data.writeStrongBinder(token);
5402 mRemote.transact(CONVERT_FROM_TRANSLUCENT_TRANSACTION, data, reply, 0);
5403 reply.readException();
5404 boolean res = reply.readInt() != 0;
5410 public boolean convertToTranslucent(IBinder token, ActivityOptions options)
5411 throws RemoteException {
5412 Parcel data = Parcel.obtain();
5413 Parcel reply = Parcel.obtain();
5414 data.writeInterfaceToken(IActivityManager.descriptor);
5415 data.writeStrongBinder(token);
5416 if (options == null) {
5420 data.writeBundle(options.toBundle());
5422 mRemote.transact(CONVERT_TO_TRANSLUCENT_TRANSACTION, data, reply, 0);
5423 reply.readException();
5424 boolean res = reply.readInt() != 0;
5430 public ActivityOptions getActivityOptions(IBinder token) throws RemoteException {
5431 Parcel data = Parcel.obtain();
5432 Parcel reply = Parcel.obtain();
5433 data.writeInterfaceToken(IActivityManager.descriptor);
5434 data.writeStrongBinder(token);
5435 mRemote.transact(GET_ACTIVITY_OPTIONS_TRANSACTION, data, reply, 0);
5436 reply.readException();
5437 ActivityOptions options = ActivityOptions.fromBundle(reply.readBundle());
5443 public void setImmersive(IBinder token, boolean immersive)
5444 throws RemoteException {
5445 Parcel data = Parcel.obtain();
5446 Parcel reply = Parcel.obtain();
5447 data.writeInterfaceToken(IActivityManager.descriptor);
5448 data.writeStrongBinder(token);
5449 data.writeInt(immersive ? 1 : 0);
5450 mRemote.transact(SET_IMMERSIVE_TRANSACTION, data, reply, 0);
5451 reply.readException();
5456 public boolean isImmersive(IBinder token)
5457 throws RemoteException {
5458 Parcel data = Parcel.obtain();
5459 Parcel reply = Parcel.obtain();
5460 data.writeInterfaceToken(IActivityManager.descriptor);
5461 data.writeStrongBinder(token);
5462 mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
5463 reply.readException();
5464 boolean res = reply.readInt() == 1;
5470 public boolean isTopOfTask(IBinder token) throws RemoteException {
5471 Parcel data = Parcel.obtain();
5472 Parcel reply = Parcel.obtain();
5473 data.writeInterfaceToken(IActivityManager.descriptor);
5474 data.writeStrongBinder(token);
5475 mRemote.transact(IS_TOP_OF_TASK_TRANSACTION, data, reply, 0);
5476 reply.readException();
5477 boolean res = reply.readInt() == 1;
5483 public boolean isTopActivityImmersive()
5484 throws RemoteException {
5485 Parcel data = Parcel.obtain();
5486 Parcel reply = Parcel.obtain();
5487 data.writeInterfaceToken(IActivityManager.descriptor);
5488 mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
5489 reply.readException();
5490 boolean res = reply.readInt() == 1;
5496 public void crashApplication(int uid, int initialPid, String packageName,
5497 String message) throws RemoteException {
5498 Parcel data = Parcel.obtain();
5499 Parcel reply = Parcel.obtain();
5500 data.writeInterfaceToken(IActivityManager.descriptor);
5502 data.writeInt(initialPid);
5503 data.writeString(packageName);
5504 data.writeString(message);
5505 mRemote.transact(CRASH_APPLICATION_TRANSACTION, data, reply, 0);
5506 reply.readException();
5511 public String getProviderMimeType(Uri uri, int userId) throws RemoteException {
5512 Parcel data = Parcel.obtain();
5513 Parcel reply = Parcel.obtain();
5514 data.writeInterfaceToken(IActivityManager.descriptor);
5515 uri.writeToParcel(data, 0);
5516 data.writeInt(userId);
5517 mRemote.transact(GET_PROVIDER_MIME_TYPE_TRANSACTION, data, reply, 0);
5518 reply.readException();
5519 String res = reply.readString();
5525 public IBinder newUriPermissionOwner(String name)
5526 throws RemoteException {
5527 Parcel data = Parcel.obtain();
5528 Parcel reply = Parcel.obtain();
5529 data.writeInterfaceToken(IActivityManager.descriptor);
5530 data.writeString(name);
5531 mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
5532 reply.readException();
5533 IBinder res = reply.readStrongBinder();
5539 public IBinder getUriPermissionOwnerForActivity(IBinder activityToken) throws RemoteException {
5540 Parcel data = Parcel.obtain();
5541 Parcel reply = Parcel.obtain();
5542 data.writeInterfaceToken(IActivityManager.descriptor);
5543 data.writeStrongBinder(activityToken);
5544 mRemote.transact(GET_URI_PERMISSION_OWNER_FOR_ACTIVITY_TRANSACTION, data, reply, 0);
5545 reply.readException();
5546 IBinder res = reply.readStrongBinder();
5552 public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
5553 Uri uri, int mode, int sourceUserId, int targetUserId) throws RemoteException {
5554 Parcel data = Parcel.obtain();
5555 Parcel reply = Parcel.obtain();
5556 data.writeInterfaceToken(IActivityManager.descriptor);
5557 data.writeStrongBinder(owner);
5558 data.writeInt(fromUid);
5559 data.writeString(targetPkg);
5560 uri.writeToParcel(data, 0);
5561 data.writeInt(mode);
5562 data.writeInt(sourceUserId);
5563 data.writeInt(targetUserId);
5564 mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
5565 reply.readException();
5570 public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
5571 int mode, int userId) throws RemoteException {
5572 Parcel data = Parcel.obtain();
5573 Parcel reply = Parcel.obtain();
5574 data.writeInterfaceToken(IActivityManager.descriptor);
5575 data.writeStrongBinder(owner);
5578 uri.writeToParcel(data, 0);
5582 data.writeInt(mode);
5583 data.writeInt(userId);
5584 mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
5585 reply.readException();
5590 public int checkGrantUriPermission(int callingUid, String targetPkg,
5591 Uri uri, int modeFlags, int userId) throws RemoteException {
5592 Parcel data = Parcel.obtain();
5593 Parcel reply = Parcel.obtain();
5594 data.writeInterfaceToken(IActivityManager.descriptor);
5595 data.writeInt(callingUid);
5596 data.writeString(targetPkg);
5597 uri.writeToParcel(data, 0);
5598 data.writeInt(modeFlags);
5599 data.writeInt(userId);
5600 mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
5601 reply.readException();
5602 int res = reply.readInt();
5608 public boolean dumpHeap(String process, int userId, boolean managed,
5609 String path, ParcelFileDescriptor fd) throws RemoteException {
5610 Parcel data = Parcel.obtain();
5611 Parcel reply = Parcel.obtain();
5612 data.writeInterfaceToken(IActivityManager.descriptor);
5613 data.writeString(process);
5614 data.writeInt(userId);
5615 data.writeInt(managed ? 1 : 0);
5616 data.writeString(path);
5619 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
5623 mRemote.transact(DUMP_HEAP_TRANSACTION, data, reply, 0);
5624 reply.readException();
5625 boolean res = reply.readInt() != 0;
5631 public int startActivities(IApplicationThread caller, String callingPackage,
5632 Intent[] intents, String[] resolvedTypes, IBinder resultTo,
5633 Bundle options, int userId) throws RemoteException {
5634 Parcel data = Parcel.obtain();
5635 Parcel reply = Parcel.obtain();
5636 data.writeInterfaceToken(IActivityManager.descriptor);
5637 data.writeStrongBinder(caller != null ? caller.asBinder() : null);
5638 data.writeString(callingPackage);
5639 data.writeTypedArray(intents, 0);
5640 data.writeStringArray(resolvedTypes);
5641 data.writeStrongBinder(resultTo);
5642 if (options != null) {
5644 options.writeToParcel(data, 0);
5648 data.writeInt(userId);
5649 mRemote.transact(START_ACTIVITIES_TRANSACTION, data, reply, 0);
5650 reply.readException();
5651 int result = reply.readInt();
5657 public int getFrontActivityScreenCompatMode() throws RemoteException {
5658 Parcel data = Parcel.obtain();
5659 Parcel reply = Parcel.obtain();
5660 data.writeInterfaceToken(IActivityManager.descriptor);
5661 mRemote.transact(GET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
5662 reply.readException();
5663 int mode = reply.readInt();
5669 public void setFrontActivityScreenCompatMode(int mode) throws RemoteException {
5670 Parcel data = Parcel.obtain();
5671 Parcel reply = Parcel.obtain();
5672 data.writeInterfaceToken(IActivityManager.descriptor);
5673 data.writeInt(mode);
5674 mRemote.transact(SET_FRONT_ACTIVITY_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
5675 reply.readException();
5680 public int getPackageScreenCompatMode(String packageName) throws RemoteException {
5681 Parcel data = Parcel.obtain();
5682 Parcel reply = Parcel.obtain();
5683 data.writeInterfaceToken(IActivityManager.descriptor);
5684 data.writeString(packageName);
5685 mRemote.transact(GET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
5686 reply.readException();
5687 int mode = reply.readInt();
5693 public void setPackageScreenCompatMode(String packageName, int mode)
5694 throws RemoteException {
5695 Parcel data = Parcel.obtain();
5696 Parcel reply = Parcel.obtain();
5697 data.writeInterfaceToken(IActivityManager.descriptor);
5698 data.writeString(packageName);
5699 data.writeInt(mode);
5700 mRemote.transact(SET_PACKAGE_SCREEN_COMPAT_MODE_TRANSACTION, data, reply, 0);
5701 reply.readException();
5706 public boolean getPackageAskScreenCompat(String packageName) throws RemoteException {
5707 Parcel data = Parcel.obtain();
5708 Parcel reply = Parcel.obtain();
5709 data.writeInterfaceToken(IActivityManager.descriptor);
5710 data.writeString(packageName);
5711 mRemote.transact(GET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
5712 reply.readException();
5713 boolean ask = reply.readInt() != 0;
5719 public void setPackageAskScreenCompat(String packageName, boolean ask)
5720 throws RemoteException {
5721 Parcel data = Parcel.obtain();
5722 Parcel reply = Parcel.obtain();
5723 data.writeInterfaceToken(IActivityManager.descriptor);
5724 data.writeString(packageName);
5725 data.writeInt(ask ? 1 : 0);
5726 mRemote.transact(SET_PACKAGE_ASK_SCREEN_COMPAT_TRANSACTION, data, reply, 0);
5727 reply.readException();
5732 public boolean switchUser(int userid) throws RemoteException {
5733 Parcel data = Parcel.obtain();
5734 Parcel reply = Parcel.obtain();
5735 data.writeInterfaceToken(IActivityManager.descriptor);
5736 data.writeInt(userid);
5737 mRemote.transact(SWITCH_USER_TRANSACTION, data, reply, 0);
5738 reply.readException();
5739 boolean result = reply.readInt() != 0;
5745 public boolean startUserInBackground(int userid) throws RemoteException {
5746 Parcel data = Parcel.obtain();
5747 Parcel reply = Parcel.obtain();
5748 data.writeInterfaceToken(IActivityManager.descriptor);
5749 data.writeInt(userid);
5750 mRemote.transact(START_USER_IN_BACKGROUND_TRANSACTION, data, reply, 0);
5751 reply.readException();
5752 boolean result = reply.readInt() != 0;
5758 public boolean unlockUser(int userId, byte[] token, byte[] secret, IProgressListener listener)
5759 throws RemoteException {
5760 Parcel data = Parcel.obtain();
5761 Parcel reply = Parcel.obtain();
5762 data.writeInterfaceToken(IActivityManager.descriptor);
5763 data.writeInt(userId);
5764 data.writeByteArray(token);
5765 data.writeByteArray(secret);
5766 data.writeStrongInterface(listener);
5767 mRemote.transact(IActivityManager.UNLOCK_USER_TRANSACTION, data, reply, 0);
5768 reply.readException();
5769 boolean result = reply.readInt() != 0;
5775 public int stopUser(int userid, boolean force, IStopUserCallback callback)
5776 throws RemoteException {
5777 Parcel data = Parcel.obtain();
5778 Parcel reply = Parcel.obtain();
5779 data.writeInterfaceToken(IActivityManager.descriptor);
5780 data.writeInt(userid);
5781 data.writeInt(force ? 1 : 0);
5782 data.writeStrongInterface(callback);
5783 mRemote.transact(STOP_USER_TRANSACTION, data, reply, 0);
5784 reply.readException();
5785 int result = reply.readInt();
5791 public UserInfo getCurrentUser() throws RemoteException {
5792 Parcel data = Parcel.obtain();
5793 Parcel reply = Parcel.obtain();
5794 data.writeInterfaceToken(IActivityManager.descriptor);
5795 mRemote.transact(GET_CURRENT_USER_TRANSACTION, data, reply, 0);
5796 reply.readException();
5797 UserInfo userInfo = UserInfo.CREATOR.createFromParcel(reply);
5803 public boolean isUserRunning(int userid, int flags) throws RemoteException {
5804 Parcel data = Parcel.obtain();
5805 Parcel reply = Parcel.obtain();
5806 data.writeInterfaceToken(IActivityManager.descriptor);
5807 data.writeInt(userid);
5808 data.writeInt(flags);
5809 mRemote.transact(IS_USER_RUNNING_TRANSACTION, data, reply, 0);
5810 reply.readException();
5811 boolean result = reply.readInt() != 0;
5817 public int[] getRunningUserIds() throws RemoteException {
5818 Parcel data = Parcel.obtain();
5819 Parcel reply = Parcel.obtain();
5820 data.writeInterfaceToken(IActivityManager.descriptor);
5821 mRemote.transact(GET_RUNNING_USER_IDS_TRANSACTION, data, reply, 0);
5822 reply.readException();
5823 int[] result = reply.createIntArray();
5829 public boolean removeTask(int taskId) throws RemoteException {
5830 Parcel data = Parcel.obtain();
5831 Parcel reply = Parcel.obtain();
5832 data.writeInterfaceToken(IActivityManager.descriptor);
5833 data.writeInt(taskId);
5834 mRemote.transact(REMOVE_TASK_TRANSACTION, data, reply, 0);
5835 reply.readException();
5836 boolean result = reply.readInt() != 0;
5842 public void registerProcessObserver(IProcessObserver observer) throws RemoteException {
5843 Parcel data = Parcel.obtain();
5844 Parcel reply = Parcel.obtain();
5845 data.writeInterfaceToken(IActivityManager.descriptor);
5846 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5847 mRemote.transact(REGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5848 reply.readException();
5853 public void unregisterProcessObserver(IProcessObserver observer) throws RemoteException {
5854 Parcel data = Parcel.obtain();
5855 Parcel reply = Parcel.obtain();
5856 data.writeInterfaceToken(IActivityManager.descriptor);
5857 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5858 mRemote.transact(UNREGISTER_PROCESS_OBSERVER_TRANSACTION, data, reply, 0);
5859 reply.readException();
5864 public void registerUidObserver(IUidObserver observer, int which) throws RemoteException {
5865 Parcel data = Parcel.obtain();
5866 Parcel reply = Parcel.obtain();
5867 data.writeInterfaceToken(IActivityManager.descriptor);
5868 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5869 data.writeInt(which);
5870 mRemote.transact(REGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0);
5871 reply.readException();
5876 public void unregisterUidObserver(IUidObserver observer) throws RemoteException {
5877 Parcel data = Parcel.obtain();
5878 Parcel reply = Parcel.obtain();
5879 data.writeInterfaceToken(IActivityManager.descriptor);
5880 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
5881 mRemote.transact(UNREGISTER_UID_OBSERVER_TRANSACTION, data, reply, 0);
5882 reply.readException();
5887 public boolean isIntentSenderTargetedToPackage(IIntentSender sender) throws RemoteException {
5888 Parcel data = Parcel.obtain();
5889 Parcel reply = Parcel.obtain();
5890 data.writeInterfaceToken(IActivityManager.descriptor);
5891 data.writeStrongBinder(sender.asBinder());
5892 mRemote.transact(IS_INTENT_SENDER_TARGETED_TO_PACKAGE_TRANSACTION, data, reply, 0);
5893 reply.readException();
5894 boolean res = reply.readInt() != 0;
5900 public boolean isIntentSenderAnActivity(IIntentSender sender) throws RemoteException {
5901 Parcel data = Parcel.obtain();
5902 Parcel reply = Parcel.obtain();
5903 data.writeInterfaceToken(IActivityManager.descriptor);
5904 data.writeStrongBinder(sender.asBinder());
5905 mRemote.transact(IS_INTENT_SENDER_AN_ACTIVITY_TRANSACTION, data, reply, 0);
5906 reply.readException();
5907 boolean res = reply.readInt() != 0;
5913 public Intent getIntentForIntentSender(IIntentSender sender) throws RemoteException {
5914 Parcel data = Parcel.obtain();
5915 Parcel reply = Parcel.obtain();
5916 data.writeInterfaceToken(IActivityManager.descriptor);
5917 data.writeStrongBinder(sender.asBinder());
5918 mRemote.transact(GET_INTENT_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5919 reply.readException();
5920 Intent res = reply.readInt() != 0
5921 ? Intent.CREATOR.createFromParcel(reply) : null;
5927 public String getTagForIntentSender(IIntentSender sender, String prefix)
5928 throws RemoteException {
5929 Parcel data = Parcel.obtain();
5930 Parcel reply = Parcel.obtain();
5931 data.writeInterfaceToken(IActivityManager.descriptor);
5932 data.writeStrongBinder(sender.asBinder());
5933 data.writeString(prefix);
5934 mRemote.transact(GET_TAG_FOR_INTENT_SENDER_TRANSACTION, data, reply, 0);
5935 reply.readException();
5936 String res = reply.readString();
5942 public void updatePersistentConfiguration(Configuration values) throws RemoteException
5944 Parcel data = Parcel.obtain();
5945 Parcel reply = Parcel.obtain();
5946 data.writeInterfaceToken(IActivityManager.descriptor);
5947 values.writeToParcel(data, 0);
5948 mRemote.transact(UPDATE_PERSISTENT_CONFIGURATION_TRANSACTION, data, reply, 0);
5949 reply.readException();
5954 public long[] getProcessPss(int[] pids) throws RemoteException {
5955 Parcel data = Parcel.obtain();
5956 Parcel reply = Parcel.obtain();
5957 data.writeInterfaceToken(IActivityManager.descriptor);
5958 data.writeIntArray(pids);
5959 mRemote.transact(GET_PROCESS_PSS_TRANSACTION, data, reply, 0);
5960 reply.readException();
5961 long[] res = reply.createLongArray();
5967 public void showBootMessage(CharSequence msg, boolean always) throws RemoteException {
5968 Parcel data = Parcel.obtain();
5969 Parcel reply = Parcel.obtain();
5970 data.writeInterfaceToken(IActivityManager.descriptor);
5971 TextUtils.writeToParcel(msg, data, 0);
5972 data.writeInt(always ? 1 : 0);
5973 mRemote.transact(SHOW_BOOT_MESSAGE_TRANSACTION, data, reply, 0);
5974 reply.readException();
5979 public void keyguardWaitingForActivityDrawn() throws RemoteException {
5980 Parcel data = Parcel.obtain();
5981 Parcel reply = Parcel.obtain();
5982 data.writeInterfaceToken(IActivityManager.descriptor);
5983 mRemote.transact(KEYGUARD_WAITING_FOR_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
5984 reply.readException();
5989 public void keyguardGoingAway(int flags)
5990 throws RemoteException {
5991 Parcel data = Parcel.obtain();
5992 Parcel reply = Parcel.obtain();
5993 data.writeInterfaceToken(IActivityManager.descriptor);
5994 data.writeInt(flags);
5995 mRemote.transact(KEYGUARD_GOING_AWAY_TRANSACTION, data, reply, 0);
5996 reply.readException();
6001 public boolean shouldUpRecreateTask(IBinder token, String destAffinity)
6002 throws RemoteException {
6003 Parcel data = Parcel.obtain();
6004 Parcel reply = Parcel.obtain();
6005 data.writeInterfaceToken(IActivityManager.descriptor);
6006 data.writeStrongBinder(token);
6007 data.writeString(destAffinity);
6008 mRemote.transact(SHOULD_UP_RECREATE_TASK_TRANSACTION, data, reply, 0);
6009 reply.readException();
6010 boolean result = reply.readInt() != 0;
6016 public boolean navigateUpTo(IBinder token, Intent target, int resultCode, Intent resultData)
6017 throws RemoteException {
6018 Parcel data = Parcel.obtain();
6019 Parcel reply = Parcel.obtain();
6020 data.writeInterfaceToken(IActivityManager.descriptor);
6021 data.writeStrongBinder(token);
6022 target.writeToParcel(data, 0);
6023 data.writeInt(resultCode);
6024 if (resultData != null) {
6026 resultData.writeToParcel(data, 0);
6030 mRemote.transact(NAVIGATE_UP_TO_TRANSACTION, data, reply, 0);
6031 reply.readException();
6032 boolean result = reply.readInt() != 0;
6038 public int getLaunchedFromUid(IBinder activityToken) throws RemoteException {
6039 Parcel data = Parcel.obtain();
6040 Parcel reply = Parcel.obtain();
6041 data.writeInterfaceToken(IActivityManager.descriptor);
6042 data.writeStrongBinder(activityToken);
6043 mRemote.transact(GET_LAUNCHED_FROM_UID_TRANSACTION, data, reply, 0);
6044 reply.readException();
6045 int result = reply.readInt();
6051 public String getLaunchedFromPackage(IBinder activityToken) throws RemoteException {
6052 Parcel data = Parcel.obtain();
6053 Parcel reply = Parcel.obtain();
6054 data.writeInterfaceToken(IActivityManager.descriptor);
6055 data.writeStrongBinder(activityToken);
6056 mRemote.transact(GET_LAUNCHED_FROM_PACKAGE_TRANSACTION, data, reply, 0);
6057 reply.readException();
6058 String result = reply.readString();
6064 public void registerUserSwitchObserver(IUserSwitchObserver observer,
6065 String name) throws RemoteException {
6066 Parcel data = Parcel.obtain();
6067 Parcel reply = Parcel.obtain();
6068 data.writeInterfaceToken(IActivityManager.descriptor);
6069 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
6070 data.writeString(name);
6071 mRemote.transact(REGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
6072 reply.readException();
6077 public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException {
6078 Parcel data = Parcel.obtain();
6079 Parcel reply = Parcel.obtain();
6080 data.writeInterfaceToken(IActivityManager.descriptor);
6081 data.writeStrongBinder(observer != null ? observer.asBinder() : null);
6082 mRemote.transact(UNREGISTER_USER_SWITCH_OBSERVER_TRANSACTION, data, reply, 0);
6083 reply.readException();
6088 public void requestBugReport(@ActivityManager.BugreportMode int bugreportType)
6089 throws RemoteException {
6090 Parcel data = Parcel.obtain();
6091 Parcel reply = Parcel.obtain();
6092 data.writeInterfaceToken(IActivityManager.descriptor);
6093 data.writeInt(bugreportType);
6094 mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0);
6095 reply.readException();
6100 public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason)
6101 throws RemoteException {
6102 Parcel data = Parcel.obtain();
6103 Parcel reply = Parcel.obtain();
6104 data.writeInterfaceToken(IActivityManager.descriptor);
6106 data.writeInt(aboveSystem ? 1 : 0);
6107 data.writeString(reason);
6108 mRemote.transact(INPUT_DISPATCHING_TIMED_OUT_TRANSACTION, data, reply, 0);
6109 reply.readException();
6110 long res = reply.readInt();
6116 public Bundle getAssistContextExtras(int requestType) throws RemoteException {
6117 Parcel data = Parcel.obtain();
6118 Parcel reply = Parcel.obtain();
6119 data.writeInterfaceToken(IActivityManager.descriptor);
6120 data.writeInt(requestType);
6121 mRemote.transact(GET_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
6122 reply.readException();
6123 Bundle res = reply.readBundle();
6129 public boolean requestAssistContextExtras(int requestType, IResultReceiver receiver,
6130 Bundle receiverExtras,
6131 IBinder activityToken, boolean focused, boolean newSessionId) throws RemoteException {
6132 Parcel data = Parcel.obtain();
6133 Parcel reply = Parcel.obtain();
6134 data.writeInterfaceToken(IActivityManager.descriptor);
6135 data.writeInt(requestType);
6136 data.writeStrongBinder(receiver.asBinder());
6137 data.writeBundle(receiverExtras);
6138 data.writeStrongBinder(activityToken);
6139 data.writeInt(focused ? 1 : 0);
6140 data.writeInt(newSessionId ? 1 : 0);
6141 mRemote.transact(REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
6142 reply.readException();
6143 boolean res = reply.readInt() != 0;
6149 public void reportAssistContextExtras(IBinder token, Bundle extras, AssistStructure structure,
6150 AssistContent content, Uri referrer) throws RemoteException {
6151 Parcel data = Parcel.obtain();
6152 Parcel reply = Parcel.obtain();
6153 data.writeInterfaceToken(IActivityManager.descriptor);
6154 data.writeStrongBinder(token);
6155 data.writeBundle(extras);
6156 structure.writeToParcel(data, 0);
6157 content.writeToParcel(data, 0);
6158 if (referrer != null) {
6160 referrer.writeToParcel(data, 0);
6164 mRemote.transact(REPORT_ASSIST_CONTEXT_EXTRAS_TRANSACTION, data, reply, 0);
6165 reply.readException();
6170 public boolean launchAssistIntent(Intent intent, int requestType, String hint, int userHandle,
6171 Bundle args) throws RemoteException {
6172 Parcel data = Parcel.obtain();
6173 Parcel reply = Parcel.obtain();
6174 data.writeInterfaceToken(IActivityManager.descriptor);
6175 intent.writeToParcel(data, 0);
6176 data.writeInt(requestType);
6177 data.writeString(hint);
6178 data.writeInt(userHandle);
6179 data.writeBundle(args);
6180 mRemote.transact(LAUNCH_ASSIST_INTENT_TRANSACTION, data, reply, 0);
6181 reply.readException();
6182 boolean res = reply.readInt() != 0;
6188 public boolean isAssistDataAllowedOnCurrentActivity() throws RemoteException {
6189 Parcel data = Parcel.obtain();
6190 Parcel reply = Parcel.obtain();
6191 data.writeInterfaceToken(IActivityManager.descriptor);
6192 mRemote.transact(IS_SCREEN_CAPTURE_ALLOWED_ON_CURRENT_ACTIVITY_TRANSACTION, data, reply, 0);
6193 reply.readException();
6194 boolean res = reply.readInt() != 0;
6200 public boolean showAssistFromActivity(IBinder token, Bundle args) throws RemoteException {
6201 Parcel data = Parcel.obtain();
6202 Parcel reply = Parcel.obtain();
6203 data.writeInterfaceToken(IActivityManager.descriptor);
6204 data.writeStrongBinder(token);
6205 data.writeBundle(args);
6206 mRemote.transact(SHOW_ASSIST_FROM_ACTIVITY_TRANSACTION, data, reply, 0);
6207 reply.readException();
6208 boolean res = reply.readInt() != 0;
6214 public void killUid(int appId, int userId, String reason) throws RemoteException {
6215 Parcel data = Parcel.obtain();
6216 Parcel reply = Parcel.obtain();
6217 data.writeInterfaceToken(IActivityManager.descriptor);
6218 data.writeInt(appId);
6219 data.writeInt(userId);
6220 data.writeString(reason);
6221 mRemote.transact(KILL_UID_TRANSACTION, data, reply, 0);
6222 reply.readException();
6227 public void hang(IBinder who, boolean allowRestart) throws RemoteException {
6228 Parcel data = Parcel.obtain();
6229 Parcel reply = Parcel.obtain();
6230 data.writeInterfaceToken(IActivityManager.descriptor);
6231 data.writeStrongBinder(who);
6232 data.writeInt(allowRestart ? 1 : 0);
6233 mRemote.transact(HANG_TRANSACTION, data, reply, 0);
6234 reply.readException();
6239 public void reportActivityFullyDrawn(IBinder token) throws RemoteException {
6240 Parcel data = Parcel.obtain();
6241 Parcel reply = Parcel.obtain();
6242 data.writeInterfaceToken(IActivityManager.descriptor);
6243 data.writeStrongBinder(token);
6244 mRemote.transact(REPORT_ACTIVITY_FULLY_DRAWN_TRANSACTION, data, reply, 0);
6245 reply.readException();
6250 public void notifyActivityDrawn(IBinder token) throws RemoteException {
6251 Parcel data = Parcel.obtain();
6252 Parcel reply = Parcel.obtain();
6253 data.writeInterfaceToken(IActivityManager.descriptor);
6254 data.writeStrongBinder(token);
6255 mRemote.transact(NOTIFY_ACTIVITY_DRAWN_TRANSACTION, data, reply, 0);
6256 reply.readException();
6261 public void restart() throws RemoteException {
6262 Parcel data = Parcel.obtain();
6263 Parcel reply = Parcel.obtain();
6264 data.writeInterfaceToken(IActivityManager.descriptor);
6265 mRemote.transact(RESTART_TRANSACTION, data, reply, 0);
6266 reply.readException();
6271 public void performIdleMaintenance() throws RemoteException {
6272 Parcel data = Parcel.obtain();
6273 Parcel reply = Parcel.obtain();
6274 data.writeInterfaceToken(IActivityManager.descriptor);
6275 mRemote.transact(PERFORM_IDLE_MAINTENANCE_TRANSACTION, data, reply, 0);
6276 reply.readException();
6281 public void sendIdleJobTrigger() throws RemoteException {
6282 Parcel data = Parcel.obtain();
6283 Parcel reply = Parcel.obtain();
6284 data.writeInterfaceToken(IActivityManager.descriptor);
6285 mRemote.transact(SEND_IDLE_JOB_TRIGGER_TRANSACTION, data, reply, 0);
6286 reply.readException();
6291 public IActivityContainer createVirtualActivityContainer(IBinder parentActivityToken,
6292 IActivityContainerCallback callback) throws RemoteException {
6293 Parcel data = Parcel.obtain();
6294 Parcel reply = Parcel.obtain();
6295 data.writeInterfaceToken(IActivityManager.descriptor);
6296 data.writeStrongBinder(parentActivityToken);
6297 data.writeStrongBinder(callback == null ? null : callback.asBinder());
6298 mRemote.transact(CREATE_VIRTUAL_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
6299 reply.readException();
6300 final int result = reply.readInt();
6301 final IActivityContainer res;
6303 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
6312 public void deleteActivityContainer(IActivityContainer activityContainer)
6313 throws RemoteException {
6314 Parcel data = Parcel.obtain();
6315 Parcel reply = Parcel.obtain();
6316 data.writeInterfaceToken(IActivityManager.descriptor);
6317 data.writeStrongBinder(activityContainer.asBinder());
6318 mRemote.transact(DELETE_ACTIVITY_CONTAINER_TRANSACTION, data, reply, 0);
6319 reply.readException();
6324 public boolean startBinderTracking() throws RemoteException {
6325 Parcel data = Parcel.obtain();
6326 Parcel reply = Parcel.obtain();
6327 data.writeInterfaceToken(IActivityManager.descriptor);
6328 mRemote.transact(START_BINDER_TRACKING_TRANSACTION, data, reply, 0);
6329 reply.readException();
6330 boolean res = reply.readInt() != 0;
6336 public boolean stopBinderTrackingAndDump(ParcelFileDescriptor fd) throws RemoteException {
6337 Parcel data = Parcel.obtain();
6338 Parcel reply = Parcel.obtain();
6339 data.writeInterfaceToken(IActivityManager.descriptor);
6342 fd.writeToParcel(data, Parcelable.PARCELABLE_WRITE_RETURN_VALUE);
6346 mRemote.transact(STOP_BINDER_TRACKING_AND_DUMP_TRANSACTION, data, reply, 0);
6347 reply.readException();
6348 boolean res = reply.readInt() != 0;
6354 public int setVrMode(IBinder token, boolean enabled, ComponentName packageName)
6355 throws RemoteException {
6356 Parcel data = Parcel.obtain();
6357 Parcel reply = Parcel.obtain();
6358 data.writeInterfaceToken(IActivityManager.descriptor);
6359 data.writeStrongBinder(token);
6360 data.writeInt(enabled ? 1 : 0);
6361 packageName.writeToParcel(data, 0);
6362 mRemote.transact(SET_VR_MODE_TRANSACTION, data, reply, 0);
6363 reply.readException();
6364 int res = reply.readInt();
6370 public boolean isVrModePackageEnabled(ComponentName packageName)
6371 throws RemoteException {
6372 Parcel data = Parcel.obtain();
6373 Parcel reply = Parcel.obtain();
6374 data.writeInterfaceToken(IActivityManager.descriptor);
6375 packageName.writeToParcel(data, 0);
6376 mRemote.transact(IS_VR_PACKAGE_ENABLED_TRANSACTION, data, reply, 0);
6377 reply.readException();
6378 int res = reply.readInt();
6385 public IActivityContainer createStackOnDisplay(int displayId) throws RemoteException {
6386 Parcel data = Parcel.obtain();
6387 Parcel reply = Parcel.obtain();
6388 data.writeInterfaceToken(IActivityManager.descriptor);
6389 data.writeInt(displayId);
6390 mRemote.transact(CREATE_STACK_ON_DISPLAY, data, reply, 0);
6391 reply.readException();
6392 final int result = reply.readInt();
6393 final IActivityContainer res;
6395 res = IActivityContainer.Stub.asInterface(reply.readStrongBinder());
6405 public int getActivityDisplayId(IBinder activityToken)
6406 throws RemoteException {
6407 Parcel data = Parcel.obtain();
6408 Parcel reply = Parcel.obtain();
6409 data.writeInterfaceToken(IActivityManager.descriptor);
6410 data.writeStrongBinder(activityToken);
6411 mRemote.transact(GET_ACTIVITY_DISPLAY_ID_TRANSACTION, data, reply, 0);
6412 reply.readException();
6413 final int displayId = reply.readInt();
6420 public void startLockTaskMode(int taskId) throws RemoteException {
6421 Parcel data = Parcel.obtain();
6422 Parcel reply = Parcel.obtain();
6423 data.writeInterfaceToken(IActivityManager.descriptor);
6424 data.writeInt(taskId);
6425 mRemote.transact(START_LOCK_TASK_BY_TASK_ID_TRANSACTION, data, reply, 0);
6426 reply.readException();
6432 public void startLockTaskMode(IBinder token) throws RemoteException {
6433 Parcel data = Parcel.obtain();
6434 Parcel reply = Parcel.obtain();
6435 data.writeInterfaceToken(IActivityManager.descriptor);
6436 data.writeStrongBinder(token);
6437 mRemote.transact(START_LOCK_TASK_BY_TOKEN_TRANSACTION, data, reply, 0);
6438 reply.readException();
6444 public void startSystemLockTaskMode(int taskId) throws RemoteException {
6445 Parcel data = Parcel.obtain();
6446 Parcel reply = Parcel.obtain();
6447 data.writeInterfaceToken(IActivityManager.descriptor);
6448 data.writeInt(taskId);
6449 mRemote.transact(START_SYSTEM_LOCK_TASK_TRANSACTION, data, reply, 0);
6450 reply.readException();
6456 public void stopLockTaskMode() throws RemoteException {
6457 Parcel data = Parcel.obtain();
6458 Parcel reply = Parcel.obtain();
6459 data.writeInterfaceToken(IActivityManager.descriptor);
6460 mRemote.transact(STOP_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
6461 reply.readException();
6467 public void stopSystemLockTaskMode() throws RemoteException {
6468 Parcel data = Parcel.obtain();
6469 Parcel reply = Parcel.obtain();
6470 data.writeInterfaceToken(IActivityManager.descriptor);
6471 mRemote.transact(STOP_SYSTEM_LOCK_TASK_TRANSACTION, data, reply, 0);
6472 reply.readException();
6478 public boolean isInLockTaskMode() throws RemoteException {
6479 Parcel data = Parcel.obtain();
6480 Parcel reply = Parcel.obtain();
6481 data.writeInterfaceToken(IActivityManager.descriptor);
6482 mRemote.transact(IS_IN_LOCK_TASK_MODE_TRANSACTION, data, reply, 0);
6483 reply.readException();
6484 boolean isInLockTaskMode = reply.readInt() == 1;
6487 return isInLockTaskMode;
6491 public int getLockTaskModeState() throws RemoteException {
6492 Parcel data = Parcel.obtain();
6493 Parcel reply = Parcel.obtain();
6494 data.writeInterfaceToken(IActivityManager.descriptor);
6495 mRemote.transact(GET_LOCK_TASK_MODE_STATE_TRANSACTION, data, reply, 0);
6496 reply.readException();
6497 int lockTaskModeState = reply.readInt();
6500 return lockTaskModeState;
6504 public void showLockTaskEscapeMessage(IBinder token) throws RemoteException {
6505 Parcel data = Parcel.obtain();
6506 Parcel reply = Parcel.obtain();
6507 data.writeInterfaceToken(IActivityManager.descriptor);
6508 data.writeStrongBinder(token);
6509 mRemote.transact(SHOW_LOCK_TASK_ESCAPE_MESSAGE_TRANSACTION, data, reply,
6510 IBinder.FLAG_ONEWAY);
6511 reply.readException();
6517 public void setTaskDescription(IBinder token, ActivityManager.TaskDescription values)
6518 throws RemoteException {
6519 Parcel data = Parcel.obtain();
6520 Parcel reply = Parcel.obtain();
6521 data.writeInterfaceToken(IActivityManager.descriptor);
6522 data.writeStrongBinder(token);
6523 values.writeToParcel(data, 0);
6524 mRemote.transact(SET_TASK_DESCRIPTION_TRANSACTION, data, reply, 0);
6525 reply.readException();
6531 public void setTaskResizeable(int taskId, int resizeableMode) throws RemoteException {
6532 Parcel data = Parcel.obtain();
6533 Parcel reply = Parcel.obtain();
6534 data.writeInterfaceToken(IActivityManager.descriptor);
6535 data.writeInt(taskId);
6536 data.writeInt(resizeableMode);
6537 mRemote.transact(SET_TASK_RESIZEABLE_TRANSACTION, data, reply, 0);
6538 reply.readException();
6544 public void resizeTask(int taskId, Rect r, int resizeMode) throws RemoteException
6546 Parcel data = Parcel.obtain();
6547 Parcel reply = Parcel.obtain();
6548 data.writeInterfaceToken(IActivityManager.descriptor);
6549 data.writeInt(taskId);
6550 data.writeInt(resizeMode);
6551 r.writeToParcel(data, 0);
6552 mRemote.transact(RESIZE_TASK_TRANSACTION, data, reply, 0);
6553 reply.readException();
6559 public Rect getTaskBounds(int taskId) throws RemoteException
6561 Parcel data = Parcel.obtain();
6562 Parcel reply = Parcel.obtain();
6563 data.writeInterfaceToken(IActivityManager.descriptor);
6564 data.writeInt(taskId);
6565 mRemote.transact(GET_TASK_BOUNDS_TRANSACTION, data, reply, 0);
6566 reply.readException();
6567 Rect rect = Rect.CREATOR.createFromParcel(reply);
6574 public Bitmap getTaskDescriptionIcon(String filename, int userId) throws RemoteException {
6575 Parcel data = Parcel.obtain();
6576 Parcel reply = Parcel.obtain();
6577 data.writeInterfaceToken(IActivityManager.descriptor);
6578 data.writeString(filename);
6579 data.writeInt(userId);
6580 mRemote.transact(GET_TASK_DESCRIPTION_ICON_TRANSACTION, data, reply, 0);
6581 reply.readException();
6582 final Bitmap icon = reply.readInt() == 0 ? null : Bitmap.CREATOR.createFromParcel(reply);
6589 public void startInPlaceAnimationOnFrontMostApplication(ActivityOptions options)
6590 throws RemoteException {
6591 Parcel data = Parcel.obtain();
6592 Parcel reply = Parcel.obtain();
6593 data.writeInterfaceToken(IActivityManager.descriptor);
6594 if (options == null) {
6598 data.writeBundle(options.toBundle());
6600 mRemote.transact(START_IN_PLACE_ANIMATION_TRANSACTION, data, reply, 0);
6601 reply.readException();
6607 public boolean requestVisibleBehind(IBinder token, boolean visible) throws RemoteException {
6608 Parcel data = Parcel.obtain();
6609 Parcel reply = Parcel.obtain();
6610 data.writeInterfaceToken(IActivityManager.descriptor);
6611 data.writeStrongBinder(token);
6612 data.writeInt(visible ? 1 : 0);
6613 mRemote.transact(REQUEST_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
6614 reply.readException();
6615 boolean success = reply.readInt() > 0;
6622 public boolean isBackgroundVisibleBehind(IBinder token) throws RemoteException {
6623 Parcel data = Parcel.obtain();
6624 Parcel reply = Parcel.obtain();
6625 data.writeInterfaceToken(IActivityManager.descriptor);
6626 data.writeStrongBinder(token);
6627 mRemote.transact(IS_BACKGROUND_VISIBLE_BEHIND_TRANSACTION, data, reply, 0);
6628 reply.readException();
6629 final boolean visible = reply.readInt() > 0;
6636 public void backgroundResourcesReleased(IBinder token) throws RemoteException {
6637 Parcel data = Parcel.obtain();
6638 Parcel reply = Parcel.obtain();
6639 data.writeInterfaceToken(IActivityManager.descriptor);
6640 data.writeStrongBinder(token);
6641 mRemote.transact(BACKGROUND_RESOURCES_RELEASED_TRANSACTION, data, reply, 0);
6642 reply.readException();
6648 public void notifyLaunchTaskBehindComplete(IBinder token) throws RemoteException {
6649 Parcel data = Parcel.obtain();
6650 Parcel reply = Parcel.obtain();
6651 data.writeInterfaceToken(IActivityManager.descriptor);
6652 data.writeStrongBinder(token);
6653 mRemote.transact(NOTIFY_LAUNCH_TASK_BEHIND_COMPLETE_TRANSACTION, data, reply, 0);
6654 reply.readException();
6660 public void notifyEnterAnimationComplete(IBinder token) throws RemoteException {
6661 Parcel data = Parcel.obtain();
6662 Parcel reply = Parcel.obtain();
6663 data.writeInterfaceToken(IActivityManager.descriptor);
6664 data.writeStrongBinder(token);
6665 mRemote.transact(NOTIFY_ENTER_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
6666 reply.readException();
6672 public void bootAnimationComplete() throws RemoteException {
6673 Parcel data = Parcel.obtain();
6674 Parcel reply = Parcel.obtain();
6675 data.writeInterfaceToken(IActivityManager.descriptor);
6676 mRemote.transact(BOOT_ANIMATION_COMPLETE_TRANSACTION, data, reply, 0);
6677 reply.readException();
6683 public void notifyCleartextNetwork(int uid, byte[] firstPacket) throws RemoteException {
6684 Parcel data = Parcel.obtain();
6685 Parcel reply = Parcel.obtain();
6686 data.writeInterfaceToken(IActivityManager.descriptor);
6688 data.writeByteArray(firstPacket);
6689 mRemote.transact(NOTIFY_CLEARTEXT_NETWORK_TRANSACTION, data, reply, 0);
6690 reply.readException();
6696 public void setDumpHeapDebugLimit(String processName, int uid, long maxMemSize,
6697 String reportPackage) throws RemoteException {
6698 Parcel data = Parcel.obtain();
6699 Parcel reply = Parcel.obtain();
6700 data.writeInterfaceToken(IActivityManager.descriptor);
6701 data.writeString(processName);
6703 data.writeLong(maxMemSize);
6704 data.writeString(reportPackage);
6705 mRemote.transact(SET_DUMP_HEAP_DEBUG_LIMIT_TRANSACTION, data, reply, 0);
6706 reply.readException();
6712 public void dumpHeapFinished(String path) throws RemoteException {
6713 Parcel data = Parcel.obtain();
6714 Parcel reply = Parcel.obtain();
6715 data.writeInterfaceToken(IActivityManager.descriptor);
6716 data.writeString(path);
6717 mRemote.transact(DUMP_HEAP_FINISHED_TRANSACTION, data, reply, 0);
6718 reply.readException();
6724 public void setVoiceKeepAwake(IVoiceInteractionSession session, boolean keepAwake)
6725 throws RemoteException {
6726 Parcel data = Parcel.obtain();
6727 Parcel reply = Parcel.obtain();
6728 data.writeInterfaceToken(IActivityManager.descriptor);
6729 data.writeStrongBinder(session.asBinder());
6730 data.writeInt(keepAwake ? 1 : 0);
6731 mRemote.transact(SET_VOICE_KEEP_AWAKE_TRANSACTION, data, reply, 0);
6732 reply.readException();
6738 public void updateLockTaskPackages(int userId, String[] packages) throws RemoteException {
6739 Parcel data = Parcel.obtain();
6740 Parcel reply = Parcel.obtain();
6741 data.writeInterfaceToken(IActivityManager.descriptor);
6742 data.writeInt(userId);
6743 data.writeStringArray(packages);
6744 mRemote.transact(UPDATE_LOCK_TASK_PACKAGES_TRANSACTION, data, reply, 0);
6745 reply.readException();
6751 public void updateDeviceOwner(String packageName) throws RemoteException {
6752 Parcel data = Parcel.obtain();
6753 Parcel reply = Parcel.obtain();
6754 data.writeInterfaceToken(IActivityManager.descriptor);
6755 data.writeString(packageName);
6756 mRemote.transact(UPDATE_DEVICE_OWNER_TRANSACTION, data, reply, 0);
6757 reply.readException();
6763 public int getPackageProcessState(String packageName, String callingPackage)
6764 throws RemoteException {
6765 Parcel data = Parcel.obtain();
6766 Parcel reply = Parcel.obtain();
6767 data.writeInterfaceToken(IActivityManager.descriptor);
6768 data.writeString(packageName);
6769 data.writeString(callingPackage);
6770 mRemote.transact(GET_PACKAGE_PROCESS_STATE_TRANSACTION, data, reply, 0);
6771 reply.readException();
6772 int res = reply.readInt();
6779 public boolean setProcessMemoryTrimLevel(String process, int userId, int level)
6780 throws RemoteException {
6781 Parcel data = Parcel.obtain();
6782 Parcel reply = Parcel.obtain();
6783 data.writeInterfaceToken(IActivityManager.descriptor);
6784 data.writeString(process);
6785 data.writeInt(userId);
6786 data.writeInt(level);
6787 mRemote.transact(SET_PROCESS_MEMORY_TRIM_TRANSACTION, data, reply, 0);
6788 reply.readException();
6789 int res = reply.readInt();
6796 public boolean isRootVoiceInteraction(IBinder token) throws RemoteException {
6797 Parcel data = Parcel.obtain();
6798 Parcel reply = Parcel.obtain();
6799 data.writeInterfaceToken(IActivityManager.descriptor);
6800 data.writeStrongBinder(token);
6801 mRemote.transact(IS_ROOT_VOICE_INTERACTION_TRANSACTION, data, reply, 0);
6802 reply.readException();
6803 int res = reply.readInt();
6810 public void exitFreeformMode(IBinder token) throws RemoteException {
6811 Parcel data = Parcel.obtain();
6812 Parcel reply = Parcel.obtain();
6813 data.writeInterfaceToken(IActivityManager.descriptor);
6814 data.writeStrongBinder(token);
6815 mRemote.transact(EXIT_FREEFORM_MODE_TRANSACTION, data, reply, 0);
6816 reply.readException();
6822 public int getActivityStackId(IBinder token) throws RemoteException {
6823 Parcel data = Parcel.obtain();
6824 Parcel reply = Parcel.obtain();
6825 data.writeInterfaceToken(IActivityManager.descriptor);
6826 data.writeStrongBinder(token);
6827 mRemote.transact(GET_ACTIVITY_STACK_ID_TRANSACTION, data, reply, 0);
6828 reply.readException();
6829 int stackId = reply.readInt();
6836 public void reportSizeConfigurations(IBinder token, int[] horizontalSizeConfiguration,
6837 int[] verticalSizeConfigurations, int[] smallestSizeConfigurations)
6838 throws RemoteException {
6839 Parcel data = Parcel.obtain();
6840 Parcel reply = Parcel.obtain();
6841 data.writeInterfaceToken(IActivityManager.descriptor);
6842 data.writeStrongBinder(token);
6843 writeIntArray(horizontalSizeConfiguration, data);
6844 writeIntArray(verticalSizeConfigurations, data);
6845 writeIntArray(smallestSizeConfigurations, data);
6846 mRemote.transact(REPORT_SIZE_CONFIGURATIONS, data, reply, 0);
6847 reply.readException();
6852 private static void writeIntArray(int[] array, Parcel data) {
6853 if (array == null) {
6856 data.writeInt(array.length);
6857 data.writeIntArray(array);
6862 public void suppressResizeConfigChanges(boolean suppress) throws RemoteException {
6863 Parcel data = Parcel.obtain();
6864 Parcel reply = Parcel.obtain();
6865 data.writeInterfaceToken(IActivityManager.descriptor);
6866 data.writeInt(suppress ? 1 : 0);
6867 mRemote.transact(SUPPRESS_RESIZE_CONFIG_CHANGES_TRANSACTION, data, reply, 0);
6868 reply.readException();
6874 public void moveTasksToFullscreenStack(int fromStackId, boolean onTop) throws RemoteException {
6875 Parcel data = Parcel.obtain();
6876 Parcel reply = Parcel.obtain();
6877 data.writeInterfaceToken(IActivityManager.descriptor);
6878 data.writeInt(fromStackId);
6879 data.writeInt(onTop ? 1 : 0);
6880 mRemote.transact(MOVE_TASKS_TO_FULLSCREEN_STACK_TRANSACTION, data, reply, 0);
6881 reply.readException();
6887 public int getAppStartMode(int uid, String packageName) throws RemoteException {
6888 Parcel data = Parcel.obtain();
6889 Parcel reply = Parcel.obtain();
6890 data.writeInterfaceToken(IActivityManager.descriptor);
6892 data.writeString(packageName);
6893 mRemote.transact(GET_APP_START_MODE_TRANSACTION, data, reply, 0);
6894 reply.readException();
6895 int res = reply.readInt();
6902 public boolean isInMultiWindowMode(IBinder token) throws RemoteException {
6903 Parcel data = Parcel.obtain();
6904 Parcel reply = Parcel.obtain();
6905 data.writeInterfaceToken(IActivityManager.descriptor);
6906 data.writeStrongBinder(token);
6907 mRemote.transact(IN_MULTI_WINDOW_TRANSACTION, data, reply, 0);
6908 reply.readException();
6909 final boolean multiWindowMode = reply.readInt() == 1 ? true : false;
6912 return multiWindowMode;
6916 public boolean isInPictureInPictureMode(IBinder token) throws RemoteException {
6917 Parcel data = Parcel.obtain();
6918 Parcel reply = Parcel.obtain();
6919 data.writeInterfaceToken(IActivityManager.descriptor);
6920 data.writeStrongBinder(token);
6921 mRemote.transact(IN_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0);
6922 reply.readException();
6923 final boolean pipMode = reply.readInt() == 1 ? true : false;
6930 public void enterPictureInPictureMode(IBinder token) throws RemoteException {
6931 Parcel data = Parcel.obtain();
6932 Parcel reply = Parcel.obtain();
6933 data.writeInterfaceToken(IActivityManager.descriptor);
6934 data.writeStrongBinder(token);
6935 mRemote.transact(ENTER_PICTURE_IN_PICTURE_TRANSACTION, data, reply, 0);
6936 reply.readException();
6942 public boolean isAppForeground(int uid) throws RemoteException {
6943 Parcel data = Parcel.obtain();
6944 Parcel reply = Parcel.obtain();
6945 data.writeInterfaceToken(IActivityManager.descriptor);
6947 mRemote.transact(IS_APP_FOREGROUND_TRANSACTION, data, reply, 0);
6948 final boolean isForeground = reply.readInt() == 1 ? true : false;
6951 return isForeground;
6955 public void notifyPinnedStackAnimationEnded() throws RemoteException {
6956 Parcel data = Parcel.obtain();
6957 Parcel reply = Parcel.obtain();
6958 data.writeInterfaceToken(IActivityManager.descriptor);
6959 mRemote.transact(NOTIFY_PINNED_STACK_ANIMATION_ENDED_TRANSACTION, data, reply, 0);
6965 public void removeStack(int stackId) throws RemoteException {
6966 Parcel data = Parcel.obtain();
6967 Parcel reply = Parcel.obtain();
6968 data.writeInterfaceToken(IActivityManager.descriptor);
6969 data.writeInt(stackId);
6970 mRemote.transact(REMOVE_STACK, data, reply, 0);
6971 reply.readException();
6977 public void notifyLockedProfile(@UserIdInt int userId) throws RemoteException {
6978 Parcel data = Parcel.obtain();
6979 Parcel reply = Parcel.obtain();
6980 data.writeInterfaceToken(IActivityManager.descriptor);
6981 data.writeInt(userId);
6982 mRemote.transact(NOTIFY_LOCKED_PROFILE, data, reply, 0);
6983 reply.readException();
6989 public void startConfirmDeviceCredentialIntent(Intent intent) throws RemoteException {
6990 Parcel data = Parcel.obtain();
6991 Parcel reply = Parcel.obtain();
6992 data.writeInterfaceToken(IActivityManager.descriptor);
6993 intent.writeToParcel(data, 0);
6994 mRemote.transact(START_CONFIRM_DEVICE_CREDENTIAL_INTENT, data, reply, 0);
6995 reply.readException();
7001 public int sendIntentSender(IIntentSender target, int code, Intent intent, String resolvedType,
7002 IIntentReceiver finishedReceiver, String requiredPermission, Bundle options)
7003 throws RemoteException {
7004 Parcel data = Parcel.obtain();
7005 Parcel reply = Parcel.obtain();
7006 data.writeInterfaceToken(IActivityManager.descriptor);
7007 data.writeStrongBinder(target.asBinder());
7008 data.writeInt(code);
7009 if ((intent!=null)) {
7011 intent.writeToParcel(data, 0);
7016 data.writeString(resolvedType);
7017 data.writeStrongBinder((((finishedReceiver!=null))?(finishedReceiver.asBinder()):(null)));
7018 data.writeString(requiredPermission);
7019 if ((options!=null)) {
7021 options.writeToParcel(data, 0);
7026 mRemote.transact(SEND_INTENT_SENDER_TRANSACTION, data, reply, 0);
7027 reply.readException();
7028 final int res = reply.readInt();
7034 private IBinder mRemote;