!13456 新增backToCallerAbilityWithResult接口

Merge pull request !13456 from 段嗣钊/release50
This commit is contained in:
openharmony_ci 2024-08-20 13:50:32 +00:00 committed by Gitee
commit 65557bc5fc
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 30 additions and 0 deletions

View File

@ -246,6 +246,15 @@ declare namespace wantConstant {
* @since 12
*/
APP_CLONE_INDEX_KEY = 'ohos.extra.param.key.appCloneIndex',
/**
* Indicates the param of caller's request code.
*
* @syscap SystemCapability.Ability.AbilityBase
* @atomicservice
* @since 12
*/
CALLER_REQUEST_CODE = 'ohos.extra.param.key.callerRequestCode',
/**
* Indicates the param of page path.

View File

@ -2585,6 +2585,27 @@ export default class UIAbilityContext extends Context {
*/
terminateSelfWithResult(parameter: AbilityResult): Promise<void>;
/**
* Return to caller application with specified result code and data while not destroying current ability.
* If the current application is in the background, you need to apply for permission:ohos.permission.START_ABILITIES_FROM_BACKGROUND.
*
* @param { AbilityResult } abilityResult - Indicates the result to return.
* @param { string } requestCode - Indicates the request code of caller ability.
* @returns { Promise<void> } The promise returned by the function.
* @throws { BusinessError } 201 - The application does not have permission to call the interface.
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified. 2.Incorrect parameter types.
* @throws { BusinessError } 16000009 - An ability cannot be started or stopped in Wukong mode.
* @throws { BusinessError } 16000011 - The context does not exist.
* @throws { BusinessError } 16000050 - Internal error.
* @throws { BusinessError } 16000074 - The caller does not exist.
* @throws { BusinessError } 16000075 - Not support back to caller.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @stagemodelonly
* @atomicservice
* @since 12
*/
backToCallerAbilityWithResult(abilityResult: AbilityResult, requestCode: string): Promise<void>;
/**
* Connects the current ability to an service extension ability.
*