Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
8a4d06eb
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8a4d06eb
编写于
1月 31, 2023
作者:
Y
yupeng74@huawei.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
isIdleState升级为系统API以及错误码解释修改
Signed-off-by:
N
yupeng74@huawei.com
<
yupeng74@huawei.com
>
上级
e177625a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
97 addition
and
89 deletion
+97
-89
zh-cn/application-dev/device-usage-statistics/device-usage-statistics-overview.md
...vice-usage-statistics/device-usage-statistics-overview.md
+2
-2
zh-cn/application-dev/device-usage-statistics/device-usage-statistics-use-guide.md
...ice-usage-statistics/device-usage-statistics-use-guide.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md
...ce/apis/js-apis-resourceschedule-deviceUsageStatistics.md
+88
-80
zh-cn/application-dev/reference/errorcodes/errorcode-DeviceUsageStatistics.md
...v/reference/errorcodes/errorcode-DeviceUsageStatistics.md
+6
-6
未找到文件。
zh-cn/application-dev/device-usage-statistics/device-usage-statistics-overview.md
浏览文件 @
8a4d06eb
...
...
@@ -36,5 +36,5 @@
解除注册应用分组变化回调监听。
## 设备使用信息统计使用权限
-
设备使用信息统计的queryBundleActiveStates、queryBundleStateInfos、queryBundleStateInfoByInterval、queryBundleActiveEventStates、queryAppNotificationNumber、queryAppUsagePriorityGroup(bundleName?)、setBundleGroup、registerGroupCallBack、unRegisterGroupCallBack接口为系统api,调用前需要申请ohos.permission.BUNDLE_ACTIVE_INFO权限。
-
设备使用信息统计的queryCurrentBundleActiveStates、queryAppUsagePriorityGroup()、isIdleState(三方应用只能查询自身的空闲状态)接口为三方api,调用时不需要申请权限。
\ No newline at end of file
-
设备使用信息统计的isIdleState、queryBundleEvents、queryBundleStatsInfos、queryBundleStatsInfoByInterval、queryDeviceEventStats、queryNotificationEventStats、queryAppGroup(bundleName)、setAppGroup、registerAppGroupCallBack、unregisterAppGroupCallBack、queryModuleUsageRecords和queryModuleUsageRecords(maxnum)接口为系统api,调用前需要申请ohos.permission.BUNDLE_ACTIVE_INFO权限。
-
设备使用信息统计的queryCurrentBundleEvents、queryAppGroup()接口为三方api,调用时不需要申请权限。
\ No newline at end of file
zh-cn/application-dev/device-usage-statistics/device-usage-statistics-use-guide.md
浏览文件 @
8a4d06eb
...
...
@@ -227,7 +227,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
}
```
7.
判断指定Bundle Name的应用当前是否是空闲状态,
不需要配置权限,三方应用只能查询自身的空闲状态
。
7.
判断指定Bundle Name的应用当前是否是空闲状态,
需要配置ohos.permission.BUNDLE_ACTIVE_INFO权限
。
```js
import usageStatistics from '@ohos.resourceschedule.usageStatistics'
...
...
zh-cn/application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md
浏览文件 @
8a4d06eb
...
...
@@ -35,8 +35,12 @@ isIdleState(bundleName: string, callback: AsyncCallback<boolean>): void
判断指定bundleName的应用当前是否是空闲状态,三方应用只能查询自身的空闲状态,使用Callback形式返回。
**需要权限**
:ohos.permission.BUNDLE_ACTIVE_INFO
**系统能力**
:SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
**系统API**
:此接口为系统接口。
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -53,8 +57,8 @@ isIdleState(bundleName: string, callback: AsyncCallback<boolean>): void
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed.
|
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information.
|
**示例**
:
```
js
...
...
@@ -77,8 +81,12 @@ isIdleState(bundleName: string): Promise<boolean>
判断指定bundleName的应用当前是否是空闲状态,三方应用只能查询自身的空闲状态,使用Promise形式返回。
**需要权限**
:ohos.permission.BUNDLE_ACTIVE_INFO
**系统能力**
:SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
**系统API**
:此接口为系统接口。
**参数**
:
| 参数名 | 类型 | 必填 | 说明 |
...
...
@@ -100,8 +108,8 @@ isIdleState(bundleName: string): Promise<boolean>
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
**示例**
:
...
...
@@ -140,10 +148,10 @@ queryAppGroup(): Promise<number>
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000005 | Application is not installed. |
| 10000006 |
Get application info failed
. |
| 10100002 |
Get Application group info failed
. |
| 10000004 | IPC
failed. |
| 10000005 | Application is not installed. |
| 10000006 |
Failed to get the application information
. |
| 10100002 |
Failed to get the application group information
. |
**示例**
:
...
...
@@ -182,10 +190,10 @@ queryAppGroup(callback: AsyncCallback<number>): void
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000005 | Application is not installed. |
| 10000006 |
Get application info failed
. |
| 10100002 |
Get Application group info failed
. |
| 10000004 | IPC
failed. |
| 10000005 | Application is not installed. |
| 10000006 |
Failed to get the application information
. |
| 10100002 |
Failed to get the application group information
. |
**示例**
:
...
...
@@ -232,9 +240,9 @@ queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback<Bun
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10000007 |
Get system or actual time failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10000007 |
Failed to get the system time
. |
**示例**
:
...
...
@@ -292,9 +300,9 @@ queryBundleStatsInfos(begin: number, end: number): Promise<BundleStatsMap>
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10000007 |
Get system or actual time failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10000007 |
Failed to get the system time
. |
**示例**
:
...
...
@@ -346,9 +354,9 @@ queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: num
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10000007 |
Get system or actual time failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10000007 |
Failed to get the system time
. |
**示例**
:
...
...
@@ -405,9 +413,9 @@ queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: num
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10000007 |
Get system or actual time failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10000007 |
Failed to get the system time
. |
**示例**
:
...
...
@@ -456,9 +464,9 @@ queryBundleEvents(begin: number, end: number, callback: AsyncCallback<Array&l
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10000007 |
Get system or actual time failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10000007 |
Failed to get the system time
. |
**示例**
:
...
...
@@ -514,9 +522,9 @@ queryBundleEvents(begin: number, end: number): Promise<Array<BundleEvents&
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10000007 |
Get system or actual time failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10000007 |
Failed to get the system time
. |
**示例**
:
...
...
@@ -561,9 +569,9 @@ queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback<
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10000007 |
Get system or actual time failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10000007 |
Failed to get the system time
. |
**示例**
:
...
...
@@ -615,9 +623,9 @@ queryCurrentBundleEvents(begin: number, end: number): Promise<Array<Bundle
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed.
|
| 10000007 |
Get system or actual time failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information.
|
| 10000007 |
Failed to get the system time
. |
**示例**
:
...
...
@@ -664,9 +672,9 @@ queryModuleUsageRecords(): Promise<Array<HapModuleInfo>>
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10000007 |
Get system or actual time failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10000007 |
Failed to get the system time
. |
**示例**
:
...
...
@@ -714,9 +722,9 @@ queryModuleUsageRecords(callback: AsyncCallback<Array<HapModuleInfo>>
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10000007 |
Get system or actual time failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10000007 |
Failed to get the system time
. |
**示例**
:
...
...
@@ -771,9 +779,9 @@ queryModuleUsageRecords(maxNum: number): Promise<Array<HapModuleInfo>&g
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10000007 |
Get system or actual time failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10000007 |
Failed to get the system time
. |
**示例**
:
...
...
@@ -821,9 +829,9 @@ queryModuleUsageRecords(maxNum: number, callback: AsyncCallback<Array<HapM
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10000007 |
Get system or actual time failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10000007 |
Failed to get the system time
. |
**示例**
:
...
...
@@ -878,10 +886,10 @@ queryAppGroup(bundleName : string): Promise<number>
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000004 | IPC
failed. |
| 10000005 | Application is not installed. |
| 10000006 |
Get application info failed
. |
| 10100002 |
Get Application group info failed
. |
| 10000006 |
Failed to get the application information
. |
| 10100002 |
Failed to get the application group information
. |
**示例**
:
...
...
@@ -927,10 +935,10 @@ queryAppGroup(bundleName : string, callback: AsyncCallback<number>): void
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000004 | IPC
failed. |
| 10000005 | Application is not installed. |
| 10000006 |
Get application info failed
. |
| 10100002 |
Get Application group info failed
. |
| 10000006 |
Failed to get the application information
. |
| 10100002 |
Failed to get the application group information
. |
**示例**
:
...
...
@@ -977,9 +985,9 @@ setAppGroup(bundleName: string, newGroup: GroupType): Promise<void>
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10100001 |
Application group operation repeated
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10100001 |
Repeated operation on the application group
. |
**返回值**
:
...
...
@@ -1033,9 +1041,9 @@ setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback<
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10100001 |
Application group operation repeated
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10100001 |
Repeated operation on the application group
. |
**示例**
:
...
...
@@ -1083,8 +1091,8 @@ registerAppGroupCallBack(groupCallback: Callback<AppGroupCallbackInfo>): P
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10100001 |
Application group operation repeated
. |
| 10000004 | IPC
failed. |
| 10100001 |
Repeated operation on the application group
. |
**返回值**
:
...
...
@@ -1142,8 +1150,8 @@ registerAppGroupCallBack(groupCallback: Callback<AppGroupCallbackInfo>, ca
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10100001 |
Application group operation repeated
. |
| 10000004 | IPC
failed. |
| 10100001 |
Repeated operation on the application group
. |
**示例**
:
...
...
@@ -1198,8 +1206,8 @@ unregisterAppGroupCallBack(): Promise<void>
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10100001 |
Application group operation repeated
. |
| 10000004 | IPC
failed. |
| 10100001 |
Repeated operation on the application group
. |
**示例**
:
...
...
@@ -1242,8 +1250,8 @@ unregisterAppGroupCallBack(callback: AsyncCallback<void>): void;
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10100001 |
Application group operation repeated
. |
| 10000004 | IPC
failed. |
| 10100001 |
Repeated operation on the application group
. |
**示例**
:
...
...
@@ -1295,9 +1303,9 @@ queryDeviceEventStats(begin: number, end: number): Promise<Array<DeviceEve
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10000007 |
Get system or actual time failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10000007 |
Failed to get the system time
. |
**示例**
:
...
...
@@ -1343,9 +1351,9 @@ queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback<Arr
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10000007 |
Get system or actual time failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10000007 |
Failed to get the system time
. |
**示例**
:
...
...
@@ -1398,9 +1406,9 @@ queryNotificationEventStats(begin: number, end: number): Promise<Array<Dev
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10000007 |
Get system or actual time failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10000007 |
Failed to get the system time
. |
**示例**
:
...
...
@@ -1446,9 +1454,9 @@ queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback&
| 10000001 | Memory operation failed. |
| 10000002 | Parcel operation failed. |
| 10000003 | System service operation failed. |
| 10000004 | IPC
Communication failed. |
| 10000006 |
Get application info failed
. |
| 10000007 |
Get system or actual time failed
. |
| 10000004 | IPC
failed. |
| 10000006 |
Failed to get the application information
. |
| 10000007 |
Failed to get the system time
. |
**示例**
:
...
...
zh-cn/application-dev/reference/errorcodes/errorcode-DeviceUsageStatistics.md
浏览文件 @
8a4d06eb
...
...
@@ -58,7 +58,7 @@ System service operation failed.
**错误信息**
IPC
communication
failed.
IPC failed.
**错误描述**
...
...
@@ -94,7 +94,7 @@ The application is not installed.
**错误信息**
Get application info failed
.
Failed to get the application information
.
**错误描述**
...
...
@@ -114,11 +114,11 @@ Get application info failed.
**错误信息**
Get system or actual time operation failed
.
Failed to get the system time
.
**错误描述**
系统服务获取系统
事件或者实际事件
操作失败。
系统服务获取系统
时间或者实际时间
操作失败。
**可能原因**
...
...
@@ -132,7 +132,7 @@ Get system or actual time operation failed.
**错误信息**
Application group operation failed. The application group are the the same or do not need te be updated
.
Repeated operation on the application group
.
**错误描述**
...
...
@@ -150,7 +150,7 @@ Application group operation failed. The application group are the the same or do
**错误信息**
Get application group info failed. The application group infomation cannot be found
.
Failed to get the application group information
.
**错误描述**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录