public interface IAbilityManager
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
DEFAULT_DENSITY |
Indicates the default density.
|
static int |
DEFAULT_HEAPSIZE |
Indicates the basic memory size.
|
static int |
DEFAULT_ICONSIZE |
Indicates the default icon size, in pixels.
|
static int |
LOCK_MISSION_MODE_LOCKED |
Indicates that the full mission lock mode is enabled.
|
static int |
LOCK_MISSION_MODE_NULL |
Indicates that the lock mission mode is disabled.
|
static int |
LOCK_MISSION_MODE_PINNED |
Indicates that the mission lock mode is enabled.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
boolean |
canAbilityStartOnDisplay(Context context,
int displayId,
Intent intent) |
Checks whether an ability can be started on a specified display when there are multiple physical display devices.
|
boolean |
clearUpApplicationData() |
Clears user data of the application, which is equivalent to initializing the application.
|
List<RunningProcessInfo> |
getAllRunningProcesses() |
Obtains information about application processes that are running on the device.
|
int |
getAppLargeMemory() |
Obtains the maximum memory that can be used by an application on the current device.
|
int |
getAppMemory() |
Obtains the memory that can be used by an application on the current device.
|
DeviceConfigInfo |
getDeviceConfigInfo() |
Obtains configuration information about the device, such as its touch type, keyboard type, and navigation device.
|
int |
getHomeScreenIconDensity() |
Obtains the density of icons on the home screen.
|
int |
getHomeScreenIconSize() |
Obtains the size of icons on the home screen.
|
int |
getMissionLockModeState() |
Obtains the current state of the lock mission mode.
|
void |
getMyProcessMemoryInfo(RunningProcessInfo outState) |
Obtains memory information about the calling process, helping you learn the memory usage of the process running
for the current application.
|
List<ProcessErrorInfo> |
getProcessesErrorInfo() |
Obtains a list of process error info.
|
MemoryInfo[] |
getProcessMemoryInfo(int[] pids) |
Obtains the memory usage of specified processes.
|
void |
getSystemMemoryInfo(SystemMemoryInfo outInfo) |
Obtains system memory information, including the total system memory, available system memory, and whether
the system memory is low.
|
boolean |
isBackgroundRunningRestricted() |
Checks whether the process of this application is forbidden to run in the background.
|
boolean |
isLowRamDevice() |
Checks whether the current device is a low-RAM device.
|
boolean |
isUserKingKong() |
ask that is user kingkong test
|
void |
killProcessesByBundleName(String bundleName) |
Kills all background processes associated with a specified package.
|
List<AbilityMissionInfo> |
queryRecentAbilityMissionInfo(int maxMissionNum,
int flag) |
Query recent Ability Mission info.
|
List<AbilityMissionInfo> |
queryRunningAbilityMissionInfo(int maxMissionNum) |
Query running Ability Mission info.
|
void |
updateDeviceLocale(LocaleProfile localeProfile) |
Updates the current locale for the device.
|
static final int DEFAULT_DENSITY
static final int DEFAULT_HEAPSIZE
static final int DEFAULT_ICONSIZE
static final int LOCK_MISSION_MODE_LOCKED
The constant value is 0x00000001. Applications in this mode are locked, with the Home key and Recent
key disabled.
static final int LOCK_MISSION_MODE_NULL
The constant value is 0x00000000.
static final int LOCK_MISSION_MODE_PINNED
The constant value is 0x00000002. Applications in this mode are locked, but with the Return key,
Home key, and Recent key enabled.
MemoryInfo[] getProcessMemoryInfo(int[] pids)
pids - Indicates the PIDs of the processes whose memory usage is to be queried.List<ProcessErrorInfo> getProcessesErrorInfo()
List<RunningProcessInfo> getAllRunningProcesses()
int getAppLargeMemory()
It is not recommended that the maximum memory size returned by this method be used as the memory usage
standard for your application. Instead, use the value returned by getAppMemory() for reference.
int getAppMemory()
You can use the memory size returned by this method as a standard to determine how to optimize memory usage in your application.
void getSystemMemoryInfo(SystemMemoryInfo outInfo)
You can use this method during application debugging to learn and optimize the memory usage of the current system.
outInfo - Indicates the object storing system memory information.void getMyProcessMemoryInfo(RunningProcessInfo outState)
RunningProcessInfo object
includes the PID, UID, last trim level, importance level and importance reason.outState - Indicates the object storing memory information for the calling process.boolean isLowRamDevice()
This method helps you determine whether to optimize your application, for example, to disable some RAM-consuming features, so that it can run properly on a low-RAM device.
true if the current device is a low-RAM device; returns false otherwise.boolean clearUpApplicationData()
This method deletes all dynamic data and notifications related to the application and revokes all permissions the user has granted to it, but does not delete its core files. Exercise caution when using this method.
true if the application's user data is successfully cleared; returns false
otherwise.void killProcessesByBundleName(String bundleName)
This method does not permanently kill these background processes. The system will restart them as required.
To use this method, you need to request the ohos.permission.CLEAN_BACKGROUND_PROCESSES
permission from the system. The ohos.permission.CLEAN_BACKGROUND_PROCESSES permission is of the
normal level.
bundleName - Indicates the name of the package whose processes are to be killed.DeviceConfigInfo getDeviceConfigInfo()
DeviceConfigInfo object containing the device configuration information.int getHomeScreenIconDensity()
This information is used when you create icons or shortcuts for your application.
int getHomeScreenIconSize()
This information is used when you create icons or shortcuts for your application.
boolean isUserKingKong()
boolean canAbilityStartOnDisplay(Context context, int displayId, Intent intent)
context - Indicates the context from which the ability will be started. This parameter cannot be null.displayId - Indicates the ID of the target display on which the ability will be started.intent - Indicates the Intent for starting the ability. This parameter cannot be null.true if the ability can be started on the specified display; returns false
otherwise.int getMissionLockModeState()
You can call Context.lockMission() to enable the lock mission mode, and call
Context.unlockMission() to disable it.
LOCK_MISSION_MODE_NULL,
LOCK_MISSION_MODE_LOCKED, or LOCK_MISSION_MODE_PINNED.void updateDeviceLocale(LocaleProfile localeProfile)
ohos.permission.UPDATE_CONFIGURATION and ohos.permission.MODIFY_SETTINGS permissions
from the system.localeProfile - Indicates the LocaleProfile object
containing the new locale.List<AbilityMissionInfo> queryRunningAbilityMissionInfo(int maxMissionNum)
ohos.permission.ACCESS_MISSIONS permission to get all running apps AbilityMissionInfo.maxMissionNum - Indicate the Max number of the return list.List<AbilityMissionInfo> queryRecentAbilityMissionInfo(int maxMissionNum, int flag)
ohos.permission.ACCESS_MISSIONS permission to get all recent apps AbilityMissionInfo.maxMissionNum - Indicate the Max number of the return list.flag - Indicates the flag using to query ability infos, 1 indicate to get all recent apps, otherwise
return infos whithout missions that are unavailable to user.boolean isBackgroundRunningRestricted()
true if this application is not allowed to run in the background;
returns false otherwise.