Home | History | Annotate | Download | only in app
      1 /*
      2  * Copyright (C) 2016 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package android.app;
     18 
     19 import android.app.ActivityManager;
     20 import android.app.ApplicationErrorReport;
     21 import android.app.ContentProviderHolder;
     22 import android.app.GrantedUriPermission;
     23 import android.app.IApplicationThread;
     24 import android.app.IActivityController;
     25 import android.app.IAppTask;
     26 import android.app.IAssistDataReceiver;
     27 import android.app.IInstrumentationWatcher;
     28 import android.app.IProcessObserver;
     29 import android.app.IServiceConnection;
     30 import android.app.IStopUserCallback;
     31 import android.app.ITaskStackListener;
     32 import android.app.IUiAutomationConnection;
     33 import android.app.IUidObserver;
     34 import android.app.IUserSwitchObserver;
     35 import android.app.Notification;
     36 import android.app.PendingIntent;
     37 import android.app.PictureInPictureParams;
     38 import android.app.ProfilerInfo;
     39 import android.app.WaitResult;
     40 import android.app.assist.AssistContent;
     41 import android.app.assist.AssistStructure;
     42 import android.content.ComponentName;
     43 import android.content.IIntentReceiver;
     44 import android.content.IIntentSender;
     45 import android.content.Intent;
     46 import android.content.IntentFilter;
     47 import android.content.IntentSender;
     48 import android.content.pm.ApplicationInfo;
     49 import android.content.pm.ConfigurationInfo;
     50 import android.content.pm.IPackageDataObserver;
     51 import android.content.pm.ParceledListSlice;
     52 import android.content.pm.ProviderInfo;
     53 import android.content.pm.UserInfo;
     54 import android.content.res.Configuration;
     55 import android.graphics.Bitmap;
     56 import android.graphics.GraphicBuffer;
     57 import android.graphics.Point;
     58 import android.graphics.Rect;
     59 import android.net.Uri;
     60 import android.os.Bundle;
     61 import android.os.Debug;
     62 import android.os.IBinder;
     63 import android.os.IProgressListener;
     64 import android.os.ParcelFileDescriptor;
     65 import android.os.PersistableBundle;
     66 import android.os.RemoteCallback;
     67 import android.os.StrictMode;
     68 import android.os.WorkSource;
     69 import android.service.voice.IVoiceInteractionSession;
     70 import android.view.IRecentsAnimationRunner;
     71 import android.view.RemoteAnimationDefinition;
     72 import android.view.RemoteAnimationAdapter;
     73 import com.android.internal.app.IVoiceInteractor;
     74 import com.android.internal.os.IResultReceiver;
     75 import com.android.internal.policy.IKeyguardDismissCallback;
     76 
     77 import java.util.List;
     78 
     79 /**
     80  * System private API for talking with the activity manager service.  This
     81  * provides calls from the application back to the activity manager.
     82  *
     83  * {@hide}
     84  */
     85 interface IActivityManager {
     86     // WARNING: when these transactions are updated, check if they are any callers on the native
     87     // side. If so, make sure they are using the correct transaction ids and arguments.
     88     // If a transaction which will also be used on the native side is being inserted, add it to
     89     // below block of transactions.
     90 
     91     // Since these transactions are also called from native code, these must be kept in sync with
     92     // the ones in frameworks/native/libs/binder/include/binder/IActivityManager.h
     93     // =============== Beginning of transactions used on native side as well ======================
     94     ParcelFileDescriptor openContentUri(in String uriString);
     95     void registerUidObserver(in IUidObserver observer, int which, int cutpoint,
     96             String callingPackage);
     97     void unregisterUidObserver(in IUidObserver observer);
     98     boolean isUidActive(int uid, String callingPackage);
     99     int getUidProcessState(int uid, in String callingPackage);
    100     // =============== End of transactions used on native side as well ============================
    101 
    102     // Special low-level communication with activity manager.
    103     void handleApplicationCrash(in IBinder app,
    104             in ApplicationErrorReport.ParcelableCrashInfo crashInfo);
    105     @UnsupportedAppUsage
    106     int startActivity(in IApplicationThread caller, in String callingPackage, in Intent intent,
    107             in String resolvedType, in IBinder resultTo, in String resultWho, int requestCode,
    108             int flags, in ProfilerInfo profilerInfo, in Bundle options);
    109     @UnsupportedAppUsage
    110     void unhandledBack();
    111     @UnsupportedAppUsage
    112     boolean finishActivity(in IBinder token, int code, in Intent data, int finishTask);
    113     @UnsupportedAppUsage
    114     Intent registerReceiver(in IApplicationThread caller, in String callerPackage,
    115             in IIntentReceiver receiver, in IntentFilter filter,
    116             in String requiredPermission, int userId, int flags);
    117     @UnsupportedAppUsage
    118     void unregisterReceiver(in IIntentReceiver receiver);
    119     @UnsupportedAppUsage
    120     int broadcastIntent(in IApplicationThread caller, in Intent intent,
    121             in String resolvedType, in IIntentReceiver resultTo, int resultCode,
    122             in String resultData, in Bundle map, in String[] requiredPermissions,
    123             int appOp, in Bundle options, boolean serialized, boolean sticky, int userId);
    124     void unbroadcastIntent(in IApplicationThread caller, in Intent intent, int userId);
    125     oneway void finishReceiver(in IBinder who, int resultCode, in String resultData, in Bundle map,
    126             boolean abortBroadcast, int flags);
    127     void attachApplication(in IApplicationThread app, long startSeq);
    128     List<ActivityManager.RunningTaskInfo> getTasks(int maxNum);
    129     @UnsupportedAppUsage
    130     List<ActivityManager.RunningTaskInfo> getFilteredTasks(int maxNum, int ignoreActivityType,
    131             int ignoreWindowingMode);
    132     @UnsupportedAppUsage
    133     void moveTaskToFront(in IApplicationThread caller, in String callingPackage, int task,
    134             int flags, in Bundle options);
    135     @UnsupportedAppUsage
    136     int getTaskForActivity(in IBinder token, in boolean onlyRoot);
    137     ContentProviderHolder getContentProvider(in IApplicationThread caller, in String callingPackage,
    138             in String name, int userId, boolean stable);
    139     @UnsupportedAppUsage
    140     void publishContentProviders(in IApplicationThread caller,
    141             in List<ContentProviderHolder> providers);
    142     boolean refContentProvider(in IBinder connection, int stableDelta, int unstableDelta);
    143     PendingIntent getRunningServiceControlPanel(in ComponentName service);
    144     ComponentName startService(in IApplicationThread caller, in Intent service,
    145             in String resolvedType, boolean requireForeground, in String callingPackage, int userId);
    146     @UnsupportedAppUsage
    147     int stopService(in IApplicationThread caller, in Intent service,
    148             in String resolvedType, int userId);
    149     // Currently keeping old bindService because it is on the greylist
    150     @UnsupportedAppUsage
    151     int bindService(in IApplicationThread caller, in IBinder token, in Intent service,
    152             in String resolvedType, in IServiceConnection connection, int flags,
    153             in String callingPackage, int userId);
    154     int bindIsolatedService(in IApplicationThread caller, in IBinder token, in Intent service,
    155             in String resolvedType, in IServiceConnection connection, int flags,
    156             in String instanceName, in String callingPackage, int userId);
    157     void updateServiceGroup(in IServiceConnection connection, int group, int importance);
    158     @UnsupportedAppUsage
    159     boolean unbindService(in IServiceConnection connection);
    160     void publishService(in IBinder token, in Intent intent, in IBinder service);
    161     @UnsupportedAppUsage
    162     void setDebugApp(in String packageName, boolean waitForDebugger, boolean persistent);
    163     void setAgentApp(in String packageName, @nullable String agent);
    164     @UnsupportedAppUsage
    165     void setAlwaysFinish(boolean enabled);
    166     @UnsupportedAppUsage
    167     boolean startInstrumentation(in ComponentName className, in String profileFile,
    168             int flags, in Bundle arguments, in IInstrumentationWatcher watcher,
    169             in IUiAutomationConnection connection, int userId,
    170             in String abiOverride);
    171     void addInstrumentationResults(in IApplicationThread target, in Bundle results);
    172     void finishInstrumentation(in IApplicationThread target, int resultCode,
    173             in Bundle results);
    174     /**
    175      * @return A copy of global {@link Configuration}, contains general settings for the entire
    176      *         system. Corresponds to the configuration of the default display.
    177      * @throws RemoteException
    178      */
    179     @UnsupportedAppUsage
    180     Configuration getConfiguration();
    181     /**
    182      * Updates global configuration and applies changes to the entire system.
    183      * @param values Update values for global configuration. If null is passed it will request the
    184      *               Window Manager to compute new config for the default display.
    185      * @throws RemoteException
    186      * @return Returns true if the configuration was updated.
    187      */
    188     @UnsupportedAppUsage
    189     boolean updateConfiguration(in Configuration values);
    190     boolean stopServiceToken(in ComponentName className, in IBinder token, int startId);
    191     @UnsupportedAppUsage
    192     void setProcessLimit(int max);
    193     @UnsupportedAppUsage
    194     int getProcessLimit();
    195     @UnsupportedAppUsage
    196     int checkPermission(in String permission, int pid, int uid);
    197     int checkUriPermission(in Uri uri, int pid, int uid, int mode, int userId,
    198             in IBinder callerToken);
    199     void grantUriPermission(in IApplicationThread caller, in String targetPkg, in Uri uri,
    200             int mode, int userId);
    201     void revokeUriPermission(in IApplicationThread caller, in String targetPkg, in Uri uri,
    202             int mode, int userId);
    203     @UnsupportedAppUsage
    204     void setActivityController(in IActivityController watcher, boolean imAMonkey);
    205     void showWaitingForDebugger(in IApplicationThread who, boolean waiting);
    206     /*
    207      * This will deliver the specified signal to all the persistent processes. Currently only
    208      * SIGUSR1 is delivered. All others are ignored.
    209      */
    210     void signalPersistentProcesses(int signal);
    211 
    212     @UnsupportedAppUsage
    213     ParceledListSlice getRecentTasks(int maxNum, int flags, int userId);
    214     oneway void serviceDoneExecuting(in IBinder token, int type, int startId, int res);
    215     @UnsupportedAppUsage
    216     IIntentSender getIntentSender(int type, in String packageName, in IBinder token,
    217             in String resultWho, int requestCode, in Intent[] intents, in String[] resolvedTypes,
    218             int flags, in Bundle options, int userId);
    219     void cancelIntentSender(in IIntentSender sender);
    220     String getPackageForIntentSender(in IIntentSender sender);
    221     void registerIntentSenderCancelListener(in IIntentSender sender, in IResultReceiver receiver);
    222     void unregisterIntentSenderCancelListener(in IIntentSender sender, in IResultReceiver receiver);
    223     void enterSafeMode();
    224     void noteWakeupAlarm(in IIntentSender sender, in WorkSource workSource, int sourceUid,
    225             in String sourcePkg, in String tag);
    226     oneway void removeContentProvider(in IBinder connection, boolean stable);
    227     @UnsupportedAppUsage
    228     void setRequestedOrientation(in IBinder token, int requestedOrientation);
    229     void unbindFinished(in IBinder token, in Intent service, boolean doRebind);
    230     @UnsupportedAppUsage
    231     void setProcessImportant(in IBinder token, int pid, boolean isForeground, String reason);
    232     void setServiceForeground(in ComponentName className, in IBinder token,
    233             int id, in Notification notification, int flags, int foregroundServiceType);
    234     int getForegroundServiceType(in ComponentName className, in IBinder token);
    235     @UnsupportedAppUsage
    236     boolean moveActivityTaskToBack(in IBinder token, boolean nonRoot);
    237     @UnsupportedAppUsage
    238     void getMemoryInfo(out ActivityManager.MemoryInfo outInfo);
    239     List<ActivityManager.ProcessErrorStateInfo> getProcessesInErrorState();
    240     boolean clearApplicationUserData(in String packageName, boolean keepState,
    241             in IPackageDataObserver observer, int userId);
    242     @UnsupportedAppUsage
    243     void forceStopPackage(in String packageName, int userId);
    244     boolean killPids(in int[] pids, in String reason, boolean secure);
    245     @UnsupportedAppUsage
    246     List<ActivityManager.RunningServiceInfo> getServices(int maxNum, int flags);
    247     // Retrieve running application processes in the system
    248     @UnsupportedAppUsage
    249     List<ActivityManager.RunningAppProcessInfo> getRunningAppProcesses();
    250     IBinder peekService(in Intent service, in String resolvedType, in String callingPackage);
    251     // Turn on/off profiling in a particular process.
    252     @UnsupportedAppUsage
    253     boolean profileControl(in String process, int userId, boolean start,
    254             in ProfilerInfo profilerInfo, int profileType);
    255     @UnsupportedAppUsage
    256     boolean shutdown(int timeout);
    257     @UnsupportedAppUsage
    258     void stopAppSwitches();
    259     @UnsupportedAppUsage
    260     void resumeAppSwitches();
    261     boolean bindBackupAgent(in String packageName, int backupRestoreMode, int targetUserId);
    262     void backupAgentCreated(in String packageName, in IBinder agent, int userId);
    263     void unbindBackupAgent(in ApplicationInfo appInfo);
    264     int getUidForIntentSender(in IIntentSender sender);
    265     int handleIncomingUser(int callingPid, int callingUid, int userId, boolean allowAll,
    266             boolean requireFull, in String name, in String callerPackage);
    267     void addPackageDependency(in String packageName);
    268     void killApplication(in String pkg, int appId, int userId, in String reason);
    269     @UnsupportedAppUsage
    270     void closeSystemDialogs(in String reason);
    271     @UnsupportedAppUsage
    272     Debug.MemoryInfo[] getProcessMemoryInfo(in int[] pids);
    273     void killApplicationProcess(in String processName, int uid);
    274     // Special low-level communication with activity manager.
    275     boolean handleApplicationWtf(in IBinder app, in String tag, boolean system,
    276             in ApplicationErrorReport.ParcelableCrashInfo crashInfo);
    277     @UnsupportedAppUsage
    278     void killBackgroundProcesses(in String packageName, int userId);
    279     boolean isUserAMonkey();
    280     // Retrieve info of applications installed on external media that are currently
    281     // running.
    282     List<ApplicationInfo> getRunningExternalApplications();
    283     @UnsupportedAppUsage
    284     void finishHeavyWeightApp();
    285     // A StrictMode violation to be handled.
    286     @UnsupportedAppUsage
    287     void handleApplicationStrictModeViolation(in IBinder app, int penaltyMask,
    288             in StrictMode.ViolationInfo crashInfo);
    289     boolean isTopActivityImmersive();
    290     void crashApplication(int uid, int initialPid, in String packageName, int userId, in String message);
    291     @UnsupportedAppUsage
    292     String getProviderMimeType(in Uri uri, int userId);
    293     // Cause the specified process to dump the specified heap.
    294     boolean dumpHeap(in String process, int userId, boolean managed, boolean mallocInfo,
    295             boolean runGc, in String path, in ParcelFileDescriptor fd,
    296             in RemoteCallback finishCallback);
    297     @UnsupportedAppUsage
    298     boolean isUserRunning(int userid, int flags);
    299     @UnsupportedAppUsage
    300     void setPackageScreenCompatMode(in String packageName, int mode);
    301     @UnsupportedAppUsage
    302     boolean switchUser(int userid);
    303     @UnsupportedAppUsage
    304     boolean removeTask(int taskId);
    305     @UnsupportedAppUsage
    306     void registerProcessObserver(in IProcessObserver observer);
    307     @UnsupportedAppUsage
    308     void unregisterProcessObserver(in IProcessObserver observer);
    309     boolean isIntentSenderTargetedToPackage(in IIntentSender sender);
    310     @UnsupportedAppUsage
    311     void updatePersistentConfiguration(in Configuration values);
    312     @UnsupportedAppUsage
    313     long[] getProcessPss(in int[] pids);
    314     void showBootMessage(in CharSequence msg, boolean always);
    315     @UnsupportedAppUsage
    316     void killAllBackgroundProcesses();
    317     ContentProviderHolder getContentProviderExternal(in String name, int userId,
    318             in IBinder token, String tag);
    319     /** @deprecated - Use {@link #removeContentProviderExternalAsUser} which takes a user ID. */
    320     @UnsupportedAppUsage
    321     void removeContentProviderExternal(in String name, in IBinder token);
    322     void removeContentProviderExternalAsUser(in String name, in IBinder token, int userId);
    323     // Get memory information about the calling process.
    324     void getMyMemoryState(out ActivityManager.RunningAppProcessInfo outInfo);
    325     boolean killProcessesBelowForeground(in String reason);
    326     @UnsupportedAppUsage
    327     UserInfo getCurrentUser();
    328     // This is not public because you need to be very careful in how you
    329     // manage your activity to make sure it is always the uid you expect.
    330     @UnsupportedAppUsage
    331     int getLaunchedFromUid(in IBinder activityToken);
    332     @UnsupportedAppUsage
    333     void unstableProviderDied(in IBinder connection);
    334     @UnsupportedAppUsage
    335     boolean isIntentSenderAnActivity(in IIntentSender sender);
    336     boolean isIntentSenderAForegroundService(in IIntentSender sender);
    337     boolean isIntentSenderABroadcast(in IIntentSender sender);
    338     @UnsupportedAppUsage
    339     int startActivityAsUser(in IApplicationThread caller, in String callingPackage,
    340             in Intent intent, in String resolvedType, in IBinder resultTo, in String resultWho,
    341             int requestCode, int flags, in ProfilerInfo profilerInfo,
    342             in Bundle options, int userId);
    343     @UnsupportedAppUsage
    344     int stopUser(int userid, boolean force, in IStopUserCallback callback);
    345     @UnsupportedAppUsage
    346     void registerUserSwitchObserver(in IUserSwitchObserver observer, in String name);
    347     void unregisterUserSwitchObserver(in IUserSwitchObserver observer);
    348     int[] getRunningUserIds();
    349 
    350     // Request a heap dump for the system server.
    351     void requestSystemServerHeapDump();
    352 
    353     // Deprecated - This method is only used by a few internal components and it will soon be
    354     // replaced by a proper bug report API (which will be restricted to a few, pre-defined apps).
    355     // No new code should be calling it.
    356     @UnsupportedAppUsage
    357     void requestBugReport(int bugreportType);
    358 
    359     /**
    360      *  Takes a telephony bug report and notifies the user with the title and description
    361      *  that are passed to this API as parameters
    362      *
    363      *  @param shareTitle should be a valid legible string less than 50 chars long
    364      *  @param shareDescription should be less than 91 bytes when encoded into UTF-8 format
    365      *
    366      *  @throws IllegalArgumentException if shareTitle or shareDescription is too big or if the
    367      *          paremeters cannot be encoding to an UTF-8 charset.
    368      */
    369     void requestTelephonyBugReport(in String shareTitle, in String shareDescription);
    370 
    371     /**
    372      *  Deprecated - This method is only used by Wifi, and it will soon be replaced by a proper
    373      *  bug report API.
    374      *
    375      *  Takes a minimal bugreport of Wifi-related state.
    376      *
    377      *  @param shareTitle should be a valid legible string less than 50 chars long
    378      *  @param shareDescription should be less than 91 bytes when encoded into UTF-8 format
    379      *
    380      *  @throws IllegalArgumentException if shareTitle or shareDescription is too big or if the
    381      *          parameters cannot be encoding to an UTF-8 charset.
    382      */
    383     void requestWifiBugReport(in String shareTitle, in String shareDescription);
    384 
    385     @UnsupportedAppUsage
    386     Intent getIntentForIntentSender(in IIntentSender sender);
    387     // This is not public because you need to be very careful in how you
    388     // manage your activity to make sure it is always the uid you expect.
    389     @UnsupportedAppUsage
    390     String getLaunchedFromPackage(in IBinder activityToken);
    391     void killUid(int appId, int userId, in String reason);
    392     void setUserIsMonkey(boolean monkey);
    393     @UnsupportedAppUsage
    394     void hang(in IBinder who, boolean allowRestart);
    395 
    396     @UnsupportedAppUsage
    397     List<ActivityManager.StackInfo> getAllStackInfos();
    398     @UnsupportedAppUsage
    399     void moveTaskToStack(int taskId, int stackId, boolean toTop);
    400     /**
    401      * Resizes the input stack id to the given bounds.
    402      *
    403      * @param stackId Id of the stack to resize.
    404      * @param bounds Bounds to resize the stack to or {@code null} for fullscreen.
    405      * @param allowResizeInDockedMode True if the resize should be allowed when the docked stack is
    406      *                                active.
    407      * @param preserveWindows True if the windows of activities contained in the stack should be
    408      *                        preserved.
    409      * @param animate True if the stack resize should be animated.
    410      * @param animationDuration The duration of the resize animation in milliseconds or -1 if the
    411      *                          default animation duration should be used.
    412      * @throws RemoteException
    413      */
    414     @UnsupportedAppUsage
    415     void resizeStack(int stackId, in Rect bounds, boolean allowResizeInDockedMode,
    416             boolean preserveWindows, boolean animate, int animationDuration);
    417     void setFocusedStack(int stackId);
    418     ActivityManager.StackInfo getFocusedStackInfo();
    419     @UnsupportedAppUsage
    420     void restart();
    421     void performIdleMaintenance();
    422     void appNotRespondingViaProvider(in IBinder connection);
    423     @UnsupportedAppUsage
    424     Rect getTaskBounds(int taskId);
    425     @UnsupportedAppUsage
    426     boolean setProcessMemoryTrimLevel(in String process, int uid, int level);
    427 
    428 
    429     // Start of L transactions
    430     String getTagForIntentSender(in IIntentSender sender, in String prefix);
    431     @UnsupportedAppUsage
    432     boolean startUserInBackground(int userid);
    433     @UnsupportedAppUsage
    434     boolean isInLockTaskMode();
    435     @UnsupportedAppUsage
    436     void startRecentsActivity(in Intent intent, in IAssistDataReceiver assistDataReceiver,
    437             in IRecentsAnimationRunner recentsAnimationRunner);
    438     @UnsupportedAppUsage
    439     void cancelRecentsAnimation(boolean restoreHomeStackPosition);
    440     @UnsupportedAppUsage
    441     int startActivityFromRecents(int taskId, in Bundle options);
    442     @UnsupportedAppUsage
    443     void startSystemLockTaskMode(int taskId);
    444     @UnsupportedAppUsage
    445     boolean isTopOfTask(in IBinder token);
    446     void bootAnimationComplete();
    447     int checkPermissionWithToken(in String permission, int pid, int uid,
    448             in IBinder callerToken);
    449     @UnsupportedAppUsage
    450     void registerTaskStackListener(in ITaskStackListener listener);
    451     void unregisterTaskStackListener(in ITaskStackListener listener);
    452     void notifyCleartextNetwork(int uid, in byte[] firstPacket);
    453     @UnsupportedAppUsage
    454     void setTaskResizeable(int taskId, int resizeableMode);
    455     @UnsupportedAppUsage
    456     void resizeTask(int taskId, in Rect bounds, int resizeMode);
    457     @UnsupportedAppUsage
    458     int getLockTaskModeState();
    459     @UnsupportedAppUsage
    460     void setDumpHeapDebugLimit(in String processName, int uid, long maxMemSize,
    461             in String reportPackage);
    462     void dumpHeapFinished(in String path);
    463     void updateLockTaskPackages(int userId, in String[] packages);
    464     void noteAlarmStart(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String tag);
    465     void noteAlarmFinish(in IIntentSender sender, in WorkSource workSource, int sourceUid, in String tag);
    466     @UnsupportedAppUsage
    467     int getPackageProcessState(in String packageName, in String callingPackage);
    468     void updateDeviceOwner(in String packageName);
    469 
    470     // Start of N transactions
    471     // Start Binder transaction tracking for all applications.
    472     @UnsupportedAppUsage
    473     boolean startBinderTracking();
    474     // Stop Binder transaction tracking for all applications and dump trace data to the given file
    475     // descriptor.
    476     @UnsupportedAppUsage
    477     boolean stopBinderTrackingAndDump(in ParcelFileDescriptor fd);
    478     /**
    479      * Try to place task to provided position. The final position might be different depending on
    480      * current user and stacks state. The task will be moved to target stack if it's currently in
    481      * different stack.
    482      */
    483     @UnsupportedAppUsage
    484     void positionTaskInStack(int taskId, int stackId, int position);
    485     @UnsupportedAppUsage
    486     void suppressResizeConfigChanges(boolean suppress);
    487     @UnsupportedAppUsage
    488     boolean moveTopActivityToPinnedStack(int stackId, in Rect bounds);
    489     boolean isAppStartModeDisabled(int uid, in String packageName);
    490     @UnsupportedAppUsage
    491     boolean unlockUser(int userid, in byte[] token, in byte[] secret,
    492             in IProgressListener listener);
    493     void killPackageDependents(in String packageName, int userId);
    494     /**
    495      * Resizes the docked stack, and all other stacks as the result of the dock stack bounds change.
    496      *
    497      * @param dockedBounds The bounds for the docked stack.
    498      * @param tempDockedTaskBounds The temporary bounds for the tasks in the docked stack, which
    499      *                             might be different from the stack bounds to allow more
    500      *                             flexibility while resizing, or {@code null} if they should be the
    501      *                             same as the stack bounds.
    502      * @param tempDockedTaskInsetBounds The temporary bounds for the tasks to calculate the insets.
    503      *                                  When resizing, we usually "freeze" the layout of a task. To
    504      *                                  achieve that, we also need to "freeze" the insets, which
    505      *                                  gets achieved by changing task bounds but not bounds used
    506      *                                  to calculate the insets in this transient state
    507      * @param tempOtherTaskBounds The temporary bounds for the tasks in all other stacks, or
    508      *                            {@code null} if they should be the same as the stack bounds.
    509      * @param tempOtherTaskInsetBounds Like {@code tempDockedTaskInsetBounds}, but for the other
    510      *                                 stacks.
    511      * @throws RemoteException
    512      */
    513     @UnsupportedAppUsage
    514     void resizeDockedStack(in Rect dockedBounds, in Rect tempDockedTaskBounds,
    515             in Rect tempDockedTaskInsetBounds,
    516             in Rect tempOtherTaskBounds, in Rect tempOtherTaskInsetBounds);
    517     @UnsupportedAppUsage
    518     void removeStack(int stackId);
    519     void makePackageIdle(String packageName, int userId);
    520     int getMemoryTrimLevel();
    521     boolean isVrModePackageEnabled(in ComponentName packageName);
    522     void notifyLockedProfile(int userId);
    523     void startConfirmDeviceCredentialIntent(in Intent intent, in Bundle options);
    524     @UnsupportedAppUsage
    525     void sendIdleJobTrigger();
    526     int sendIntentSender(in IIntentSender target, in IBinder whitelistToken, int code,
    527             in Intent intent, in String resolvedType, in IIntentReceiver finishedReceiver,
    528             in String requiredPermission, in Bundle options);
    529     boolean isBackgroundRestricted(in String packageName);
    530 
    531     // Start of N MR1 transactions
    532     void setRenderThread(int tid);
    533     /**
    534      * Lets activity manager know whether the calling process is currently showing "top-level" UI
    535      * that is not an activity, i.e. windows on the screen the user is currently interacting with.
    536      *
    537      * <p>This flag can only be set for persistent processes.
    538      *
    539      * @param hasTopUi Whether the calling process has "top-level" UI.
    540      */
    541     void setHasTopUi(boolean hasTopUi);
    542 
    543     // Start of O transactions
    544     int restartUserInBackground(int userId);
    545     /** Cancels the window transitions for the given task. */
    546     @UnsupportedAppUsage
    547     void cancelTaskWindowTransition(int taskId);
    548     /**
    549      * @param taskId the id of the task to retrieve the sAutoapshots for
    550      * @param reducedResolution if set, if the snapshot needs to be loaded from disk, this will load
    551      *                          a reduced resolution of it, which is much faster
    552      * @return a graphic buffer representing a screenshot of a task
    553      */
    554     @UnsupportedAppUsage
    555     ActivityManager.TaskSnapshot getTaskSnapshot(int taskId, boolean reducedResolution);
    556     void scheduleApplicationInfoChanged(in List<String> packageNames, int userId);
    557     void setPersistentVrThread(int tid);
    558 
    559     void waitForNetworkStateUpdate(long procStateSeq);
    560     /**
    561      * Add a bare uid to the background restrictions whitelist.  Only the system uid may call this.
    562      */
    563     void backgroundWhitelistUid(int uid);
    564 
    565     // Start of P transactions
    566     /**
    567      *  Similar to {@link #startUserInBackground(int userId), but with a listener to report
    568      *  user unlock progress.
    569      */
    570     boolean startUserInBackgroundWithListener(int userid, IProgressListener unlockProgressListener);
    571 
    572     /**
    573      * Method for the shell UID to start deletating its permission identity to an
    574      * active instrumenation. The shell can delegate permissions only to one active
    575      * instrumentation at a time. An active instrumentation is one running and
    576      * started from the shell.
    577      */
    578     void startDelegateShellPermissionIdentity(int uid, in String[] permissions);
    579 
    580     /**
    581      * Method for the shell UID to stop deletating its permission identity to an
    582      * active instrumenation. An active instrumentation is one running and
    583      * started from the shell.
    584      */
    585     void stopDelegateShellPermissionIdentity();
    586 
    587     /** Returns a file descriptor that'll be closed when the system server process dies. */
    588     ParcelFileDescriptor getLifeMonitor();
    589 
    590     /**
    591      * Start user, if it us not already running, and bring it to foreground.
    592      * unlockProgressListener can be null if monitoring progress is not necessary.
    593      */
    594     boolean startUserInForegroundWithListener(int userid, IProgressListener unlockProgressListener);
    595 }
    596