提交 acfbd073 编写于 作者: A annie_wangli

update docs

Signed-off-by: Nannie_wangli <annie.wangli@huawei.com>
上级 aae0bf4c
......@@ -21,7 +21,7 @@ Creates an **AppAccountManager** instance.
**Return Value**
| Type | Description |
| ----------------- | ------------------------ |
| ----------------- | ------------ |
| AppAccountManager | **AppAccountManager** instance created.|
**Example**
......@@ -43,8 +43,8 @@ Adds an app account to the account management service. This method uses an async
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ------------------------------------------ |
| Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | --------------------- |
| name | string | Yes | Name of the app account to add. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when the app account is added.|
......@@ -67,8 +67,8 @@ Adds an app account and its additional information to the account management ser
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ------------------------- | ---- | ------------------------------------------------------------ |
| 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&lt;void&gt; | Yes | Callback invoked when the app account and its additional information are added. |
......@@ -94,15 +94,15 @@ Adds an app account and its additional information to the account management ser
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ------ | ---- | ------------------------------------------------------------ |
| 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 |
| ------------------- | ---------------------------------- |
| ------------------- | --------------------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
......@@ -126,8 +126,8 @@ Implicitly adds an app account based on the specified account owner, authenticat
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | --------------------- | ---- | ------------------------------ |
| 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. |
......@@ -167,8 +167,8 @@ Deletes an app account from the account management service. This method uses an
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------------------------------- |
| Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | ----------------- |
| name | string | Yes | Name of the app account to delete. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback invoked when the app account is deleted.|
......@@ -191,14 +191,14 @@ Deletes an app account from the account management service. This method uses a p
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------------------------ |
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ------------ |
| name | string | Yes | Name of the app account to delete.|
**Return Value**
| Type | Description |
| :------------------ | :---------------------------------- |
| :------------------ | :-------------------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
......@@ -222,8 +222,8 @@ Disables an app account from accessing an application with the given bundle name
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------------------------- | ---- | ------------------------------------------------------------ |
| Name | Type | Mandatory | Description |
| ---------- | ------------------------- | ---- | ------------------------------- |
| name | string | Yes | App account name. |
| 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.|
......@@ -247,15 +247,15 @@ Disables an app account from accessing an application with the given bundle name
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | ---------------------------------- |
| Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | ----------------- |
| name | string | Yes | App account name.|
| bundleName | string | Yes | Bundle name of an app. |
**Return Value**
| Type | Description |
| :------------------ | :---------------------------------- |
| :------------------ | :-------------------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
......@@ -279,8 +279,8 @@ Enables an app account to access an application with the given bundle name. This
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------------------------- | ---- | ------------------------------------------------------------ |
| Name | Type | Mandatory | Description |
| ---------- | ------------------------- | ---- | ------------------------------- |
| name | string | Yes | App account name. |
| 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.|
......@@ -304,15 +304,15 @@ Enables an app account to access an application with the given bundle name. This
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | ------------------ |
| Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | --------- |
| name | string | Yes | App account name. |
| bundleName | string | Yes | Bundle name of an app.|
**Return Value**
| Type | Description |
| :------------------ | :---------------------------------- |
| :------------------ | :-------------------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
......@@ -337,8 +337,8 @@ Checks whether an app account allows application data synchronization. This meth
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ---------------------------- | ---- | -------------------------------------------- |
| Name | Type | Mandatory | Description |
| -------- | ---------------------------- | ---- | ---------------------- |
| name | string | Yes | App account name. |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return whether the app account allows application data synchronization.|
......@@ -364,14 +364,14 @@ Checks whether an app account allows application data synchronization. This meth
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------- |
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ------- |
| name | string | Yes | App account name.|
**Return Value**
| Type | Description |
| :--------------------- | :---------------------------------- |
| :--------------------- | :-------------------- |
| Promise&lt;boolean&gt; | 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&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.
......@@ -395,8 +395,8 @@ Sets a credential for an app account. This method uses an asynchronous callback
**Parameters**
| Name | Type | Mandatory| Description |
| -------------- | ------------------------- | ---- | ---------------------------- |
| 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. |
......@@ -421,8 +421,8 @@ Sets a credential for an app account. This method uses a promise to return the r
**Parameters**
| Name | Type | Mandatory| Description |
| -------------- | ------ | ---- | -------------------- |
| 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. |
......@@ -430,7 +430,7 @@ Sets a credential for an app account. This method uses a promise to return the r
**Return Value**
| Type | Description |
| :------------------ | :---------------------------------- |
| :------------------ | :-------------------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
......@@ -454,8 +454,8 @@ Sets additional information for an app account. This method uses an asynchronous
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ------------------------- | ---- | -------------------------------- |
| Name | Type | Mandatory | Description |
| --------- | ------------------------- | ---- | ---------------- |
| name | string | Yes | App account name. |
| 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.|
......@@ -479,15 +479,15 @@ Sets additional information for an app account. This method uses a promise to re
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ------ | ---- | ------------------ |
| Name | Type | Mandatory | Description |
| --------- | ------ | ---- | --------- |
| name | string | Yes | App account name. |
| extraInfo | string | Yes | Additional information to set.|
**Return Value**
| Type | Description |
| :------------------ | :---------------------------------- |
| :------------------ | :-------------------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
......@@ -513,8 +513,8 @@ Sets whether to enable application data synchronization for an app account. This
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | -------------------------------------------------- |
| Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | ------------------------- |
| name | string | Yes | App account name. |
| 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.|
......@@ -540,15 +540,15 @@ Sets whether to enable application data synchronization for an app account. This
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------- | ---- | ---------------------- |
| Name | Type | Mandatory | Description |
| -------- | ------- | ---- | ----------- |
| name | string | Yes | App account name. |
| isEnable | boolean | Yes | Whether to enable app data synchronization.|
**Return Value**
| Type | Description |
| :------------------ | :---------------------------------- |
| :------------------ | :-------------------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
......@@ -572,8 +572,8 @@ Sets data to be associated with an app account. This method uses an asynchronous
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------------------------------- |
| 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. |
......@@ -597,8 +597,8 @@ Sets data to be associated with an app account. This method uses a promise to re
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ---------------------------------- |
| 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. |
......@@ -606,7 +606,7 @@ Sets data to be associated with an app account. This method uses a promise to re
**Return Value**
| Type | Description |
| :------------------ | :---------------------------------- |
| :------------------ | :-------------------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
......@@ -630,8 +630,8 @@ Obtains the credential of an app account. This method uses an asynchronous callb
**Parameters**
| Name | Type | Mandatory| Description |
| -------------- | --------------------------- | ---- | ---------------------------- |
| Name | Type | Mandatory | Description |
| -------------- | --------------------------- | ---- | -------------- |
| name | string | Yes | App account name. |
| 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.|
......@@ -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 | Type | Mandatory | Description |
| -------------- | ------ | ---- | ---------- |
| name | string | Yes | App account name. |
| credentialType | string | Yes | Type of the credential to obtain.|
**Return Value**
| Type | Description |
| :-------------------- | :---------------------------------- |
| :-------------------- | :-------------------- |
| Promise&lt;string&gt; | Promise used to return the result.|
**Example**
......@@ -688,8 +688,8 @@ Obtains additional information of an app account. This method uses an asynchrono
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | -------------------------------- |
| Name | Type | Mandatory | Description |
| -------- | --------------------------- | ---- | ---------------- |
| name | string | Yes | App account name. |
| callback | AsyncCallback&lt;string&gt; | Yes | Callback invoked to return the additional information of the specified app account.|
......@@ -713,14 +713,14 @@ Obtains additional information of an app account. This method uses a promise to
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------- |
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ------- |
| name | string | Yes | App account name.|
**Return Value**
| Type | Description |
| :-------------------- | :---------------------------------- |
| :-------------------- | :-------------------- |
| Promise&lt;string&gt; | Promise used to return the result.|
**Example**
......@@ -744,8 +744,8 @@ Obtains data associated with an app account. This method uses an asynchronous ca
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | ---------------------------------- |
| Name | Type | Mandatory | Description |
| -------- | --------------------------- | ---- | ----------------- |
| name | string | Yes | App account name. |
| 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.|
......@@ -770,15 +770,15 @@ Obtains data associated with an app account. This method uses a promise to retur
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------------------- |
| Name | Type | Mandatory | Description |
| ---- | ------ | ---- | ----------- |
| name | string | Yes | App account name. |
| key | string | Yes | Key of the data to obtain.|
**Return Value**
| Type | Description |
| :-------------------- | :---------------------------------- |
| :-------------------- | :-------------------- |
| Promise&lt;string&gt; | Promise used to return the result.|
**Example**
......@@ -798,14 +798,14 @@ 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.
**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 |
| -------- | ------------------------------------------------ | ---- | ---------------- |
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | -------- |
| callback | AsyncCallback&lt;Array&lt;AppAccountInfo&gt;&gt; | Yes | Callback invoked to return information about all accessible app accounts.|
**Example**
......@@ -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.
**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 |
| ------------------------------------------ | ----------------------------------- |
| ---------------------------------------- | --------------------- |
| Promise&lt;Array&lt;AppAccountInfo&gt;&gt; | Promise used to return the result.|
**Example**
......@@ -851,14 +851,14 @@ 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.
**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 |
| -------- | ------------------------------------------------ | ---- | ---------------- |
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | -------- |
| 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.|
......@@ -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.
**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 |
| ------ | ------ | ---- | ---------- |
| Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ----- |
| owner | string | Yes | Bundle name of the app.|
**Parameters**
| Type | Description |
| ------------------------------------------ | ----------------------------------- |
| ---------------------------------------- | --------------------- |
| Promise&lt;Array&lt;AppAccountInfo&gt;&gt; | Promise used to return the result.|
**Example**
......@@ -917,8 +917,8 @@ Subscribes to the account change event of the specified account owners. This met
**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.|
| 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. |
......@@ -948,8 +948,8 @@ Unsubscribes from the account change event. This method uses an asynchronous cal
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | -------------------------------- | ---- | ------------------------ |
| Name | Type | Mandatory | Description |
| -------- | -------------------------------- | ---- | ------------ |
| type | 'change' | Yes | Account change event to unsubscribe from. |
| callback | Callback<Array\<AppAccountInfo>> | No | Callback used to report the account change.|
......@@ -981,8 +981,8 @@ Authenticates an app account to obtain the Open Authorization (OAuth) access tok
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | --------------------- | ---- | ------------------------------ |
| 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. |
......@@ -1023,8 +1023,8 @@ Obtains the OAuth access token of an app account based on the specified authenti
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | ---------------------- |
| Name | Type | Mandatory | Description |
| -------- | --------------------------- | ---- | ----------- |
| name | string | Yes | App account name. |
| owner | string | Yes | Bundle name of the app.|
| authType | string | Yes | Authentication type. |
......@@ -1050,8 +1050,8 @@ Obtains the OAuth access token of an app account based on the specified authenti
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------ | ---- | ---------------------- |
| Name | Type | Mandatory | Description |
| -------- | ------ | ---- | ----------- |
| name | string | Yes | App account name. |
| owner | string | Yes | Bundle name of the app.|
| authType | string | Yes | Authentication type. |
......@@ -1059,7 +1059,7 @@ Obtains the OAuth access token of an app account based on the specified authenti
**Parameters**
| Type | Description |
| --------------------- | ----------------------------------- |
| --------------------- | --------------------- |
| Promise&lt;string&gt; | Promise used to return the result.|
**Example**
......@@ -1083,11 +1083,11 @@ Sets an OAuth access token for an app account. This method uses an asynchronous
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------------- |
| Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | -------- |
| name | string | Yes | App account name.|
| 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.|
**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 | Type | Mandatory | Description |
| -------- | ------ | ---- | -------- |
| name | string | Yes | App account name.|
| authType | string | Yes | Authentication type. |
| token | string | Yes | OAuth access token to set. |
| token | string | Yes | OAuth access token to set.|
**Parameters**
| Type | Description |
| ------------------- | ----------------------------------- |
| ------------------- | --------------------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
......@@ -1142,12 +1142,12 @@ Deletes the specified OAuth access token for an app account. This method uses an
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------------------- |
| Name | Type | Mandatory | Description |
| -------- | ------------------------- | ---- | ------------ |
| 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. |
| 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. |
**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 | Type | Mandatory | Description |
| -------- | ------ | ---- | ------------ |
| 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. |
| token | string | Yes | OAuth access token to delete. |
| token | string | Yes | OAuth access token to delete.|
**Parameters**
| Type | Description |
| ------------------- | ----------------------------------- |
| ------------------- | --------------------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
......@@ -1203,8 +1203,8 @@ Sets the visibility of an OAuth access token to the specified app. This method u
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------------------------- | ---- | ------------------------ |
| Name | Type | Mandatory | Description |
| ---------- | ------------------------- | ---- | ------------ |
| name | string | Yes | App account name. |
| authType | string | Yes | Authentication type. |
| bundleName | string | Yes | Bundle name of the app.|
......@@ -1230,8 +1230,8 @@ Sets the visibility of an OAuth access token to the specified app. This method u
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------- | ---- | ------------------------ |
| Name | Type | Mandatory | Description |
| ---------- | ------- | ---- | ------------ |
| name | string | Yes | App account name. |
| authType | string | Yes | Authentication type. |
| bundleName | string | Yes | Bundle name of the app.|
......@@ -1240,14 +1240,13 @@ Sets the visibility of an OAuth access token to the specified app. This method u
**Parameters**
| Type | Description |
| ------------------- | ----------------------------------- |
| ------------------- | --------------------- |
| Promise&lt;void&gt; | 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,8 +1264,8 @@ Checks whether an OAuth token is visible to the specified app. This method uses
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ---------------------------- | ---- | -------------------------- |
| Name | Type | Mandatory | Description |
| ---------- | ---------------------------- | ---- | ------------- |
| name | string | Yes | App account name. |
| authType | string | Yes | Authentication type. |
| bundleName | string | Yes | Bundle name of the app.|
......@@ -1292,8 +1291,8 @@ Checks whether an OAuth token is visible to the specified app. This method uses
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | -------------------------- |
| Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | ------------- |
| name | string | Yes | App account name. |
| authType | string | Yes | Authentication type. |
| bundleName | string | Yes | Bundle name of the app.|
......@@ -1301,7 +1300,7 @@ Checks whether an OAuth token is visible to the specified app. This method uses
**Parameters**
| Type | Description |
| ---------------------- | ----------------------------------- |
| ---------------------- | --------------------- |
| Promise&lt;boolean&gt; | Promise used to return the result.|
**Example**
......@@ -1325,8 +1324,8 @@ Obtains information about all OAuth access tokens of an app account visible to t
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------ | ---- | ---------------------- |
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ----------- |
| name | string | Yes | App account name. |
| owner | string | Yes | Bundle name of the app.|
| callback | AsyncCallback&lt;Array&lt;OAuthTokenInfo&gt;&gt; | Yes | Callback invoked to return the result. |
......@@ -1351,15 +1350,15 @@ Obtains information about all OAuth access tokens of an app account visible to t
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ---------------------- |
| Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ----------- |
| name | string | Yes | App account name. |
| owner | string | Yes | Bundle name of the app.|
**Parameters**
| Type | Description |
| ------------------------------------------ | ----------------------------------- |
| ---------------------------------------- | --------------------- |
| Promise&lt;Array&lt;OAuthTokenInfo&gt;&gt; | Promise used to return the result.|
**Example**
......@@ -1383,8 +1382,8 @@ Obtains the authorization list of OAuth access tokens of an app account. This me
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------------- | ---- | ---------------------- |
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ----------- |
| name | string | Yes | App account name. |
| owner | string | Yes | Bundle name of the app.|
| callback | AsyncCallback&lt;Array&lt;string&gt;&gt; | Yes | Callback invoked to return the result. |
......@@ -1409,15 +1408,15 @@ Obtains the authorization list of OAuth access tokens of an app account. This me
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ---------------------- |
| Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ----------- |
| name | string | Yes | App account name. |
| owner | string | Yes | Bundle name of the app.|
**Parameters**
| Type | Description |
| ---------------------------------- | ----------------------------------- |
| ---------------------------------- | --------------------- |
| Promise&lt;Array&lt;string&gt;&gt; | Promise used to return the result.|
**Example**
......@@ -1441,8 +1440,8 @@ Obtains the authenticator callback for a session. This method uses an asynchrono
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ------------------------------------------ | ---- | ---------------- |
| Name | Type | Mandatory | Description |
| --------- | ---------------------------------------- | ---- | -------- |
| sessionId | string | Yes | ID of the session to authenticate.|
| callback | AsyncCallback&lt;AuthenticatorCallback&gt; | Yes | Callback invoked to return the result.|
......@@ -1476,14 +1475,14 @@ Obtains the authenticator callback for a session. This method uses a promise to
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ------ | ---- | ---------------- |
| Name | Type | Mandatory | Description |
| --------- | ------ | ---- | -------- |
| sessionId | string | Yes | ID of the session to authenticate.|
**Parameters**
| Type | Description |
| ------------------------------------ | ----------------------------------- |
| ------------------------------------ | --------------------- |
| Promise&lt;AuthenticatorCallback&gt; | Promise used to return the result.|
**Example**
......@@ -1516,8 +1515,8 @@ Obtains authenticator information of an app account. This method uses an asynchr
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | ---------------------- |
| Name | Type | Mandatory | Description |
| -------- | -------------------------------------- | ---- | ----------- |
| owner | string | Yes | Bundle name of the app.|
| callback | AsyncCallback&lt;AuthenticatorInfo&gt; | Yes | Callback invoked to return the result. |
......@@ -1541,14 +1540,14 @@ Obtains authenticator information of an app account. This method uses a promise
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ---------------------- |
| Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ----------- |
| owner | string | Yes | Bundle name of the app.|
**Parameters**
| Type | Description |
| -------------------------------- | ----------------------------------- |
| -------------------------------- | --------------------- |
| Promise&lt;AuthenticatorInfo&gt; | Promise used to return the result.|
**Example**
......@@ -1568,8 +1567,8 @@ Defines app account information.
**System capability**: SystemCapability.Account.AppAccount
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ---------------------- |
| Name | Type | Mandatory | Description |
| ----- | ------ | ---- | ----------- |
| owner | string | Yes | Bundle name of the app.|
| name | string | Yes | App account name. |
......@@ -1579,8 +1578,8 @@ Defines OAuth access token information.
**System capability**: SystemCapability.Account.AppAccount
| Name | Type | Mandatory| Description |
| -------- | ------ | ---- | ---------------- |
| Name | Type | Mandatory | Description |
| -------- | ------ | ---- | -------- |
| authType | string | Yes | Authentication type.|
| token | string | Yes | Value of the access token. |
......@@ -1590,8 +1589,8 @@ Defines OAuth authenticator information.
**System capability**: SystemCapability.Account.AppAccount
| Name | Type | Mandatory| Description |
| ------- | ------ | ---- | -------------------- |
| 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. |
......@@ -1603,7 +1602,7 @@ 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. |
......@@ -1622,8 +1621,8 @@ Enumerates the result codes.
**System capability**: SystemCapability.Account.AppAccount
| Name | Default Value| Description |
| ----------------------------------- | ------ | ------------------------ |
| 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. |
......@@ -1657,8 +1656,8 @@ Called back to send the authentication result.
**System capability**: SystemCapability.Account.AppAccount
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | -------------------- | ---- | ------------ |
| Name | Type | Mandatory | Description |
| ------ | -------------------- | ---- | ------ |
| code | number | Yes | Authentication result code.|
| result | {[key: string]: any} | Yes | Authentication result. |
......@@ -1687,8 +1686,8 @@ Called back to redirect an authentication request.
**System capability**: SystemCapability.Account.AppAccount
**Parameters**
| Name | Type| Mandatory| Description |
| ------- | ---- | ---- | -------------------- |
| Name | Type | Mandatory | Description |
| ------- | ---- | ---- | ---------- |
| request | Want | Yes | Request to be redirected.|
**Example**
......@@ -1724,8 +1723,8 @@ Implicitly adds an app account based on the specified authentication type and op
**System capability**: SystemCapability.Account.AppAccount
**Parameters**
| Name | Type | Mandatory| Description |
| ---------------- | --------------------- | ---- | ------------------------------ |
| 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. |
......@@ -1740,8 +1739,8 @@ Authenticates an app account to obtain the OAuth access token. This method uses
**System capability**: SystemCapability.Account.AppAccount
**Parameters**
| Name | Type | Mandatory| Description |
| ---------------- | --------------------- | ---- | ------------------------------ |
| Name | Type | Mandatory | Description |
| ---------------- | --------------------- | ---- | --------------- |
| name | string | Yes | App account name. |
| authType | string | Yes | Authentication type. |
| callerBundleName | string | Yes | Bundle name of the authentication requester. |
......
......@@ -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&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.
......@@ -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;
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,12 +1740,13 @@ 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. |
......@@ -1758,6 +1762,7 @@ Defines information about an OS account.
| domainInfo<sup>8+</sup> | [DomainAccountInfo](#domainaccountinfo) | No | Domain account information. |
## DomainAccountInfo<sup>8+</sup>
Domain account information.
**System capability**: SystemCapability.Account.OsAccount
......@@ -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.|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册