!10313 【应用热启需求】新增接口SetSupportedProcessCache、onAppStarted、onAppStopped

Merge pull request !10313 from 胡泽善/ProcessCache
This commit is contained in:
openharmony_ci 2024-04-26 03:42:07 +00:00 committed by Gitee
commit 588889c4a9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 39 additions and 1 deletions

View File

@ -464,4 +464,22 @@ export default class ApplicationContext extends Context {
* @since 12
*/
restartApp(want: Want): void;
/**
* Set the state about whether the application supports process cache or not.
*
* @permission ohos.permission.SET_PROCESS_CACHE_STATE
* @param { boolean } isSupported - Indicates the process cache support state.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system App.
* @throws { BusinessError } 401 - The input parameter is not a valid parameter.
* @throws { BusinessError } 16000011 - The context does not exist.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16000068 - The supported process cache state cannot be set more than once.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @stagemodelonly
* @since 12
*/
setSupportedProcessCache(isSupported : boolean): void;
}

View File

@ -79,11 +79,31 @@ export default class ApplicationStateObserver {
* @since 9
*/
onProcessStateChanged(processData: ProcessData): void;
/**
* Called when application is started.
*
* @param { AppStateData } appStateData - State changed Application info.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 12
*/
onAppStarted(appStateData: AppStateData): void;
/**
* Called when application is stopped.
*
* @param { AppStateData } appStateData - State changed Application info.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 12
*/
onAppStopped(appStateData: AppStateData): void;
}
/**
* The process data.
*
* @typedef { _ProcessData.default }
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi
* @since 9