/**@class android.app.ActivityManager @extends java.lang.Object <p> This class gives information about, and interacts with, activities, services, and the containing process. </p> <p> A number of the methods in this class are for debugging or informational purposes and they should not be used to affect any runtime behavior of your app. These methods are called out as such in the method level documentation. </p> <p> Most application developers should not have the need to use this class, most of whose methods are for specialized use cases. However, a few methods are more broadly applicable. For instance, {@link android.app.ActivityManager#isLowRamDevice() isLowRamDevice()} enables your app to detect whether it is running on a low-memory device, and behave accordingly. {@link android.app.ActivityManager#clearApplicationUserData() clearApplicationUserData()} is for apps with reset-data functionality. </p> <p> In some special use cases, where an app interacts with its Task stack, the app may use the {@link android.app.ActivityManager.AppTask} and {@link android.app.ActivityManager.RecentTaskInfo} inner classes. However, in general, the methods in this class should be used for testing and debugging purposes only. </p> */ var ActivityManager = { /** Disable hidden API checks for the newly started instrumentation. @hide */ INSTR_FLAG_DISABLE_HIDDEN_API_CHECKS : "1", /** Mount full external storage for the newly started instrumentation. @hide */ INSTR_FLAG_MOUNT_EXTERNAL_STORAGE_FULL : "2", /** Takes a bugreport without user interference (and hence causing less interference to the system), but includes all sections. @hide */ BUGREPORT_OPTION_FULL : "0", /** Allows user to monitor progress and enter additional data; might not include all sections. @hide */ BUGREPORT_OPTION_INTERACTIVE : "1", /** Takes a bugreport requested remotely by administrator of the Device Owner app, not the device's user. @hide */ BUGREPORT_OPTION_REMOTE : "2", /** Takes a bugreport on a wearable device. @hide */ BUGREPORT_OPTION_WEAR : "3", /** Takes a lightweight version of bugreport that only includes a few, urgent sections used to report telephony bugs. @hide */ BUGREPORT_OPTION_TELEPHONY : "4", /** Takes a lightweight bugreport that only includes a few sections related to Wifi. @hide */ BUGREPORT_OPTION_WIFI : "5", /** <a href="{@docRoot}guide/topics/manifest/meta-data-element.html">{@code <meta-data>}</a> name for a 'home' Activity that declares a package that is to be uninstalled in lieu of the declaring one. The package named here must be signed with the same certificate as the one declaring the {@code <meta-data>}. */ META_HOME_ALTERNATE : "android.app.home.alternate", /** Result for IActivityManager.startVoiceActivity: active session is currently hidden. @hide */ START_VOICE_HIDDEN_SESSION : "-100", /** Result for IActivityManager.startVoiceActivity: active session does not match the requesting token. @hide */ START_VOICE_NOT_ACTIVE_SESSION : "-99", /** Result for IActivityManager.startActivity: trying to start a background user activity that shouldn't be displayed for all users. @hide */ START_NOT_CURRENT_USER_ACTIVITY : "-98", /** Result for IActivityManager.startActivity: trying to start an activity under voice control when that activity does not support the VOICE category. @hide */ START_NOT_VOICE_COMPATIBLE : "-97", /** Result for IActivityManager.startActivity: an error where the start had to be canceled. @hide */ START_CANCELED : "-96", /** Result for IActivityManager.startActivity: an error where the thing being started is not an activity. @hide */ START_NOT_ACTIVITY : "-95", /** Result for IActivityManager.startActivity: an error where the caller does not have permission to start the activity. @hide */ START_PERMISSION_DENIED : "-94", /** Result for IActivityManager.startActivity: an error where the caller has requested both to forward a result and to receive a result. @hide */ START_FORWARD_AND_REQUEST_CONFLICT : "-93", /** Result for IActivityManager.startActivity: an error where the requested class is not found. @hide */ START_CLASS_NOT_FOUND : "-92", /** Result for IActivityManager.startActivity: an error where the given Intent could not be resolved to an activity. @hide */ START_INTENT_NOT_RESOLVED : "-91", /** Result for IActivityManager.startAssistantActivity: active session is currently hidden. @hide */ START_ASSISTANT_HIDDEN_SESSION : "-90", /** Result for IActivityManager.startAssistantActivity: active session does not match the requesting token. @hide */ START_ASSISTANT_NOT_ACTIVE_SESSION : "-89", /** Result for IActivityManaqer.startActivity: the activity was started successfully as normal. @hide */ START_SUCCESS : "0", /** Result for IActivityManaqer.startActivity: the caller asked that the Intent not be executed if it is the recipient, and that is indeed the case. @hide */ START_RETURN_INTENT_TO_CALLER : "1", /** Result for IActivityManaqer.startActivity: activity wasn't really started, but a task was simply brought to the foreground. @hide */ START_TASK_TO_FRONT : "2", /** Result for IActivityManaqer.startActivity: activity wasn't really started, but the given Intent was given to the existing top activity. @hide */ START_DELIVERED_TO_TOP : "3", /** Result for IActivityManaqer.startActivity: request was canceled because app switches are temporarily canceled to ensure the user's last request (such as pressing home) is performed. @hide */ START_SWITCHES_CANCELED : "100", /** Result for IActivityManaqer.startActivity: a new activity was attempted to be started while in Lock Task Mode. @hide */ START_RETURN_LOCK_TASK_MODE_VIOLATION : "101", /** Result for IActivityManaqer.startActivity: a new activity start was aborted. Never returned externally. @hide */ START_ABORTED : "102", /** Flag for IActivityManaqer.startActivity: do special start mode where a new activity is launched only if it is needed. @hide */ START_FLAG_ONLY_IF_NEEDED : "1", /** Flag for IActivityManaqer.startActivity: launch the app for debugging. @hide */ START_FLAG_DEBUG : "2", /** Flag for IActivityManaqer.startActivity: launch the app for allocation tracking. @hide */ START_FLAG_TRACK_ALLOCATION : "4", /** Flag for IActivityManaqer.startActivity: launch the app with native debugging support. @hide */ START_FLAG_NATIVE_DEBUGGING : "8", /** Result for IActivityManaqer.broadcastIntent: success! @hide */ BROADCAST_SUCCESS : "0", /** Result for IActivityManaqer.broadcastIntent: attempt to broadcast a sticky intent without appropriate permission. @hide */ BROADCAST_STICKY_CANT_HAVE_PERMISSION : "-1", /** Result for IActivityManager.broadcastIntent: trying to send a broadcast to a stopped user. Fail. @hide */ BROADCAST_FAILED_USER_STOPPED : "-2", /** Type for IActivityManaqer.getIntentSender: this PendingIntent is for a sendBroadcast operation. @hide */ INTENT_SENDER_BROADCAST : "1", /** Type for IActivityManaqer.getIntentSender: this PendingIntent is for a startActivity operation. @hide */ INTENT_SENDER_ACTIVITY : "2", /** Type for IActivityManaqer.getIntentSender: this PendingIntent is for an activity result operation. @hide */ INTENT_SENDER_ACTIVITY_RESULT : "3", /** Type for IActivityManaqer.getIntentSender: this PendingIntent is for a startService operation. @hide */ INTENT_SENDER_SERVICE : "4", /** Type for IActivityManaqer.getIntentSender: this PendingIntent is for a startForegroundService operation. @hide */ INTENT_SENDER_FOREGROUND_SERVICE : "5", /**@hide User operation call: success! */ USER_OP_SUCCESS : "0", /**@hide User operation call: given user id is not known. */ USER_OP_UNKNOWN_USER : "-1", /**@hide User operation call: given user id is the current user, can't be stopped. */ USER_OP_IS_CURRENT : "-2", /**@hide User operation call: system user can't be stopped. */ USER_OP_ERROR_IS_SYSTEM : "-3", /**@hide User operation call: one of related users cannot be stopped. */ USER_OP_ERROR_RELATED_USERS_CANNOT_STOP : "-4", /**@hide Not a real process state. */ PROCESS_STATE_UNKNOWN : "-1", /**@hide Process is a persistent system process. */ PROCESS_STATE_PERSISTENT : "0", /**@hide Process is a persistent system process and is doing UI. */ PROCESS_STATE_PERSISTENT_UI : "1", /**@hide Process is hosting the current top activities. Note that this covers all activities that are visible to the user. */ PROCESS_STATE_TOP : "2", /**@hide Process is hosting a foreground service with location type. */ PROCESS_STATE_FOREGROUND_SERVICE_LOCATION : "3", /**@hide Process is bound to a TOP app. This is ranked below SERVICE_LOCATION so that it doesn't get the capability of location access while-in-use. */ PROCESS_STATE_BOUND_TOP : "4", /**@hide Process is hosting a foreground service. */ PROCESS_STATE_FOREGROUND_SERVICE : "5", /**@hide Process is hosting a foreground service due to a system binding. */ PROCESS_STATE_BOUND_FOREGROUND_SERVICE : "6", /**@hide Process is important to the user, and something they are aware of. */ PROCESS_STATE_IMPORTANT_FOREGROUND : "7", /**@hide Process is important to the user, but not something they are aware of. */ PROCESS_STATE_IMPORTANT_BACKGROUND : "8", /**@hide Process is in the background transient so we will try to keep running. */ PROCESS_STATE_TRANSIENT_BACKGROUND : "9", /**@hide Process is in the background running a backup/restore operation. */ PROCESS_STATE_BACKUP : "10", /**@hide Process is in the background running a service. Unlike oom_adj, this level is used for both the normal running in background state and the executing operations state. */ PROCESS_STATE_SERVICE : "11", /**@hide Process is in the background running a receiver. Note that from the perspective of oom_adj, receivers run at a higher foreground level, but for our prioritization here that is not necessary and putting them below services means many fewer changes in some process states as they receive broadcasts. */ PROCESS_STATE_RECEIVER : "12", /**@hide Same as {@link #PROCESS_STATE_TOP} but while device is sleeping. */ PROCESS_STATE_TOP_SLEEPING : "13", /**@hide Process is in the background, but it can't restore its state so we want to try to avoid killing it. */ PROCESS_STATE_HEAVY_WEIGHT : "14", /**@hide Process is in the background but hosts the home activity. */ PROCESS_STATE_HOME : "15", /**@hide Process is in the background but hosts the last shown activity. */ PROCESS_STATE_LAST_ACTIVITY : "16", /**@hide Process is being cached for later use and contains activities. */ PROCESS_STATE_CACHED_ACTIVITY : "17", /**@hide Process is being cached for later use and is a client of another cached process that contains activities. */ PROCESS_STATE_CACHED_ACTIVITY_CLIENT : "18", /**@hide Process is being cached for later use and has an activity that corresponds to an existing recent task. */ PROCESS_STATE_CACHED_RECENT : "19", /**@hide Process is being cached for later use and is empty. */ PROCESS_STATE_CACHED_EMPTY : "20", /**@hide Process does not exist. */ PROCESS_STATE_NONEXISTENT : "21", /**@hide The lowest process state number */ MIN_PROCESS_STATE : "0", /**@hide The highest process state number */ MAX_PROCESS_STATE : "21", /**@hide requestType for assist context: only basic information. */ ASSIST_CONTEXT_BASIC : "0", /**@hide requestType for assist context: generate full AssistStructure. */ ASSIST_CONTEXT_FULL : "1", /**@hide requestType for assist context: generate full AssistStructure for autofill. */ ASSIST_CONTEXT_AUTOFILL : "2", /**@hide Flag for registerUidObserver: report changes in process state. */ UID_OBSERVER_PROCSTATE : "1", /**@hide Flag for registerUidObserver: report uid gone. */ UID_OBSERVER_GONE : "2", /**@hide Flag for registerUidObserver: report uid has become idle. */ UID_OBSERVER_IDLE : "4", /**@hide Flag for registerUidObserver: report uid has become active. */ UID_OBSERVER_ACTIVE : "8", /**@hide Flag for registerUidObserver: report uid cached state has changed. */ UID_OBSERVER_CACHED : "16", /**@hide Mode for {@link IActivityManager#isAppStartModeDisabled}: normal free-to-run operation. */ APP_START_MODE_NORMAL : "0", /**@hide Mode for {@link IActivityManager#isAppStartModeDisabled}: delay running until later. */ APP_START_MODE_DELAYED : "1", /**@hide Mode for {@link IActivityManager#isAppStartModeDisabled}: delay running until later, with rigid errors (throwing exception). */ APP_START_MODE_DELAYED_RIGID : "2", /**@hide Mode for {@link IActivityManager#isAppStartModeDisabled}: disable/cancel pending launches; this is the mode for ephemeral apps. */ APP_START_MODE_DISABLED : "3", /** Lock task mode is not active. */ LOCK_TASK_MODE_NONE : "0", /** Full lock task mode is active. */ LOCK_TASK_MODE_LOCKED : "1", /** App pinning mode is active. */ LOCK_TASK_MODE_PINNED : "2", /** Screen compatibility mode: the application most always run in compatibility mode. @hide */ COMPAT_MODE_ALWAYS : "-1", /** Screen compatibility mode: the application can never run in compatibility mode. @hide */ COMPAT_MODE_NEVER : "-2", /** Screen compatibility mode: unknown. @hide */ COMPAT_MODE_UNKNOWN : "-3", /** Screen compatibility mode: the application currently has compatibility mode disabled. @hide */ COMPAT_MODE_DISABLED : "0", /** Screen compatibility mode: the application currently has compatibility mode enabled. @hide */ COMPAT_MODE_ENABLED : "1", /** Screen compatibility mode: request to toggle the application's compatibility mode. @hide */ COMPAT_MODE_TOGGLE : "2", /** Flag for use with {@link #getRecentTasks}: return all tasks, even those that have set their {@link android.content.Intent#FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS} flag. */ RECENT_WITH_EXCLUDED : "1", /** Provides a list that does not contain any recent tasks that currently are not available to the user. */ RECENT_IGNORE_UNAVAILABLE : "2", /** Flag for {@link #moveTaskToFront(int, int)}: also move the "home" activity along with the task, so it is positioned immediately behind the task. */ MOVE_TASK_WITH_HOME : "1", /** Flag for {@link #moveTaskToFront(int, int)}: don't count this as a user-instigated action, so the current activity will not receive a hint that the user is leaving. */ MOVE_TASK_NO_USER_ACTION : "2", /**{@hide} */ FLAG_OR_STOPPED : "1", /**{@hide} */ FLAG_AND_LOCKED : "2", /**{@hide} */ FLAG_AND_UNLOCKED : "4", /**{@hide} */ FLAG_AND_UNLOCKING_OR_UNLOCKED : "8", /** Action an app can implement to handle reports from {@link #setWatchHeapLimit}(long). If your package has an activity handling this action, it will be launched with the heap data provided to it the same way as {@link Intent#ACTION_SEND}. Note that to match the activty must support this action and a MIME type of "*/*". */ ACTION_REPORT_HEAP_LIMIT : "android.app.action.REPORT_HEAP_LIMIT", /**Maps ActivityManager.PROCESS_STATE_ values to enums.proto ProcessStateEnum value. @param {Number} amInt a process state of the form ActivityManager.PROCESS_STATE_ @return {Number} the value of the corresponding enums.proto ProcessStateEnum value. @hide */ processStateAmToProto : function( ) {}, /** @hide Should this process state be considered a background state? */ isProcStateBackground : function( ) {}, /** @hide Is this a foreground service type? */ isForegroundService : function( ) {}, /**Returns whether the launch was successful. @hide */ isStartResultSuccessful : function( ) {}, /**Returns whether the launch result was a fatal error. @hide */ isStartResultFatalError : function( ) {}, /** @hide */ getFrontActivityScreenCompatMode : function( ) {}, /** @hide */ setFrontActivityScreenCompatMode : function( ) {}, /** @hide */ getPackageScreenCompatMode : function( ) {}, /** @hide */ setPackageScreenCompatMode : function( ) {}, /** @hide */ getPackageAskScreenCompat : function( ) {}, /** @hide */ setPackageAskScreenCompat : function( ) {}, /**Return the approximate per-application memory class of the current device. This gives you an idea of how hard a memory limit you should impose on your application to let the overall system work best. The returned value is in megabytes; the baseline Android memory class is 16 (which happens to be the Java heap limit of those devices); some devices with more memory may return 24 or even higher numbers. */ getMemoryClass : function( ) {}, /** @hide */ staticGetMemoryClass : function( ) {}, /**Return the approximate per-application memory class of the current device when an application is running with a large heap. This is the space available for memory-intensive applications; most applications should not need this amount of memory, and should instead stay with the {@link #getMemoryClass}() limit. The returned value is in megabytes. This may be the same size as {@link #getMemoryClass}() on memory constrained devices, or it may be significantly larger on devices with a large amount of available RAM. <p>This is the size of the application's Dalvik heap if it has specified <code>android:largeHeap="true"</code> in its manifest. */ getLargeMemoryClass : function( ) {}, /** @hide */ staticGetLargeMemoryClass : function( ) {}, /**Returns true if this is a low-RAM device. Exactly whether a device is low-RAM is ultimately up to the device configuration, but currently it generally means something with 1GB or less of RAM. This is mostly intended to be used by apps to determine whether they should turn off certain features that require more RAM. */ isLowRamDevice : function( ) {}, /** @hide */ isLowRamDeviceStatic : function( ) {}, /**Returns true if this is a small battery device. Exactly whether a device is considered to be small battery is ultimately up to the device configuration, but currently it generally means something in the class of a device with 1000 mAh or less. This is mostly intended to be used to determine whether certain features should be altered to account for a drastically smaller battery. @hide */ isSmallBatteryDevice : function( ) {}, /**Used by persistent processes to determine if they are running on a higher-end device so should be okay using hardware drawing acceleration (which tends to consume a lot more RAM). @hide */ isHighEndGfx : function( ) {}, /**Return the total number of bytes of RAM this device has. @hide */ getTotalRam : function( ) {}, /**TODO(b/80414790): Remove once no longer on hiddenapi-light-greylist.txt @hide @deprecated Use {@link ActivityTaskManager#getMaxRecentTasksStatic()} */ getMaxRecentTasksStatic : function( ) {}, /** @removed */ getMaxNumPictureInPictureActions : function( ) {}, /**<p></p>Return a list of the tasks that the user has recently launched, with the most recent being first and older ones after in order. <p><b>Note: this method is only intended for debugging and presenting task management user interfaces</b>. This should never be used for core logic in an application, such as deciding between different behaviors based on the information found here. Such uses are <em>not</em> supported, and will likely break in the future. For example, if multiple applications can be actively running at the same time, assumptions made about the meaning of the data here for purposes of control flow will be incorrect.</p> @param {Number} maxNum The maximum number of entries to return in the list. The actual number returned may be smaller, depending on how many tasks the user has started and the maximum number the system can remember. @param {Number} flags Information about what to return. May be any combination of {@link #RECENT_WITH_EXCLUDED} and {@link #RECENT_IGNORE_UNAVAILABLE}. @param flags Information about what to return. May be any combination of {@link #RECENT_WITH_EXCLUDED} and {@link #RECENT_IGNORE_UNAVAILABLE}. @return {Object {java.util.List}} Returns a list of RecentTaskInfo records describing each of the recent tasks. */ getRecentTasks : function( ) {}, /**Get the list of tasks associated with the calling application. @return {Object {java.util.List}} The list of tasks associated with the application making this call. @throws SecurityException */ getAppTasks : function( ) {}, /**Return the current design dimensions for {@link android.app.ActivityManager.AppTask} thumbnails, for use with {@link #addAppTask}. */ getAppTaskThumbnailSize : function( ) {}, /**Add a new {@link android.app.ActivityManager.AppTask} for the calling application. This will create a new recents entry that is added to the <b>end</b> of all existing recents. @param {Object {Activity}} activity The activity that is adding the entry. This is used to help determine the context that the new recents entry will be in. @param {Object {Intent}} intent The Intent that describes the recents entry. This is the same Intent that you would have used to launch the activity for it. In generally you will want to set both {@link Intent#FLAG_ACTIVITY_NEW_DOCUMENT} and {@link Intent#FLAG_ACTIVITY_RETAIN_IN_RECENTS}; the latter is required since this recents entry will exist without an activity, so it doesn't make sense to not retain it when its activity disappears. The given Intent here also must have an explicit ComponentName set on it. @param {Object {ActivityManager.TaskDescription}} description Optional additional description information. @param {Object {Bitmap}} thumbnail Thumbnail to use for the recents entry. Should be the size given by {@link #getAppTaskThumbnailSize()}. If the bitmap is not that exact size, it will be recreated in your process, probably in a way you don't like, before the recents entry is added. @return {Number} Returns the task id of the newly added app task, or -1 if the add failed. The most likely cause of failure is that there is no more room for more tasks for your app. */ addAppTask : function( ) {}, /**Return a list of the tasks that are currently running, with the most recent being first and older ones after in order. Note that "running" does not mean any of the task's code is currently loaded or activity -- the task may have been frozen by the system, so that it can be restarted in its previous state when next brought to the foreground. <p><b>Note: this method is only intended for debugging and presenting task management user interfaces</b>. This should never be used for core logic in an application, such as deciding between different behaviors based on the information found here. Such uses are <em>not</em> supported, and will likely break in the future. For example, if multiple applications can be actively running at the same time, assumptions made about the meaning of the data here for purposes of control flow will be incorrect.</p> @param {Number} maxNum The maximum number of entries to return in the list. The actual number returned may be smaller, depending on how many tasks the user has started. @param maxNum The maximum number of entries to return in the list. The actual number returned may be smaller, depending on how many tasks the user has started. @return {Object {java.util.List}} Returns a list of RunningTaskInfo records describing each of the running tasks. */ getRunningTasks : function( ) {}, /**Equivalent to calling {@link #moveTaskToFront(int, int, Bundle)} with a null options argument. @param {Number} taskId The identifier of the task to be moved, as found in {@link RunningTaskInfo} or {@link RecentTaskInfo}. @param {Number} flags Additional operational flags. */ moveTaskToFront : function( ) {}, /**Ask that the task associated with a given task ID be moved to the front of the stack, so it is now visible to the user. @param {Number} taskId The identifier of the task to be moved, as found in {@link RunningTaskInfo} or {@link RecentTaskInfo}. @param {Number} flags Additional operational flags. @param {Object {Bundle}} options Additional options for the operation, either null or as per {@link Context#startActivity(Intent, android.os.Bundle) Context.startActivity(Intent, Bundle)}. */ moveTaskToFront : function( ) {}, /**Check if the context is allowed to start an activity on specified display. Some launch restrictions may apply to secondary displays that are private, virtual, or owned by the system, in which case an activity start may throw a {@link SecurityException}. Call this method prior to starting an activity on a secondary display to check if the current context has access to it. @param {Object {Context}} context Source context, from which an activity will be started. @param {Number} displayId Target display id. @param {Object {Intent}} intent Intent used to launch an activity. @param context Source context, from which an activity will be started. @param displayId Target display id. @param intent Intent used to launch an activity. @return {Boolean} {@code true} if a call to start an activity on the target display is allowed for the provided context and no {@link SecurityException} will be thrown, {@code false} otherwise. */ isActivityStartAllowedOnDisplay : function( ) {}, /**Return a list of the services that are currently running. <p><b>Note: this method is only intended for debugging or implementing service management type user interfaces.</b></p> @param {Number} maxNum The maximum number of entries to return in the list. The actual number returned may be smaller, depending on how many services are running. @param maxNum The maximum number of entries to return in the list. The actual number returned may be smaller, depending on how many services are running. @return {Object {java.util.List}} Returns a list of RunningServiceInfo records describing each of the running tasks. */ getRunningServices : function( ) {}, /**Returns a PendingIntent you can start to show a control panel for the given running service. If the service does not have a control panel, null is returned. */ getRunningServiceControlPanel : function( ) {}, /**Return general information about the memory state of the system. This can be used to help decide how to manage your own memory, though note that polling is not recommended and {@link android.content.ComponentCallbacks2#onTrimMemory(int) ComponentCallbacks2.onTrimMemory(int)} is the preferred way to do this. Also see {@link #getMyMemoryState} for how to retrieve the current trim level of your process as needed, which gives a better hint for how to manage its memory. */ getMemoryInfo : function( ) {}, /** @hide */ clearApplicationUserData : function( ) {}, /**Permits an application to erase its own data from disk. This is equivalent to the user choosing to clear the app's data from within the device settings UI. It erases all dynamic data associated with the app -- its private data and data in its private area on external storage -- but does not remove the installed application itself, nor any OBB files. It also revokes all runtime permissions that the app has acquired, clears all notifications and removes all Uri grants related to this application. @return {Boolean} {@code true} if the application successfully requested that the application's data be erased; {@code false} otherwise. */ clearApplicationUserData : function( ) {}, /**Permits an application to get the persistent URI permissions granted to another. <p>Typically called by Settings or DocumentsUI, requires {@code GET_APP_GRANTED_URI_PERMISSIONS}. @param {String} packageName application to look for the granted permissions, or {@code null} to get granted permissions for all applications @return {Object {android.content.pm.ParceledListSlice}} list of granted URI permissions @hide @deprecated use {@link UriGrantsManager#getGrantedUriPermissions(String)} instead. */ getGrantedUriPermissions : function( ) {}, /**Permits an application to clear the persistent URI permissions granted to another. <p>Typically called by Settings, requires {@code CLEAR_APP_GRANTED_URI_PERMISSIONS}. @param {String} packageName application to clear its granted permissions @hide @deprecated use {@link UriGrantsManager#clearGrantedUriPermissions(String)} instead. */ clearGrantedUriPermissions : function( ) {}, /**Returns a list of any processes that are currently in an error condition. The result will be null if all processes are running properly at this time. @return {Object {java.util.List}} Returns a list of ProcessErrorStateInfo records, or null if there are no current error conditions (it will not return an empty list). This list ordering is not specified. */ getProcessesInErrorState : function( ) {}, /**Returns a list of application processes installed on external media that are running on the device. <p><b>Note: this method is only intended for debugging or building a user-facing process management UI.</b></p> @return {Object {java.util.List}} Returns a list of ApplicationInfo records, or null if none This list ordering is not specified. @hide */ getRunningExternalApplications : function( ) {}, /**Query whether the user has enabled background restrictions for this app. <p> The user may chose to do this, if they see that an app is consuming an unreasonable amount of battery while in the background. </p> <p> If true, any work that the app tries to do will be aggressively restricted while it is in the background. At a minimum, jobs and alarms will not execute and foreground services cannot be started unless an app activity is in the foreground. </p> <p><b> Note that these restrictions stay in effect even when the device is charging.</b></p> @return {Boolean} true if user has enforced background restrictions for this app, false otherwise. */ isBackgroundRestricted : function( ) {}, /**Sets the memory trim mode for a process and schedules a memory trim operation. <p><b>Note: this method is only intended for testing framework.</b></p> @return {Boolean} Returns true if successful. @hide */ setProcessMemoryTrimLevel : function( ) {}, /**Returns a list of application processes that are running on the device. <p><b>Note: this method is only intended for debugging or building a user-facing process management UI.</b></p> @return {Object {java.util.List}} Returns a list of RunningAppProcessInfo records, or null if there are no running processes (it will not return an empty list). This list ordering is not specified. */ getRunningAppProcesses : function( ) {}, /**Return the importance of a given package name, based on the processes that are currently running. The return value is one of the importance constants defined in {@link android.app.ActivityManager.RunningAppProcessInfo}, giving you the highest importance of all the processes that this package has code running inside of. If there are no processes running its code, {@link android.app.ActivityManager.RunningAppProcessInfo#IMPORTANCE_GONE} is returned. @hide */ getPackageImportance : function( ) {}, /**Return the importance of a given uid, based on the processes that are currently running. The return value is one of the importance constants defined in {@link android.app.ActivityManager.RunningAppProcessInfo}, giving you the highest importance of all the processes that this uid has running. If there are no processes running its code, {@link android.app.ActivityManager.RunningAppProcessInfo#IMPORTANCE_GONE} is returned. @hide */ getUidImportance : function( ) {}, /**Start monitoring changes to the imoportance of uids running in the system. @param {Object {ActivityManager.OnUidImportanceListener}} listener The listener callback that will receive change reports. @param {Number} importanceCutpoint The level of importance in which the caller is interested in differences. For example, if {@link RunningAppProcessInfo#IMPORTANCE_PERCEPTIBLE} is used here, you will receive a call each time a uids importance transitions between being <= {@link RunningAppProcessInfo#IMPORTANCE_PERCEPTIBLE} and > {@link RunningAppProcessInfo#IMPORTANCE_PERCEPTIBLE}. <p>The caller must hold the {@link android.Manifest.permission#PACKAGE_USAGE_STATS} permission to use this feature.</p> @throws IllegalArgumentException If the listener is already registered. @throws SecurityException If the caller does not hold {@link android.Manifest.permission#PACKAGE_USAGE_STATS}. @hide */ addOnUidImportanceListener : function( ) {}, /**Remove an importance listener that was previously registered with {@link #addOnUidImportanceListener}. @throws IllegalArgumentException If the listener is not registered. @hide */ removeOnUidImportanceListener : function( ) {}, /**Return global memory state information for the calling process. This does not fill in all fields of the {@link android.app.ActivityManager.RunningAppProcessInfo}. The only fields that will be filled in are {@link android.app.ActivityManager.RunningAppProcessInfo#pid}, {@link android.app.ActivityManager.RunningAppProcessInfo#uid}, {@link android.app.ActivityManager.RunningAppProcessInfo#lastTrimLevel}, {@link android.app.ActivityManager.RunningAppProcessInfo#importance}, {@link android.app.ActivityManager.RunningAppProcessInfo#lru}, and {@link android.app.ActivityManager.RunningAppProcessInfo#importanceReasonCode}. */ getMyMemoryState : function( ) {}, /**Return information about the memory usage of one or more processes. <p><b>Note: this method is only intended for debugging or building a user-facing process management UI.</b></p> <p>As of {@link android.os.Build.VERSION_CODES#Q Android Q}, for regular apps this method will only return information about the memory info for the processes running as the caller's uid; no other process memory info is available and will be zero. Also of {@link android.os.Build.VERSION_CODES#Q Android Q} the sample rate allowed by this API is significantly limited, if called faster the limit you will receive the same data as the previous call.</p> @param {Object {int[]}} pids The pids of the processes whose memory usage is to be retrieved. @return {Object {android.os.Debug.MemoryInfo}} Returns an array of memory information, one for each requested pid. */ getProcessMemoryInfo : function( ) {}, /** @deprecated This is now just a wrapper for {@link #killBackgroundProcesses(String)}; the previous behavior here is no longer available to applications because it allows them to break other applications by removing their alarms, stopping their services, etc. */ restartPackage : function( ) {}, /**Have the system immediately kill all background processes associated with the given package. This is the same as the kernel killing those processes to reclaim memory; the system will take care of restarting these processes in the future as needed. @param {String} packageName The name of the package whose processes are to be killed. */ killBackgroundProcesses : function( ) {}, /**Kills the specified UID. @param {Number} uid The UID to kill. @param {String} reason The reason for the kill. @hide */ killUid : function( ) {}, /**Have the system perform a force stop of everything associated with the given application package. All processes that share its uid will be killed, all services it has running stopped, all activities removed, etc. In addition, a {@link Intent#ACTION_PACKAGE_RESTARTED} broadcast will be sent, so that any of its registered alarms can be stopped, notifications removed, etc. <p>You must hold the permission {@link android.Manifest.permission#FORCE_STOP_PACKAGES} to be able to call this method. @param {String} packageName The name of the package to be stopped. @param {Number} userId The user for which the running package is to be stopped. @hide This is not available to third party applications due to it allowing them to break other applications by stopping their services, removing their alarms, etc. */ forceStopPackageAsUser : function( ) {}, /** @see #forceStopPackageAsUser(String, int) @hide */ forceStopPackage : function( ) {}, /**Sets the current locales of the device. Calling app must have the permission {@code android.permission.CHANGE_CONFIGURATION} and {@code android.permission.WRITE_SETTINGS}. @hide */ setDeviceLocales : function( ) {}, /**Returns a list of supported locales by this system. It includes all locales that are selectable by the user, potentially including locales that the framework does not have translated resources for. To get locales that the framework has translated resources for, use {@code Resources.getSystem().getAssets().getLocales()} instead. @hide */ getSupportedLocales : function( ) {}, /**Get the device configuration attributes. */ getDeviceConfigurationInfo : function( ) {}, /**Get the preferred density of icons for the launcher. This is used when custom drawables are created (e.g., for shortcuts). @return {Number} density in terms of DPI */ getLauncherLargeIconDensity : function( ) {}, /**Get the preferred launcher icon size. This is used when custom drawables are created (e.g., for shortcuts). @return {Number} dimensions of square icons in terms of pixels */ getLauncherLargeIconSize : function( ) {}, /**Returns "true" if the user interface is currently being messed with by a monkey. */ isUserAMonkey : function( ) {}, /**Returns "true" if device is running in a test harness. @deprecated this method is false for all user builds. Users looking to check if their device is running in a device farm should see {@link #isRunningInUserTestHarness()}. */ isRunningInTestHarness : function( ) {}, /**Returns "true" if the device is running in Test Harness Mode. <p>Test Harness Mode is a feature that allows devices to run without human interaction in a device farm/testing harness (such as Firebase Test Lab). You should check this method if you want your app to behave differently when running in a test harness to skip setup screens that would impede UI testing. e.g. a keyboard application that has a full screen setup page for the first time it is launched. <p>Note that you should <em>not</em> use this to determine whether or not your app is running an instrumentation test, as it is not set for a standard device running a test. */ isRunningInUserTestHarness : function( ) {}, /**Unsupported compiled sdk warning should always be shown for the intput activity even in cases where the system would normally not show the warning. E.g. when running in a test harness. @param {Object {ComponentName}} activity The component name of the activity to always show the warning for. @hide */ alwaysShowUnsupportedCompileSdkWarning : function( ) {}, /** @hide */ checkComponentPermission : function( ) {}, /** @hide */ checkUidPermission : function( ) {}, /** @param {Number} callingPid The pid of the incoming call, as per Binder.getCallingPid(). @param {Number} callingUid The uid of the incoming call, as per Binder.getCallingUid(). @param {Number} userId The user id argument supplied by the caller -- this is the user they want to run as. @param {Boolean} allowAll If true, we will allow USER_ALL. This means you must be prepared to get a USER_ALL returned and deal with it correctly. If false, an exception will be thrown if USER_ALL is supplied. @param {Boolean} requireFull If true, the caller must hold {@link android.Manifest.permission#INTERACT_ACROSS_USERS_FULL} to be able to run as a different user than their current process; otherwise they must hold {@link android.Manifest.permission#INTERACT_ACROSS_USERS}. @param {String} name Optional textual name of the incoming call; only for generating error messages. @param {String} callerPackage Optional package name of caller; only for error messages. @param callerPackage Optional package name of caller; only for error messages. @return {Number} Returns the user ID that the call should run as. Will always be a concrete user number, unless <var>allowAll</var> is true in which case it could also be USER_ALL. */ handleIncomingUser : function( ) {}, /**Gets the userId of the current foreground user. Requires system permissions. @hide */ getCurrentUser : function( ) {}, /** @param {Number} userid the user's id. Zero indicates the default user. @hide */ switchUser : function( ) {}, /**Returns whether switching to provided user was successful. @param {Object {UserHandle}} user the user to switch to. @throws IllegalArgumentException if the user is null. @hide */ switchUser : function( ) {}, /**Logs out current current foreground user by switching to the system user and stopping the user being switched from. @hide */ logoutCurrentUser : function( ) {}, /**Return whether the given user is actively running. This means that the user is in the "started" state, not "stopped" -- it is currently allowed to run code through scheduled alarms, receiving broadcasts, etc. A started user may be either the current foreground user or a background user; the result here does not distinguish between the two. @param {Number} userId the user's id. Zero indicates the default user. @hide */ isUserRunning : function( ) {}, /**{@hide} */ isVrModePackageEnabled : function( ) {}, /**Perform a system dump of various state associated with the given application package name. This call blocks while the dump is being performed, so should not be done on a UI thread. The data will be written to the given file descriptor as text. @param {Object {FileDescriptor}} fd The file descriptor that the dump should be written to. The file descriptor is <em>not</em> closed by this function; the caller continues to own it. @param {String} packageName The name of the package that is to be dumped. */ dumpPackageState : function( ) {}, /** @hide */ dumpPackageStateStatic : function( ) {}, /** @hide */ isSystemReady : function( ) {}, /** @hide */ broadcastStickyIntent : function( ) {}, /**Convenience for sending a sticky broadcast. For internal use only. @hide */ broadcastStickyIntent : function( ) {}, /** @hide */ resumeAppSwitches : function( ) {}, /** @hide */ noteWakeupAlarm : function( ) {}, /** @hide */ noteAlarmStart : function( ) {}, /** @hide */ noteAlarmFinish : function( ) {}, /** @hide */ getService : function( ) {}, /**Request that the system start watching for the calling process to exceed a pss size as given here. Once called, the system will look for any occasions where it sees the associated process with a larger pss size and, when this happens, automatically pull a heap dump from it and allow the user to share the data. Note that this request continues running even if the process is killed and restarted. To remove the watch, use {@link #clearWatchHeapLimit}(). <p>This API only works if the calling process has been marked as {@link android.app.ApplicationInfo#FLAG_DEBUGGABLE} or this is running on a debuggable (userdebug or eng) build.</p> <p>Callers can optionally implement {@link #ACTION_REPORT_HEAP_LIMIT} to directly handle heap limit reports themselves.</p> @param {Number} pssSize The size in bytes to set the limit at. */ setWatchHeapLimit : function( ) {}, /**Clear a heap watch limit previously set by {@link #setWatchHeapLimit}(long). */ clearWatchHeapLimit : function( ) {}, /**Return whether currently in lock task mode. When in this mode no new tasks can be created or switched to. @see Activity#startLockTask() @deprecated Use {@link #getLockTaskModeState} instead. */ isInLockTaskMode : function( ) {}, /**Return the current state of task locking. The three possible outcomes are {@link #LOCK_TASK_MODE_NONE}, {@link #LOCK_TASK_MODE_LOCKED} and {@link #LOCK_TASK_MODE_PINNED}. @see Activity#startLockTask() */ getLockTaskModeState : function( ) {}, /**Enable more aggressive scheduling for latency-sensitive low-runtime VR threads. Only one thread can be a VR thread in a process at a time, and that thread may be subject to restrictions on the amount of time it can run. If persistent VR mode is set, whatever thread has been granted aggressive scheduling via this method will return to normal operation, and calling this method will do nothing while persistent VR mode is enabled. To reset the VR thread for an application, a tid of 0 can be passed. @param {Number} tid tid of the VR thread @param tid tid of the VR thread */ setVrThread : function( ) {}, /**Enable more aggressive scheduling for latency-sensitive low-runtime VR threads that persist beyond a single process. Only one thread can be a persistent VR thread at a time, and that thread may be subject to restrictions on the amount of time it can run. Calling this method will disable aggressive scheduling for non-persistent VR threads set via {@link #setVrThread}. If persistent VR mode is disabled then the persistent VR thread loses its new scheduling priority; this method must be called again to set the persistent thread. To reset the persistent VR thread, a tid of 0 can be passed. @param {Number} tid tid of the VR thread @param tid tid of the VR thread @hide */ setPersistentVrThread : function( ) {}, /** @hide */ scheduleApplicationInfoChanged : function( ) {}, };