**DataShareExtensionAbility** provides extension abilities for data share services based on the ExtensionAbility framework.
>**NOTE**
>
>The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
>The APIs provided by this module are system APIs.
>
>The APIs of this module can be used only in the stage model.
Called to initialize service logic of the server when the DataShare client connects to the DataShareExtensionAbility server. This API can be overridden as required.
| uri | string | Yes | [URI](js-apis-uri.md#uri) to normalize.|
| callback | AsyncCallback<string> | Yes | Callback used to return the result. If the operation is successful, the normalized URI is returned. Otherwise, **null** is returned.|
| uri | string | Yes | [URI](js-apis-uri.md#uri) to denormalize.|
| callback | AsyncCallback<string> | Yes | Callback used to return the result. If the operation is successful, the URI obtained is returned. If the URI passed in is returned, denormalization is not required. If denormalization is not supported, **null** is returned.|
The **DataShareResultSet** module provides methods for accessing the result set obtained from the database. You can access the values in the specified rows or the value of the specified data type.
>**NOTE**
>
>The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
| offset | number | Yes | Offset relative to the current position. A negative value means to move backward, and a positive value means to move forward.|
The **ValueBucket** holds data in key-value (KV) pairs. You can use it to insert data into a database.
>**Note**
>
>The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
| [key: string] | [ValueType](#valuetype)\| Uint8Array \| null | Yes | KV pairs in a **ValuesBucket**. The key is of the string type. The value can be a number, string, Boolean value, Unit8Array, or **null**.|
Provides APIs for privacy management, such as management of permission usage records.
The **PrivacyManager** module provides APIs for privacy management, such as management of permission usage records.
> **NOTE**
>
> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The APIs of this module are system APIs and cannot be called by third-party applications.
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> The APIs of this module are system APIs and cannot be called by third-party applications.
## Modules to Import
...
...
@@ -19,7 +19,6 @@ import privacyManager from '@ohos.privacyManager';
Adds a permission usage record when an application protected by the permission is called by another service or application. This API uses a promise to return the result.
The permission usage record includes the application identity of the invoker, name of the permission used, and number of successful and failed accesses to the application.
**Required permissions**: ohos.permission.PERMISSION_USED_STATS (available only to system applications)
...
...
@@ -41,10 +40,6 @@ The permission usage record includes the application identity of the invoker, na
| Promise<number> | Promise used to return the result. If **0** is returned, the record is added successfully. If **-1** is returned, the record fails to be added.|
Adds a permission usage record when an application protected by the permission is called by another service or application. This API uses an asynchronous callback to return the result.
The permission usage record includes the application identity of the invoker, name of the permission used, and number of successful and failed accesses to the application.
**Required permissions**: ohos.permission.PERMISSION_USED_STATS (available only to system applications)
...
...
@@ -202,7 +196,7 @@ Represents the permission usage records of all applications.
## BundleUsedRecord
Represents the application access records of an application.
Represents the permission access records of an application.
@@ -212,11 +206,11 @@ Represents the application access records of an application.
| isRemote | boolean | No | Whether the token ID belongs to 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.|
| permissionRecords | Array<[PermissionUsedRecord](#PermissionUsedRecord)> | No | Permission usage records of the specified application obtained. |
| permissionRecords | Array<[PermissionUsedRecord](#PermissionUsedRecord)> | No | Permission usage records of the target application. |
@@ -225,8 +219,8 @@ Represents the access records of a permission.
| permissionName | string | 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, in ms.|
| lastRejectTime | number | No | Last time when the access to the permission was rejected, in ms.|
| 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 | 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 records. This parameter is valid only when **flag** is **FLAG_PERMISSION_USAGE_SUMMARY**. By default, 10 records are provided. |