diff --git a/en/application-dev/device-usage-statistics/device-usage-statistics-overview.md b/en/application-dev/device-usage-statistics/device-usage-statistics-overview.md index e9d669f7973dce4360c617a6872fa3c86adf481f..69fca5fb8177eddc65ddfc0ffade70350446a8a1 100644 --- a/en/application-dev/device-usage-statistics/device-usage-statistics-overview.md +++ b/en/application-dev/device-usage-statistics/device-usage-statistics-overview.md @@ -4,24 +4,24 @@ With device usage statistics APIs, you can have a better understanding of the ap ## Introduction -Currently you can have access to statistics on the application usage, and notification and system usage statistics feature will be available for use in later versions. +Currently you can have access to statistics on the application usage, and the notification and system usage statistics feature will be available for use in later versions. - **The application usage statistics is updated**: -1. Every 30 minutes -2. Upon system time change -3. Upon start of a new day + 1. Every 30 minutes + 2. Upon system time change + 3. Upon start of a new day - **The application usage statistics can include the following**: -1. Events of all applications based on the specified start time and end time -2. Application usage duration statistics based on the specified start time and end time -3. Events of the current application based on the specified start time and end time -4. Application usage duration statistics in the specified time frame at the specified interval (daily, weekly, monthly, or annually) -5. Priority group of the current invoker application -6. Whether a specific application is in the idle state -7. Number of FA usage records specified by **maxNum**, sorted by time (most recent first). If **maxNum** is not specified, the default value **1000** will be used. -8. Number of notifications from applications based on the specified start time and end time -9. Statistics about system events (hibernation, wakeup, unlocking, and screen locking) that occur between the specified start time and end time -9. Priority group of the invoker application or a specified application + 1. Events of all applications based on the specified start time and end time + 2. Application usage duration statistics based on the specified start time and end time + 3. Events of the current application based on the specified start time and end time + 4. Application usage duration statistics in the specified time frame at the specified interval (daily, weekly, monthly, or annually) + 5. Priority group of the current invoker application + 6. Whether a specific application is in the idle state + 7. Number of FA usage records specified by **maxNum**, sorted by time (most recent first). If **maxNum** is not specified, the default value **1000** will be used. + 8. Number of notifications from applications based on the specified start time and end time + 9. Statistics about system events (hibernation, wakeup, unlocking, and screen locking) that occur between the specified start time and end time + 10. Priority group of the invoker application or a specified application - **The setters can be used to:** @@ -35,6 +35,6 @@ Currently you can have access to statistics on the application usage, and notifi Deregister the callback for application group changes. -### Required Permissions +## Required Permissions - Before calling the following system APIs, you need to apply for the **ohos.permission.BUNDLE_ACTIVE_INFO** permission: **queryBundleActiveStates**, **queryBundleStateInfos**, **queryBundleStateInfoByInterval**, **queryBundleActiveEventStates**, **queryAppNotificationNumber**, **queryAppUsagePriorityGroup(bundleName?)**, **setBundleGroup**, **registerGroupCallBack**, and **unRegisterGroupCallBack**. - This permission is not required for calling third-party APIs: **queryCurrentBundleActiveStates**, **queryAppUsagePriorityGroup()**, and **isIdleState**. 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 62515f421c9527b53bb230fa59c11c598827e876..4957e7a992b873fc1063325ea5e8e9a61df00e5a 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 @@ -1,40 +1,40 @@ # 设备使用信息统计概述 -设备使用信息统计,包括app usage/notification usage/system usage等使用统计,目前只支持app usage使用统计。应用使用信息统计,用于保存和查询应用使用详情(app usage)、事件日志数据(event log)、应用分组(bundle group)情况。部件缓存的应用记录(使用历史统计和使用事件记录)会在事件上报后30分钟内刷新到数据库持久化保存。 +设备使用信息统计,包括app usage、notification usage、system usage等使用统计,目前只支持app usage使用统计。应用使用信息统计,用于保存和查询应用使用详情(app usage)、事件日志数据(event log)、应用分组(bundle group)情况。部件缓存的应用记录(使用历史统计和使用事件记录)会在事件上报后30分钟内刷新到数据库持久化保存。 ## 设备使用信息统计功能说明 设备使用信息统计接口众多,目前只支持app usage使用统计,接下来介绍下应用使用详情(app usage)的接口逻辑。 - **应用使用统计信息落盘时机**: -1. 每隔30分钟触发一次刷新。 -2. 系统时间变更触发一次刷新。 -3. 下一天开始触发一次刷新。 + 1. 每隔30分钟触发一次刷新。 + 2. 系统时间变更触发一次刷新。 + 3. 下一天开始触发一次刷新。 - **应用查询接口**: -1. 根据起止时间查询所有应用的事件集合。 -2. 根据起止时间查询应用的使用时长。 -3. 根据起止时间查询当前应用的事件集合。 -4. 根据interval(日、周、月、年)类型和起止时间查询应用的使用时长。 -5. 查询调用者应用的优先级群组。 -6. 判断指定应用当前是否是空闲状态。 -7. 查询FA使用记录。返回数量最大不超过maxNum设置的值,FA使用记录由近及远排序,maxNum最大为1000,若不填写maxNum参数,则maxNum默认为1000。 -8. 根据起止时间查询应用通知次数。 -9. 根据起止时间查询系统事件(休眠、唤醒、解锁、锁屏)统计信息。 -9. 查询调用者应用或指定应用的优先级群组。 + 1. 根据起止时间查询所有应用的事件集合。 + 2. 根据起止时间查询应用的使用时长。 + 3. 根据起止时间查询当前应用的事件集合。 + 4. 根据interval(日、周、月、年)类型和起止时间查询应用的使用时长。 + 5. 查询调用者应用的优先级群组。 + 6. 判断指定应用当前是否是空闲状态。 + 7. 查询FA使用记录。返回数量最大不超过maxNum设置的值,FA使用记录由近及远排序,maxNum最大为1000,若不填写maxNum参数,则maxNum默认为1000。 + 8. 根据起止时间查询应用通知次数。 + 9. 根据起止时间查询系统事件(休眠、唤醒、解锁、锁屏)统计信息。 + 10. 查询调用者应用或指定应用的优先级群组。 -- 设置接口 +- **设置接口** -1. 给应用名称为bundleName的应用分组设置为newGroup。 + 给应用名称为bundleName的应用分组设置为newGroup。 -- 注册接口 +- **注册接口** -1. 注册应用分组变化回调监听,当应用分组发生变化,会给所有已注册的应用返回变化信息 + 注册应用分组变化回调监听,当应用分组发生变化,会给所有已注册的应用返回变化信息。 -- 解注册接口 +- **解除注册接口** -1. 解除注册应用分组变化回调监听 + 解除注册应用分组变化回调监听。 -### 设备使用信息统计使用权限 +## 设备使用信息统计使用权限 - 设备使用信息统计的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