diff --git a/BUILD.gn b/BUILD.gn index fa3d6f6591eb40e29baf97bca530c751de46a3e0..2891dcc89e4b5bfae46b2a459c6359bd2dc05169 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1,4 +1,4 @@ -import("//build/ohos.gni") +import("device_usage_statistics.gni") import("//build/ohos/sa_profile/sa_profile.gni") ################################################## @@ -6,7 +6,7 @@ ohos_sa_profile("bundleactive_sa_profile") { sources = [ "sa_profile/1906.xml" ] - part_name = "bundleactive" + part_name = "device_usage_statistics" } ################################################## @@ -28,7 +28,7 @@ ohos_shared_library("bundleactiveinner") { "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy" ] - part_name = "bundleactive" + part_name = "${device_usage_statistics_part_name}" subsystem_name = "resourceschedule" } ################################################## bundleactiveinner end @@ -41,7 +41,7 @@ ohos_prebuilt_etc("bundleactive_service_init") { source = "init/bundleactive_service.rc" } relative_install_dir = "init" - part_name = "bundleactive" + part_name = "${device_usage_statistics_part_name}" subsystem_name = "resourceschedule" } ################################################## @@ -91,7 +91,7 @@ ohos_shared_library("bundleactiveservice") { "//foundation/distributedschedule/safwk/interfaces/innerkits/safwk:system_ability_fwk", "//foundation/distributedschedule/samgr/interfaces/innerkits/samgr_proxy:samgr_proxy" ] - part_name = "bundleactive" + part_name = "${device_usage_statistics_part_name}" subsystem_name = "resourceschedule" } ################################################## bundleactiveservice end diff --git a/README_zh.md b/README_ZH.md similarity index 83% rename from README_zh.md rename to README_ZH.md index 26da36953eb286267e2fa6896a410a78c061105a..8d12502c47d985eba0f36498d34571d176f47dfd 100644 --- a/README_zh.md +++ b/README_ZH.md @@ -9,8 +9,8 @@ ## 简介 -设备使用信息统计,包括app usage/notification usage/system usage等使用统计。例如应用使用信息统计,用于保存和查询应用使用详情、事件日志数据、应用分组情况。 -部件缓存的应用记录(使用历史统计和使用事件记录)会定期刷新到数据库进行持久化保存。 +设备使用信息统计,包括app usage/notification usage/system usage等使用统计。例如应用使用信息统计,用于保存和查询应用使用详情(app usage)、事件日志数据(event log)、应用分组(bundle group)情况。 +部件缓存的应用记录(使用历史统计和使用事件记录)会在事件上报后30分钟内刷新到数据库持久化保存。 ## 目录 @@ -23,8 +23,8 @@ │ └── kits # 对外接口目录 ├── services # 服务层目录 ├── frameworks -│ ├── JS # 外部JS接口实现目录 -│ └── native # 外部native接口实现目录 +│ ├── JS # 对外JS接口实现目录 +│ └── native # 对外Native接口实现目录 ├── adapter # 适配目录 └── test # 测试用例目录 ``` @@ -33,7 +33,7 @@ ### 接口说明 -设备使用信息统计接口,包括app usage/notification usage/system usage等接口,以app usage接口为例,对外暴露的主要接口如下所示。 +设备使用信息统计接口,包括app usage/notification usage/system usage等接口,以app usage接口为例,对外提供主要接口如下。 - - - -

接口名

@@ -44,20 +44,20 @@

queryBundleActiveStates(begin::number, end::number, callback:AsyncCallback<Array<BundleActiveState>>):void

通过时间段间隔查询所有应用的事件集合。

+

通过指定起始和结束时间查询所有应用的事件集合。

queryBundleStateInfos(begin::number, end::number, callback:AsyncCallback<BundleStateInfoResponse>):void

使用起始和结束时间来查询应用使用时长统计信息。

+

通过指定起始和结束时间查询应用使用时长统计信息。

