Signed-off-by: caochunlei <caochunlei1@huawei.com>
This commit is contained in:
caochunlei 2022-07-18 14:07:08 +08:00
parent 942f18bfd3
commit 6cdbf00810
2 changed files with 25 additions and 0 deletions

View File

@ -302,4 +302,16 @@ export default class Ability {
* @StageModelOnly
*/
dump(params: Array<string>): Array<string>;
/**
* Called when the system has determined to trim the memory, for example, when the ability is running in the
* background and there is no enough memory for running as many background processes as possible.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @param level Indicates the memory trim level, which shows the current memory usage status.
* @return -
* @StageModelOnly
*/
onMemoryLevel(level: AbilityConstant.MemoryLevel): void;
}

View File

@ -89,6 +89,19 @@ declare namespace AbilityConstant {
MISMATCH = 2,
}
/**
* Type of memory level.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
*/
export enum MemoryLevel {
MEMORY_LEVEL_MODERATE = 0,
MEMORY_LEVEL_LOW = 1,
MEMORY_LEVEL_CRITICAL = 2,
}
/**
* Type of window mode.
*