From c7667e086bd3e86245439b94de49df4ea7d4191b Mon Sep 17 00:00:00 2001 From: xuqian Date: Wed, 6 Nov 2024 09:22:46 +0800 Subject: [PATCH] modify setappaccess code Signed-off-by: xuqian --- api/@ohos.account.appAccount.d.ts | 34 +++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/api/@ohos.account.appAccount.d.ts b/api/@ohos.account.appAccount.d.ts index 1397132cc..f491bf8a2 100644 --- a/api/@ohos.account.appAccount.d.ts +++ b/api/@ohos.account.appAccount.d.ts @@ -344,6 +344,23 @@ declare namespace appAccount { * @syscap SystemCapability.Account.AppAccount * @since 9 */ + /** + * Sets a third-party application with the specified bundle name to access the given application + * account for data query and listening. + * + * @param { string } name - Indicates the name of the application account. + * @param { string } bundleName - Indicates the bundle name of the third-party application. + * @param { boolean } isAccessible - Indicates the accessibility flag, true for accessible, false for inaccessible. + * @param { AsyncCallback } callback - Asynchronous callback interface. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 12300001 - System service exception. + * @throws { BusinessError } 12300002 - Invalid name or bundleName. + * @throws { BusinessError } 12300003 - Account not found. + * @throws { BusinessError } 12400005 - The size of authorization list reaches the upper limit. + * @syscap SystemCapability.Account.AppAccount + * @since 14 + */ setAppAccess(name: string, bundleName: string, isAccessible: boolean, callback: AsyncCallback): void; /** @@ -363,6 +380,23 @@ declare namespace appAccount { * @syscap SystemCapability.Account.AppAccount * @since 9 */ + /** + * Sets a third-party application with the specified bundle name to access the given application + * account for data query and listening. + * + * @param { string } name - Indicates the name of the application account. + * @param { string } bundleName - Indicates the bundle name of the third-party application. + * @param { boolean } isAccessible - Indicates the accessibility flag, true for accessible, false for inaccessible. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified. + *
2. Incorrect parameter types. + * @throws { BusinessError } 12300001 - System service exception. + * @throws { BusinessError } 12300002 - Invalid name or bundleName. + * @throws { BusinessError } 12300003 - Account not found. + * @throws { BusinessError } 12400005 - The size of authorization list reaches the upper limit. + * @syscap SystemCapability.Account.AppAccount + * @since 14 + */ setAppAccess(name: string, bundleName: string, isAccessible: boolean): Promise; /**