diff --git a/en/application-dev/reference/apis/js-apis-appAccount.md b/en/application-dev/reference/apis/js-apis-appAccount.md index f8414adaa9aa458914b66d9aaf503183c299095c..09034ce9408058dacd486db08869deaa054ecf29 100644 --- a/en/application-dev/reference/apis/js-apis-appAccount.md +++ b/en/application-dev/reference/apis/js-apis-appAccount.md @@ -20,8 +20,8 @@ Creates an **AppAccountManager** instance. **System capability**: SystemCapability.Account.AppAccount **Return Value** -| Type | Description | -| ----------------- | ------------------------ | +| Type | Description | +| ----------------- | ------------ | | AppAccountManager | **AppAccountManager** instance created.| **Example** @@ -43,10 +43,10 @@ Adds an app account to the account management service. This method uses an async **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------------------------- | ---- | ------------------------------------------ | -| name | string | Yes | Name of the app account to add. | -| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is added.| +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | ---- | --------------------- | +| name | string | Yes | Name of the app account to add. | +| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is added.| **Example** @@ -67,11 +67,11 @@ Adds an app account and its additional information to the account management ser **Parameters** -| Name | Type | Mandatory| Description | -| --------- | ------------------------- | ---- | ------------------------------------------------------------ | -| name | string | Yes | Name of the app account to add. | -| extraInfo | string | Yes | Additional information (for example, token) of the app account to add. The additional information cannot contain sensitive information about the app account.| -| callback | AsyncCallback<void> | Yes | Callback invoked when the app account and its additional information are added. | +| Name | Type | Mandatory | Description | +| --------- | ------------------------- | ---- | ---------------------------------------- | +| name | string | Yes | Name of the app account to add. | +| extraInfo | string | Yes | Additional information (for example, token) of the app account to add. The additional information cannot contain sensitive information about the app account.| +| callback | AsyncCallback<void> | Yes | Callback invoked when the app account and its additional information are added. | **Example** @@ -94,15 +94,15 @@ Adds an app account and its additional information to the account management ser **Parameters** -| Name | Type | Mandatory| Description | -| --------- | ------ | ---- | ------------------------------------------------------------ | -| name | string | Yes | Name of the app account to add. | -| extraInfo | string | Yes | Additional information of the app account to add. The additional information cannot contain sensitive information about the app account.| +| Name | Type | Mandatory | Description | +| --------- | ------ | ---- | -------------------------------- | +| name | string | Yes | Name of the app account to add. | +| extraInfo | string | Yes | Additional information of the app account to add. The additional information cannot contain sensitive information about the app account.| **Return Value** -| Type | Description | -| ------------------- | ---------------------------------- | +| Type | Description | +| ------------------- | --------------------- | | Promise<void> | Promise used to return the result.| **Example** @@ -126,12 +126,12 @@ Implicitly adds an app account based on the specified account owner, authenticat **Parameters** -| Name | Type | Mandatory| Description | -| -------- | --------------------- | ---- | ------------------------------ | -| owner | string | Yes | Bundle name of the app account to add.| -| authType | string | Yes | Authentication type of the app account to add. | -| options | {[key: string]: any} | Yes | Options for the authentication. | -| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| +| Name | Type | Mandatory | Description | +| -------- | --------------------- | ---- | --------------- | +| owner | string | Yes | Bundle name of the app account to add.| +| authType | string | Yes | Authentication type of the app account to add. | +| options | {[key: string]: any} | Yes | Options for the authentication. | +| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| **Example** @@ -167,10 +167,10 @@ Deletes an app account from the account management service. This method uses an **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------------------------- | ---- | ---------------------------------- | -| name | string | Yes | Name of the app account to delete. | -| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is deleted.| +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | ---- | ----------------- | +| name | string | Yes | Name of the app account to delete. | +| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is deleted.| **Example** @@ -191,14 +191,14 @@ Deletes an app account from the account management service. This method uses a p **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ------------------------ | -| name | string | Yes | Name of the app account to delete.| +| Name | Type | Mandatory | Description | +| ---- | ------ | ---- | ------------ | +| name | string | Yes | Name of the app account to delete.| **Return Value** -| Type | Description | -| :------------------ | :---------------------------------- | +| Type | Description | +| :------------------ | :-------------------- | | Promise<void> | Promise used to return the result.| **Example** @@ -222,11 +222,11 @@ Disables an app account from accessing an application with the given bundle name **Parameters** -| Name | Type | Mandatory| Description | -| ---------- | ------------------------- | ---- | ------------------------------------------------------------ | -| name | string | Yes | App account name. | -| bundleName | string | Yes | Bundle name of an app. | -| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is disabled from accessing the application with the given bundle name.| +| Name | Type | Mandatory | Description | +| ---------- | ------------------------- | ---- | ------------------------------- | +| name | string | Yes | App account name. | +| bundleName | string | Yes | Bundle name of an app. | +| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is disabled from accessing the application with the given bundle name.| **Example** @@ -247,15 +247,15 @@ Disables an app account from accessing an application with the given bundle name **Parameters** -| Name | Type | Mandatory| Description | -| ---------- | ------ | ---- | ---------------------------------- | -| name | string | Yes | App account name.| -| bundleName | string | Yes | Bundle name of an app. | +| Name | Type | Mandatory | Description | +| ---------- | ------ | ---- | ----------------- | +| name | string | Yes | App account name.| +| bundleName | string | Yes | Bundle name of an app. | **Return Value** -| Type | Description | -| :------------------ | :---------------------------------- | +| Type | Description | +| :------------------ | :-------------------- | | Promise<void> | Promise used to return the result.| **Example** @@ -279,11 +279,11 @@ Enables an app account to access an application with the given bundle name. This **Parameters** -| Name | Type | Mandatory| Description | -| ---------- | ------------------------- | ---- | ------------------------------------------------------------ | -| name | string | Yes | App account name. | -| bundleName | string | Yes | Bundle name of an app. | -| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is enabled to access the application with the given bundle name.| +| Name | Type | Mandatory | Description | +| ---------- | ------------------------- | ---- | ------------------------------- | +| name | string | Yes | App account name. | +| bundleName | string | Yes | Bundle name of an app. | +| callback | AsyncCallback<void> | Yes | Callback invoked when the app account is enabled to access the application with the given bundle name.| **Example** @@ -304,15 +304,15 @@ Enables an app account to access an application with the given bundle name. This **Parameters** -| Name | Type | Mandatory| Description | -| ---------- | ------ | ---- | ------------------ | -| name | string | Yes | App account name. | -| bundleName | string | Yes | Bundle name of an app.| +| Name | Type | Mandatory | Description | +| ---------- | ------ | ---- | --------- | +| name | string | Yes | App account name. | +| bundleName | string | Yes | Bundle name of an app.| **Return Value** -| Type | Description | -| :------------------ | :---------------------------------- | +| Type | Description | +| :------------------ | :-------------------- | | Promise<void> | Promise used to return the result.| **Example** @@ -337,10 +337,10 @@ Checks whether an app account allows application data synchronization. This meth **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ---------------------------- | ---- | -------------------------------------------- | -| name | string | Yes | App account name. | -| callback | AsyncCallback<boolean> | Yes | Callback used to return whether the app account allows application data synchronization.| +| Name | Type | Mandatory | Description | +| -------- | ---------------------------- | ---- | ---------------------- | +| name | string | Yes | App account name. | +| callback | AsyncCallback<boolean> | Yes | Callback used to return whether the app account allows application data synchronization.| **Example** @@ -364,14 +364,14 @@ Checks whether an app account allows application data synchronization. This meth **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | -------------- | -| name | string | Yes | App account name.| +| Name | Type | Mandatory | Description | +| ---- | ------ | ---- | ------- | +| name | string | Yes | App account name.| **Return Value** -| Type | Description | -| :--------------------- | :---------------------------------- | +| Type | Description | +| :--------------------- | :-------------------- | | Promise<boolean> | Promise used to return the result.| **Example** @@ -387,7 +387,7 @@ Checks whether an app account allows application data synchronization. This meth ### setAccountCredential -setAccountCredential(name: string, credentialType: string, credential: string callback: AsyncCallback<void>): void +setAccountCredential(name: string, credentialType: string, credential: string,callback: AsyncCallback<void>): void Sets a credential for an app account. This method uses an asynchronous callback to return the result. @@ -395,12 +395,12 @@ Sets a credential for an app account. This method uses an asynchronous callback **Parameters** -| Name | Type | Mandatory| Description | -| -------------- | ------------------------- | ---- | ---------------------------- | -| name | string | Yes | App account name. | -| credentialType | string | Yes | Type of the credential to set. | -| credential | string | Yes | Credential to set. | -| callback | AsyncCallback<void> | Yes | Callback invoked when a credential is set for the specified app account.| +| Name | Type | Mandatory | Description | +| -------------- | ------------------------- | ---- | -------------- | +| name | string | Yes | App account name. | +| credentialType | string | Yes | Type of the credential to set. | +| credential | string | Yes | Credential to set. | +| callback | AsyncCallback<void> | Yes | Callback invoked when a credential is set for the specified app account.| **Example** @@ -421,16 +421,16 @@ Sets a credential for an app account. This method uses a promise to return the r **Parameters** -| Name | Type | Mandatory| Description | -| -------------- | ------ | ---- | -------------------- | -| name | string | Yes | App account name. | -| credentialType | string | Yes | Type of the credential to set.| -| credential | string | Yes | Credential to set. | +| Name | Type | Mandatory | Description | +| -------------- | ------ | ---- | ---------- | +| name | string | Yes | App account name. | +| credentialType | string | Yes | Type of the credential to set.| +| credential | string | Yes | Credential to set. | **Return Value** -| Type | Description | -| :------------------ | :---------------------------------- | +| Type | Description | +| :------------------ | :-------------------- | | Promise<void> | Promise used to return the result.| **Example** @@ -454,11 +454,11 @@ Sets additional information for an app account. This method uses an asynchronous **Parameters** -| Name | Type | Mandatory| Description | -| --------- | ------------------------- | ---- | -------------------------------- | -| name | string | Yes | App account name. | -| extraInfo | string | Yes | Additional information to set. | -| callback | AsyncCallback<void> | Yes | Callback invoked when additional information is set for the specified app account.| +| Name | Type | Mandatory | Description | +| --------- | ------------------------- | ---- | ---------------- | +| name | string | Yes | App account name. | +| extraInfo | string | Yes | Additional information to set. | +| callback | AsyncCallback<void> | Yes | Callback invoked when additional information is set for the specified app account.| **Example** @@ -479,15 +479,15 @@ Sets additional information for an app account. This method uses a promise to re **Parameters** -| Name | Type | Mandatory| Description | -| --------- | ------ | ---- | ------------------ | -| name | string | Yes | App account name. | -| extraInfo | string | Yes | Additional information to set.| +| Name | Type | Mandatory | Description | +| --------- | ------ | ---- | --------- | +| name | string | Yes | App account name. | +| extraInfo | string | Yes | Additional information to set.| **Return Value** -| Type | Description | -| :------------------ | :---------------------------------- | +| Type | Description | +| :------------------ | :-------------------- | | Promise<void> | Promise used to return the result.| **Example** @@ -513,11 +513,11 @@ Sets whether to enable application data synchronization for an app account. This **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------------------------- | ---- | -------------------------------------------------- | -| name | string | Yes | App account name. | -| isEnable | boolean | Yes | Whether to enable app data synchronization. | -| callback | AsyncCallback<void> | Yes | Callback invoked when application data synchronization is enabled or disabled for the app account.| +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | ---- | ------------------------- | +| name | string | Yes | App account name. | +| isEnable | boolean | Yes | Whether to enable app data synchronization. | +| callback | AsyncCallback<void> | Yes | Callback invoked when application data synchronization is enabled or disabled for the app account.| **Example** @@ -540,15 +540,15 @@ Sets whether to enable application data synchronization for an app account. This **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------- | ---- | ---------------------- | -| name | string | Yes | App account name. | -| isEnable | boolean | Yes | Whether to enable app data synchronization.| +| Name | Type | Mandatory | Description | +| -------- | ------- | ---- | ----------- | +| name | string | Yes | App account name. | +| isEnable | boolean | Yes | Whether to enable app data synchronization.| **Return Value** -| Type | Description | -| :------------------ | :---------------------------------- | +| Type | Description | +| :------------------ | :-------------------- | | Promise<void> | Promise used to return the result.| **Example** @@ -572,12 +572,12 @@ Sets data to be associated with an app account. This method uses an asynchronous **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------------------------- | ---- | ---------------------------------- | -| name | string | Yes | App account name. | -| key | string | Yes | Key of the data to set. The private key can be customized.| -| value | string | Yes | Value of the data to be set. | -| callback | AsyncCallback<void> | Yes | Callback invoked when the data associated with the specified app account is set.| +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | ---- | ----------------- | +| name | string | Yes | App account name. | +| key | string | Yes | Key of the data to set. The private key can be customized.| +| value | string | Yes | Value of the data to be set. | +| callback | AsyncCallback<void> | Yes | Callback invoked when the data associated with the specified app account is set.| **Example** @@ -597,16 +597,16 @@ Sets data to be associated with an app account. This method uses a promise to re **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ---------------------------------- | -| name | string | Yes | App account name. | -| key | string | Yes | Key of the data to set. The private key can be customized.| -| value | string | Yes | Value of the data to be set. | +| Name | Type | Mandatory | Description | +| ----- | ------ | ---- | ----------------- | +| name | string | Yes | App account name. | +| key | string | Yes | Key of the data to set. The private key can be customized.| +| value | string | Yes | Value of the data to be set. | **Return Value** -| Type | Description | -| :------------------ | :---------------------------------- | +| Type | Description | +| :------------------ | :-------------------- | | Promise<void> | Promise used to return the result.| **Example** @@ -630,11 +630,11 @@ Obtains the credential of an app account. This method uses an asynchronous callb **Parameters** -| Name | Type | Mandatory| Description | -| -------------- | --------------------------- | ---- | ---------------------------- | -| name | string | Yes | App account name. | -| credentialType | string | Yes | Type of the credential to obtain. | -| callback | AsyncCallback<string> | Yes | Callback invoked to return the credential of the specified app account.| +| Name | Type | Mandatory | Description | +| -------------- | --------------------------- | ---- | -------------- | +| name | string | Yes | App account name. | +| credentialType | string | Yes | Type of the credential to obtain. | +| callback | AsyncCallback<string> | Yes | Callback invoked to return the credential of the specified app account.| **Example** @@ -656,15 +656,15 @@ Obtains the credential of an app account. This method uses a promise to return t **Parameters** -| Name | Type | Mandatory| Description | -| -------------- | ------ | ---- | -------------------- | -| name | string | Yes | App account name. | -| credentialType | string | Yes | Type of the credential to obtain.| +| Name | Type | Mandatory | Description | +| -------------- | ------ | ---- | ---------- | +| name | string | Yes | App account name. | +| credentialType | string | Yes | Type of the credential to obtain.| **Return Value** -| Type | Description | -| :-------------------- | :---------------------------------- | +| Type | Description | +| :-------------------- | :-------------------- | | Promise<string> | Promise used to return the result.| **Example** @@ -688,10 +688,10 @@ Obtains additional information of an app account. This method uses an asynchrono **Parameters** -| Name | Type | Mandatory| Description | -| -------- | --------------------------- | ---- | -------------------------------- | -| name | string | Yes | App account name. | -| callback | AsyncCallback<string> | Yes | Callback invoked to return the additional information of the specified app account.| +| Name | Type | Mandatory | Description | +| -------- | --------------------------- | ---- | ---------------- | +| name | string | Yes | App account name. | +| callback | AsyncCallback<string> | Yes | Callback invoked to return the additional information of the specified app account.| **Example** @@ -713,14 +713,14 @@ Obtains additional information of an app account. This method uses a promise to **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | -------------- | -| name | string | Yes | App account name.| +| Name | Type | Mandatory | Description | +| ---- | ------ | ---- | ------- | +| name | string | Yes | App account name.| **Return Value** -| Type | Description | -| :-------------------- | :---------------------------------- | +| Type | Description | +| :-------------------- | :-------------------- | | Promise<string> | Promise used to return the result.| **Example** @@ -744,11 +744,11 @@ Obtains data associated with an app account. This method uses an asynchronous ca **Parameters** -| Name | Type | Mandatory| Description | -| -------- | --------------------------- | ---- | ---------------------------------- | -| name | string | Yes | App account name. | -| key | string | Yes | Key of the data to obtain. | -| callback | AsyncCallback<string> | Yes | Callback invoked to return the data associated with the specified app account.| +| Name | Type | Mandatory | Description | +| -------- | --------------------------- | ---- | ----------------- | +| name | string | Yes | App account name. | +| key | string | Yes | Key of the data to obtain. | +| callback | AsyncCallback<string> | Yes | Callback invoked to return the data associated with the specified app account.| **Example** @@ -770,15 +770,15 @@ Obtains data associated with an app account. This method uses a promise to retur **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ------------------- | -| name | string | Yes | App account name. | -| key | string | Yes | Key of the data to obtain.| +| Name | Type | Mandatory | Description | +| ---- | ------ | ---- | ----------- | +| name | string | Yes | App account name. | +| key | string | Yes | Key of the data to obtain.| **Return Value** -| Type | Description | -| :-------------------- | :---------------------------------- | +| Type | Description | +| :-------------------- | :-------------------- | | Promise<string> | Promise used to return the result.| **Example** @@ -798,15 +798,15 @@ getAllAccessibleAccounts(callback: AsyncCallback<Array<AppAccountInfo>& Obtains information about all accessible app accounts. This method uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.GET_ACCOUNTS_PRIVILEGED (available only to system applications) +**Required permissions**: ohos.permission.GET_ALL_APP_ACCOUNTS (available only to system applications) **System capability**: SystemCapability.Account.AppAccount **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------------------------------------------------ | ---- | ---------------- | -| callback | AsyncCallback<Array<AppAccountInfo>> | Yes | Callback invoked to return information about all accessible app accounts.| +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | -------- | +| callback | AsyncCallback<Array<AppAccountInfo>> | Yes | Callback invoked to return information about all accessible app accounts.| **Example** @@ -824,14 +824,14 @@ getAllAccessibleAccounts(): Promise<Array<AppAccountInfo>> Obtains information about all accessible app accounts. This method uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.GET_ACCOUNTS_PRIVILEGED (available only to system applications) +**Required permissions**: ohos.permission.GET_ALL_APP_ACCOUNTS (available only to system applications) **System capability**: SystemCapability.Account.AppAccount **Parameters** -| Type | Description | -| ------------------------------------------ | ----------------------------------- | +| Type | Description | +| ---------------------------------------- | --------------------- | | Promise<Array<AppAccountInfo>> | Promise used to return the result.| **Example** @@ -851,16 +851,16 @@ getAllAccounts(owner: string, callback: AsyncCallback<Array<AppAccountInfo Obtains information about all app accounts of the specified app. This method uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.GET_ACCOUNTS_PRIVILEGED (available only to system applications) +**Required permissions**: ohos.permission.GET_ALL_APP_ACCOUNTS (available only to system applications) **System capability**: SystemCapability.Account.AppAccount **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------------------------------------------------ | ---- | ---------------- | -| owner | string | Yes | Bundle name of the app. | -| callback | AsyncCallback<Array<AppAccountInfo>> | Yes | Callback invoked to return information about all accessible app accounts.| +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | -------- | +| owner | string | Yes | Bundle name of the app. | +| callback | AsyncCallback<Array<AppAccountInfo>> | Yes | Callback invoked to return information about all accessible app accounts.| **Example** @@ -879,20 +879,20 @@ getAllAccounts(owner: string): Promise<Array<AppAccountInfo>> Obtains information about all app accounts of the specified app. This method uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.GET_ACCOUNTS_PRIVILEGED (available only to system applications) +**Required permissions**: ohos.permission.GET_ALL_APP_ACCOUNTS (available only to system applications) **System capability**: SystemCapability.Account.AppAccount **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ---------- | -| owner | string | Yes | Bundle name of the app.| +| Name | Type | Mandatory | Description | +| ----- | ------ | ---- | ----- | +| owner | string | Yes | Bundle name of the app.| **Parameters** -| Type | Description | -| ------------------------------------------ | ----------------------------------- | +| Type | Description | +| ---------------------------------------- | --------------------- | | Promise<Array<AppAccountInfo>> | Promise used to return the result.| **Example** @@ -917,11 +917,11 @@ Subscribes to the account change event of the specified account owners. This met **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------------------------------------------- | ---- | ------------------------------------------------------------ | -| type | 'change' | Yes | Type of the event to subscribe to. The subscriber will receive a notification when the account owners update their accounts.| -| owners | Array<string> | Yes | Owners of the accounts. | -| callback | Callback<Array<AppAccountInfo>> | Yes | Callback invoked to return the account change. | +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | ------------------------------ | +| type | 'change' | Yes | Type of the event to subscribe to. The subscriber will receive a notification when the account owners update their accounts.| +| owners | Array<string> | Yes | Owners of the accounts. | +| callback | Callback<Array<AppAccountInfo>> | Yes | Callback invoked to return the account change. | **Example** @@ -948,10 +948,10 @@ Unsubscribes from the account change event. This method uses an asynchronous cal **Parameters** -| Name | Type | Mandatory| Description | -| -------- | -------------------------------- | ---- | ------------------------ | -| type | 'change' | Yes | Account change event to unsubscribe from. | -| callback | Callback> | No | Callback used to report the account change.| +| Name | Type | Mandatory | Description | +| -------- | -------------------------------- | ---- | ------------ | +| type | 'change' | Yes | Account change event to unsubscribe from. | +| callback | Callback> | No | Callback used to report the account change.| **Example** @@ -981,13 +981,13 @@ Authenticates an app account to obtain the Open Authorization (OAuth) access tok **Parameters** -| Name | Type | Mandatory| Description | -| -------- | --------------------- | ---- | ------------------------------ | -| name | string | Yes | Name of the app account to authenticate. | -| owner | string | Yes | Bundle name of the app.| -| authType | string | Yes | Authentication type. | -| options | {[key: string]: any} | Yes | Options for the authentication. | -| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| +| Name | Type | Mandatory | Description | +| -------- | --------------------- | ---- | --------------- | +| name | string | Yes | Name of the app account to authenticate. | +| owner | string | Yes | Bundle name of the app.| +| authType | string | Yes | Authentication type. | +| options | {[key: string]: any} | Yes | Options for the authentication. | +| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| **Example** @@ -1023,12 +1023,12 @@ Obtains the OAuth access token of an app account based on the specified authenti **Parameters** -| Name | Type | Mandatory| Description | -| -------- | --------------------------- | ---- | ---------------------- | -| name | string | Yes | App account name. | -| owner | string | Yes | Bundle name of the app.| -| authType | string | Yes | Authentication type. | -| callback | AsyncCallback<string> | Yes | Callback invoked to return the result. | +| Name | Type | Mandatory | Description | +| -------- | --------------------------- | ---- | ----------- | +| name | string | Yes | App account name. | +| owner | string | Yes | Bundle name of the app.| +| authType | string | Yes | Authentication type. | +| callback | AsyncCallback<string> | Yes | Callback invoked to return the result. | **Example** @@ -1050,16 +1050,16 @@ Obtains the OAuth access token of an app account based on the specified authenti **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------ | ---- | ---------------------- | -| name | string | Yes | App account name. | -| owner | string | Yes | Bundle name of the app.| -| authType | string | Yes | Authentication type. | +| Name | Type | Mandatory | Description | +| -------- | ------ | ---- | ----------- | +| name | string | Yes | App account name. | +| owner | string | Yes | Bundle name of the app.| +| authType | string | Yes | Authentication type. | **Parameters** -| Type | Description | -| --------------------- | ----------------------------------- | +| Type | Description | +| --------------------- | --------------------- | | Promise<string> | Promise used to return the result.| **Example** @@ -1083,12 +1083,12 @@ Sets an OAuth access token for an app account. This method uses an asynchronous **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------------------------- | ---- | ---------------- | -| name | string | Yes | App account name.| -| authType | string | Yes | Authentication type. | -| token | string | Yes | OAuth access token to set. | -| callback | AsyncCallback<void> | Yes | Callback invoked to return the result.| +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | ---- | -------- | +| name | string | Yes | App account name.| +| authType | string | Yes | Authentication type. | +| token | string | Yes | OAuth access token to set.| +| callback | AsyncCallback<void> | Yes | Callback invoked to return the result.| **Example** @@ -1109,16 +1109,16 @@ Sets an OAuth access token for an app account. This method uses a promise to ret **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------ | ---- | ---------------- | -| name | string | Yes | App account name.| -| authType | string | Yes | Authentication type. | -| token | string | Yes | OAuth access token to set. | +| Name | Type | Mandatory | Description | +| -------- | ------ | ---- | -------- | +| name | string | Yes | App account name.| +| authType | string | Yes | Authentication type. | +| token | string | Yes | OAuth access token to set.| **Parameters** -| Type | Description | -| ------------------- | ----------------------------------- | +| Type | Description | +| ------------------- | --------------------- | | Promise<void> | Promise used to return the result.| **Example** @@ -1142,13 +1142,13 @@ Deletes the specified OAuth access token for an app account. This method uses an **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------------------------- | ---- | ---------------------- | -| name | string | Yes | App account name. | -| owner | string | Yes | Bundle name of the app.| -| authType | string | Yes | Authentication type. | -| token | string | Yes | OAuth access token to delete. | -| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. | +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | ---- | ------------ | +| name | string | Yes | App account name. | +| owner | string | Yes | Bundle name of the app. | +| authType | string | Yes | Authentication type. | +| token | string | Yes | OAuth access token to delete.| +| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. | **Example** @@ -1169,17 +1169,17 @@ Deletes the specified OAuth access token for an app account. This method uses a **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------ | ---- | ---------------------- | -| name | string | Yes | App account name. | -| owner | string | Yes | Bundle name of the app.| -| authType | string | Yes | Authentication type. | -| token | string | Yes | OAuth access token to delete. | +| Name | Type | Mandatory | Description | +| -------- | ------ | ---- | ------------ | +| name | string | Yes | App account name. | +| owner | string | Yes | Bundle name of the app. | +| authType | string | Yes | Authentication type. | +| token | string | Yes | OAuth access token to delete.| **Parameters** -| Type | Description | -| ------------------- | ----------------------------------- | +| Type | Description | +| ------------------- | --------------------- | | Promise<void> | Promise used to return the result.| **Example** @@ -1203,13 +1203,13 @@ Sets the visibility of an OAuth access token to the specified app. This method u **Parameters** -| Name | Type | Mandatory| Description | -| ---------- | ------------------------- | ---- | ------------------------ | -| name | string | Yes | App account name. | -| authType | string | Yes | Authentication type. | -| bundleName | string | Yes | Bundle name of the app.| -| isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. | -| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. | +| Name | Type | Mandatory | Description | +| ---------- | ------------------------- | ---- | ------------ | +| name | string | Yes | App account name. | +| authType | string | Yes | Authentication type. | +| bundleName | string | Yes | Bundle name of the app.| +| isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. | +| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. | **Example** @@ -1230,24 +1230,23 @@ Sets the visibility of an OAuth access token to the specified app. This method u **Parameters** -| Name | Type | Mandatory| Description | -| ---------- | ------- | ---- | ------------------------ | -| name | string | Yes | App account name. | -| authType | string | Yes | Authentication type. | -| bundleName | string | Yes | Bundle name of the app.| -| isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. | +| Name | Type | Mandatory | Description | +| ---------- | ------- | ---- | ------------ | +| name | string | Yes | App account name. | +| authType | string | Yes | Authentication type. | +| bundleName | string | Yes | Bundle name of the app.| +| isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. | **Parameters** -| Type | Description | -| ------------------- | ----------------------------------- | +| Type | Description | +| ------------------- | --------------------- | | Promise<void> | Promise used to return the result.| **Example** ``` const appAccountManager = account_appAccount.createAppAccountManager(); - const appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.setOAuthTokenVisibility("LiSi", "readAge", "com.example.ohos.accountjsdemo", true).then(() => { console.log('setOAuthTokenVisibility successfully'); }).catch((err) => { @@ -1265,12 +1264,12 @@ Checks whether an OAuth token is visible to the specified app. This method uses **Parameters** -| Name | Type | Mandatory| Description | -| ---------- | ---------------------------- | ---- | -------------------------- | -| name | string | Yes | App account name. | -| authType | string | Yes | Authentication type. | -| bundleName | string | Yes | Bundle name of the app.| -| callback | AsyncCallback<boolean> | Yes | Callback invoked to return the result. | +| Name | Type | Mandatory | Description | +| ---------- | ---------------------------- | ---- | ------------- | +| name | string | Yes | App account name. | +| authType | string | Yes | Authentication type. | +| bundleName | string | Yes | Bundle name of the app.| +| callback | AsyncCallback<boolean> | Yes | Callback invoked to return the result. | **Example** @@ -1292,16 +1291,16 @@ Checks whether an OAuth token is visible to the specified app. This method uses **Parameters** -| Name | Type | Mandatory| Description | -| ---------- | ------ | ---- | -------------------------- | -| name | string | Yes | App account name. | -| authType | string | Yes | Authentication type. | -| bundleName | string | Yes | Bundle name of the app.| +| Name | Type | Mandatory | Description | +| ---------- | ------ | ---- | ------------- | +| name | string | Yes | App account name. | +| authType | string | Yes | Authentication type. | +| bundleName | string | Yes | Bundle name of the app.| **Parameters** -| Type | Description | -| ---------------------- | ----------------------------------- | +| Type | Description | +| ---------------------- | --------------------- | | Promise<boolean> | Promise used to return the result.| **Example** @@ -1325,11 +1324,11 @@ Obtains information about all OAuth access tokens of an app account visible to t **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------------------------------------------------ | ---- | ---------------------- | -| name | string | Yes | App account name. | -| owner | string | Yes | Bundle name of the app.| -| callback | AsyncCallback<Array<OAuthTokenInfo>> | Yes | Callback invoked to return the result. | +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | ----------- | +| name | string | Yes | App account name. | +| owner | string | Yes | Bundle name of the app.| +| callback | AsyncCallback<Array<OAuthTokenInfo>> | Yes | Callback invoked to return the result. | **Example** @@ -1351,15 +1350,15 @@ Obtains information about all OAuth access tokens of an app account visible to t **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ---------------------- | -| name | string | Yes | App account name. | -| owner | string | Yes | Bundle name of the app.| +| Name | Type | Mandatory | Description | +| ----- | ------ | ---- | ----------- | +| name | string | Yes | App account name. | +| owner | string | Yes | Bundle name of the app.| **Parameters** -| Type | Description | -| ------------------------------------------ | ----------------------------------- | +| Type | Description | +| ---------------------------------------- | --------------------- | | Promise<Array<OAuthTokenInfo>> | Promise used to return the result.| **Example** @@ -1383,11 +1382,11 @@ Obtains the authorization list of OAuth access tokens of an app account. This me **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ---------------------------------------- | ---- | ---------------------- | -| name | string | Yes | App account name. | -| owner | string | Yes | Bundle name of the app.| -| callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the result. | +| Name | Type | Mandatory | Description | +| -------- | ---------------------------------------- | ---- | ----------- | +| name | string | Yes | App account name. | +| owner | string | Yes | Bundle name of the app.| +| callback | AsyncCallback<Array<string>> | Yes | Callback invoked to return the result. | **Example** @@ -1409,15 +1408,15 @@ Obtains the authorization list of OAuth access tokens of an app account. This me **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ---------------------- | -| name | string | Yes | App account name. | -| owner | string | Yes | Bundle name of the app.| +| Name | Type | Mandatory | Description | +| ----- | ------ | ---- | ----------- | +| name | string | Yes | App account name. | +| owner | string | Yes | Bundle name of the app.| **Parameters** -| Type | Description | -| ---------------------------------- | ----------------------------------- | +| Type | Description | +| ---------------------------------- | --------------------- | | Promise<Array<string>> | Promise used to return the result.| **Example** @@ -1441,10 +1440,10 @@ Obtains the authenticator callback for a session. This method uses an asynchrono **Parameters** -| Name | Type | Mandatory| Description | -| --------- | ------------------------------------------ | ---- | ---------------- | -| sessionId | string | Yes | ID of the session to authenticate.| -| callback | AsyncCallback<AuthenticatorCallback> | Yes | Callback invoked to return the result.| +| Name | Type | Mandatory | Description | +| --------- | ---------------------------------------- | ---- | -------- | +| sessionId | string | Yes | ID of the session to authenticate.| +| callback | AsyncCallback<AuthenticatorCallback> | Yes | Callback invoked to return the result.| **Example** @@ -1476,14 +1475,14 @@ Obtains the authenticator callback for a session. This method uses a promise to **Parameters** -| Name | Type | Mandatory| Description | -| --------- | ------ | ---- | ---------------- | -| sessionId | string | Yes | ID of the session to authenticate.| +| Name | Type | Mandatory | Description | +| --------- | ------ | ---- | -------- | +| sessionId | string | Yes | ID of the session to authenticate.| **Parameters** -| Type | Description | -| ------------------------------------ | ----------------------------------- | +| Type | Description | +| ------------------------------------ | --------------------- | | Promise<AuthenticatorCallback> | Promise used to return the result.| **Example** @@ -1516,10 +1515,10 @@ Obtains authenticator information of an app account. This method uses an asynchr **Parameters** -| Name | Type | Mandatory| Description | -| -------- | -------------------------------------- | ---- | ---------------------- | -| owner | string | Yes | Bundle name of the app.| -| callback | AsyncCallback<AuthenticatorInfo> | Yes | Callback invoked to return the result. | +| Name | Type | Mandatory | Description | +| -------- | -------------------------------------- | ---- | ----------- | +| owner | string | Yes | Bundle name of the app.| +| callback | AsyncCallback<AuthenticatorInfo> | Yes | Callback invoked to return the result. | **Example** @@ -1541,14 +1540,14 @@ Obtains authenticator information of an app account. This method uses a promise **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ---------------------- | -| owner | string | Yes | Bundle name of the app.| +| Name | Type | Mandatory | Description | +| ----- | ------ | ---- | ----------- | +| owner | string | Yes | Bundle name of the app.| **Parameters** -| Type | Description | -| -------------------------------- | ----------------------------------- | +| Type | Description | +| -------------------------------- | --------------------- | | Promise<AuthenticatorInfo> | Promise used to return the result.| **Example** @@ -1568,10 +1567,10 @@ Defines app account information. **System capability**: SystemCapability.Account.AppAccount -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ---------------------- | -| owner | string | Yes | Bundle name of the app.| -| name | string | Yes | App account name. | +| Name | Type | Mandatory | Description | +| ----- | ------ | ---- | ----------- | +| owner | string | Yes | Bundle name of the app.| +| name | string | Yes | App account name. | ## OAuthTokenInfo8+ @@ -1579,10 +1578,10 @@ Defines OAuth access token information. **System capability**: SystemCapability.Account.AppAccount -| Name | Type | Mandatory| Description | -| -------- | ------ | ---- | ---------------- | -| authType | string | Yes | Authentication type.| -| token | string | Yes | Value of the access token. | +| Name | Type | Mandatory | Description | +| -------- | ------ | ---- | -------- | +| authType | string | Yes | Authentication type.| +| token | string | Yes | Value of the access token. | ## AuthenticatorInfo8+ @@ -1590,11 +1589,11 @@ Defines OAuth authenticator information. **System capability**: SystemCapability.Account.AppAccount -| Name | Type | Mandatory| Description | -| ------- | ------ | ---- | -------------------- | -| owner | string | Yes | Bundle name of the authenticator owner.| -| iconId | string | Yes | ID of the authenticator icon. | -| labelId | string | Yes | ID of the authenticator label. | +| Name | Type | Mandatory | Description | +| ------- | ------ | ---- | ---------- | +| owner | string | Yes | Bundle name of the authenticator owner.| +| iconId | string | Yes | ID of the authenticator icon. | +| labelId | string | Yes | ID of the authenticator label. | ## Constants8+ @@ -1602,19 +1601,19 @@ Enumerates the constants. **System capability**: SystemCapability.Account.AppAccount -| Name | Default Value | Description | -| ----------------------------- | ---------------------- | ------------------------- | -| ACTION_ADD_ACCOUNT_IMPLICITLY | "addAccountImplicitly" | Operation for implicitly adding an account. | -| ACTION_AUTHENTICATE | "authenticate" | Authentication operation. | -| KEY_NAME | "name" | App account name. | +| Name | Default Value | Description | +| ----------------------------- | ---------------------- | ------------- | +| ACTION_ADD_ACCOUNT_IMPLICITLY | "addAccountImplicitly" | Operation for implicitly adding an account. | +| ACTION_AUTHENTICATE | "authenticate" | Authentication operation. | +| KEY_NAME | "name" | App account name. | | KEY_OWNER | "owner" | App account owner.| -| KEY_TOKEN | "token" | OAuth access token. | -| KEY_ACTION | "action" | Action. | -| KEY_AUTH_TYPE | "authType" | Authentication type. | -| KEY_SESSION_ID | "sessionId" | Session ID. | -| KEY_CALLER_PID | "callerPid" | Caller process ID (PID). | -| KEY_CALLER_UID | "callerUid" | Caller user ID (UID). | -| KEY_CALLER_BUNDLE_NAME | "callerBundleName" | Caller bundle name. | +| KEY_TOKEN | "token" | OAuth access token. | +| KEY_ACTION | "action" | Action. | +| KEY_AUTH_TYPE | "authType" | Authentication type. | +| KEY_SESSION_ID | "sessionId" | Session ID. | +| KEY_CALLER_PID | "callerPid" | Caller process ID (PID). | +| KEY_CALLER_UID | "callerUid" | Caller user ID (UID). | +| KEY_CALLER_BUNDLE_NAME | "callerBundleName" | Caller bundle name. | ## ResultCode8+ @@ -1622,27 +1621,27 @@ Enumerates the result codes. **System capability**: SystemCapability.Account.AppAccount -| Name | Default Value| Description | -| ----------------------------------- | ------ | ------------------------ | -| SUCCESS | 0 | The operation is successful. | -| ERROR_ACCOUNT_NOT_EXIST | 10001 | The app account does not exist. | -| ERROR_APP_ACCOUNT_SERVICE_EXCEPTION | 10002 | The app account service is abnormal. | -| ERROR_INVALID_PASSWORD | 10003 | The password is invalid. | -| ERROR_INVALID_REQUEST | 10004 | The request is invalid. | -| ERROR_INVALID_RESPONSE | 10005 | The response is invalid. | -| ERROR_NETWORK_EXCEPTION | 10006 | The network is abnormal. | -| ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST | 10007 | The authenticator does not exist. | -| ERROR_OAUTH_CANCELED | 10008 | The authentication is canceled. | -| ERROR_OAUTH_LIST_TOO_LARGE | 10009 | The size of the OAuth list exceeds the limit. | -| ERROR_OAUTH_SERVICE_BUSY | 10010 | The OAuth service is busy. | -| ERROR_OAUTH_SERVICE_EXCEPTION | 10011 | The OAuth service is abnormal. | -| ERROR_OAUTH_SESSION_NOT_EXIST | 10012 | The session to be authenticated does not exist. | -| ERROR_OAUTH_TIMEOUT | 10013 | The authentication timed out. | -| ERROR_OAUTH_TOKEN_NOT_EXIST | 10014 | The OAuth access token does not exist.| -| ERROR_OAUTH_TOKEN_TOO_MANY | 10015 | The number of OAuth access tokens reaches the limit. | -| ERROR_OAUTH_UNSUPPORT_ACTION | 10016 | The authentication operation is not supported. | -| ERROR_OAUTH_UNSUPPORT_AUTH_TYPE | 10017 | The authentication type is not supported. | -| ERROR_PERMISSION_DENIED | 10018 | The required permission is missing. | +| Name | Default Value | Description | +| ----------------------------------- | ----- | ------------ | +| SUCCESS | 0 | The operation is successful. | +| ERROR_ACCOUNT_NOT_EXIST | 10001 | The app account does not exist. | +| ERROR_APP_ACCOUNT_SERVICE_EXCEPTION | 10002 | The app account service is abnormal. | +| ERROR_INVALID_PASSWORD | 10003 | The password is invalid. | +| ERROR_INVALID_REQUEST | 10004 | The request is invalid. | +| ERROR_INVALID_RESPONSE | 10005 | The response is invalid. | +| ERROR_NETWORK_EXCEPTION | 10006 | The network is abnormal. | +| ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST | 10007 | The authenticator does not exist. | +| ERROR_OAUTH_CANCELED | 10008 | The authentication is canceled. | +| ERROR_OAUTH_LIST_TOO_LARGE | 10009 | The size of the OAuth list exceeds the limit. | +| ERROR_OAUTH_SERVICE_BUSY | 10010 | The OAuth service is busy. | +| ERROR_OAUTH_SERVICE_EXCEPTION | 10011 | The OAuth service is abnormal. | +| ERROR_OAUTH_SESSION_NOT_EXIST | 10012 | The session to be authenticated does not exist. | +| ERROR_OAUTH_TIMEOUT | 10013 | The authentication timed out. | +| ERROR_OAUTH_TOKEN_NOT_EXIST | 10014 | The OAuth access token does not exist.| +| ERROR_OAUTH_TOKEN_TOO_MANY | 10015 | The number of OAuth access tokens reaches the limit. | +| ERROR_OAUTH_UNSUPPORT_ACTION | 10016 | The authentication operation is not supported. | +| ERROR_OAUTH_UNSUPPORT_AUTH_TYPE | 10017 | The authentication type is not supported. | +| ERROR_PERMISSION_DENIED | 10018 | The required permission is missing. | ## AuthenticatorCallback8+ @@ -1657,10 +1656,10 @@ Called back to send the authentication result. **System capability**: SystemCapability.Account.AppAccount **Parameters** -| Name| Type | Mandatory| Description | -| ------ | -------------------- | ---- | ------------ | -| code | number | Yes | Authentication result code.| -| result | {[key: string]: any} | Yes | Authentication result. | +| Name | Type | Mandatory | Description | +| ------ | -------------------- | ---- | ------ | +| code | number | Yes | Authentication result code.| +| result | {[key: string]: any} | Yes | Authentication result. | **Example** @@ -1687,9 +1686,9 @@ Called back to redirect an authentication request. **System capability**: SystemCapability.Account.AppAccount **Parameters** -| Name | Type| Mandatory| Description | -| ------- | ---- | ---- | -------------------- | -| request | Want | Yes | Request to be redirected.| +| Name | Type | Mandatory | Description | +| ------- | ---- | ---- | ---------- | +| request | Want | Yes | Request to be redirected.| **Example** @@ -1724,12 +1723,12 @@ Implicitly adds an app account based on the specified authentication type and op **System capability**: SystemCapability.Account.AppAccount **Parameters** -| Name | Type | Mandatory| Description | -| ---------------- | --------------------- | ---- | ------------------------------ | -| authType | string | Yes | Authentication type. | -| callerBundleName | string | Yes | Bundle name of the authentication requester. | -| options | {[key: string]: any} | Yes | Options for the authentication. | -| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| +| Name | Type | Mandatory | Description | +| ---------------- | --------------------- | ---- | --------------- | +| authType | string | Yes | Authentication type. | +| callerBundleName | string | Yes | Bundle name of the authentication requester. | +| options | {[key: string]: any} | Yes | Options for the authentication. | +| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| ### authenticate8+ @@ -1740,13 +1739,13 @@ Authenticates an app account to obtain the OAuth access token. This method uses **System capability**: SystemCapability.Account.AppAccount **Parameters** -| Name | Type | Mandatory| Description | -| ---------------- | --------------------- | ---- | ------------------------------ | -| name | string | Yes | App account name. | -| authType | string | Yes | Authentication type. | -| callerBundleName | string | Yes | Bundle name of the authentication requester. | -| options | {[key: string]: any} | Yes | Options for the authentication. | -| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| +| Name | Type | Mandatory | Description | +| ---------------- | --------------------- | ---- | --------------- | +| name | string | Yes | App account name. | +| authType | string | Yes | Authentication type. | +| callerBundleName | string | Yes | Bundle name of the authentication requester. | +| options | {[key: string]: any} | Yes | Options for the authentication. | +| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-osAccount.md b/en/application-dev/reference/apis/js-apis-osAccount.md index 6de662feea1f67cba1ef42f86eb294af29c47cea..de757b71b485830c58890547591a99fad14bca9c 100644 --- a/en/application-dev/reference/apis/js-apis-osAccount.md +++ b/en/application-dev/reference/apis/js-apis-osAccount.md @@ -29,6 +29,7 @@ Obtains an **AccountManager** instance. ``` ## OsAccountType + Enumerates OS account types. **System capability**: SystemCapability.Account.OsAccount @@ -51,6 +52,8 @@ Activates an OS account. This method uses an asynchronous callback to return the This is a system API and cannot be called by third-party applications. +**Required permissions**: ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION + **System capability**: SystemCapability.Account.OsAccount **Parameters** @@ -488,7 +491,7 @@ This is a system API and cannot be called by third-party applications. setOsAccountConstraints(localId: number, constraints: Array<string>, enable: boolean,callback: AsyncCallback<void>): void -Sets or removes constraints for an OS account. +Sets or removes constraints for an OS account. This method uses an asynchronous callback to return the result. This is a system API and cannot be called by third-party applications. @@ -519,7 +522,7 @@ This is a system API and cannot be called by third-party applications. setOsAccountConstraints(localId: number, constraints: Array<string>, enable: boolean): Promise<void> -Sets or removes constraints for an OS account. +Sets or removes constraints for an OS account. This method uses a promise to return the result. This is a system API and cannot be called by third-party applications. @@ -1737,16 +1740,17 @@ This is a system API and cannot be called by third-party applications. ``` ## OsAccountInfo + Defines information about an OS account. **System capability**: SystemCapability.Account.OsAccount -| Name | Type | Mandatory| Description | -| ----------------- | ------------------------------------------------------------ | ---- | --------------------------------- | -| localId | number | Yes | ID of the target OS account. | -| localName | string | Yes | OS account name. | -| type | [OsAccountType](#osaccounttype) | Yes | OS account type. | -| constraints | Array<string> | No | [Constraints](#constraints) on the OS account.| +| Name | Type | Mandatory| Description | +| ------------------------------ | ------------------------------------------------------------ | ---- | --------------------------------- | +| localId | number | Yes | ID of the target OS account. | +| localName | string | Yes | OS account name. | +| type | [OsAccountType](#osaccounttype) | Yes | OS account type. | +| constraints | Array<string> | No | [Constraints](#constraints) on the OS account.| | isVerified8+ | boolean | Yes | Whether the OS account is verified. | | photo8+ | string | No | Profile photo of the OS account. | | createTime8+ | number | Yes | Time when the OS account was created. | @@ -1754,17 +1758,18 @@ Defines information about an OS account. | serialNumber8+ | number | Yes | SN of the OS account. | | isActived8+ | boolean | Yes | Whether the OS account is activated. | | isCreateCompleted8+ | boolean | Yes | Whether the OS account information is complete. | -| distributedInfo | [distributedAccount.DistributedInfo](js-apis-distributed-account.md) | No | Distributed account information. | +| distributedInfo | [distributedAccount.DistributedInfo](js-apis-distributed-account.md) | No | Distributed account information. | | domainInfo8+ | [DomainAccountInfo](#domainaccountinfo) | No | Domain account information. | ## DomainAccountInfo8+ + Domain account information. **System capability**: SystemCapability.Account.OsAccount | Name | Type | Mandatory| Description | | ----------- | ------ | ---- | ---------- | -| domain | string | Yes | Domain name. | +| domain | string | Yes | Domain name. | | accountName | string | Yes | Domain account name.| ## Constraints @@ -1801,8 +1806,8 @@ Domain account information. | constraint.control.apps | A user is not allowed to modify apps in **Settings** or the boot module.| | constraint.physical.media | A user is not allowed to mount external physical media.| | constraint.microphone | A user is not allowed to use microphones.| -| constraint.microphone.unmute | A user is not allowed to adjust the microphone volume.| -| constraint.volume.adjust | A user is not allowed to adjust the device's global volume.| +| constraint.microphone.unmute | A user is not allowed to unmute the microphone.| +| constraint.volume.adjust | A user is not allowed to adjust the volume.| | constraint.calls.outgoing | A user is not allowed to make outgoing calls.| | constraint.sms.use | A user is not allowed to send or receive SMS messages.| | constraint.fun | A user is not allowed to have entertainment.| @@ -1820,7 +1825,7 @@ Domain account information. | constraint.os.account.set.icon | A user is not allowed to change their icon.| | constraint.wallpaper.set | A user is not allowed to set a wallpaper.| | constraint.oem.unlock | A user is not allowed to enable OEM unlock.| -| constraint.device.unmute | A user is not allowed to mute the device's global volume.| +| constraint.device.unmute | A user is not allowed to unmute the device.| | constraint.password.unified | The managed profile is not allowed to have unified lock screen challenge with the primary user.| | constraint.autofill | A user is not allowed to use the autofill service.| | constraint.content.capture | Capturing the content of a user's screen is prohibited.|