diff --git a/api/@ohos.app.ability.wantConstant.d.ts b/api/@ohos.app.ability.wantConstant.d.ts index f9ffbb0b0..b1f988485 100644 --- a/api/@ohos.app.ability.wantConstant.d.ts +++ b/api/@ohos.app.ability.wantConstant.d.ts @@ -316,6 +316,14 @@ declare namespace wantConstant { * @since 14 */ CREATE_APP_INSTANCE_KEY = 'ohos.extra.param.key.createAppInstance', + + /** + * Indicates the app clone index of caller. + * + * @syscap SystemCapability.Ability.AbilityBase + * @since 14 + */ + CALLER_APP_CLONE_INDEX = 'ohos.param.callerAppCloneIndex', } /** diff --git a/api/@ohos.application.uriPermissionManager.d.ts b/api/@ohos.application.uriPermissionManager.d.ts index cb78e7279..8ec43d996 100644 --- a/api/@ohos.application.uriPermissionManager.d.ts +++ b/api/@ohos.application.uriPermissionManager.d.ts @@ -84,6 +84,33 @@ declare namespace uriPermissionManager { */ function grantUriPermission(uri: string, flag: wantConstant.Flags, targetBundleName: string): Promise; + /** + * Grant URI to another application + * + * @permission ohos.permission.PROXY_AUTHORIZATION_URI + * @param { string } uri - File URI. + * @param { wantConstant.Flags } flag - wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION, + * wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION or + * wantConstant.Flags.FLAG_AUTH_PERSISTABLE_URI_PERMISSION. + * @param { string } targetBundleName - Indicates the bundle name of authorization target. + * @param { number } appCloneIndex - Indicates the clone index of target application. + * @returns { Promise } - the promise returned by the function. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000058 - Invalid URI flag. + * @throws { BusinessError } 16000059 - Invalid URI type. + * @throws { BusinessError } 16000060 - A sandbox application cannot grant URI permission. + * @throws { BusinessError } 16000081 - Get target application info failed. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use. + * @since 14 + */ + function grantUriPermission(uri: string, flag: wantConstant.Flags, targetBundleName: string, appCloneIndex: number): Promise; + /** * Revoke URI from one application * @@ -155,6 +182,26 @@ declare namespace uriPermissionManager { * @since 12 */ function revokeUriPermission(uri: string, targetBundleName: string): Promise; + + /** + * Revoke URI from one application + * + * @param { string } uri - File URI. + * @param { string } targetBundleName - Indicates the bundle name of authorization target. + * @param { number } appCloneIndex - Indicates the clone index of target application. + * @returns { Promise } - the promise returned by the function. + * @throws { BusinessError } 202 - Not System App. Interface caller is not a system app. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1. Mandatory parameters are left unspecified; + * 2. Incorrect parameter types. + * @throws { BusinessError } 16000050 - Internal error. + * @throws { BusinessError } 16000059 - Invalid URI type. + * @throws { BusinessError } 16000081 - Get target application info failed. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + * @since 14 + */ + function revokeUriPermission(uri: string, targetBundleName: string, appCloneIndex: number): Promise; } export default uriPermissionManager; \ No newline at end of file