queryCurrentBundleActiveStates(begin::number, end::number, callback:AsyncCallback<Array<BundleActiveState>>):void

通过时间段间隔查询当前应用的事件集合。

+

通过指定起始和结束时间查询当前应用的事件集合。

queryBundleStateInfoByInterval(byInterval:intervalType, begin::number, end::number, callback:AsyncCallback<Array<BundleStateInfo>>):void

通过时间段间隔查询应用使用时长统计信息。

+

通过指定时间段间隔(天、周、月、年)查询应用使用时长统计信息。

queryAppUsagePriorityGroup(callback:AsyncCallback<number>):void

查询(返回)当前调用者应用的使用优先级群组。

@@ -71,7 +71,7 @@ ### 使用说明 -设备使用信息统计接口众多,以app usage接口为例,介绍下接口逻辑。 +设备使用信息统计接口众多,以应用使用详情(app usage)接口为例,介绍接口逻辑。 - **运行进程**:设备使用信息统计服务在foundation进程启动和运行。 - **应用使用统计信息落盘时机**: diff --git a/device_usage_statistics.gni b/device_usage_statistics.gni new file mode 100644 index 0000000000000000000000000000000000000000..a18fede18fdf4030eb59dd4a1898443ec422758a --- /dev/null +++ b/device_usage_statistics.gni @@ -0,0 +1,3 @@ +import("//build/ohos.gni") + +device_usage_statistics_part_name = "device_usage_statistics" \ No newline at end of file diff --git a/interfaces/innerkits/src/bundle_active_client.cpp b/interfaces/innerkits/src/bundle_active_client.cpp index 9f9d8354fa8536850911cdd0da7886c97230c3e1..7ddb46d3d86954219a792106ddf94f6e48ae2047 100644 --- a/interfaces/innerkits/src/bundle_active_client.cpp +++ b/interfaces/innerkits/src/bundle_active_client.cpp @@ -31,7 +31,7 @@ bool BundleActiveClient::GetBundleActiveProxy() { sptr object = samgr->GetSystemAbility(BUNDLE_ACTIVE_SYS_ABILITY_ID); if (object == nullptr) { - BUNDLE_ACTIVE_LOGE("Failed to get SystemAbility[1910] ."); + BUNDLE_ACTIVE_LOGE("Failed to get SystemAbility[1906] ."); return false; } diff --git a/ohos.build b/ohos.build index 6435cac9026cfb05d019a6c040e53809f7a8cc79..722a3a58106fcb929bb5ccddee812d82ce9a6db6 100644 --- a/ohos.build +++ b/ohos.build @@ -1,25 +1,25 @@ { "subsystem": "resourceschedule", "parts": { - "bundleactive": { + "device_usage_statistics": { "variants": [ ], "module_list": [ - "//foundation/resourceschedule/bundleactive:bundleactiveinner", - "//foundation/resourceschedule/bundleactive:bundleactiveservice", - "//foundation/resourceschedule/bundleactive:bundleactive_sa_profile", - "//foundation/resourceschedule/bundleactive:bundleactive_service_init" + "//foundation/resourceschedule/device_usage_statistics:bundleactiveinner", + "//foundation/resourceschedule/device_usage_statistics:bundleactiveservice", + "//foundation/resourceschedule/device_usage_statistics:bundleactive_sa_profile", + "//foundation/resourceschedule/device_usage_statistics:bundleactive_service_init" ], "inner_kits": [ { "header": { - "header_base": "//foundation/resourceschedule/bundleactive/interfaces/innerkits/include", + "header_base": "//foundation/resourceschedule/device_usage_statistics/interfaces/innerkits/include", "header_files": [ "bundle_active_proxy.h", "bundle_active_client.h" ] }, - "name": "//foundation/resourceschedule/bundleactive:bundleactiveinner" + "name": "//foundation/resourceschedule/device_usage_statistics:bundleactiveinner" } ], "system_kits": [