diff --git a/bundle.json b/bundle.json index e83679d2a517c9e040f470cf5beedd7570974392..523ce2b4c0a2f728fe2c7d427cb706af0db1521b 100644 --- a/bundle.json +++ b/bundle.json @@ -36,7 +36,6 @@ "common_event_service", "device_manager", "dsoftbus", - "eventhandler", "ffrt", "hicollie", "hilog", diff --git a/services/dfx/include/hicollie_helper.h b/services/dfx/include/hicollie_helper.h deleted file mode 100644 index f58fb701e3acf63ae93079cfe7515e448042b082..0000000000000000000000000000000000000000 --- a/services/dfx/include/hicollie_helper.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef SERVICES_DFX_INCLUDE_HICOLLIE_HELLER_H -#define SERVICES_DFX_INCLUDE_HICOLLIE_HELLER_H -#include "event_handler.h" -#include -namespace OHOS { -class HicollieHelper { -public: - static int AddThread(const std::string& name, std::shared_ptr handler, - std::function timeOutCallback, uint64_t interval); -}; -} // namespace OHOS -#endif // SERVICES_DFX_INCLUDE_HICOLLIE_HELLER_H diff --git a/services/dfx/source/hicollie_helper.cpp b/services/dfx/source/hicollie_helper.cpp deleted file mode 100644 index 23c5305fdb7c43971a371979a950d2a25c72a181..0000000000000000000000000000000000000000 --- a/services/dfx/source/hicollie_helper.cpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "hicollie_helper.h" -#ifdef HICOLLIE_ENABLE -#include "xcollie/watchdog.h" -#endif - -namespace OHOS { -int HicollieHelper::AddThread(const std::string& name, std::shared_ptr handler, - std::function timeOutCallback, uint64_t interval) -{ -#ifdef HICOLLIE_ENABLE - return HiviewDFX::Watchdog::GetInstance().AddThread(name, handler, timeOutCallback, interval); -#else - // HICOLLIE_ENABLE is false, do nothing and return 1. - return 1; -#endif -} -} // namespace OHOS \ No newline at end of file diff --git a/services/samgr/native/source/collect/common_event_collect.cpp b/services/samgr/native/source/collect/common_event_collect.cpp index 0510e008ae7c18763aeeab67dc6db38e75bb00e4..e5a39aef7e6d7a83df1baaf71c7c2072611e249f 100644 --- a/services/samgr/native/source/collect/common_event_collect.cpp +++ b/services/samgr/native/source/collect/common_event_collect.cpp @@ -34,7 +34,6 @@ #include "system_ability_manager.h" #include "samgr_xcollie.h" -using namespace OHOS::AppExecFwk; namespace OHOS { namespace { constexpr uint32_t INIT_EVENT = 10; diff --git a/services/samgr/native/source/collect/device_switch_collect.cpp b/services/samgr/native/source/collect/device_switch_collect.cpp index 53bd9f0caca68a2863b895433fe530bc672c06c2..ad3c3ad24b5fc99aeebae330ff6d330f5234076e 100644 --- a/services/samgr/native/source/collect/device_switch_collect.cpp +++ b/services/samgr/native/source/collect/device_switch_collect.cpp @@ -23,7 +23,6 @@ #include "system_ability_manager.h" using namespace std; -using namespace OHOS::AppExecFwk; namespace OHOS { namespace { diff --git a/services/samgr/native/test/unittest/BUILD.gn b/services/samgr/native/test/unittest/BUILD.gn index c1e31225438901d900c3c9303843ada8a9cdab42..f5931c94dd8c693d1ce57e4a5abe81ecb35c8c27 100644 --- a/services/samgr/native/test/unittest/BUILD.gn +++ b/services/samgr/native/test/unittest/BUILD.gn @@ -104,7 +104,6 @@ ohos_unittest("SystemAbilityMgrTest") { "access_token:libaccesstoken_sdk", "c_utils:utils", "config_policy:configpolicy_util", - "eventhandler:libeventhandler", "ffrt:libffrt", "googletest:gtest_main", "hilog:libhilog", @@ -231,7 +230,6 @@ ohos_unittest("SystemAbilityMgrCollectTest") { "access_token:libaccesstoken_sdk", "c_utils:utils", "config_policy:configpolicy_util", - "eventhandler:libeventhandler", "ffrt:libffrt", "googletest:gtest_main", "hilog:libhilog", @@ -366,7 +364,6 @@ ohos_unittest("SystemAbilityMgrDeviceNetworkingTest") { "access_token:libaccesstoken_sdk", "c_utils:utils", "config_policy:configpolicy_util", - "eventhandler:libeventhandler", "ffrt:libffrt", "googletest:gtest_main", "hilog:libhilog", @@ -476,7 +473,6 @@ ohos_unittest("SystemAbilityMgrStubTest") { "access_token:libaccesstoken_sdk", "c_utils:utils", "config_policy:configpolicy_util", - "eventhandler:libeventhandler", "ffrt:libffrt", "googletest:gtest_main", "hilog:libhilog", @@ -686,7 +682,6 @@ ohos_unittest("SystemAbilityStateSchedulerTest") { "access_token:libaccesstoken_sdk", "c_utils:utils", "config_policy:configpolicy_util", - "eventhandler:libeventhandler", "ffrt:libffrt", "googletest:gtest_main", "hilog:libhilog", @@ -1047,7 +1042,6 @@ ohos_executable("TestTool") { "access_token:libaccesstoken_sdk", "c_utils:utils", "config_policy:configpolicy_util", - "eventhandler:libeventhandler", "ffrt:libffrt", "hisysevent:libhisysevent", "hisysevent:libhisysevent_easy", diff --git a/services/samgr/native/test/unittest/src/common_event_collect_test.cpp b/services/samgr/native/test/unittest/src/common_event_collect_test.cpp index 2a61f87635bbd24082121459c0c992291eb0cfb1..6f3bb792c70304e7a68bc50189747df9e1989c5f 100644 --- a/services/samgr/native/test/unittest/src/common_event_collect_test.cpp +++ b/services/samgr/native/test/unittest/src/common_event_collect_test.cpp @@ -24,7 +24,6 @@ #define private public #include "common_event_collect.h" #include "device_status_collect_manager.h" -#include "event_handler.h" #undef private using namespace std; @@ -181,62 +180,11 @@ HWTEST_F(CommonEventCollectTest, ProcessEvent002, TestSize.Level3) sptr collect = new DeviceStatusCollectManager(); sptr commonEventCollect = new CommonEventCollect(collect); std::shared_ptr commonHandler = std::make_shared(commonEventCollect); - AppExecFwk::InnerEvent *event = nullptr; - auto destructor = [](AppExecFwk::InnerEvent *event) { - if (event != nullptr) { - delete event; - } - }; commonHandler->ProcessEvent(COMMON_DIED_EVENT, 0); - EXPECT_EQ(event, nullptr); + EXPECT_NE(commonEventCollect->commonEventSubscriber_, nullptr); DTEST_LOG << "ProcessEvent002 end" << std::endl; } -/** - * @tc.name: ProcessEvent003 - * @tc.desc: test ProcessEvent, commonCollect_ is nullptr - * @tc.type: FUNC - * @tc.require: I6OU0A - */ -HWTEST_F(CommonEventCollectTest, ProcessEvent003, TestSize.Level3) -{ - DTEST_LOG << "ProcessEvent003 begin" << std::endl; - sptr commonEventCollect = nullptr; - std::shared_ptr commonHandler = std::make_shared(commonEventCollect); - AppExecFwk::InnerEvent *event = new AppExecFwk::InnerEvent(); - auto destructor = [](AppExecFwk::InnerEvent *event) { - if (event != nullptr) { - delete event; - } - }; - commonHandler->ProcessEvent(COMMON_DIED_EVENT, 0); - EXPECT_NE(event, nullptr); - DTEST_LOG << "ProcessEvent003 end" << std::endl; -} - -/** - * @tc.name: ProcessEvent004 - * @tc.desc: test ProcessEvent, eventId is invalid - * @tc.type: FUNC - * @tc.require: I6OU0A - */ -HWTEST_F(CommonEventCollectTest, ProcessEvent004, TestSize.Level3) -{ - DTEST_LOG << "ProcessEvent004 begin" << std::endl; - sptr commonEventCollect = nullptr; - std::shared_ptr commonHandler = std::make_shared(commonEventCollect); - AppExecFwk::InnerEvent *event = new AppExecFwk::InnerEvent(); - event->innerEventId_ = static_cast(-1); - auto destructor = [](AppExecFwk::InnerEvent *event) { - if (event != nullptr) { - delete event; - } - }; - commonHandler->ProcessEvent(-1, 0); - EXPECT_NE(event, nullptr); - DTEST_LOG << "ProcessEvent004 end" << std::endl; -} - /** * @tc.name: OnReceiveEvent001 * @tc.desc: test OnReceiveEvent diff --git a/services/samgr/native/test/unittest/src/device_networking_collect_test.cpp b/services/samgr/native/test/unittest/src/device_networking_collect_test.cpp index 0656f2e05e7bac3770b00b4d8f0a7cc9f4b1b056..22ad43d21b733e7251ef94826c1ec6169fb09781 100644 --- a/services/samgr/native/test/unittest/src/device_networking_collect_test.cpp +++ b/services/samgr/native/test/unittest/src/device_networking_collect_test.cpp @@ -22,7 +22,6 @@ #define private public #include "device_networking_collect.h" -#include "event_handler.h" using namespace std; using namespace testing; @@ -39,12 +38,9 @@ constexpr uint32_t DELAY_TIME = 100; bool DeviceNetworkingCollectTest::isCaseDone_ = false; std::mutex DeviceNetworkingCollectTest::caseDoneLock_; std::condition_variable DeviceNetworkingCollectTest::caseDoneCondition_; -std::shared_ptr collectHandler_ = nullptr; void DeviceNetworkingCollectTest::SetUpTestCase() { - auto runner = AppExecFwk::EventRunner::Create("collect_test2"); - collectHandler_ = std::make_shared(runner); DTEST_LOG << "SetUpTestCase" << std::endl; } diff --git a/services/samgr/native/test/unittest/src/system_ability_state_scheduler_proc_test.cpp b/services/samgr/native/test/unittest/src/system_ability_state_scheduler_proc_test.cpp index 67b7555a9d63bdf7a636ba07f5a4b04b5cc4f54a..1643e68ae65ffa3ff8ac0294b3008fe25a3abcba 100644 --- a/services/samgr/native/test/unittest/src/system_ability_state_scheduler_proc_test.cpp +++ b/services/samgr/native/test/unittest/src/system_ability_state_scheduler_proc_test.cpp @@ -22,7 +22,6 @@ #define private public #include "schedule/system_ability_state_scheduler.h" -#include "event_handler.h" #include "system_ability_manager.h" using namespace std; diff --git a/test/fuzztest/samgr_fuzzer/BUILD.gn b/test/fuzztest/samgr_fuzzer/BUILD.gn index 8e9e07f8a4574d8abef98b52c9ad063627b79898..daae3343d4e848cd61900659877943617aaffa57 100644 --- a/test/fuzztest/samgr_fuzzer/BUILD.gn +++ b/test/fuzztest/samgr_fuzzer/BUILD.gn @@ -173,7 +173,6 @@ foreach(item, samgr_fuzztests) { "access_token:libaccesstoken_sdk", "c_utils:utils", "config_policy:configpolicy_util", - "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "hisysevent:libhisysevent", diff --git a/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn b/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn index e44b7bab243e74e16d90bd7980901c50290f3aec..141bd7ca811b727caf6ef2681d6c8518e9aba05a 100644 --- a/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn +++ b/test/fuzztest/samgrcoverage_fuzzer/BUILD.gn @@ -76,7 +76,6 @@ ohos_fuzztest("SamgrCoverageFuzzTest") { "access_token:libaccesstoken_sdk", "c_utils:utils", "config_policy:configpolicy_util", - "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "hisysevent:libhisysevent", diff --git a/test/fuzztest/samgrdumper_fuzzer/BUILD.gn b/test/fuzztest/samgrdumper_fuzzer/BUILD.gn index a4884847e43aea75700a63e7315bd35577274f37..892965e21763ef11183692de03d3b19c2766bcb5 100644 --- a/test/fuzztest/samgrdumper_fuzzer/BUILD.gn +++ b/test/fuzztest/samgrdumper_fuzzer/BUILD.gn @@ -75,7 +75,6 @@ ohos_fuzztest("SamgrDumperFuzzTest") { "access_token:libaccesstoken_sdk", "c_utils:utils", "config_policy:configpolicy_util", - "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "hisysevent:libhisysevent", diff --git a/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn b/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn index 021bffdaf04143e769f452a747bd6936337c38fe..0fdc4eb5bd43acb390849c2026e033d2f6a4acb5 100644 --- a/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn +++ b/test/fuzztest/systemabilitymanager_fuzzer/BUILD.gn @@ -75,7 +75,6 @@ ohos_fuzztest("SystemAbilityManagerFuzzTest") { "access_token:libaccesstoken_sdk", "c_utils:utils", "config_policy:configpolicy_util", - "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "hisysevent:libhisysevent",