改为新增SetSupportProcessCache接口

Signed-off-by: huzeshan <huzeshan@huawei.com>
This commit is contained in:
huzeshan 2024-04-01 10:09:18 +08:00
parent c673a436d3
commit 3c51ab2ee2
2 changed files with 15 additions and 14 deletions

View File

@ -200,18 +200,4 @@ export default class AbilityStage {
* @since 12
*/
onDestroy(): void;
/**
* Called back when the system needs to confirm whether the application supports process cache.
*
* @returns { boolean } Indicates that whether process cache is supported or not.
* When process caching is supported, the system does not destroy the process when the application exits
* and reuses the cached process when the application starts next time.
* If process cache is not supported, the process will be destroyed normally when the application exits,
* and the process will be re-created when the application starts next time.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
* @since 12
*/
onCheckProcessCache(): boolean;
}

View File

@ -464,4 +464,19 @@ export default class ApplicationContext extends Context {
* @since 12
*/
restartApp(want: Want): void;
/**
* Set the state about whether the application supports process cache or not.
*
* @param { isSupport } boolean - Indicates the process cache support state.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @throws { BusinessError } 16000011 - The context does not exist.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16000068 - The support process cache state cannot be set more than once.
* @systemapi
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @since 12
*/
SetSupportProcessCache(isSupport : boolean): void;
}