diff --git a/BUILD.gn b/BUILD.gn index 450a9ce6aeede7a1b00b537f3fbb0e91167ba146..09800fb7f20d854af6fc35d05c8aa49f0c399390 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -85,7 +85,7 @@ ohos_shared_library("usagestatsinner") { ] external_deps = [ "c_utils:utils", - "eventhandler:libeventhandler", + "ffrt:libffrt", "hilog:libhilog", "hitrace:hitrace_meter", "ipc:ipc_core", @@ -99,7 +99,6 @@ ohos_shared_library("usagestatsinner") { get_target_outputs(":app_group_callback_interface") sources += filter_include(app_group_callback_output_values, [ "*.cpp" ]) - public_external_deps = [ "ffrt:libffrt" ] part_name = "${device_usage_statistics_part_name}" subsystem_name = "resourceschedule" innerapi_tags = [ "platformsdk" ] @@ -148,13 +147,12 @@ ohos_shared_library("bundlestate") { external_deps = [ "c_utils:utils", - "eventhandler:libeventhandler", + "ffrt:libffrt", "hilog:libhilog", "ipc:ipc_single", "napi:ace_napi", "samgr:samgr_proxy", ] - public_external_deps = [ "ffrt:libffrt" ] relative_install_dir = "module" part_name = "${device_usage_statistics_part_name}" subsystem_name = "resourceschedule" @@ -197,7 +195,6 @@ ohos_shared_library("usagestatistics") { external_deps = [ "c_utils:utils", - "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "ipc:ipc_single", @@ -261,31 +258,24 @@ ohos_shared_library("usagestatservice") { ] external_deps = [ - "ability_base:want", "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", - "bundle_framework:appexecfwk_base", - "bundle_framework:appexecfwk_core", - "c_utils:utils", - "common_event_service:cesfwk_innerkits", "config_policy:configpolicy_util", - "eventhandler:libeventhandler", "ffrt:libffrt", "hicollie:libhicollie", "hilog:libhilog", "hisysevent:libhisysevent", "init:libbegetutil", "ipc:ipc_single", + "jsoncpp:jsoncpp", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", ] - public_external_deps = [ "jsoncpp:jsoncpp" ] - if (os_account_part_enabled) { cflags_cc += [ "-DOS_ACCOUNT_PART_ENABLED" ] external_deps += [ "os_account:os_account_innerkits" ] @@ -347,31 +337,24 @@ ohos_static_library("usagestatservice_static") { ] external_deps = [ - "ability_base:want", "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", - "bundle_framework:appexecfwk_base", - "bundle_framework:appexecfwk_core", - "c_utils:utils", - "common_event_service:cesfwk_innerkits", "config_policy:configpolicy_util", - "eventhandler:libeventhandler", "ffrt:libffrt", "hicollie:libhicollie", "hilog:libhilog", "hisysevent:libhisysevent", "init:libbegetutil", "ipc:ipc_single", + "jsoncpp:jsoncpp", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", ] - public_external_deps = [ "jsoncpp:jsoncpp" ] - if (os_account_part_enabled) { cflags_cc += [ "-DOS_ACCOUNT_PART_ENABLED" ] external_deps += [ "os_account:os_account_innerkits" ] diff --git a/bundle.json b/bundle.json index e30298b10033d0fbe53eff3a94863933d47ef15b..95085d8e4ee3dc4da8eab12f019ea402859c5a70 100644 --- a/bundle.json +++ b/bundle.json @@ -23,10 +23,8 @@ "ram": "10240KB", "deps": { "components": [ - "bundle_framework", "relational_store", "safwk", - "common_event_service", "config_policy", "os_account", "ipc", @@ -39,9 +37,7 @@ "cJSON", "c_utils", "napi", - "ability_base", "background_task_mgr", - "eventhandler", "power_manager", "selinux_adapter", "time_service", diff --git a/interfaces/innerkits/include/bundle_active_client.h b/interfaces/innerkits/include/bundle_active_client.h index 03d19bbb3bc878beca2f88e341d06a7e385f8263..0ad98aec4868b96ce5df3829f414eca077c70e13 100644 --- a/interfaces/innerkits/include/bundle_active_client.h +++ b/interfaces/innerkits/include/bundle_active_client.h @@ -25,9 +25,6 @@ #include "bundle_active_package_stats.h" #include "bundle_active_module_record.h" #include "bundle_state_inner_errors.h" -#include "event_handler.h" -#include "event_runner.h" -#include "ffrt.h" #include "system_ability_definition.h" #include "if_system_ability_manager.h" @@ -234,7 +231,6 @@ private: ~BundleActiveClient() {} sptr bundleActiveProxy_; sptr recipient_; - ffrt::recursive_mutex mutex_; }; } // namespace DeviceUsageStats } // namespace OHOS diff --git a/interfaces/innerkits/src/bundle_active_client.cpp b/interfaces/innerkits/src/bundle_active_client.cpp index ac99561a20aff17a5a7acb184004f3f3a64ce025..e92722eb80f307a426221adf088c1c41494fbb42 100644 --- a/interfaces/innerkits/src/bundle_active_client.cpp +++ b/interfaces/innerkits/src/bundle_active_client.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "unistd.h" - +#include "ffrt.h" #include "bundle_active_log.h" #include "bundle_active_client.h" @@ -24,6 +24,7 @@ namespace { static const int32_t SLEEP_TIME_SECOND = 1; static const int32_t MS_TO_US = 1000; } +ffrt::recursive_mutex mutex_; BundleActiveClient& BundleActiveClient::GetInstance() { static BundleActiveClient instance; @@ -225,7 +226,7 @@ ErrCode BundleActiveClient::QueryNotificationEventStats(int64_t beginTime, int64 void BundleActiveClient::BundleActiveClientDeathRecipient::AddObserver(const sptr &observer) { - std::lock_guard lock(BundleActiveClient::GetInstance().mutex_); + std::lock_guard lock(mutex_); if (observer) { observer_ = observer; } @@ -233,7 +234,7 @@ void BundleActiveClient::BundleActiveClientDeathRecipient::AddObserver(const spt void BundleActiveClient::BundleActiveClientDeathRecipient::RemoveObserver() { - std::lock_guard lock(BundleActiveClient::GetInstance().mutex_); + std::lock_guard lock(mutex_); if (observer_) { observer_ = nullptr; } @@ -242,7 +243,7 @@ void BundleActiveClient::BundleActiveClientDeathRecipient::RemoveObserver() void BundleActiveClient::BundleActiveClientDeathRecipient::OnRemoteDied(const wptr &object) { (void)object; - std::lock_guard lock(BundleActiveClient::GetInstance().mutex_); + std::lock_guard lock(mutex_); BundleActiveClient::GetInstance().bundleActiveProxy_ = nullptr; ffrt::submit([this]() { this->OnServiceDiedInner(); @@ -251,7 +252,7 @@ void BundleActiveClient::BundleActiveClientDeathRecipient::OnRemoteDied(const wp void BundleActiveClient::BundleActiveClientDeathRecipient::OnServiceDiedInner() { - std::lock_guard lock(BundleActiveClient::GetInstance().mutex_); + std::lock_guard lock(mutex_); while (BundleActiveClient::GetInstance().GetBundleActiveProxy() != ERR_OK) { sleep(SLEEP_TIME_SECOND); } diff --git a/services/packagegroup/include/bundle_active_group_handler.h b/services/packagegroup/include/bundle_active_group_handler.h index 08dbb38e30219378af6270f44cfe0769454ec11e..64d5fbe73456acd14fe2ec2b19ae2b09ed4c42fb 100644 --- a/services/packagegroup/include/bundle_active_group_handler.h +++ b/services/packagegroup/include/bundle_active_group_handler.h @@ -16,8 +16,6 @@ #ifndef BUNDLE_ACTIVE_GROUP_HANDLER_H #define BUNDLE_ACTIVE_GROUP_HANDLER_H -#include "event_handler.h" -#include "event_runner.h" #include "ffrt.h" #include #include diff --git a/services/packagegroup/src/bundle_active_group_controller.cpp b/services/packagegroup/src/bundle_active_group_controller.cpp index 1848ee2a949940ac31d206a5ba9fc871a4757ca9..3ce28c47ff41c80ef0197d45eae2d102c6894a47 100644 --- a/services/packagegroup/src/bundle_active_group_controller.cpp +++ b/services/packagegroup/src/bundle_active_group_controller.cpp @@ -208,8 +208,6 @@ void BundleActiveGroupController::CheckIdleStatsOneTime() BundleActiveGroupHandlerObject tmpGroupHandlerObj; std::shared_ptr handlerobjToPtr = std::make_shared(tmpGroupHandlerObj); - auto handlerEvent = AppExecFwk::InnerEvent::Get( - BundleActiveGroupHandler::MSG_ONE_TIME_CHECK_BUNDLE_STATE); auto activeGroupHandler = activeGroupHandler_.lock(); if (!activeGroupHandler_.expired()) { activeGroupHandler_.lock()->SendEvent(BundleActiveGroupHandler::MSG_ONE_TIME_CHECK_BUNDLE_STATE, diff --git a/test/fuzztest/appgroupcallbackstub_fuzzer/BUILD.gn b/test/fuzztest/appgroupcallbackstub_fuzzer/BUILD.gn index fff8c6b2c58af2a195526973bd76ff6bf2262743..c923b477819e628feef1417463827e15ce8675c2 100644 --- a/test/fuzztest/appgroupcallbackstub_fuzzer/BUILD.gn +++ b/test/fuzztest/appgroupcallbackstub_fuzzer/BUILD.gn @@ -51,23 +51,19 @@ ohos_fuzztest("AppgroupcallbackstubFuzzTest") { public_deps = [ "${usage_statistics_path}:usagestatservice_static" ] external_deps = [ - "ability_base:want", "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "access_token:libtokenid_sdk", - "bundle_framework:appexecfwk_base", - "bundle_framework:appexecfwk_core", "cJSON:cjson", - "c_utils:utils", - "common_event_service:cesfwk_innerkits", - "eventhandler:libeventhandler", + "cJSON:cjson_static", "ffrt:libffrt", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", + "jsoncpp:jsoncpp", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", diff --git a/test/fuzztest/bundleactiveobserver_fuzzer/BUILD.gn b/test/fuzztest/bundleactiveobserver_fuzzer/BUILD.gn index 06693f223d1767d0a8d3513176c8c6e3d8604f7d..79672306220b4a19aa6ccc4a131569c2036eb6e6 100644 --- a/test/fuzztest/bundleactiveobserver_fuzzer/BUILD.gn +++ b/test/fuzztest/bundleactiveobserver_fuzzer/BUILD.gn @@ -56,23 +56,19 @@ ohos_fuzztest("BundleActiveObserverFuzzTest") { "${usage_statistics_path}:usagestatsinner", ] external_deps = [ - "ability_base:want", "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "access_token:libtokenid_sdk", - "bundle_framework:appexecfwk_base", - "bundle_framework:appexecfwk_core", "cJSON:cjson", - "c_utils:utils", - "common_event_service:cesfwk_innerkits", - "eventhandler:libeventhandler", + "cJSON:cjson_static", "ffrt:libffrt", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", + "jsoncpp:jsoncpp", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", diff --git a/test/fuzztest/bundleactiveonremoterequest_fuzzer/BUILD.gn b/test/fuzztest/bundleactiveonremoterequest_fuzzer/BUILD.gn index 1c05cfc844c56481c31a91a3d525175e8910576d..9aa6d3421045a0bfb8d6b4a463ce0301f054ac3d 100644 --- a/test/fuzztest/bundleactiveonremoterequest_fuzzer/BUILD.gn +++ b/test/fuzztest/bundleactiveonremoterequest_fuzzer/BUILD.gn @@ -50,23 +50,19 @@ ohos_fuzztest("BundleActiveOnRemoteRequestFuzzTest") { public_deps = [ "${usage_statistics_path}:usagestatservice_static" ] external_deps = [ - "ability_base:want", "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "access_token:libtokenid_sdk", - "bundle_framework:appexecfwk_base", - "bundle_framework:appexecfwk_core", "cJSON:cjson", - "c_utils:utils", - "common_event_service:cesfwk_innerkits", - "eventhandler:libeventhandler", + "cJSON:cjson_static", "ffrt:libffrt", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", + "jsoncpp:jsoncpp", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", diff --git a/test/fuzztest/bundleactivepowerstatecallbackproxy_fuzzer/BUILD.gn b/test/fuzztest/bundleactivepowerstatecallbackproxy_fuzzer/BUILD.gn index 5ec4293ac2b68ebec289dfc99b8458d9edec3a90..48062b526fac6c96877b536c878b5767ebe3527d 100644 --- a/test/fuzztest/bundleactivepowerstatecallbackproxy_fuzzer/BUILD.gn +++ b/test/fuzztest/bundleactivepowerstatecallbackproxy_fuzzer/BUILD.gn @@ -55,23 +55,19 @@ ohos_fuzztest("BundleActivePowerstateCallbackproxyFuzzTest") { "${usage_statistics_path}:usagestatsinner", ] external_deps = [ - "ability_base:want", "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "access_token:libtokenid_sdk", - "bundle_framework:appexecfwk_base", - "bundle_framework:appexecfwk_core", "cJSON:cjson", - "c_utils:utils", - "common_event_service:cesfwk_innerkits", - "eventhandler:libeventhandler", + "cJSON:cjson_static", "ffrt:libffrt", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", + "jsoncpp:jsoncpp", "relational_store:native_rdb", "safwk:system_ability_fwk", "samgr:samgr_proxy", diff --git a/test/unittest/BUILD.gn b/test/unittest/BUILD.gn index 8a7f8528ed0cb89162df46fc06e321b1751943e0..39bb926b8fd89e5692dc340e830fdb09b6045223 100644 --- a/test/unittest/BUILD.gn +++ b/test/unittest/BUILD.gn @@ -49,16 +49,10 @@ ohos_unittest("BundleActiveTotalTest") { ] external_deps = [ - "ability_base:want", "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", - "bundle_framework:appexecfwk_base", - "bundle_framework:appexecfwk_core", - "c_utils:utils", - "common_event_service:cesfwk_innerkits", - "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "init:libbegetutil", @@ -104,8 +98,6 @@ ohos_unittest("DeviceUsageStatsTest") { "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", - "c_utils:utils", - "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "ipc:ipc_single", @@ -148,8 +140,6 @@ ohos_unittest("DeviceUsageStatsMultiTest") { "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", - "c_utils:utils", - "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "ipc:ipc_single", @@ -194,10 +184,6 @@ ohos_unittest("DeviceUsageStatsServiceTest") { "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", - "bundle_framework:appexecfwk_core", - "c_utils:utils", - "common_event_service:cesfwk_innerkits", - "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "ipc:ipc_single", @@ -251,10 +237,6 @@ ohos_unittest("DeviceUsageStatsMockTest") { "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", - "bundle_framework:appexecfwk_core", - "c_utils:utils", - "common_event_service:cesfwk_innerkits", - "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "ipc:ipc_single", @@ -299,11 +281,6 @@ ohos_unittest("DeviceUsagePackageUsageTest") { "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", - "bundle_framework:appexecfwk_base", - "bundle_framework:appexecfwk_core", - "c_utils:utils", - "common_event_service:cesfwk_innerkits", - "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "ipc:ipc_single",