diff --git a/zh-cn/application-dev/reference/apis-media-library-kit/Readme-CN.md b/zh-cn/application-dev/reference/apis-media-library-kit/Readme-CN.md
index 58ef6e90d54f595bcc9217e039d7a6fb29147d2e..1f204ccf4afd288dc70f7dbcdb0d47e2bd994d1c 100644
--- a/zh-cn/application-dev/reference/apis-media-library-kit/Readme-CN.md
+++ b/zh-cn/application-dev/reference/apis-media-library-kit/Readme-CN.md
@@ -45,10 +45,11 @@
- [media_asset_manager_capi.h](capi-media-asset-manager-capi-h.md)
- [moving_photo_capi.h](capi-moving-photo-capi-h.md)
- 结构体
- - [MediaLibrary_RequestId](capi-mediaassetmanager-medialibrary-requestid.md)
- - [OH_MediaAssetManager](capi-mediaassetmanager-oh-mediaassetmanager.md)
- - [OH_MediaAssetChangeRequest](capi-mediaassetmanager-oh-mediaassetchangerequest.md)
- - [OH_MovingPhoto](capi-mediaassetmanager-oh-movingphoto.md)
- - [OH_MediaAsset](capi-mediaassetmanager-oh-mediaasset.md)
- - [MediaLibrary_RequestOptions](capi-mediaassetmanager-medialibrary-requestoptions.md)
-
+ - [MediaLibrary_RequestId](capi-medialibrary-requestid.md)
+ - [OH_MediaAssetManager](capi-oh-mediaassetmanager.md)
+ - [OH_MediaAssetChangeRequest](capi-oh-mediaassetchangerequest.md)
+ - [OH_MovingPhoto](capi-oh-movingphoto.md)
+ - [OH_MediaAsset](capi-oh-mediaasset.md)
+ - [MediaLibrary_RequestOptions](capi-medialibrary-requestoptions.md)
+- 错误码
+ - [媒体库错误码](errcode-medialibrary.md)
diff --git a/zh-cn/application-dev/reference/apis-media-library-kit/errcode-medialibrary.md b/zh-cn/application-dev/reference/apis-media-library-kit/errcode-medialibrary.md
new file mode 100644
index 0000000000000000000000000000000000000000..df4a7bd824cf60f40060cbd522bd23ccbf0e2b91
--- /dev/null
+++ b/zh-cn/application-dev/reference/apis-media-library-kit/errcode-medialibrary.md
@@ -0,0 +1,69 @@
+# 媒体库错误码
+
+> **说明:**
+>
+> 以下仅介绍本模块特有错误码,通用错误码请参考[通用错误码说明文档](../errorcode-universal.md)。
+
+
+## 23800107 context为空或者无效
+
+**错误信息**
+
+Context is invalid.
+
+**错误描述**
+
+上下文对象不存在或者为空时,方法会返回错误码。
+
+**可能原因**
+
+上下文对象不存在。
+
+**处理步骤**
+
+请检查上下文对象是否可用。
+
+
+## 23800301 系统内部错误
+
+**错误信息**
+
+System inner fail.
+
+**错误描述**
+
+媒体库内部错误。
+
+**可能原因**
+
+1. 数据库异常。
+
+2. 文件系统异常。
+
+3. IPC消息超时。
+
+**处理步骤**
+
+清理后台或重启设备。
+
+## 23800151 场景参数校验不通过
+
+**错误信息**
+
+Scene parameter validation failed.
+
+**错误描述**
+
+参数异常。
+
+**可能原因**
+
+1. 必选参数范围不满足要求。
+
+2. 传入的记录已存在。
+
+3. 传入的记录数量超过最大数量。
+
+**处理步骤**
+
+检查参数赋值或者参数长度。
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-photoAccessHelper-sys.md b/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-photoAccessHelper-sys.md
index a245959bc5312c646b7785190d9b6a8e95c156de..94e618dfa3c48e34ef88593ca1fd2437b6f73c39 100644
--- a/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-photoAccessHelper-sys.md
+++ b/zh-cn/application-dev/reference/apis-media-library-kit/js-apis-photoAccessHelper-sys.md
@@ -8630,6 +8630,374 @@ async function example(phAccessHelper: photoAccessHelper.PhotoAccessHelper, cont
}
```
+## PhotoAssetCustomRecordManager20+
+
+媒体库支持图库自定义用户统计行为接口。
+
+**系统接口**:此接口为系统接口。
+
+### getCustomRecordManagerInstance20+
+
+static getCustomRecordManagerInstance(context: Context): PhotoAssetCustomRecordManager
+
+获取图库自定义用户统计行为实例。
+
+**系统接口**:此接口为系统接口。
+
+**系统能力**: SystemCapability.FileManagement.PhotoAccessHelper.Core
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| --- | --- | --- | --- |
+| context | [Context](../apis-ability-kit/js-apis-inner-application-context.md#context) | 是 | 传入Ability实例的上下文。 |
+
+**返回值:**
+
+| 类型 | 说明 |
+| --- | --- |
+| [PhotoAssetCustomRecordManager](#photoassetcustomrecordmanager20) | 用户自定义行为统计实例。 |
+
+**错误码:**
+
+以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[媒体库错误码](errcode-medialibrary.md)。
+
+| 错误码ID | 错误信息 |
+| --- | --- |
+| 202 | Called by non-system application. |
+| 23800107 | Context is invalid. |
+
+**示例:**
+
+```ts
+import { common } from '@kit.AbilityKit';
+import { BusinessError } from '@kit.BasicServicesKit';
+
+async example(context: Context) {
+ console.info('getCustomRecordManagerInstance');
+ try {
+ let context = getContext(this);
+ let crManager = photoAccessHelper.PhotoAssetCustomRecordManager.getCustomRecordManagerInstance(context);
+ } catch(err) {
+ console.error(`getCustomRecordManagerInstance failed with error: ${err.code}, ${err.message}`);
+ }
+}
+```
+
+### createCustomRecords20+
+
+createCustomRecords(customRecords: Array<PhotoAssetCustomRecord>): Promise<void>
+
+新增自定义用户统计行为数据。使用Promise异步回调。
+
+**系统接口**:此接口为系统接口。
+
+**系统能力**: SystemCapability.FileManagement.PhotoAccessHelper.Core
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| --- | --- | --- | --- |
+| customRecords | Array<[PhotoAssetCustomRecord](#photoassetcustomrecord20)> | 是 | 新增自定义用户统计行为数据。 |
+
+**返回值:**
+
+| 类型 | 说明 |
+| --- | --- |
+| Promise<void> | Promise对象,无返回结果。 |
+
+**错误码:**
+
+以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[媒体库错误码](errcode-medialibrary.md)。
+
+| 错误码ID | 错误信息 |
+| --- | --- |
+| 202 | Called by non-system application. |
+| 23800151 | Scenario parameters fail to pass the verification. Possible causes: 1. The value range of mandatory parameters in photoAssetCustomRecord does not meet the requirements. 2. The transferred record already exists. 3. The number of transferred records exceeds 200. |
+| 23800301 | Internal system error. It is recommended to retry and check the logs. Possible causes: 1. Database corrupted; 2. The file system is abnormal; 3. The IPC request timed out. |
+
+**示例:**
+
+```ts
+import { BusinessError } from '@kit.BasicServicesKit';
+
+async example() {
+ console.info('createCustomRecords');
+ let context = getContext(this);
+ let crManager = photoAccessHelper.PhotoAssetCustomRecordManager.getCustomRecordManagerInstance(context);
+ let crArray:Array = [
+ {fileId:1,shareCount:1,lcdJumpCount:1}
+ ];
+ crManager.createCustomRecords(crArray).then(() => {
+ console.info('createCustomRecords successful');
+ }).catch((err: BusinessError) => {
+ console.error('createCustomRecords fail with error: ${err.code}, ${err.message}');
+ });
+}
+```
+
+### getCustomRecords20+
+
+getCustomRecords(optionCheck: FetchOptions): Promise<FetchResult<PhotoAssetCustomRecord>>
+
+根据检索选项获取自定义用户统计行为数据。使用Promise异步回调。
+
+**系统接口**:此接口为系统接口。
+
+**系统能力**: SystemCapability.FileManagement.PhotoAccessHelper.Core
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| --- | --- | --- | --- |
+| optionCheck | [FetchOptions](js-apis-photoAccessHelper.md#fetchoptions) | 是 | 检索选项。 |
+
+**返回值:**
+
+| 类型 | 说明 |
+| --- | --- |
+| Promise<FetchResult<[PhotoAssetCustomRecord](#photoassetcustomrecord20)>> | Promise对象,返回自定义用户统计行为数据集合。 |
+
+**错误码:**
+
+以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[媒体库错误码](errcode-medialibrary.md)。
+
+| 错误码ID | 错误信息 |
+| --- | --- |
+| 202 | Called by non-system application. |
+| 23800151 | Scenario parameters fail to pass the verification. Possible causes: 1. The fileter criteria or fetchColumns that are not supported by options are transferred. |
+| 23800301 | Internal system error. It is recommended to retry and check the logs. Possible causes: 1. Database corrupted; 2. The file system is abnormal; 3. The IPC request timed out. |
+
+**示例:**
+
+```ts
+import { dataSharePredicates } from '@kit.ArkData';
+import { BusinessError } from '@kit.BasicServicesKit';
+
+async example() {
+ console.info('getCustomRecords');
+ let context = getContext(this);
+ let crManager = photoAccessHelper.PhotoAssetCustomRecordManager.getCustomRecordManagerInstance(context);
+ let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
+ predicates.equalTo('file_id', 1);
+ let fetchOption: photoAccessHelper.FetchOptions = {
+ fetchColumns: [],
+ predicates: predicates
+ };
+ crManager.getCustomRecords(fetchOption).then(async (fetchResult) => {
+ let record = await fetchResult.getFirstObject();
+ console.info('record file id is ' + record.fileId);
+ }).catch((err: BusinessError) => {
+ console.error('getCustomRecords fail with error: ${err.code}, ${err.message}');
+ });
+}
+```
+
+### setCustomRecords20+
+
+setCustomRecords(customRecords: Array<PhotoAssetCustomRecord>): Promise<Array<number>>
+
+根据自定义用户统计行为数据,更新已存在的数据库字段。使用Promise异步回调。
+
+**系统接口**:此接口为系统接口。
+
+**系统能力**: SystemCapability.FileManagement.PhotoAccessHelper.Core
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| --- | --- | --- | --- |
+| customRecords | Array<[PhotoAssetCustomRecord](#photoassetcustomrecord20)> | 是 | 自定义用户统计行为数据。 |
+
+**返回值:**
+
+| 类型 | 说明 |
+| --- | --- |
+| Promise<Array<number>> | 更新失败的自定义用户统计行为数据中的fileId。 |
+
+**错误码:**
+
+以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[媒体库错误码](errcode-medialibrary.md)。
+
+| 错误码ID | 错误信息 |
+| --- | --- |
+| 202 | Called by non-system application. |
+| 23800151 | Scenario parameters fail to pass the verification. Possible causes: 1. The value range of mandatory parameters in photoAssetCustomRecord does not meet the requirements. 2. The number of transferred records exceeds 200. |
+| 23800301 | Internal system error. It is recommended to retry and check the logs. Possible causes: 1. Database corrupted; 2. The file system is abnormal; 3. The IPC request timed out. |
+
+**示例:**
+
+```ts
+import { BusinessError } from '@kit.BasicServicesKit';
+
+async example() {
+ console.info('setCustomRecords');
+ let context = getContext(this);
+ let crManager = photoAccessHelper.PhotoAssetCustomRecordManager.getCustomRecordManagerInstance(context);
+ let UpdateArray: Array = [
+ {fileId:1,shareCount:2,lcdJumpCount:3},
+ {fileId:2,shareCount:2,lcdJumpCount:3}
+ ];
+ crManager.setCustomRecords(UpdateArray).then((failIds) => {
+ console.info('setCustomRecords successful');
+ }).catch((err: BusinessError) => {
+ console.error('setCustomRecords file with err: ${err.code}, ${err.message}');
+ });
+}
+```
+
+### removeCustomRecords20+
+
+removeCustomRecords(optionCheck: FetchOptions): Promise<void>
+
+根据检索选项删除自定义用户统计行为数据。使用Promise异步回调。
+
+**系统接口**:此接口为系统接口。
+
+**系统能力**: SystemCapability.FileManagement.PhotoAccessHelper.Core
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| --- | --- | --- | --- |
+| optionCheck | [FetchOptions](js-apis-photoAccessHelper.md#fetchoptions) | 是 | 检索选项。 |
+
+**返回值:**
+
+| 类型 | 说明 |
+| --- | --- |
+| Promise<void> | Promise对象,无返回结果。 |
+
+**错误码:**
+
+以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[媒体库错误码](errcode-medialibrary.md)。
+
+| 错误码ID | 错误信息 |
+| --- | --- |
+| 202 | Called by non-system application. |
+| 23800151 | Scenario parameters fail to pass the verification. Possible causes: 1. The fileter criteria or fetchColumns that are not supported by options are transferred |
+| 23800301 | Internal system error. It is recommended to retry and check the logs. Possible causes: 1. Database corrupted; 2. The file system is abnormal; 3. The IPC request timed out. |
+
+**示例:**
+
+```ts
+import { dataSharePredicates } from '@kit.ArkData';
+import { BusinessError } from '@kit.BasicServicesKit';
+
+async example() {
+ console.info('removeCustomRecords');
+ let context = getContext(this);
+ let crManager = photoAccessHelper.PhotoAssetCustomRecordManager.getCustomRecordManagerInstance(context);
+ let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
+ predicates.equalTo('file_id', 1);
+ let fetchOption: photoAccessHelper.FetchOptions = {
+ fetchColumns: [],
+ predicates: predicates
+ };
+ crManager.removeCustomRecords(fetchOption).then(() => {
+ console.info('removeCustomRecords successful');
+ }).catch((err: BusinessError) => {
+ console.error('removeCustomRecords fail with error: ${err.code}, ${err.message}');
+ });
+}
+```
+
+### addShareCount20+
+
+addShareCount(ids: Array<number>): Promise<Array<number>>
+
+根据[PhotoAssetCustomRecord](#photoassetcustomrecord20)中的fileId给数据库中对应数据的shareCount加1。使用Promise异步回调。
+
+**系统接口**:此接口为系统接口。
+
+**系统能力**: SystemCapability.FileManagement.PhotoAccessHelper.Core
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| --- | --- | --- | --- |
+| ids | Array<number> | 是 | [PhotoAssetCustomRecord](#photoassetcustomrecord20)中的fileId集合。 |
+
+**返回值:**
+
+| 类型 | 说明 |
+| --- | --- |
+| Promise<Array<number>> | 更新失败的自定义用户统计行为数据中的fileId。 |
+
+**错误码:**
+
+以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[媒体库错误码](errcode-medialibrary.md)。
+
+| 错误码ID | 错误信息 |
+| --- | --- |
+| 202 | Called by non-system application. |
+| 23800151 | Scenario parameters fail to pass the verification. Possible causes: 1. The ids list is empty; 2. The number of ids lists exceeds 500. |
+| 23800301 | Internal system error. It is recommended to retry and check the logs. Possible causes: 1. Database corrupted; 2. The file system is abnormal; 3. The IPC request timed out. |
+
+```ts
+import { BusinessError } from '@kit.BasicServicesKit';
+
+async example() {
+ console.info('addShareCount');
+ let context = getContext(this);
+ let crManager = photoAccessHelper.PhotoAssetCustomRecordManager.getCustomRecordManagerInstance(context);
+ let ids: Array = [1, 2];
+ crManager.addShareCount(ids).then((failIds) => {
+ console.info('addShareCount successful');
+ }).catch((err: BusinessError) => {
+ console.error('addShareCount fail with error: ${err.code}, ${err.message}');
+ });
+}
+```
+
+### addLcdJumpCount20+
+
+addLcdJumpCount(ids: Array<number>): Promise<Array<number>>
+
+根据[PhotoAssetCustomRecord](#photoassetcustomrecord20)中的fileId给数据库中对应数据的LcdJumpCount加1。使用Promise异步回调。
+
+**系统接口**:此接口为系统接口。
+
+**系统能力**: SystemCapability.FileManagement.PhotoAccessHelper.Core
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| --- | --- | --- | --- |
+| ids | Array<number> | 是 | [PhotoAssetCustomRecord](#photoassetcustomrecord20)中的fileId集合。 |
+
+**返回值:**
+
+| 类型 | 说明 |
+| --- | --- |
+| Promise<Array<number>> | 更新失败的自定义用户统计行为数据中的fileId。 |
+
+**错误码:**
+
+以下错误码的详细介绍请参见[通用错误码](../errorcode-universal.md)和[媒体库错误码](errcode-medialibrary.md)。
+
+| 错误码ID | 错误信息 |
+| --- | --- |
+| 202 | Called by non-system application. |
+| 23800151 | Scenario parameters fail to pass the verification. Possible causes: 1. The ids list is empty; 2. The number of ids lists exceeds 500. |
+| 23800301 | Internal system error. It is recommended to retry and check the logs. Possible causes: 1. Database corrupted; 2. The file system is abnormal; 3. The IPC request timed out. |
+
+```ts
+import { BusinessError } from '@kit.BasicServicesKit';
+
+async example() {
+ console.info('addLcdJumpCount');
+ let context = getContext(this);
+ let crManager = photoAccessHelper.PhotoAssetCustomRecordManager.getCustomRecordManagerInstance(context);
+ let ids: Array = [1, 2];
+ crManager.addLcdJumpCount(ids).then((failIds) => {
+ console.info('addLcdJumpCount successful');
+ }).catch((err: BusinessError) => {
+ console.error('addLcdJumpCount fail with error: ${err.code}, ${err.message}');
+ });
+}
+```
+
## PhotoSelectOptions
图库选择选项子类,继承于BaseSelectOptions。用于拉起对应userId空间的picker。
@@ -9274,4 +9642,18 @@ async function example(phAccessHelper: photoAccessHelper.PhotoAccessHelper, cont
| 名称 | 类型 | 只读 | 可选 | 说明 |
| ---- | ------- | ---- | ---- | ----- |
-| version | number | 否 | 否 | 相册信息通知的版本号,用于确定通知的顺序。
**系统接口**:此接口为系统接口。 |
\ No newline at end of file
+| version | number | 否 | 否 | 相册信息通知的版本号,用于确定通知的顺序。
**系统接口**:此接口为系统接口。 |
+
+## PhotoAssetCustomRecord20+
+
+媒体库支持图库自定义用户统计行为。
+
+**系统接口**:此接口为系统接口。
+
+**系统能力**:SystemCapability.FileManagement.PhotoAccessHelper.Core
+
+| 名称 | 类型 | 只读 | 可选 | 说明 |
+| --- | --- | --- | --- | --- |
+| fileId | number | 是 | 否 | 图片id,必须为大于0的整数。 |
+| shareCount | number | 是 | 否 | 图片和视频被分享的次数,必须为大于0的整数。 |
+| lcdJumpCount | number | 是 | 否 | 大图跳转分享等次数,必须为大于0的整数。 |
\ No newline at end of file