@@ -64,7 +64,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. |
| 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
**Example**
...
...
@@ -74,7 +74,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
letatManager=abilityAccessCtrl.createAtManager();
lettokenID=0;// Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
@@ -111,14 +111,14 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. |
| 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
**Example**
```js
letatManager=abilityAccessCtrl.createAtManager();
lettokenID=0;// Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
@@ -154,7 +154,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0, the permissionName is greater than 256 bytes, or the flags value is invalid. |
| 12100001 | The parameter is invalid. The tokenID is 0, the permissionName exceeds 256 bytes, or the flags value is invalid. |
| 12100002 | The specified tokenID does not exist. |
| 12100003 | The specified permission does not exist. |
| 12100006 | The application specified by the tokenID is not allowed to be granted with the specified permission. Either the application is a sandbox or the tokenID is from a remote device. |
...
...
@@ -169,7 +169,7 @@ let atManager = abilityAccessCtrl.createAtManager();
lettokenID=0;// Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
@@ -221,7 +221,7 @@ let atManager = abilityAccessCtrl.createAtManager();
lettokenID=0;// Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
@@ -280,7 +280,7 @@ let atManager = abilityAccessCtrl.createAtManager();
lettokenID=0;// Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
@@ -332,7 +332,7 @@ let atManager = abilityAccessCtrl.createAtManager();
lettokenID=0;// Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
@@ -375,7 +375,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. |
| 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
| 12100002 | The specified tokenID does not exist. |
| 12100003 | The specified permission does not exist. |
| 12100006 | The operation is not allowed. Either the application is a sandbox or the tokenID is from a remote device. |
...
...
@@ -389,7 +389,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
letatManager=abilityAccessCtrl.createAtManager();
lettokenID=0;// Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
| type | string | Yes | Event type to subscribe to. The value is **'permissionStateChange'**, which indicates the permission grant state change. |
| tokenIDList | Array<number> | Yes | Token IDs of the applications to observe. If this parameter is left empty, the permission grant state changes of all applications are observed. |
| permissionList | Array<Permissions> | Yes | Permissions to observe. If this parameter is left empty, the grant state changes of all permissions are observed. |
| permissionList | Array<Permissions> | Yes | List of permission names. If this parameter is left empty, the grant state changes of all permissions are subscribed to. |
| callback | Callback<[PermissionStateChangeInfo](#permissionstatechangeinfo9)> | Yes| Callback invoked to return the permission grant state change.|
**Error codes**
...
...
@@ -452,7 +452,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. |
| 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
| 12100004 | The interface is called repeatedly with the same input. |
| 12100005 | The registration time has exceeded the limitation. |
| 12100007 | Service is abnormal. |
...
...
@@ -461,16 +461,16 @@ For details about the error codes, see [Application Access Control Error Codes](
@@ -558,7 +558,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
letatManager=abilityAccessCtrl.createAtManager();
lettokenID=0;// Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
@@ -694,7 +694,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
letatManager=abilityAccessCtrl.createAtManager();
lettokenID=0;// Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
@@ -727,14 +727,14 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. |
| 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
**Example**
```js
letatManager=abilityAccessCtrl.createAtManager();
lettokenID=0;// Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
**Required permissions**: ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| localId | number | Yes| ID of the target OS account.|
| callback | AsyncCallback<[DistributedInfo](#distributedinfo)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **undefined** and **data** is the distributed account information obtained. Otherwise, **err** is an error object.|
| localId | number | Yes| ID of the target OS account.|
| accountInfo | [DistributedInfo](#distributedinfo) | Yes| Distributed account information to set.|
| callback | AsyncCallback<void> | Yes| Callback invoked to return the result. If the distributed information is set successfully, **err** is **undefined**. Otherwise, **err** is an error object.|
**Error codes**
| ID| Error Message|
| -------- | ------------------- |
| 12300001 | System service exception. |
| 12300002 | Invalid distributedInfo. |
| 12300003 | Account identified by localId or by distributedInfo not found. |
| name | string | No|Yes| Name of the distributed account. It must be a non-null string.|
| id | string | No|Yes| UID of the distributed account. It must be a non-null string.|
| event | string | No|Yes| Login state of the distributed account. The state can be login, logout, token invalid, or logoff, which correspond to the following strings respectively:<br>- Ohos.account.event.LOGIN<br>- Ohos.account.event.LOGOUT<br>- Ohos.account.event.TOKEN_INVALID<br>- Ohos.account.event.LOGOFF |
| nickname<sup>9+</sup> | string | No|No| Nickname of the distributed account. By default, no value is passed.|
| avatar<sup>9+</sup> | string | No|No| Avatar of the distributed account. By default, no value is passed.|
| status<sup>10+</sup> | [DistributedAccountStatus](#distributedaccountstatus10) | Yes|No| Status of the distributed account. The value is of the enumerated type. The default status is unlogged.|
| scalableData<sup>8+</sup> | object | No|No| Extended information about the distributed account, passed in key-value (KV) pairs based on service requirements. By default, no value is passed.|
| name | string | Yes| Name of the distributed account. It must be a non-null string.|
| id | string | Yes| UID of the distributed account. It must be a non-null string.|
| event | string | Yes| Login state of the distributed account. The state can be login, logout, token invalid, or logoff, which correspond to the following strings respectively:<br>- Ohos.account.event.LOGIN<br>- Ohos.account.event.LOGOUT<br>- Ohos.account.event.TOKEN_INVALID<br>- Ohos.account.event.LOGOFF |
| nickname<sup>9+</sup> | string | No| Nickname of the distributed account. It must be a non-null string.|
| avatar<sup>9+</sup> | string | No| Avatar of the distributed account. It must be a non-null string.|
| scalableData<sup>8+</sup> | object | No| Extended information about the distributed account, passed in key-value (KV) pairs.<br>**NOTE**<br>This parameter is reserved and not used in the setters and getters.|
| Name | Value| Description |
| ---- | ------ | ----------- |
| NOT_LOGGED_IN | 0 | The account has not logged in.|
| type | 'activate' \| 'activating' | Yes | Type of the event to unsubscribe from. The value **activate** means an event indicating that an OS account is activated, and **activating** means an event indicating that an OS account is being activated.|
| name | string | Yes | Subscription name, which can be customized. The value cannot be empty or exceed 1024 bytes, and must be the same as the value passed by **on()**.|
| callback | Callback<number> | No | Callback to unregister. By default, **0** is returned. |
| callback | Callback<number> | No | Callback for the OS account activation state events. By default, no value is passed, which unsubscribes from all the callbacks for the OS account activation state events. |
**Error codes**
...
...
@@ -5649,7 +5649,7 @@ Obtains authentication information of the specified type. This API uses a promis
| authType | [AuthType](#authtype8) | No | Authentication credential type.|
| authType | [AuthType](#authtype8) | No | Authentication type. By default, no value is passed, which means to obtain information about all authentication types.|
**Return value**
...
...
@@ -5929,12 +5929,14 @@ Defines the executor property.
| distributedInfo | [distributedAccount.DistributedInfo](js-apis-distributed-account.md) | No | Distributed account information. By default, no value is passed. |
| domainInfo<sup>8+</sup> | [DomainAccountInfo](#domainaccountinfo8) | No | Domain account information. By default, no value is passed. |
## DomainAccountInfo<sup>8+</sup>
...
...
@@ -6169,7 +6178,7 @@ Defines the domain account information.
@@ -88,7 +88,7 @@ The permission usage record includes the application identity (token ID) of the
| permissionName | Permissions | Yes | Name of the permission.|
| successCount | number | Yes | Number of successful accesses.|
| failCount | number | Yes | Number of failed accesses.|
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If a usage record is added successfully, **err** is **undefine**. Otherwise, **err** is an error object.|
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If a usage record is added successfully, **err** is **undefined**. Otherwise, **err** is an error object.|
**Error codes**
...
...
@@ -109,7 +109,7 @@ import privacyManager from '@ohos.privacyManager';
lettokenID=0;// You can use getApplicationInfo to obtain the access token ID.
| callback | AsyncCallback<[PermissionUsedResponse](#permissionusedresponse)> | Yes| Callback invoked to return the result. If the query is successful, **err** is **undefine** and **data** is the permission usage record. Otherwise, **err** is an error object.|
| callback | AsyncCallback<[PermissionUsedResponse](#permissionusedresponse)> | Yes| Callback invoked to return the result. If the query is successful, **err** is **undefined** and **data** is the permission usage record. Otherwise, **err** is an error object.|
**Error codes**
...
...
@@ -216,14 +216,14 @@ For details about the error codes, see [Ability Access Control Error Codes](../e
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the permission is successfully used, **err** is **undefine**. Otherwise, **err** is an error object.|
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the permission is successfully used, **err** is **undefined**. Otherwise, **err** is an error object.|
**Error codes**
...
...
@@ -329,7 +329,7 @@ import privacyManager from '@ohos.privacyManager';
lettokenID=0;// You can use getApplicationInfo to obtain the access token ID.
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefine**. Otherwise, **err** is an error object.|
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is an error object.|
**Error codes**
...
...
@@ -432,7 +432,7 @@ import privacyManager from '@ohos.privacyManager';
lettokenID=0;// You can use getApplicationInfo to obtain the access token ID.
| tokenId | number | No | Token ID of the application (invoker). |
| isRemote | boolean | No | Whether the token ID belongs to the application on a remote device. The default value is **false**.|
| deviceId | string | No | ID of the device hosting the target application. |
| bundleName | string | No | Bundle name of the target application.|
| permissionNames | Array<Permissions> | No | Permissions to query. |
| beginTime | number | No | Start time of the query, in ms. The default value is **0**, indicating that no start time is set.|
| endTime | number | No | End time of the query, in ms. The default value is **0**, indicating that no end time is set.|
| flag | [PermissionUsageFlag](#permissionusageflag) | Yes | Query mode. The default value is **FLAG_PERMISSION_USAGE_SUMMARY**.|
| tokenId | number | No | Token ID of the application (invoker).<br>By default, all applications are queried. |
| isRemote | boolean | No | Whether to query the permission usage records of the remote device.<br> The default value is **false**, which means the permission usage records of the local device are queried by default.|
| deviceId | string | No | ID of the device hosting the target application.<br> The default value is the local device ID. |
| bundleName | string | No | Bundle name of the target application.<br>By default, all applications are queried.|
| permissionNames | Array<Permissions> | No | Permissions to query.<br>By default, the usage records of all permissions are queried. |
| beginTime | number | No | Start time of the query, in ms.<br>The default value is **0**, which means the start time is not set.|
| endTime | number | No | End time of the query, in ms.<br>The default value is **0**, which means the end time is not set.|
| flag | [PermissionUsageFlag](#permissionusageflag) | Yes | Query mode.|
## PermissionUsedResponse
...
...
@@ -567,9 +567,9 @@ Represents the permission usage records of all applications.
| permissionName | Permissions | No | Name of the permission. |
| accessCount | number | No | Total number of times that the permission is accessed.|
| rejectCount | number | No | Total number of times that the access to the permission is rejected.|
| lastAccessTime | number | No | Last time when the permission was accessed, accurate to ms.|
| lastRejectTime | number | No | Last time when the access to the permission was rejected, accurate to ms.|
| lastAccessDuration | number | No | Last access duration, in ms.|
| accessRecords | Array<[UsedRecordDetail](#usedrecorddetail)> | No | Successful access records. This parameter is valid only when **flag** is **FLAG_PERMISSION_USAGE_SUMMARY**. By default, 10 records are provided. |
| rejectRecords | Array<[UsedRecordDetail](#usedrecorddetail)> | No | Rejected access records. This parameter is valid only when **flag** is **FLAG_PERMISSION_USAGE_SUMMARY**. By default, 10 records are provided. |
| permissionName | Permissions | Yes | Name of the permission. |
| accessCount | number | Yes | Total number of times that the permission is accessed.|
| rejectCount | number | Yes | Total number of times that the access to the permission is rejected.|
| lastAccessTime | number | Yes | Last time when the permission was accessed, accurate to ms.|
| lastRejectTime | number | Yes | Last time when the access to the permission was rejected, accurate to ms.|
| lastAccessDuration | number | Yes | Last access duration, in ms.|
| accessRecords | Array<[UsedRecordDetail](#usedrecorddetail)> | Yes | Successful access records. This parameter is valid only when **flag** is **FLAG_PERMISSION_USAGE_SUMMARY**. By default, 10 records are provided. |
| rejectRecords | Array<[UsedRecordDetail](#usedrecorddetail)> | Yes | Rejected access records. This parameter is valid only when **flag** is **FLAG_PERMISSION_USAGE_SUMMARY**. By default, 10 records are provided. |
## UsedRecordDetail
...
...
@@ -610,9 +610,9 @@ Represents the details of a single access record.