提交 acfbd073 编写于 作者: A annie_wangli

update docs

Signed-off-by: Nannie_wangli <annie.wangli@huawei.com>
上级 aae0bf4c
...@@ -20,8 +20,8 @@ Creates an **AppAccountManager** instance. ...@@ -20,8 +20,8 @@ Creates an **AppAccountManager** instance.
**System capability**: SystemCapability.Account.AppAccount **System capability**: SystemCapability.Account.AppAccount
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| ----------------- | ------------------------ | | ----------------- | ------------ |
| AppAccountManager | **AppAccountManager** instance created.| | AppAccountManager | **AppAccountManager** instance created.|
**Example** **Example**
...@@ -43,10 +43,10 @@ Adds an app account to the account management service. This method uses an async ...@@ -43,10 +43,10 @@ Adds an app account to the account management service. This method uses an async
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | ------------------------------------------ | | -------- | ------------------------- | ---- | --------------------- |
| name | string | Yes | Name of the app account to add. | | name | string | Yes | Name of the app account to add. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when the app account is added.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when the app account is added.|
**Example** **Example**
...@@ -67,11 +67,11 @@ Adds an app account and its additional information to the account management ser ...@@ -67,11 +67,11 @@ Adds an app account and its additional information to the account management ser
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| --------- | ------------------------- | ---- | ------------------------------------------------------------ | | --------- | ------------------------- | ---- | ---------------------------------------- |
| name | string | Yes | Name of the app account to add. | | 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.| | 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&lt;void&gt; | Yes | Callback invoked when the app account and its additional information are added. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when the app account and its additional information are added. |
**Example** **Example**
...@@ -94,15 +94,15 @@ Adds an app account and its additional information to the account management ser ...@@ -94,15 +94,15 @@ Adds an app account and its additional information to the account management ser
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| --------- | ------ | ---- | ------------------------------------------------------------ | | --------- | ------ | ---- | -------------------------------- |
| name | string | Yes | Name of the app account to add. | | 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.| | extraInfo | string | Yes | Additional information of the app account to add. The additional information cannot contain sensitive information about the app account.|
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| ------------------- | ---------------------------------- | | ------------------- | --------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -126,12 +126,12 @@ Implicitly adds an app account based on the specified account owner, authenticat ...@@ -126,12 +126,12 @@ Implicitly adds an app account based on the specified account owner, authenticat
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | --------------------- | ---- | ------------------------------ | | -------- | --------------------- | ---- | --------------- |
| owner | string | Yes | Bundle name of the app account to add.| | owner | string | Yes | Bundle name of the app account to add.|
| authType | string | Yes | Authentication type 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. | | options | {[key: string]: any} | Yes | Options for the authentication. |
| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| | callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.|
**Example** **Example**
...@@ -167,10 +167,10 @@ Deletes an app account from the account management service. This method uses an ...@@ -167,10 +167,10 @@ Deletes an app account from the account management service. This method uses an
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | ---------------------------------- | | -------- | ------------------------- | ---- | ----------------- |
| name | string | Yes | Name of the app account to delete. | | name | string | Yes | Name of the app account to delete. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when the app account is deleted.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when the app account is deleted.|
**Example** **Example**
...@@ -191,14 +191,14 @@ Deletes an app account from the account management service. This method uses a p ...@@ -191,14 +191,14 @@ Deletes an app account from the account management service. This method uses a p
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ------------------------ | | ---- | ------ | ---- | ------------ |
| name | string | Yes | Name of the app account to delete.| | name | string | Yes | Name of the app account to delete.|
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| :------------------ | :---------------------------------- | | :------------------ | :-------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -222,11 +222,11 @@ Disables an app account from accessing an application with the given bundle name ...@@ -222,11 +222,11 @@ Disables an app account from accessing an application with the given bundle name
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | ------------------------- | ---- | ------------------------------------------------------------ | | ---------- | ------------------------- | ---- | ------------------------------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| bundleName | string | Yes | Bundle name of an app. | | bundleName | string | Yes | Bundle name of an app. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when the app account is disabled from accessing the application with the given bundle name.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when the app account is disabled from accessing the application with the given bundle name.|
**Example** **Example**
...@@ -247,15 +247,15 @@ Disables an app account from accessing an application with the given bundle name ...@@ -247,15 +247,15 @@ Disables an app account from accessing an application with the given bundle name
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | ---------------------------------- | | ---------- | ------ | ---- | ----------------- |
| name | string | Yes | App account name.| | name | string | Yes | App account name.|
| bundleName | string | Yes | Bundle name of an app. | | bundleName | string | Yes | Bundle name of an app. |
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| :------------------ | :---------------------------------- | | :------------------ | :-------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -279,11 +279,11 @@ Enables an app account to access an application with the given bundle name. This ...@@ -279,11 +279,11 @@ Enables an app account to access an application with the given bundle name. This
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | ------------------------- | ---- | ------------------------------------------------------------ | | ---------- | ------------------------- | ---- | ------------------------------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| bundleName | string | Yes | Bundle name of an app. | | bundleName | string | Yes | Bundle name of an app. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when the app account is enabled to access the application with the given bundle name.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when the app account is enabled to access the application with the given bundle name.|
**Example** **Example**
...@@ -304,15 +304,15 @@ Enables an app account to access an application with the given bundle name. This ...@@ -304,15 +304,15 @@ Enables an app account to access an application with the given bundle name. This
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | ------------------ | | ---------- | ------ | ---- | --------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| bundleName | string | Yes | Bundle name of an app.| | bundleName | string | Yes | Bundle name of an app.|
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| :------------------ | :---------------------------------- | | :------------------ | :-------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -337,10 +337,10 @@ Checks whether an app account allows application data synchronization. This meth ...@@ -337,10 +337,10 @@ Checks whether an app account allows application data synchronization. This meth
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------- | ---- | -------------------------------------------- | | -------- | ---------------------------- | ---- | ---------------------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return whether the app account allows application data synchronization.| | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return whether the app account allows application data synchronization.|
**Example** **Example**
...@@ -364,14 +364,14 @@ Checks whether an app account allows application data synchronization. This meth ...@@ -364,14 +364,14 @@ Checks whether an app account allows application data synchronization. This meth
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------ | ------ | ---- | -------------- | | ---- | ------ | ---- | ------- |
| name | string | Yes | App account name.| | name | string | Yes | App account name.|
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| :--------------------- | :---------------------------------- | | :--------------------- | :-------------------- |
| Promise&lt;boolean&gt; | Promise used to return the result.| | Promise&lt;boolean&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -387,7 +387,7 @@ Checks whether an app account allows application data synchronization. This meth ...@@ -387,7 +387,7 @@ Checks whether an app account allows application data synchronization. This meth
### setAccountCredential ### setAccountCredential
setAccountCredential(name: string, credentialType: string, credential: string callback: AsyncCallback&lt;void&gt;): void setAccountCredential(name: string, credentialType: string, credential: string,callback: AsyncCallback&lt;void&gt;): void
Sets a credential for an app account. This method uses an asynchronous callback to return the result. 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 ...@@ -395,12 +395,12 @@ Sets a credential for an app account. This method uses an asynchronous callback
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------------- | ------------------------- | ---- | ---------------------------- | | -------------- | ------------------------- | ---- | -------------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| credentialType | string | Yes | Type of the credential to set. | | credentialType | string | Yes | Type of the credential to set. |
| credential | string | Yes | Credential to set. | | credential | string | Yes | Credential to set. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when a credential is set for the specified app account.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when a credential is set for the specified app account.|
**Example** **Example**
...@@ -421,16 +421,16 @@ Sets a credential for an app account. This method uses a promise to return the r ...@@ -421,16 +421,16 @@ Sets a credential for an app account. This method uses a promise to return the r
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------------- | ------ | ---- | -------------------- | | -------------- | ------ | ---- | ---------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| credentialType | string | Yes | Type of the credential to set.| | credentialType | string | Yes | Type of the credential to set.|
| credential | string | Yes | Credential to set. | | credential | string | Yes | Credential to set. |
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| :------------------ | :---------------------------------- | | :------------------ | :-------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -454,11 +454,11 @@ Sets additional information for an app account. This method uses an asynchronous ...@@ -454,11 +454,11 @@ Sets additional information for an app account. This method uses an asynchronous
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| --------- | ------------------------- | ---- | -------------------------------- | | --------- | ------------------------- | ---- | ---------------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| extraInfo | string | Yes | Additional information to set. | | extraInfo | string | Yes | Additional information to set. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when additional information is set for the specified app account.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when additional information is set for the specified app account.|
**Example** **Example**
...@@ -479,15 +479,15 @@ Sets additional information for an app account. This method uses a promise to re ...@@ -479,15 +479,15 @@ Sets additional information for an app account. This method uses a promise to re
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| --------- | ------ | ---- | ------------------ | | --------- | ------ | ---- | --------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| extraInfo | string | Yes | Additional information to set.| | extraInfo | string | Yes | Additional information to set.|
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| :------------------ | :---------------------------------- | | :------------------ | :-------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -513,11 +513,11 @@ Sets whether to enable application data synchronization for an app account. This ...@@ -513,11 +513,11 @@ Sets whether to enable application data synchronization for an app account. This
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | -------------------------------------------------- | | -------- | ------------------------- | ---- | ------------------------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| isEnable | boolean | Yes | Whether to enable app data synchronization. | | isEnable | boolean | Yes | Whether to enable app data synchronization. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when application data synchronization is enabled or disabled for the app account.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when application data synchronization is enabled or disabled for the app account.|
**Example** **Example**
...@@ -540,15 +540,15 @@ Sets whether to enable application data synchronization for an app account. This ...@@ -540,15 +540,15 @@ Sets whether to enable application data synchronization for an app account. This
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------- | ---- | ---------------------- | | -------- | ------- | ---- | ----------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| isEnable | boolean | Yes | Whether to enable app data synchronization.| | isEnable | boolean | Yes | Whether to enable app data synchronization.|
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| :------------------ | :---------------------------------- | | :------------------ | :-------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -572,12 +572,12 @@ Sets data to be associated with an app account. This method uses an asynchronous ...@@ -572,12 +572,12 @@ Sets data to be associated with an app account. This method uses an asynchronous
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | ---------------------------------- | | -------- | ------------------------- | ---- | ----------------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| key | string | Yes | Key of the data to set. The private key can be customized.| | 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. | | value | string | Yes | Value of the data to be set. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when the data associated with the specified app account is set.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when the data associated with the specified app account is set.|
**Example** **Example**
...@@ -597,16 +597,16 @@ Sets data to be associated with an app account. This method uses a promise to re ...@@ -597,16 +597,16 @@ Sets data to be associated with an app account. This method uses a promise to re
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------------------------- | | ----- | ------ | ---- | ----------------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| key | string | Yes | Key of the data to set. The private key can be customized.| | 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. | | value | string | Yes | Value of the data to be set. |
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| :------------------ | :---------------------------------- | | :------------------ | :-------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -630,11 +630,11 @@ Obtains the credential of an app account. This method uses an asynchronous callb ...@@ -630,11 +630,11 @@ Obtains the credential of an app account. This method uses an asynchronous callb
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------------- | --------------------------- | ---- | ---------------------------- | | -------------- | --------------------------- | ---- | -------------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| credentialType | string | Yes | Type of the credential to obtain. | | credentialType | string | Yes | Type of the credential to obtain. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback invoked to return the credential of the specified app account.| | callback | AsyncCallback&lt;string&gt; | Yes | Callback invoked to return the credential of the specified app account.|
**Example** **Example**
...@@ -656,15 +656,15 @@ Obtains the credential of an app account. This method uses a promise to return t ...@@ -656,15 +656,15 @@ Obtains the credential of an app account. This method uses a promise to return t
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------------- | ------ | ---- | -------------------- | | -------------- | ------ | ---- | ---------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| credentialType | string | Yes | Type of the credential to obtain.| | credentialType | string | Yes | Type of the credential to obtain.|
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| :-------------------- | :---------------------------------- | | :-------------------- | :-------------------- |
| Promise&lt;string&gt; | Promise used to return the result.| | Promise&lt;string&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -688,10 +688,10 @@ Obtains additional information of an app account. This method uses an asynchrono ...@@ -688,10 +688,10 @@ Obtains additional information of an app account. This method uses an asynchrono
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | --------------------------- | ---- | -------------------------------- | | -------- | --------------------------- | ---- | ---------------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback invoked to return the additional information of the specified app account.| | callback | AsyncCallback&lt;string&gt; | Yes | Callback invoked to return the additional information of the specified app account.|
**Example** **Example**
...@@ -713,14 +713,14 @@ Obtains additional information of an app account. This method uses a promise to ...@@ -713,14 +713,14 @@ Obtains additional information of an app account. This method uses a promise to
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------ | ------ | ---- | -------------- | | ---- | ------ | ---- | ------- |
| name | string | Yes | App account name.| | name | string | Yes | App account name.|
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| :-------------------- | :---------------------------------- | | :-------------------- | :-------------------- |
| Promise&lt;string&gt; | Promise used to return the result.| | Promise&lt;string&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -744,11 +744,11 @@ Obtains data associated with an app account. This method uses an asynchronous ca ...@@ -744,11 +744,11 @@ Obtains data associated with an app account. This method uses an asynchronous ca
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | --------------------------- | ---- | ---------------------------------- | | -------- | --------------------------- | ---- | ----------------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| key | string | Yes | Key of the data to obtain. | | key | string | Yes | Key of the data to obtain. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback invoked to return the data associated with the specified app account.| | callback | AsyncCallback&lt;string&gt; | Yes | Callback invoked to return the data associated with the specified app account.|
**Example** **Example**
...@@ -770,15 +770,15 @@ Obtains data associated with an app account. This method uses a promise to retur ...@@ -770,15 +770,15 @@ Obtains data associated with an app account. This method uses a promise to retur
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ------------------- | | ---- | ------ | ---- | ----------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| key | string | Yes | Key of the data to obtain.| | key | string | Yes | Key of the data to obtain.|
**Return Value** **Return Value**
| Type | Description | | Type | Description |
| :-------------------- | :---------------------------------- | | :-------------------- | :-------------------- |
| Promise&lt;string&gt; | Promise used to return the result.| | Promise&lt;string&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -798,15 +798,15 @@ getAllAccessibleAccounts(callback: AsyncCallback&lt;Array&lt;AppAccountInfo&gt;& ...@@ -798,15 +798,15 @@ getAllAccessibleAccounts(callback: AsyncCallback&lt;Array&lt;AppAccountInfo&gt;&
Obtains information about all accessible app accounts. This method uses an asynchronous callback to return the result. 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 **System capability**: SystemCapability.Account.AppAccount
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------ | ---- | ---------------- | | -------- | ---------------------------------------- | ---- | -------- |
| callback | AsyncCallback&lt;Array&lt;AppAccountInfo&gt;&gt; | Yes | Callback invoked to return information about all accessible app accounts.| | callback | AsyncCallback&lt;Array&lt;AppAccountInfo&gt;&gt; | Yes | Callback invoked to return information about all accessible app accounts.|
**Example** **Example**
...@@ -824,14 +824,14 @@ getAllAccessibleAccounts(): Promise&lt;Array&lt;AppAccountInfo&gt;&gt; ...@@ -824,14 +824,14 @@ getAllAccessibleAccounts(): Promise&lt;Array&lt;AppAccountInfo&gt;&gt;
Obtains information about all accessible app accounts. This method uses an asynchronous callback to return the result. 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 **System capability**: SystemCapability.Account.AppAccount
**Parameters** **Parameters**
| Type | Description | | Type | Description |
| ------------------------------------------ | ----------------------------------- | | ---------------------------------------- | --------------------- |
| Promise&lt;Array&lt;AppAccountInfo&gt;&gt; | Promise used to return the result.| | Promise&lt;Array&lt;AppAccountInfo&gt;&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -851,16 +851,16 @@ getAllAccounts(owner: string, callback: AsyncCallback&lt;Array&lt;AppAccountInfo ...@@ -851,16 +851,16 @@ getAllAccounts(owner: string, callback: AsyncCallback&lt;Array&lt;AppAccountInfo
Obtains information about all app accounts of the specified app. This method uses an asynchronous callback to return the result. 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 **System capability**: SystemCapability.Account.AppAccount
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------ | ---- | ---------------- | | -------- | ---------------------------------------- | ---- | -------- |
| owner | string | Yes | Bundle name of the app. | | owner | string | Yes | Bundle name of the app. |
| callback | AsyncCallback&lt;Array&lt;AppAccountInfo&gt;&gt; | Yes | Callback invoked to return information about all accessible app accounts.| | callback | AsyncCallback&lt;Array&lt;AppAccountInfo&gt;&gt; | Yes | Callback invoked to return information about all accessible app accounts.|
**Example** **Example**
...@@ -879,20 +879,20 @@ getAllAccounts(owner: string): Promise&lt;Array&lt;AppAccountInfo&gt;&gt; ...@@ -879,20 +879,20 @@ getAllAccounts(owner: string): Promise&lt;Array&lt;AppAccountInfo&gt;&gt;
Obtains information about all app accounts of the specified app. This method uses an asynchronous callback to return the result. 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 **System capability**: SystemCapability.Account.AppAccount
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------- | | ----- | ------ | ---- | ----- |
| owner | string | Yes | Bundle name of the app.| | owner | string | Yes | Bundle name of the app.|
**Parameters** **Parameters**
| Type | Description | | Type | Description |
| ------------------------------------------ | ----------------------------------- | | ---------------------------------------- | --------------------- |
| Promise&lt;Array&lt;AppAccountInfo&gt;&gt; | Promise used to return the result.| | Promise&lt;Array&lt;AppAccountInfo&gt;&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -917,11 +917,11 @@ Subscribes to the account change event of the specified account owners. This met ...@@ -917,11 +917,11 @@ Subscribes to the account change event of the specified account owners. This met
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | 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.| | 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&lt;string&gt; | Yes | Owners of the accounts. | | owners | Array&lt;string&gt; | Yes | Owners of the accounts. |
| callback | Callback&lt;Array&lt;AppAccountInfo&gt;&gt; | Yes | Callback invoked to return the account change. | | callback | Callback&lt;Array&lt;AppAccountInfo&gt;&gt; | Yes | Callback invoked to return the account change. |
**Example** **Example**
...@@ -948,10 +948,10 @@ Unsubscribes from the account change event. This method uses an asynchronous cal ...@@ -948,10 +948,10 @@ Unsubscribes from the account change event. This method uses an asynchronous cal
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | -------------------------------- | ---- | ------------------------ | | -------- | -------------------------------- | ---- | ------------ |
| type | 'change' | Yes | Account change event to unsubscribe from. | | type | 'change' | Yes | Account change event to unsubscribe from. |
| callback | Callback<Array\<AppAccountInfo>> | No | Callback used to report the account change.| | callback | Callback<Array\<AppAccountInfo>> | No | Callback used to report the account change.|
**Example** **Example**
...@@ -981,13 +981,13 @@ Authenticates an app account to obtain the Open Authorization (OAuth) access tok ...@@ -981,13 +981,13 @@ Authenticates an app account to obtain the Open Authorization (OAuth) access tok
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | --------------------- | ---- | ------------------------------ | | -------- | --------------------- | ---- | --------------- |
| name | string | Yes | Name of the app account to authenticate. | | name | string | Yes | Name of the app account to authenticate. |
| owner | string | Yes | Bundle name of the app.| | owner | string | Yes | Bundle name of the app.|
| authType | string | Yes | Authentication type. | | authType | string | Yes | Authentication type. |
| options | {[key: string]: any} | Yes | Options for the authentication. | | options | {[key: string]: any} | Yes | Options for the authentication. |
| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| | callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.|
**Example** **Example**
...@@ -1023,12 +1023,12 @@ Obtains the OAuth access token of an app account based on the specified authenti ...@@ -1023,12 +1023,12 @@ Obtains the OAuth access token of an app account based on the specified authenti
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | --------------------------- | ---- | ---------------------- | | -------- | --------------------------- | ---- | ----------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| owner | string | Yes | Bundle name of the app.| | owner | string | Yes | Bundle name of the app.|
| authType | string | Yes | Authentication type. | | authType | string | Yes | Authentication type. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback invoked to return the result. | | callback | AsyncCallback&lt;string&gt; | Yes | Callback invoked to return the result. |
**Example** **Example**
...@@ -1050,16 +1050,16 @@ Obtains the OAuth access token of an app account based on the specified authenti ...@@ -1050,16 +1050,16 @@ Obtains the OAuth access token of an app account based on the specified authenti
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------ | ---- | ---------------------- | | -------- | ------ | ---- | ----------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| owner | string | Yes | Bundle name of the app.| | owner | string | Yes | Bundle name of the app.|
| authType | string | Yes | Authentication type. | | authType | string | Yes | Authentication type. |
**Parameters** **Parameters**
| Type | Description | | Type | Description |
| --------------------- | ----------------------------------- | | --------------------- | --------------------- |
| Promise&lt;string&gt; | Promise used to return the result.| | Promise&lt;string&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -1083,12 +1083,12 @@ Sets an OAuth access token for an app account. This method uses an asynchronous ...@@ -1083,12 +1083,12 @@ Sets an OAuth access token for an app account. This method uses an asynchronous
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | ---------------- | | -------- | ------------------------- | ---- | -------- |
| name | string | Yes | App account name.| | name | string | Yes | App account name.|
| authType | string | Yes | Authentication type. | | authType | string | Yes | Authentication type. |
| token | string | Yes | OAuth access token to set. | | token | string | Yes | OAuth access token to set.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result.| | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result.|
**Example** **Example**
...@@ -1109,16 +1109,16 @@ Sets an OAuth access token for an app account. This method uses a promise to ret ...@@ -1109,16 +1109,16 @@ Sets an OAuth access token for an app account. This method uses a promise to ret
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------ | ---- | ---------------- | | -------- | ------ | ---- | -------- |
| name | string | Yes | App account name.| | name | string | Yes | App account name.|
| authType | string | Yes | Authentication type. | | authType | string | Yes | Authentication type. |
| token | string | Yes | OAuth access token to set. | | token | string | Yes | OAuth access token to set.|
**Parameters** **Parameters**
| Type | Description | | Type | Description |
| ------------------- | ----------------------------------- | | ------------------- | --------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -1142,13 +1142,13 @@ Deletes the specified OAuth access token for an app account. This method uses an ...@@ -1142,13 +1142,13 @@ Deletes the specified OAuth access token for an app account. This method uses an
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | ---------------------- | | -------- | ------------------------- | ---- | ------------ |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| owner | string | Yes | Bundle name of the app.| | owner | string | Yes | Bundle name of the app. |
| authType | string | Yes | Authentication type. | | authType | string | Yes | Authentication type. |
| token | string | Yes | OAuth access token to delete. | | token | string | Yes | OAuth access token to delete.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. |
**Example** **Example**
...@@ -1169,17 +1169,17 @@ Deletes the specified OAuth access token for an app account. This method uses a ...@@ -1169,17 +1169,17 @@ Deletes the specified OAuth access token for an app account. This method uses a
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------ | ---- | ---------------------- | | -------- | ------ | ---- | ------------ |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| owner | string | Yes | Bundle name of the app.| | owner | string | Yes | Bundle name of the app. |
| authType | string | Yes | Authentication type. | | authType | string | Yes | Authentication type. |
| token | string | Yes | OAuth access token to delete. | | token | string | Yes | OAuth access token to delete.|
**Parameters** **Parameters**
| Type | Description | | Type | Description |
| ------------------- | ----------------------------------- | | ------------------- | --------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -1203,13 +1203,13 @@ Sets the visibility of an OAuth access token to the specified app. This method u ...@@ -1203,13 +1203,13 @@ Sets the visibility of an OAuth access token to the specified app. This method u
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | ------------------------- | ---- | ------------------------ | | ---------- | ------------------------- | ---- | ------------ |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| authType | string | Yes | Authentication type. | | authType | string | Yes | Authentication type. |
| bundleName | string | Yes | Bundle name of the app.| | bundleName | string | Yes | Bundle name of the app.|
| isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. | | isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked to return the result. |
**Example** **Example**
...@@ -1230,24 +1230,23 @@ Sets the visibility of an OAuth access token to the specified app. This method u ...@@ -1230,24 +1230,23 @@ Sets the visibility of an OAuth access token to the specified app. This method u
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | ------- | ---- | ------------------------ | | ---------- | ------- | ---- | ------------ |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| authType | string | Yes | Authentication type. | | authType | string | Yes | Authentication type. |
| bundleName | string | Yes | Bundle name of the app.| | bundleName | string | Yes | Bundle name of the app.|
| isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. | | isVisible | boolean | Yes | Whether the OAuth access token is visible to the app. |
**Parameters** **Parameters**
| Type | Description | | Type | Description |
| ------------------- | ----------------------------------- | | ------------------- | --------------------- |
| Promise&lt;void&gt; | Promise used to return the result.| | Promise&lt;void&gt; | Promise used to return the result.|
**Example** **Example**
``` ```
const appAccountManager = account_appAccount.createAppAccountManager(); const appAccountManager = account_appAccount.createAppAccountManager();
const appAccountManager = account_appAccount.createAppAccountManager();
appAccountManager.setOAuthTokenVisibility("LiSi", "readAge", "com.example.ohos.accountjsdemo", true).then(() => { appAccountManager.setOAuthTokenVisibility("LiSi", "readAge", "com.example.ohos.accountjsdemo", true).then(() => {
console.log('setOAuthTokenVisibility successfully'); console.log('setOAuthTokenVisibility successfully');
}).catch((err) => { }).catch((err) => {
...@@ -1265,12 +1264,12 @@ Checks whether an OAuth token is visible to the specified app. This method uses ...@@ -1265,12 +1264,12 @@ Checks whether an OAuth token is visible to the specified app. This method uses
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | ---------------------------- | ---- | -------------------------- | | ---------- | ---------------------------- | ---- | ------------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| authType | string | Yes | Authentication type. | | authType | string | Yes | Authentication type. |
| bundleName | string | Yes | Bundle name of the app.| | bundleName | string | Yes | Bundle name of the app.|
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback invoked to return the result. | | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback invoked to return the result. |
**Example** **Example**
...@@ -1292,16 +1291,16 @@ Checks whether an OAuth token is visible to the specified app. This method uses ...@@ -1292,16 +1291,16 @@ Checks whether an OAuth token is visible to the specified app. This method uses
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | -------------------------- | | ---------- | ------ | ---- | ------------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| authType | string | Yes | Authentication type. | | authType | string | Yes | Authentication type. |
| bundleName | string | Yes | Bundle name of the app.| | bundleName | string | Yes | Bundle name of the app.|
**Parameters** **Parameters**
| Type | Description | | Type | Description |
| ---------------------- | ----------------------------------- | | ---------------------- | --------------------- |
| Promise&lt;boolean&gt; | Promise used to return the result.| | Promise&lt;boolean&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -1325,11 +1324,11 @@ Obtains information about all OAuth access tokens of an app account visible to t ...@@ -1325,11 +1324,11 @@ Obtains information about all OAuth access tokens of an app account visible to t
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------------------------------------------------ | ---- | ---------------------- | | -------- | ---------------------------------------- | ---- | ----------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| owner | string | Yes | Bundle name of the app.| | owner | string | Yes | Bundle name of the app.|
| callback | AsyncCallback&lt;Array&lt;OAuthTokenInfo&gt;&gt; | Yes | Callback invoked to return the result. | | callback | AsyncCallback&lt;Array&lt;OAuthTokenInfo&gt;&gt; | Yes | Callback invoked to return the result. |
**Example** **Example**
...@@ -1351,15 +1350,15 @@ Obtains information about all OAuth access tokens of an app account visible to t ...@@ -1351,15 +1350,15 @@ Obtains information about all OAuth access tokens of an app account visible to t
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------------- | | ----- | ------ | ---- | ----------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| owner | string | Yes | Bundle name of the app.| | owner | string | Yes | Bundle name of the app.|
**Parameters** **Parameters**
| Type | Description | | Type | Description |
| ------------------------------------------ | ----------------------------------- | | ---------------------------------------- | --------------------- |
| Promise&lt;Array&lt;OAuthTokenInfo&gt;&gt; | Promise used to return the result.| | Promise&lt;Array&lt;OAuthTokenInfo&gt;&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -1383,11 +1382,11 @@ Obtains the authorization list of OAuth access tokens of an app account. This me ...@@ -1383,11 +1382,11 @@ Obtains the authorization list of OAuth access tokens of an app account. This me
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------- | | -------- | ---------------------------------------- | ---- | ----------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| owner | string | Yes | Bundle name of the app.| | owner | string | Yes | Bundle name of the app.|
| callback | AsyncCallback&lt;Array&lt;string&gt;&gt; | Yes | Callback invoked to return the result. | | callback | AsyncCallback&lt;Array&lt;string&gt;&gt; | Yes | Callback invoked to return the result. |
**Example** **Example**
...@@ -1409,15 +1408,15 @@ Obtains the authorization list of OAuth access tokens of an app account. This me ...@@ -1409,15 +1408,15 @@ Obtains the authorization list of OAuth access tokens of an app account. This me
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------------- | | ----- | ------ | ---- | ----------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| owner | string | Yes | Bundle name of the app.| | owner | string | Yes | Bundle name of the app.|
**Parameters** **Parameters**
| Type | Description | | Type | Description |
| ---------------------------------- | ----------------------------------- | | ---------------------------------- | --------------------- |
| Promise&lt;Array&lt;string&gt;&gt; | Promise used to return the result.| | Promise&lt;Array&lt;string&gt;&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -1441,10 +1440,10 @@ Obtains the authenticator callback for a session. This method uses an asynchrono ...@@ -1441,10 +1440,10 @@ Obtains the authenticator callback for a session. This method uses an asynchrono
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| --------- | ------------------------------------------ | ---- | ---------------- | | --------- | ---------------------------------------- | ---- | -------- |
| sessionId | string | Yes | ID of the session to authenticate.| | sessionId | string | Yes | ID of the session to authenticate.|
| callback | AsyncCallback&lt;AuthenticatorCallback&gt; | Yes | Callback invoked to return the result.| | callback | AsyncCallback&lt;AuthenticatorCallback&gt; | Yes | Callback invoked to return the result.|
**Example** **Example**
...@@ -1476,14 +1475,14 @@ Obtains the authenticator callback for a session. This method uses a promise to ...@@ -1476,14 +1475,14 @@ Obtains the authenticator callback for a session. This method uses a promise to
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| --------- | ------ | ---- | ---------------- | | --------- | ------ | ---- | -------- |
| sessionId | string | Yes | ID of the session to authenticate.| | sessionId | string | Yes | ID of the session to authenticate.|
**Parameters** **Parameters**
| Type | Description | | Type | Description |
| ------------------------------------ | ----------------------------------- | | ------------------------------------ | --------------------- |
| Promise&lt;AuthenticatorCallback&gt; | Promise used to return the result.| | Promise&lt;AuthenticatorCallback&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -1516,10 +1515,10 @@ Obtains authenticator information of an app account. This method uses an asynchr ...@@ -1516,10 +1515,10 @@ Obtains authenticator information of an app account. This method uses an asynchr
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | -------------------------------------- | ---- | ---------------------- | | -------- | -------------------------------------- | ---- | ----------- |
| owner | string | Yes | Bundle name of the app.| | owner | string | Yes | Bundle name of the app.|
| callback | AsyncCallback&lt;AuthenticatorInfo&gt; | Yes | Callback invoked to return the result. | | callback | AsyncCallback&lt;AuthenticatorInfo&gt; | Yes | Callback invoked to return the result. |
**Example** **Example**
...@@ -1541,14 +1540,14 @@ Obtains authenticator information of an app account. This method uses a promise ...@@ -1541,14 +1540,14 @@ Obtains authenticator information of an app account. This method uses a promise
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------------- | | ----- | ------ | ---- | ----------- |
| owner | string | Yes | Bundle name of the app.| | owner | string | Yes | Bundle name of the app.|
**Parameters** **Parameters**
| Type | Description | | Type | Description |
| -------------------------------- | ----------------------------------- | | -------------------------------- | --------------------- |
| Promise&lt;AuthenticatorInfo&gt; | Promise used to return the result.| | Promise&lt;AuthenticatorInfo&gt; | Promise used to return the result.|
**Example** **Example**
...@@ -1568,10 +1567,10 @@ Defines app account information. ...@@ -1568,10 +1567,10 @@ Defines app account information.
**System capability**: SystemCapability.Account.AppAccount **System capability**: SystemCapability.Account.AppAccount
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------------- | | ----- | ------ | ---- | ----------- |
| owner | string | Yes | Bundle name of the app.| | owner | string | Yes | Bundle name of the app.|
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
## OAuthTokenInfo<sup>8+</sup> ## OAuthTokenInfo<sup>8+</sup>
...@@ -1579,10 +1578,10 @@ Defines OAuth access token information. ...@@ -1579,10 +1578,10 @@ Defines OAuth access token information.
**System capability**: SystemCapability.Account.AppAccount **System capability**: SystemCapability.Account.AppAccount
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| -------- | ------ | ---- | ---------------- | | -------- | ------ | ---- | -------- |
| authType | string | Yes | Authentication type.| | authType | string | Yes | Authentication type.|
| token | string | Yes | Value of the access token. | | token | string | Yes | Value of the access token. |
## AuthenticatorInfo<sup>8+</sup> ## AuthenticatorInfo<sup>8+</sup>
...@@ -1590,11 +1589,11 @@ Defines OAuth authenticator information. ...@@ -1590,11 +1589,11 @@ Defines OAuth authenticator information.
**System capability**: SystemCapability.Account.AppAccount **System capability**: SystemCapability.Account.AppAccount
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------- | ------ | ---- | -------------------- | | ------- | ------ | ---- | ---------- |
| owner | string | Yes | Bundle name of the authenticator owner.| | owner | string | Yes | Bundle name of the authenticator owner.|
| iconId | string | Yes | ID of the authenticator icon. | | iconId | string | Yes | ID of the authenticator icon. |
| labelId | string | Yes | ID of the authenticator label. | | labelId | string | Yes | ID of the authenticator label. |
## Constants<sup>8+</sup> ## Constants<sup>8+</sup>
...@@ -1602,19 +1601,19 @@ Enumerates the constants. ...@@ -1602,19 +1601,19 @@ Enumerates the constants.
**System capability**: SystemCapability.Account.AppAccount **System capability**: SystemCapability.Account.AppAccount
| Name | Default Value | Description | | Name | Default Value | Description |
| ----------------------------- | ---------------------- | ------------------------- | | ----------------------------- | ---------------------- | ------------- |
| ACTION_ADD_ACCOUNT_IMPLICITLY | "addAccountImplicitly" | Operation for implicitly adding an account. | | ACTION_ADD_ACCOUNT_IMPLICITLY | "addAccountImplicitly" | Operation for implicitly adding an account. |
| ACTION_AUTHENTICATE | "authenticate" | Authentication operation. | | ACTION_AUTHENTICATE | "authenticate" | Authentication operation. |
| KEY_NAME | "name" | App account name. | | KEY_NAME | "name" | App account name. |
| KEY_OWNER | "owner" | App account owner.| | KEY_OWNER | "owner" | App account owner.|
| KEY_TOKEN | "token" | OAuth access token. | | KEY_TOKEN | "token" | OAuth access token. |
| KEY_ACTION | "action" | Action. | | KEY_ACTION | "action" | Action. |
| KEY_AUTH_TYPE | "authType" | Authentication type. | | KEY_AUTH_TYPE | "authType" | Authentication type. |
| KEY_SESSION_ID | "sessionId" | Session ID. | | KEY_SESSION_ID | "sessionId" | Session ID. |
| KEY_CALLER_PID | "callerPid" | Caller process ID (PID). | | KEY_CALLER_PID | "callerPid" | Caller process ID (PID). |
| KEY_CALLER_UID | "callerUid" | Caller user ID (UID). | | KEY_CALLER_UID | "callerUid" | Caller user ID (UID). |
| KEY_CALLER_BUNDLE_NAME | "callerBundleName" | Caller bundle name. | | KEY_CALLER_BUNDLE_NAME | "callerBundleName" | Caller bundle name. |
## ResultCode<sup>8+</sup> ## ResultCode<sup>8+</sup>
...@@ -1622,27 +1621,27 @@ Enumerates the result codes. ...@@ -1622,27 +1621,27 @@ Enumerates the result codes.
**System capability**: SystemCapability.Account.AppAccount **System capability**: SystemCapability.Account.AppAccount
| Name | Default Value| Description | | Name | Default Value | Description |
| ----------------------------------- | ------ | ------------------------ | | ----------------------------------- | ----- | ------------ |
| SUCCESS | 0 | The operation is successful. | | SUCCESS | 0 | The operation is successful. |
| ERROR_ACCOUNT_NOT_EXIST | 10001 | The app account does not exist. | | ERROR_ACCOUNT_NOT_EXIST | 10001 | The app account does not exist. |
| ERROR_APP_ACCOUNT_SERVICE_EXCEPTION | 10002 | The app account service is abnormal. | | ERROR_APP_ACCOUNT_SERVICE_EXCEPTION | 10002 | The app account service is abnormal. |
| ERROR_INVALID_PASSWORD | 10003 | The password is invalid. | | ERROR_INVALID_PASSWORD | 10003 | The password is invalid. |
| ERROR_INVALID_REQUEST | 10004 | The request is invalid. | | ERROR_INVALID_REQUEST | 10004 | The request is invalid. |
| ERROR_INVALID_RESPONSE | 10005 | The response is invalid. | | ERROR_INVALID_RESPONSE | 10005 | The response is invalid. |
| ERROR_NETWORK_EXCEPTION | 10006 | The network is abnormal. | | ERROR_NETWORK_EXCEPTION | 10006 | The network is abnormal. |
| ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST | 10007 | The authenticator does not exist. | | ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST | 10007 | The authenticator does not exist. |
| ERROR_OAUTH_CANCELED | 10008 | The authentication is canceled. | | 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_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_BUSY | 10010 | The OAuth service is busy. |
| ERROR_OAUTH_SERVICE_EXCEPTION | 10011 | The OAuth service is abnormal. | | 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_SESSION_NOT_EXIST | 10012 | The session to be authenticated does not exist. |
| ERROR_OAUTH_TIMEOUT | 10013 | The authentication timed out. | | ERROR_OAUTH_TIMEOUT | 10013 | The authentication timed out. |
| ERROR_OAUTH_TOKEN_NOT_EXIST | 10014 | The OAuth access token does not exist.| | 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_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_ACTION | 10016 | The authentication operation is not supported. |
| ERROR_OAUTH_UNSUPPORT_AUTH_TYPE | 10017 | The authentication type is not supported. | | ERROR_OAUTH_UNSUPPORT_AUTH_TYPE | 10017 | The authentication type is not supported. |
| ERROR_PERMISSION_DENIED | 10018 | The required permission is missing. | | ERROR_PERMISSION_DENIED | 10018 | The required permission is missing. |
## AuthenticatorCallback<sup>8+</sup> ## AuthenticatorCallback<sup>8+</sup>
...@@ -1657,10 +1656,10 @@ Called back to send the authentication result. ...@@ -1657,10 +1656,10 @@ Called back to send the authentication result.
**System capability**: SystemCapability.Account.AppAccount **System capability**: SystemCapability.Account.AppAccount
**Parameters** **Parameters**
| Name| Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ------ | -------------------- | ---- | ------------ | | ------ | -------------------- | ---- | ------ |
| code | number | Yes | Authentication result code.| | code | number | Yes | Authentication result code.|
| result | {[key: string]: any} | Yes | Authentication result. | | result | {[key: string]: any} | Yes | Authentication result. |
**Example** **Example**
...@@ -1687,9 +1686,9 @@ Called back to redirect an authentication request. ...@@ -1687,9 +1686,9 @@ Called back to redirect an authentication request.
**System capability**: SystemCapability.Account.AppAccount **System capability**: SystemCapability.Account.AppAccount
**Parameters** **Parameters**
| Name | Type| Mandatory| Description | | Name | Type | Mandatory | Description |
| ------- | ---- | ---- | -------------------- | | ------- | ---- | ---- | ---------- |
| request | Want | Yes | Request to be redirected.| | request | Want | Yes | Request to be redirected.|
**Example** **Example**
...@@ -1724,12 +1723,12 @@ Implicitly adds an app account based on the specified authentication type and op ...@@ -1724,12 +1723,12 @@ Implicitly adds an app account based on the specified authentication type and op
**System capability**: SystemCapability.Account.AppAccount **System capability**: SystemCapability.Account.AppAccount
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------------- | --------------------- | ---- | ------------------------------ | | ---------------- | --------------------- | ---- | --------------- |
| authType | string | Yes | Authentication type. | | authType | string | Yes | Authentication type. |
| callerBundleName | string | Yes | Bundle name of the authentication requester. | | callerBundleName | string | Yes | Bundle name of the authentication requester. |
| options | {[key: string]: any} | Yes | Options for the authentication. | | options | {[key: string]: any} | Yes | Options for the authentication. |
| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| | callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.|
### authenticate<sup>8+</sup> ### authenticate<sup>8+</sup>
...@@ -1740,13 +1739,13 @@ Authenticates an app account to obtain the OAuth access token. This method uses ...@@ -1740,13 +1739,13 @@ Authenticates an app account to obtain the OAuth access token. This method uses
**System capability**: SystemCapability.Account.AppAccount **System capability**: SystemCapability.Account.AppAccount
**Parameters** **Parameters**
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ---------------- | --------------------- | ---- | ------------------------------ | | ---------------- | --------------------- | ---- | --------------- |
| name | string | Yes | App account name. | | name | string | Yes | App account name. |
| authType | string | Yes | Authentication type. | | authType | string | Yes | Authentication type. |
| callerBundleName | string | Yes | Bundle name of the authentication requester. | | callerBundleName | string | Yes | Bundle name of the authentication requester. |
| options | {[key: string]: any} | Yes | Options for the authentication. | | options | {[key: string]: any} | Yes | Options for the authentication. |
| callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.| | callback | AuthenticatorCallback | Yes | Authenticator callback invoked to return the authentication result.|
**Example** **Example**
......
...@@ -29,6 +29,7 @@ Obtains an **AccountManager** instance. ...@@ -29,6 +29,7 @@ Obtains an **AccountManager** instance.
``` ```
## OsAccountType ## OsAccountType
Enumerates OS account types. Enumerates OS account types.
**System capability**: SystemCapability.Account.OsAccount **System capability**: SystemCapability.Account.OsAccount
...@@ -51,6 +52,8 @@ Activates an OS account. This method uses an asynchronous callback to return the ...@@ -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. 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 **System capability**: SystemCapability.Account.OsAccount
**Parameters** **Parameters**
...@@ -488,7 +491,7 @@ This is a system API and cannot be called by third-party applications. ...@@ -488,7 +491,7 @@ This is a system API and cannot be called by third-party applications.
setOsAccountConstraints(localId: number, constraints: Array&lt;string&gt;, enable: boolean,callback: AsyncCallback&lt;void&gt;): void setOsAccountConstraints(localId: number, constraints: Array&lt;string&gt;, enable: boolean,callback: AsyncCallback&lt;void&gt;): 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. 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. ...@@ -519,7 +522,7 @@ This is a system API and cannot be called by third-party applications.
setOsAccountConstraints(localId: number, constraints: Array&lt;string&gt;, enable: boolean): Promise&lt;void&gt; setOsAccountConstraints(localId: number, constraints: Array&lt;string&gt;, enable: boolean): Promise&lt;void&gt;
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. 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. ...@@ -1737,16 +1740,17 @@ This is a system API and cannot be called by third-party applications.
``` ```
## OsAccountInfo ## OsAccountInfo
Defines information about an OS account. Defines information about an OS account.
**System capability**: SystemCapability.Account.OsAccount **System capability**: SystemCapability.Account.OsAccount
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------------- | ------------------------------------------------------------ | ---- | --------------------------------- | | ------------------------------ | ------------------------------------------------------------ | ---- | --------------------------------- |
| localId | number | Yes | ID of the target OS account. | | localId | number | Yes | ID of the target OS account. |
| localName | string | Yes | OS account name. | | localName | string | Yes | OS account name. |
| type | [OsAccountType](#osaccounttype) | Yes | OS account type. | | type | [OsAccountType](#osaccounttype) | Yes | OS account type. |
| constraints | Array&lt;string&gt; | No | [Constraints](#constraints) on the OS account.| | constraints | Array&lt;string&gt; | No | [Constraints](#constraints) on the OS account.|
| isVerified<sup>8+</sup> | boolean | Yes | Whether the OS account is verified. | | isVerified<sup>8+</sup> | boolean | Yes | Whether the OS account is verified. |
| photo<sup>8+</sup> | string | No | Profile photo of the OS account. | | photo<sup>8+</sup> | string | No | Profile photo of the OS account. |
| createTime<sup>8+</sup> | number | Yes | Time when the OS account was created. | | createTime<sup>8+</sup> | number | Yes | Time when the OS account was created. |
...@@ -1754,17 +1758,18 @@ Defines information about an OS account. ...@@ -1754,17 +1758,18 @@ Defines information about an OS account.
| serialNumber<sup>8+</sup> | number | Yes | SN of the OS account. | | serialNumber<sup>8+</sup> | number | Yes | SN of the OS account. |
| isActived<sup>8+</sup> | boolean | Yes | Whether the OS account is activated. | | isActived<sup>8+</sup> | boolean | Yes | Whether the OS account is activated. |
| isCreateCompleted<sup>8+</sup> | boolean | Yes | Whether the OS account information is complete. | | isCreateCompleted<sup>8+</sup> | 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. |
| domainInfo<sup>8+</sup> | [DomainAccountInfo](#domainaccountinfo) | No | Domain account information. | | domainInfo<sup>8+</sup> | [DomainAccountInfo](#domainaccountinfo) | No | Domain account information. |
## DomainAccountInfo<sup>8+</sup> ## DomainAccountInfo<sup>8+</sup>
Domain account information. Domain account information.
**System capability**: SystemCapability.Account.OsAccount **System capability**: SystemCapability.Account.OsAccount
| Name | Type | Mandatory| Description | | Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ---------- | | ----------- | ------ | ---- | ---------- |
| domain | string | Yes | Domain name. | | domain | string | Yes | Domain name. |
| accountName | string | Yes | Domain account name.| | accountName | string | Yes | Domain account name.|
## Constraints ## Constraints
...@@ -1801,8 +1806,8 @@ Domain account information. ...@@ -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.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.physical.media | A user is not allowed to mount external physical media.|
| constraint.microphone | A user is not allowed to use microphones.| | constraint.microphone | A user is not allowed to use microphones.|
| constraint.microphone.unmute | A user is not allowed to adjust the microphone volume.| | constraint.microphone.unmute | A user is not allowed to unmute the microphone.|
| constraint.volume.adjust | A user is not allowed to adjust the device's global volume.| | 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.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.sms.use | A user is not allowed to send or receive SMS messages.|
| constraint.fun | A user is not allowed to have entertainment.| | constraint.fun | A user is not allowed to have entertainment.|
...@@ -1820,7 +1825,7 @@ Domain account information. ...@@ -1820,7 +1825,7 @@ Domain account information.
| constraint.os.account.set.icon | A user is not allowed to change their icon.| | 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.wallpaper.set | A user is not allowed to set a wallpaper.|
| constraint.oem.unlock | A user is not allowed to enable OEM unlock.| | 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.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.autofill | A user is not allowed to use the autofill service.|
| constraint.content.capture | Capturing the content of a user's screen is prohibited.| | constraint.content.capture | Capturing the content of a user's screen is prohibited.|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册