From 4f1d8da03c7be2a8e89f6aac95c6fcd1a6c5ffa1 Mon Sep 17 00:00:00 2001 From: houdisheng Date: Mon, 11 Apr 2022 14:50:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9review=E6=84=8F=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: houdisheng --- .../device-usage-statistics-dev-guide.md | 2 +- .../device-usage-statistics-overview.md | 2 +- .../apis/js-apis-deviceUsageStatistics.md | 48 +++++++++---------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-dev-guide.md b/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-dev-guide.md index 7cf87789f9..792b939a96 100644 --- a/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-dev-guide.md +++ b/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-dev-guide.md @@ -207,7 +207,7 @@ import stats from '@ohos.bundleState'; }); ``` -8. 根据maxNum,查询FA使用记录,返回不超过maxNum条FA使用记录,config.json中需要配置权限:ohos.permission.BUNDLE_ACTIVE_INFO。 +8. 查询FA使用记录。返回数量最大不超过maxNum设置的值,config.json中需要配置权限:ohos.permission.BUNDLE_ACTIVE_INFO。 ```js import stats from '@ohos.bundleState' diff --git a/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-overview.md b/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-overview.md index 82cd448eb5..32a29f47b9 100644 --- a/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-overview.md +++ b/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-overview.md @@ -18,7 +18,7 @@ >4. 根据interval(日、周、月、年)类型和起止时间查询应用的使用时长; >5. 查询调用者应用的优先级群组; >6. 判断指定应用当前是否是空闲状态; ->7. 根据maxNum,查询FA使用记录,返回不超过maxNum条FA使用记录; +>7. 查询FA使用记录。返回数量最大不超过maxNum设置的值,maxNum最大为1000; ### 设备使用信息统计使用权限 - 设备使用信息统计的queryBundleActiveStates、queryBundleStateInfos、queryBundleStateInfoByInterval接口为系统api,调用前需要申请ohos.permission.BUNDLE_ACTIVE_INFO权限。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-deviceUsageStatistics.md b/zh-cn/application-dev/reference/apis/js-apis-deviceUsageStatistics.md index 1ca049d423..d6c753a4b7 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-deviceUsageStatistics.md +++ b/zh-cn/application-dev/reference/apis/js-apis-deviceUsageStatistics.md @@ -59,7 +59,7 @@ isIdleState(bundleName: string): Promise<boolean> **示例**: - ``` + ```js bundleState.isIdleState("com.ohos.camera").then( res => { console.log('BUNDLE_ACTIVE isIdleState promise succeeded, result: ' + JSON.stringify(res)); }).catch( err => { @@ -83,7 +83,7 @@ queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void **示例**: - ``` + ```js bundleState.queryAppUsagePriorityGroup((err, res) => { if (err) { console.log('BUNDLE_ACTIVE queryAppUsagePriorityGroup callback failed. because: ' + err.code); @@ -109,7 +109,7 @@ queryAppUsagePriorityGroup(): Promise<number> **示例**: - ``` + ```js bundleState.queryAppUsagePriorityGroup().then( res => { console.log('BUNDLE_ACTIVE queryAppUsagePriorityGroup promise succeeded. result: ' + JSON.stringify(res)); }).catch( err => { @@ -137,7 +137,7 @@ queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback<Bun **示例**: - ``` + ```js bundleState.queryBundleStateInfos(0, 20000000000000, (err, res) => { if (err) { console.log('BUNDLE_ACTIVE queryBundleStateInfos callback failed, because: ' + err.code); @@ -178,7 +178,7 @@ queryBundleStateInfos(begin: number, end: number): Promise<BundleActiveInfoRe **示例**: - ``` + ```js bundleState.queryBundleStateInfos(0, 20000000000000).then( res => { console.log('BUNDLE_ACTIVE queryBundleStateInfos promise success.'); let i = 1; @@ -213,7 +213,7 @@ queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: num **示例**: - ``` + ```js bundleState.queryBundleStateInfoByInterval(0, 0, 20000000000000, (err, res) => { if (err) { console.log('BUNDLE_ACTIVE queryBundleStateInfoByInterval callback failed, because: ' + err.code); @@ -253,7 +253,7 @@ queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: num **示例**: - ``` + ```js bundleState.queryBundleStateInfoByInterval(0, 0, 20000000000000).then( res => { console.log('BUNDLE_ACTIVE queryBundleStateInfoByInterval promise success.'); for (let i = 0; i < res.length; i++) { @@ -285,7 +285,7 @@ queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback<A **示例**: - ``` + ```js bundleState.queryBundleActiveStates(0, 20000000000000, (err, res) => { if (err) { console.log('BUNDLE_ACTIVE queryBundleActiveStates callback failed, because: ' + err.code); @@ -324,7 +324,7 @@ queryBundleActiveStates(begin: number, end: number): Promise<Array<BundleA **示例**: - ``` + ```js bundleState.queryBundleActiveStates(0, 20000000000000).then( res => { console.log('BUNDLE_ACTIVE queryBundleActiveStates promise success.'); for (let i = 0; i < res.length; i++) { @@ -354,7 +354,7 @@ queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallba **示例**: - ``` + ```js bundleState.queryCurrentBundleActiveStates(0, 20000000000000, (err, res) => { if (err) { console.log('BUNDLE_ACTIVE queryCurrentBundleActiveStates callback failed, because: ' + err.code); @@ -391,7 +391,7 @@ queryCurrentBundleActiveStates(begin: number, end: number): Promise<Array< **示例**: - ``` + ```js bundleState.queryCurrentBundleActiveStates(0, 20000000000000).then( res => { console.log('BUNDLE_ACTIVE queryCurrentBundleActiveStates promise success.'); for (let i = 0; i < res.length; i++) { @@ -403,11 +403,11 @@ queryCurrentBundleActiveStates(begin: number, end: number): Promise<Array< }); ``` -## bundleState.getModuleUsageRecord9 +## bundleState.getModuleUsageRecord9+ -getModuleUsageRecord(begin: number, end: number): Promise<Array<BundleActiveModuleInfo>> +getModuleUsageRecord(maxNum: number): Promise<Array<BundleActiveModuleInfo>> -据maxNum,查询FA使用记录,使用Promise返回不超过maxNum条FA使用记录。 +据maxNum,查询FA使用记录,使用Promise返回不超过maxNum条FA使用记录,maxNum最大为1000。 **需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO @@ -427,7 +427,7 @@ getModuleUsageRecord(begin: number, end: number): Promise<Array<BundleActi **示例**: - ``` + ```js bundleState.getModuleUsageRecord(this.maxNum).then( res => { console.log('BUNDLE_ACTIVE getModuleUsageRecord promise succeeded'); for (let i = 0; i < res.length; i++) { @@ -439,11 +439,11 @@ getModuleUsageRecord(begin: number, end: number): Promise<Array<BundleActi }); ``` -## bundleState.getModuleUsageRecord9 +## bundleState.getModuleUsageRecord9+ -getModuleUsageRecord(begin: number, end: number): Promise<Array<BundleActiveModuleInfo>> +getModuleUsageRecord(maxNum: number): Promise<Array<BundleActiveModuleInfo>> -据maxNum,查询FA使用记录,使用CallBack返回不超过maxNum条FA使用记录。 +查询FA使用记录。使用callback返回数量最大不超过maxNum设置的值,maxNum最大为1000。 **需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO @@ -458,7 +458,7 @@ getModuleUsageRecord(begin: number, end: number): Promise<Array<BundleActi **示例**: - ``` + ```js bundleState.getModuleUsageRecord(this.maxNum,(err, res) => { if(err) { console.log('BUNDLE_ACTIVE getModuleUsageRecord callback failed, because: ' + err.code); @@ -468,12 +468,12 @@ getModuleUsageRecord(begin: number, end: number): Promise<Array<BundleActi console.log('BUNDLE_ACTIVE getModuleUsageRecord callback number : ' + (i + 1)); console.log('BUNDLE_ACTIVE getModuleUsageRecord callback result ' + JSON.stringify(res[i])); } - } + } }); ``` -## BundleActiveModuleInfo9 -提供FA的使用信息。 +## BundleActiveModuleInfo9+ +FA的使用信息的属性集合。 ### 属性 @@ -495,8 +495,8 @@ getModuleUsageRecord(begin: number, end: number): Promise<Array<BundleActi | lastModuleUsedTime | number | 是 | FA的上一次使用时间。| | formRecords | Array | 是 | FA中卡片的使用记录。| -## BundleActiveFormInfo9 -提供FA中卡片的使用记录。 +## BundleActiveFormInfo9+ +FA卡片的使用信息的属性集合。 ### 属性 -- GitLab