-
public class ActivityManagerApis
-
-
Method Summary
Modifier and Type Method Description static intcheckPermission(@Nullable() String permission, int pid, int uid)static voidregisterProcessObserver(@Nullable() IProcessObserver processObserver)static voidunregisterProcessObserver(@Nullable() IProcessObserver observer)static voidregisterUidObserver(@Nullable() IUidObserver observer, int which, int cutpoint, @Nullable() String callingPackage)static voidunregisterUidObserver(@Nullable() IUidObserver observer)static IContentProvidergetContentProviderExternal(@Nullable() String name, int userId, @Nullable() IBinder token, @Nullable() String tag)static voidremoveContentProviderExternal(@Nullable() String name, @Nullable() IBinder token)static voidforceStopPackageNoThrow(@Nullable() String packageName, int userId)static voidstartActivity(@Nullable() Intent intent, @Nullable() String mimeType, int userId)static voidstartActivityNoThrow(@NonNull() Intent intent, @Nullable() String mimeType, int userId)static voidbroadcastIntent(Intent intent, String resolvedType, IIntentReceiver resultTo, int resultCode, String resultData, Bundle map, Array<String> requiredPermissions, int appOp, Bundle options, boolean serialized, boolean sticky, int userId)static voidbroadcastIntent(Intent intent, int userId)static intgetPackageProcessState(String pkg, int userId, String callingPackage)static voidforceStopPackage(String packageName, int userId)static voidstartDelegateShellPermissionIdentity(int uid, Array<String> permissions)Method for the shell UID to start deletating its permission identity to anactive instrumenation. static voidstopDelegateShellPermissionIdentity()Method for the shell UID to stop deletating its permission identity to anactive instrumenation. static List<String>getDelegatedShellPermissions()Method for the shell UID to get currently adopted permissions for an active instrumentation.An active instrumentation is one running and started from the shell. static ActivityTaskManager.RootTaskInfogetFocusedRootTaskInfo()static voidregisterTaskStackListener(@NonNull() ITaskStackListener listener)static voidunregisterTaskStackListener(@NonNull() ITaskStackListener listener)static List<ActivityManager.RunningTaskInfo>getTasks(int maxNum)static IntentregisterReceiver(String callerPackage, String callingFeatureId, String receiverId, BroadcastReceiver receiver, IntentFilter filter, String requiredPermission, int userId, int flags)static voidunregisterReceiver(IIntentReceiver receiver)-
-
Method Detail
-
checkPermission
static int checkPermission(@Nullable() String permission, int pid, int uid)
-
registerProcessObserver
static void registerProcessObserver(@Nullable() IProcessObserver processObserver)
-
unregisterProcessObserver
static void unregisterProcessObserver(@Nullable() IProcessObserver observer)
-
registerUidObserver
static void registerUidObserver(@Nullable() IUidObserver observer, int which, int cutpoint, @Nullable() String callingPackage)
-
unregisterUidObserver
static void unregisterUidObserver(@Nullable() IUidObserver observer)
-
getContentProviderExternal
@Nullable() static IContentProvider getContentProviderExternal(@Nullable() String name, int userId, @Nullable() IBinder token, @Nullable() String tag)
-
removeContentProviderExternal
static void removeContentProviderExternal(@Nullable() String name, @Nullable() IBinder token)
-
forceStopPackageNoThrow
static void forceStopPackageNoThrow(@Nullable() String packageName, int userId)
-
startActivity
static void startActivity(@Nullable() Intent intent, @Nullable() String mimeType, int userId)
-
startActivityNoThrow
static void startActivityNoThrow(@NonNull() Intent intent, @Nullable() String mimeType, int userId)
-
broadcastIntent
static void broadcastIntent(Intent intent, String resolvedType, IIntentReceiver resultTo, int resultCode, String resultData, Bundle map, Array<String> requiredPermissions, int appOp, Bundle options, boolean serialized, boolean sticky, int userId)
-
broadcastIntent
static void broadcastIntent(Intent intent, int userId)
-
getPackageProcessState
static int getPackageProcessState(String pkg, int userId, String callingPackage)
-
forceStopPackage
static void forceStopPackage(String packageName, int userId)
-
startDelegateShellPermissionIdentity
@RequiresApi(value = Build.VERSION_CODES.Q) static void startDelegateShellPermissionIdentity(int uid, Array<String> permissions)
Method for the shell UID to start deletating its permission identity to anactive instrumenation. The shell can delegate permissions only to one activeinstrumentation at a time. An active instrumentation is one running andstarted from the shell.
-
stopDelegateShellPermissionIdentity
@RequiresApi(value = Build.VERSION_CODES.Q) static void stopDelegateShellPermissionIdentity()
Method for the shell UID to stop deletating its permission identity to anactive instrumenation. An active instrumentation is one running andstarted from the shell.
-
getDelegatedShellPermissions
@RequiresApi(value = Build.VERSION_CODES.Q) static List<String> getDelegatedShellPermissions()
Method for the shell UID to get currently adopted permissions for an active instrumentation.An active instrumentation is one running and started from the shell.
-
getFocusedRootTaskInfo
@RequiresApi(value = Build.VERSION_CODES.S) static ActivityTaskManager.RootTaskInfo getFocusedRootTaskInfo()
-
registerTaskStackListener
static void registerTaskStackListener(@NonNull() ITaskStackListener listener)
-
unregisterTaskStackListener
static void unregisterTaskStackListener(@NonNull() ITaskStackListener listener)
-
getTasks
static List<ActivityManager.RunningTaskInfo> getTasks(int maxNum)
-
registerReceiver
static Intent registerReceiver(String callerPackage, String callingFeatureId, String receiverId, BroadcastReceiver receiver, IntentFilter filter, String requiredPermission, int userId, int flags)
-
unregisterReceiver
static void unregisterReceiver(IIntentReceiver receiver)
-
-
-
-