From 69d2de8409972ba777d050a8a358a540aa84f780 Mon Sep 17 00:00:00 2001 From: li-tiangang4 Date: Tue, 20 Aug 2024 15:10:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=99=BA=E8=83=BD=E6=8C=87=E9=92=88=E4=BC=A0?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-tiangang4 --- common/utils/include/idistributed_hardware.h | 8 +++---- .../include/distributed_hardware_fwk_kit.h | 2 +- .../inner_kits/include/ipc/dhfwk_sa_manager.h | 4 ++-- .../include/ipc/distributed_hardware_proxy.h | 10 ++++----- .../src/distributed_hardware_fwk_kit.cpp | 2 +- .../inner_kits/src/ipc/dhfwk_sa_manager.cpp | 22 +++++++++---------- .../src/ipc/distributed_hardware_proxy.cpp | 6 ++--- .../include/dhfwk_sa_manager_test.h | 6 ++--- .../src/dhfwk_sa_manager_test.cpp | 20 ++++++++--------- .../include/distributed_hardware_proxy_test.h | 6 ++--- .../componentmanager/component_manager.h | 6 ++--- .../componentmanager/component_privacy.h | 2 +- .../include/distributed_hardware_service.h | 8 +++---- .../include/ipc/publisher_listener_proxy.h | 4 ++-- .../include/publisher/publisher.h | 6 ++--- .../include/publisher/publisher_item.h | 6 ++--- .../resourcemanager/capability_info_manager.h | 6 ++--- .../include/resourcemanager/db_adapter.h | 2 +- .../local_capability_info_manager.h | 2 +- .../resourcemanager/meta_info_manager.h | 2 +- .../resourcemanager/version_info_manager.h | 4 ++-- .../include/task/task_executor.h | 4 ++-- .../include/transport/dh_comm_tool.h | 2 +- .../include/utils/dh_context.h | 2 +- .../componentmanager/component_manager.cpp | 6 ++--- .../componentmanager/component_privacy.cpp | 2 +- .../src/distributed_hardware_service.cpp | 6 ++--- .../src/ipc/publisher_listener_proxy.cpp | 2 +- .../src/publisher/publisher.cpp | 4 ++-- .../src/publisher/publisher_item.cpp | 4 ++-- .../capability_info_manager.cpp | 4 ++-- .../src/resourcemanager/db_adapter.cpp | 2 +- .../src/resourcemanager/meta_info_manager.cpp | 2 +- .../resourcemanager/version_info_manager.cpp | 2 +- .../src/task/task_executor.cpp | 2 +- .../src/transport/dh_comm_tool.cpp | 2 +- .../src/utils/dh_context.cpp | 2 +- .../include/distributed_hardware_stub_test.h | 6 ++--- .../include/version_info_manager_test.h | 4 ++-- utils/include/histreamer_query_tool.h | 10 +++++++-- 40 files changed, 104 insertions(+), 98 deletions(-) diff --git a/common/utils/include/idistributed_hardware.h b/common/utils/include/idistributed_hardware.h index 090e7005..f7390e53 100644 --- a/common/utils/include/idistributed_hardware.h +++ b/common/utils/include/idistributed_hardware.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 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 @@ -34,8 +34,8 @@ public: DECLARE_INTERFACE_DESCRIPTOR(u"ohos.distributedhardware.accessToken"); IDistributedHardware() = default; virtual ~IDistributedHardware() = default; - virtual int32_t RegisterPublisherListener(const DHTopic topic, const sptr &listener) = 0; - virtual int32_t UnregisterPublisherListener(const DHTopic topic, const sptr &listener) = 0; + virtual int32_t RegisterPublisherListener(const DHTopic topic, const sptr listener) = 0; + virtual int32_t UnregisterPublisherListener(const DHTopic topic, const sptr listener) = 0; virtual int32_t PublishMessage(const DHTopic topic, const std::string &msg) = 0; virtual std::string QueryLocalSysSpec(QueryLocalSysSpecType spec) = 0; @@ -44,7 +44,7 @@ public: virtual int32_t CreateControlChannel(int32_t engineId, const std::string &peerDevId) = 0; virtual int32_t NotifyAVCenter(int32_t engineId, const AVTransEvent &event) = 0; virtual int32_t RegisterCtlCenterCallback(int32_t engineId, - const sptr &callback) = 0; + const sptr callback) = 0; virtual int32_t NotifySourceRemoteSinkStarted(std::string &deviceId) = 0; virtual int32_t PauseDistributedHardware(DHType dhType, const std::string &networkId) = 0; virtual int32_t ResumeDistributedHardware(DHType dhType, const std::string &networkId) = 0; diff --git a/interfaces/inner_kits/include/distributed_hardware_fwk_kit.h b/interfaces/inner_kits/include/distributed_hardware_fwk_kit.h index e4d34565..c66ef9de 100644 --- a/interfaces/inner_kits/include/distributed_hardware_fwk_kit.h +++ b/interfaces/inner_kits/include/distributed_hardware_fwk_kit.h @@ -128,7 +128,7 @@ public: * @param callback av control center callback. * @return Returns 0 if success. */ - API_EXPORT int32_t RegisterCtlCenterCallback(int32_t engineId, const sptr &callback); + API_EXPORT int32_t RegisterCtlCenterCallback(int32_t engineId, const sptr callback); /** * @brief Pause distributed hardware. diff --git a/interfaces/inner_kits/include/ipc/dhfwk_sa_manager.h b/interfaces/inner_kits/include/ipc/dhfwk_sa_manager.h index ecf21521..831fafeb 100644 --- a/interfaces/inner_kits/include/ipc/dhfwk_sa_manager.h +++ b/interfaces/inner_kits/include/ipc/dhfwk_sa_manager.h @@ -57,12 +57,12 @@ private: private: std::atomic dhfwkOnLine_; - std::atomic isSubscribeDHFWKSAChangeListener; + std::atomic isSubscribeDHFWKSAChangeListener_; std::mutex proxyMutex_; sptr dhfwkProxy_; sptr saListener_; std::mutex saStatCbMutex_; - DHFWKSAStateCb saStateCallback; + DHFWKSAStateCb saStateCallback_; std::mutex publisherListenersMutex_; std::unordered_map>> publisherListenersCache_; std::mutex avTransControlCenterCbMutex_; diff --git a/interfaces/inner_kits/include/ipc/distributed_hardware_proxy.h b/interfaces/inner_kits/include/ipc/distributed_hardware_proxy.h index 17c324e1..c0533a7d 100644 --- a/interfaces/inner_kits/include/ipc/distributed_hardware_proxy.h +++ b/interfaces/inner_kits/include/ipc/distributed_hardware_proxy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 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 @@ -27,14 +27,14 @@ namespace OHOS { namespace DistributedHardware { class DistributedHardwareProxy : public IRemoteProxy { public: - explicit DistributedHardwareProxy(const sptr& impl) + explicit DistributedHardwareProxy(const sptr impl) : IRemoteProxy(impl) { } virtual ~DistributedHardwareProxy() {} - int32_t RegisterPublisherListener(const DHTopic topic, const sptr &listener) override; - int32_t UnregisterPublisherListener(const DHTopic topic, const sptr &listener) override; + int32_t RegisterPublisherListener(const DHTopic topic, const sptr listener) override; + int32_t UnregisterPublisherListener(const DHTopic topic, const sptr listener) override; int32_t PublishMessage(const DHTopic topic, const std::string &msg) override; std::string QueryLocalSysSpec(QueryLocalSysSpecType spec) override; @@ -42,7 +42,7 @@ public: int32_t ReleaseAVCenter(int32_t engineId) override; int32_t CreateControlChannel(int32_t engineId, const std::string &peerDevId) override; int32_t NotifyAVCenter(int32_t engineId, const AVTransEvent &event) override; - int32_t RegisterCtlCenterCallback(int32_t engineId, const sptr &callback) override; + int32_t RegisterCtlCenterCallback(int32_t engineId, const sptr callback) override; int32_t NotifySourceRemoteSinkStarted(std::string &deviceId) override; int32_t PauseDistributedHardware(DHType dhType, const std::string &networkId) override; int32_t ResumeDistributedHardware(DHType dhType, const std::string &networkId) override; diff --git a/interfaces/inner_kits/src/distributed_hardware_fwk_kit.cpp b/interfaces/inner_kits/src/distributed_hardware_fwk_kit.cpp index 40e6749c..a37929a9 100644 --- a/interfaces/inner_kits/src/distributed_hardware_fwk_kit.cpp +++ b/interfaces/inner_kits/src/distributed_hardware_fwk_kit.cpp @@ -189,7 +189,7 @@ int32_t DistributedHardwareFwkKit::NotifyAVCenter(int32_t engineId, const AVTran } int32_t DistributedHardwareFwkKit::RegisterCtlCenterCallback(int32_t engineId, - const sptr &callback) + const sptr callback) { DHLOGI("Register av control center callback. engineId: %{public}" PRId32, engineId); diff --git a/interfaces/inner_kits/src/ipc/dhfwk_sa_manager.cpp b/interfaces/inner_kits/src/ipc/dhfwk_sa_manager.cpp index b1e43ee2..78c24914 100644 --- a/interfaces/inner_kits/src/ipc/dhfwk_sa_manager.cpp +++ b/interfaces/inner_kits/src/ipc/dhfwk_sa_manager.cpp @@ -29,8 +29,8 @@ namespace OHOS { namespace DistributedHardware { IMPLEMENT_SINGLE_INSTANCE(DHFWKSAManager); DHFWKSAManager::DHFWKSAManager() - : dhfwkOnLine_(false), isSubscribeDHFWKSAChangeListener(false), dhfwkProxy_(nullptr), - saListener_(sptr(new SystemAbilityListener())), saStateCallback(nullptr), + : dhfwkOnLine_(false), isSubscribeDHFWKSAChangeListener_(false), dhfwkProxy_(nullptr), + saListener_(sptr(new SystemAbilityListener())), saStateCallback_(nullptr), publisherListenersCache_({}), avTransControlCenterCbCache_({}) { DHLOGI("Ctor DHFWKSAManager"); @@ -39,7 +39,7 @@ DHFWKSAManager::~DHFWKSAManager() { DHLOGI("Dtor DHFWKSAManager"); dhfwkOnLine_ = false; - isSubscribeDHFWKSAChangeListener = false; + isSubscribeDHFWKSAChangeListener_.store(false); dhfwkProxy_ = nullptr; saListener_ = nullptr; } @@ -53,20 +53,20 @@ void DHFWKSAManager::RegisterAbilityListener() return; } - if (!isSubscribeDHFWKSAChangeListener) { + if (!isSubscribeDHFWKSAChangeListener_.load()) { DHLOGI("try subscribe sa change listener, sa id: %{public}d", DISTRIBUTED_HARDWARE_SA_ID); int32_t ret = saMgr->SubscribeSystemAbility(DISTRIBUTED_HARDWARE_SA_ID, saListener_); if (ret != 0) { DHLOGE("subscribe DHFWK sa change listener failed, ret: %{public}d", ret); return; } - isSubscribeDHFWKSAChangeListener = true; + isSubscribeDHFWKSAChangeListener_.store(true); } } sptr DHFWKSAManager::GetDHFWKProxy() { - if (!isSubscribeDHFWKSAChangeListener) { + if (!isSubscribeDHFWKSAChangeListener_.load()) { RegisterAbilityListener(); } @@ -97,7 +97,7 @@ sptr DHFWKSAManager::GetDHFWKProxy() void DHFWKSAManager::RegisterSAStateCallback(DHFWKSAStateCb callback) { std::lock_guard lock(saStatCbMutex_); - saStateCallback = callback; + saStateCallback_ = callback; } void DHFWKSAManager::SystemAbilityListener::OnAddSystemAbility(int32_t systemAbilityId, const std::string &deviceId) @@ -111,8 +111,8 @@ void DHFWKSAManager::SystemAbilityListener::OnAddSystemAbility(int32_t systemAbi DHFWKSAManager::GetInstance().dhfwkOnLine_ = true; { std::lock_guard lock(DHFWKSAManager::GetInstance().saStatCbMutex_); - if (DHFWKSAManager::GetInstance().saStateCallback != nullptr) { - DHFWKSAManager::GetInstance().saStateCallback(true); + if (DHFWKSAManager::GetInstance().saStateCallback_ != nullptr) { + DHFWKSAManager::GetInstance().saStateCallback_(true); } } if (DHFWKSAManager::GetInstance().RestoreListener() != DH_FWK_SUCCESS) { @@ -136,8 +136,8 @@ void DHFWKSAManager::SystemAbilityListener::OnRemoveSystemAbility(int32_t system } { std::lock_guard lock(DHFWKSAManager::GetInstance().saStatCbMutex_); - if (DHFWKSAManager::GetInstance().saStateCallback != nullptr) { - DHFWKSAManager::GetInstance().saStateCallback(false); + if (DHFWKSAManager::GetInstance().saStateCallback_ != nullptr) { + DHFWKSAManager::GetInstance().saStateCallback_(false); } } DHLOGI("sa %{public}" PRId32 " stopped", systemAbilityId); diff --git a/interfaces/inner_kits/src/ipc/distributed_hardware_proxy.cpp b/interfaces/inner_kits/src/ipc/distributed_hardware_proxy.cpp index 0b1c3910..68135245 100644 --- a/interfaces/inner_kits/src/ipc/distributed_hardware_proxy.cpp +++ b/interfaces/inner_kits/src/ipc/distributed_hardware_proxy.cpp @@ -37,7 +37,7 @@ const std::unordered_set DH_TYPE_SET { }; int32_t DistributedHardwareProxy::RegisterPublisherListener(const DHTopic topic, - const sptr &listener) + const sptr listener) { if (listener == nullptr) { DHLOGE("publisher listener is null"); @@ -86,7 +86,7 @@ int32_t DistributedHardwareProxy::RegisterPublisherListener(const DHTopic topic, } int32_t DistributedHardwareProxy::UnregisterPublisherListener(const DHTopic topic, - const sptr &listener) + const sptr listener) { if (listener == nullptr) { DHLOGE("publisher listener is null"); @@ -352,7 +352,7 @@ int32_t DistributedHardwareProxy::NotifyAVCenter(int32_t engineId, const AVTrans } int32_t DistributedHardwareProxy::RegisterCtlCenterCallback(int32_t engineId, - const sptr &callback) + const sptr callback) { sptr remote = Remote(); if (remote == nullptr) { diff --git a/interfaces/inner_kits/test/unittest/common/ipc/dhfwk_sa_manager/include/dhfwk_sa_manager_test.h b/interfaces/inner_kits/test/unittest/common/ipc/dhfwk_sa_manager/include/dhfwk_sa_manager_test.h index 64ae9291..15182bd6 100644 --- a/interfaces/inner_kits/test/unittest/common/ipc/dhfwk_sa_manager/include/dhfwk_sa_manager_test.h +++ b/interfaces/inner_kits/test/unittest/common/ipc/dhfwk_sa_manager/include/dhfwk_sa_manager_test.h @@ -43,14 +43,14 @@ sptr AsObject() return nullptr; } -int32_t RegisterPublisherListener(const DHTopic topic, const sptr &listener) +int32_t RegisterPublisherListener(const DHTopic topic, const sptr listener) { (void)topic; (void)listener; return DH_FWK_SUCCESS; } -int32_t UnregisterPublisherListener(const DHTopic topic, const sptr &listener) +int32_t UnregisterPublisherListener(const DHTopic topic, const sptr listener) { (void)topic; (void)listener; @@ -97,7 +97,7 @@ int32_t NotifyAVCenter(int32_t engineId, const AVTransEvent &event) return DH_FWK_SUCCESS; } -int32_t RegisterCtlCenterCallback(int32_t engineId, const sptr &callback) +int32_t RegisterCtlCenterCallback(int32_t engineId, const sptr callback) { (void)engineId; (void)callback; diff --git a/interfaces/inner_kits/test/unittest/common/ipc/dhfwk_sa_manager/src/dhfwk_sa_manager_test.cpp b/interfaces/inner_kits/test/unittest/common/ipc/dhfwk_sa_manager/src/dhfwk_sa_manager_test.cpp index 2a2c89e1..8b3a7a77 100644 --- a/interfaces/inner_kits/test/unittest/common/ipc/dhfwk_sa_manager/src/dhfwk_sa_manager_test.cpp +++ b/interfaces/inner_kits/test/unittest/common/ipc/dhfwk_sa_manager/src/dhfwk_sa_manager_test.cpp @@ -50,10 +50,10 @@ void DHFWKSaStateCallback(bool callback) */ HWTEST_F(DHFWKSAManagerTest, RegisterAbilityListener_001, TestSize.Level0) { - DHFWKSAManager::GetInstance().isSubscribeDHFWKSAChangeListener.store(false); + DHFWKSAManager::GetInstance().isSubscribeDHFWKSAChangeListener_.store(false); DHFWKSAManager::GetInstance().saListener_ = nullptr; DHFWKSAManager::GetInstance().RegisterAbilityListener(); - EXPECT_EQ(false, DHFWKSAManager::GetInstance().isSubscribeDHFWKSAChangeListener.load()); + EXPECT_EQ(false, DHFWKSAManager::GetInstance().isSubscribeDHFWKSAChangeListener_.load()); } /** @@ -64,9 +64,9 @@ HWTEST_F(DHFWKSAManagerTest, RegisterAbilityListener_001, TestSize.Level0) */ HWTEST_F(DHFWKSAManagerTest, RegisterAbilityListener_002, TestSize.Level0) { - DHFWKSAManager::GetInstance().isSubscribeDHFWKSAChangeListener.store(true); + DHFWKSAManager::GetInstance().isSubscribeDHFWKSAChangeListener_.store(true); DHFWKSAManager::GetInstance().RegisterAbilityListener(); - EXPECT_EQ(true, DHFWKSAManager::GetInstance().isSubscribeDHFWKSAChangeListener.load()); + EXPECT_EQ(true, DHFWKSAManager::GetInstance().isSubscribeDHFWKSAChangeListener_.load()); } /** @@ -77,7 +77,7 @@ HWTEST_F(DHFWKSAManagerTest, RegisterAbilityListener_002, TestSize.Level0) */ HWTEST_F(DHFWKSAManagerTest, GetDHFWKProxy_001, TestSize.Level0) { - DHFWKSAManager::GetInstance().isSubscribeDHFWKSAChangeListener.store(false); + DHFWKSAManager::GetInstance().isSubscribeDHFWKSAChangeListener_.store(false); DHFWKSAManager::GetInstance().dhfwkProxy_ = nullptr; DHFWKSAManager::GetInstance().GetDHFWKProxy(); EXPECT_EQ(nullptr, DHFWKSAManager::GetInstance().dhfwkProxy_); @@ -91,7 +91,7 @@ HWTEST_F(DHFWKSAManagerTest, GetDHFWKProxy_001, TestSize.Level0) */ HWTEST_F(DHFWKSAManagerTest, GetDHFWKProxy_002, TestSize.Level0) { - DHFWKSAManager::GetInstance().isSubscribeDHFWKSAChangeListener.store(true); + DHFWKSAManager::GetInstance().isSubscribeDHFWKSAChangeListener_.store(true); DHFWKSAManager::GetInstance().dhfwkProxy_ = sptr(new MockIDistributedHardware()); DHFWKSAManager::GetInstance().GetDHFWKProxy(); EXPECT_NE(nullptr, DHFWKSAManager::GetInstance().dhfwkProxy_); @@ -106,9 +106,9 @@ HWTEST_F(DHFWKSAManagerTest, GetDHFWKProxy_002, TestSize.Level0) HWTEST_F(DHFWKSAManagerTest, RegisterSAStateCallback_001, TestSize.Level0) { DHFWKSAStateCb callback; - DHFWKSAManager::GetInstance().isSubscribeDHFWKSAChangeListener.store(true); + DHFWKSAManager::GetInstance().isSubscribeDHFWKSAChangeListener_.store(true); DHFWKSAManager::GetInstance().RegisterSAStateCallback(callback); - EXPECT_EQ(true, DHFWKSAManager::GetInstance().isSubscribeDHFWKSAChangeListener.load()); + EXPECT_EQ(true, DHFWKSAManager::GetInstance().isSubscribeDHFWKSAChangeListener_.load()); } /** @@ -164,7 +164,7 @@ HWTEST_F(DHFWKSAManagerTest, OnAddSystemAbility_003, TestSize.Level0) } int32_t systemAbilityId = DISTRIBUTED_HARDWARE_SA_ID; std::string deviceId = "deviceId"; - DHFWKSAManager::GetInstance().saStateCallback = DHFWKSaStateCallback; + DHFWKSAManager::GetInstance().saStateCallback_ = DHFWKSaStateCallback; DHFWKSAManager::GetInstance().saListener_->OnAddSystemAbility(systemAbilityId, deviceId); EXPECT_NE(nullptr, DHFWKSAManager::GetInstance().saListener_); } @@ -222,7 +222,7 @@ HWTEST_F(DHFWKSAManagerTest, OnRemoveSystemAbility_003, TestSize.Level0) } int32_t systemAbilityId = DISTRIBUTED_HARDWARE_SA_ID; std::string deviceId = "deviceId"; - DHFWKSAManager::GetInstance().saStateCallback = DHFWKSaStateCallback; + DHFWKSAManager::GetInstance().saStateCallback_ = DHFWKSaStateCallback; DHFWKSAManager::GetInstance().saListener_->OnAddSystemAbility(systemAbilityId, deviceId); EXPECT_NE(nullptr, DHFWKSAManager::GetInstance().saListener_); } diff --git a/interfaces/inner_kits/test/unittest/common/ipc/distributed_hardware_proxy/include/distributed_hardware_proxy_test.h b/interfaces/inner_kits/test/unittest/common/ipc/distributed_hardware_proxy/include/distributed_hardware_proxy_test.h index 704ac0b6..a1f75ea9 100644 --- a/interfaces/inner_kits/test/unittest/common/ipc/distributed_hardware_proxy/include/distributed_hardware_proxy_test.h +++ b/interfaces/inner_kits/test/unittest/common/ipc/distributed_hardware_proxy/include/distributed_hardware_proxy_test.h @@ -44,14 +44,14 @@ public: return nullptr; } - int32_t RegisterPublisherListener(const DHTopic topic, const sptr &listener) + int32_t RegisterPublisherListener(const DHTopic topic, const sptr listener) { (void)topic; (void)listener; return DH_FWK_SUCCESS; } - int32_t UnregisterPublisherListener(const DHTopic topic, const sptr &listener) + int32_t UnregisterPublisherListener(const DHTopic topic, const sptr listener) { (void)topic; (void)listener; @@ -98,7 +98,7 @@ public: return DH_FWK_SUCCESS; } - int32_t RegisterCtlCenterCallback(int32_t engineId, const sptr &callback) + int32_t RegisterCtlCenterCallback(int32_t engineId, const sptr callback) { (void)engineId; (void)callback; diff --git a/services/distributedhardwarefwkservice/include/componentmanager/component_manager.h b/services/distributedhardwarefwkservice/include/componentmanager/component_manager.h index 09b9cfdb..9ac3cdff 100644 --- a/services/distributedhardwarefwkservice/include/componentmanager/component_manager.h +++ b/services/distributedhardwarefwkservice/include/componentmanager/component_manager.h @@ -79,7 +79,7 @@ public: class ComponentManagerEventHandler : public AppExecFwk::EventHandler { public: - ComponentManagerEventHandler(const std::shared_ptr &runner); + ComponentManagerEventHandler(const std::shared_ptr runner); ~ComponentManagerEventHandler() override = default; void ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event) override; }; @@ -130,9 +130,9 @@ private: void StopComponent(); void StopPrivacy(); int32_t GetEnableCapParam(const std::string &networkId, const std::string &uuid, DHType dhType, EnableParam ¶m, - std::shared_ptr &capability); + std::shared_ptr capability); int32_t GetEnableMetaParam(const std::string &networkId, const std::string &uuid, DHType dhType, EnableParam ¶m, - std::shared_ptr &metaCapPtr); + std::shared_ptr metaCapPtr); int32_t GetCapParam(const std::string &uuid, const std::string &dhId, std::shared_ptr &capability); int32_t GetMetaParam(const std::string &uuid, const std::string &dhId, std::shared_ptr &metaCapPtr); diff --git a/services/distributedhardwarefwkservice/include/componentmanager/component_privacy.h b/services/distributedhardwarefwkservice/include/componentmanager/component_privacy.h index 12b90d7c..09d33143 100644 --- a/services/distributedhardwarefwkservice/include/componentmanager/component_privacy.h +++ b/services/distributedhardwarefwkservice/include/componentmanager/component_privacy.h @@ -42,7 +42,7 @@ public: class ComponentEventHandler : public AppExecFwk::EventHandler { public: - explicit ComponentEventHandler(const std::shared_ptr &runner, + explicit ComponentEventHandler(const std::shared_ptr runner, ComponentPrivacy *comPrivacy); ~ComponentEventHandler() override; diff --git a/services/distributedhardwarefwkservice/include/distributed_hardware_service.h b/services/distributedhardwarefwkservice/include/distributed_hardware_service.h index 426c6bcd..cb6d7408 100644 --- a/services/distributedhardwarefwkservice/include/distributed_hardware_service.h +++ b/services/distributedhardwarefwkservice/include/distributed_hardware_service.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 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 @@ -37,8 +37,8 @@ DECLARE_SYSTEM_ABILITY(DistributedHardwareService); public: DistributedHardwareService(int32_t saId, bool runOnCreate); ~DistributedHardwareService() = default; - int32_t RegisterPublisherListener(const DHTopic topic, const sptr &listener) override; - int32_t UnregisterPublisherListener(const DHTopic topic, const sptr &listener) override; + int32_t RegisterPublisherListener(const DHTopic topic, const sptr listener) override; + int32_t UnregisterPublisherListener(const DHTopic topic, const sptr listener) override; int32_t PublishMessage(const DHTopic topic, const std::string &msg) override; std::string QueryLocalSysSpec(const QueryLocalSysSpecType spec) override; int Dump(int32_t fd, const std::vector& args) override; @@ -47,7 +47,7 @@ public: int32_t ReleaseAVCenter(int32_t engineId) override; int32_t CreateControlChannel(int32_t engineId, const std::string &peerDevId) override; int32_t NotifyAVCenter(int32_t engineId, const AVTransEvent &event) override; - int32_t RegisterCtlCenterCallback(int32_t engineId, const sptr &callback) override; + int32_t RegisterCtlCenterCallback(int32_t engineId, const sptr callback) override; int32_t NotifySourceRemoteSinkStarted(std::string &deviceId) override; int32_t PauseDistributedHardware(DHType dhType, const std::string &networkId) override; int32_t ResumeDistributedHardware(DHType dhType, const std::string &networkId) override; diff --git a/services/distributedhardwarefwkservice/include/ipc/publisher_listener_proxy.h b/services/distributedhardwarefwkservice/include/ipc/publisher_listener_proxy.h index 549b8f09..e84e4c55 100644 --- a/services/distributedhardwarefwkservice/include/ipc/publisher_listener_proxy.h +++ b/services/distributedhardwarefwkservice/include/ipc/publisher_listener_proxy.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 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 @@ -24,7 +24,7 @@ namespace OHOS { namespace DistributedHardware { class PublisherListenerProxy : public IRemoteProxy { public: - explicit PublisherListenerProxy(const sptr &object); + explicit PublisherListenerProxy(const sptr object); virtual ~PublisherListenerProxy() override; diff --git a/services/distributedhardwarefwkservice/include/publisher/publisher.h b/services/distributedhardwarefwkservice/include/publisher/publisher.h index a90e73ef..e7307c5b 100644 --- a/services/distributedhardwarefwkservice/include/publisher/publisher.h +++ b/services/distributedhardwarefwkservice/include/publisher/publisher.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 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 @@ -28,8 +28,8 @@ class Publisher { DECLARE_SINGLE_INSTANCE_BASE(Publisher); public: virtual ~Publisher(); - void RegisterListener(const DHTopic topic, const sptr &listener); - void UnregisterListener(const DHTopic topic, const sptr &listener); + void RegisterListener(const DHTopic topic, const sptr listener); + void UnregisterListener(const DHTopic topic, const sptr listener); void PublishMessage(const DHTopic topic, const std::string &message); private: Publisher(); diff --git a/services/distributedhardwarefwkservice/include/publisher/publisher_item.h b/services/distributedhardwarefwkservice/include/publisher/publisher_item.h index c63be2fe..6194d342 100644 --- a/services/distributedhardwarefwkservice/include/publisher/publisher_item.h +++ b/services/distributedhardwarefwkservice/include/publisher/publisher_item.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 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 @@ -32,8 +32,8 @@ public: PublisherItem(); explicit PublisherItem(DHTopic topic); virtual ~PublisherItem(); - void AddListener(const sptr &listener); - void RemoveListener(const sptr &listener); + void AddListener(const sptr listener); + void RemoveListener(const sptr listener); void PublishMessage(const std::string &message); private: DHTopic topic_; diff --git a/services/distributedhardwarefwkservice/include/resourcemanager/capability_info_manager.h b/services/distributedhardwarefwkservice/include/resourcemanager/capability_info_manager.h index ca9cec7a..6474dbae 100644 --- a/services/distributedhardwarefwkservice/include/resourcemanager/capability_info_manager.h +++ b/services/distributedhardwarefwkservice/include/resourcemanager/capability_info_manager.h @@ -59,7 +59,7 @@ public: /* Queries distributed hardware information based on filter criteria. */ std::map> QueryCapabilityByFilters( const std::map &filters); - bool IsCapabilityMatchFilter(const std::shared_ptr &cap, const CapabilityInfoFilter &filter, + bool IsCapabilityMatchFilter(const std::shared_ptr cap, const CapabilityInfoFilter &filter, const std::string &value); bool HasCapability(const std::string &deviceId, const std::string &dhId); void GetCapabilitiesByDeviceId(const std::string &deviceId, @@ -68,7 +68,7 @@ public: /* Queries capability information based on deviceId and dhId. */ int32_t GetCapability(const std::string &deviceId, const std::string &dhId, std::shared_ptr &capPtr); - int32_t GetDataByKey(const std::string &key, std::shared_ptr& capInfoPtr); + int32_t GetDataByKey(const std::string &key, std::shared_ptr &capInfoPtr); /* Query batch records by dhtype */ int32_t GetDataByDHType(const DHType dhType, CapabilityInfoMap &capabilityMap); /* Queries batch records in the database based on the prefix of the key. */ @@ -80,7 +80,7 @@ public: class CapabilityInfoManagerEventHandler : public AppExecFwk::EventHandler { public: - CapabilityInfoManagerEventHandler(const std::shared_ptr &runner, + CapabilityInfoManagerEventHandler(const std::shared_ptr runner, std::shared_ptr capabilityInfoMgrPtr); ~CapabilityInfoManagerEventHandler() override = default; void ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event) override; diff --git a/services/distributedhardwarefwkservice/include/resourcemanager/db_adapter.h b/services/distributedhardwarefwkservice/include/resourcemanager/db_adapter.h index 4f5aae43..bb731b01 100644 --- a/services/distributedhardwarefwkservice/include/resourcemanager/db_adapter.h +++ b/services/distributedhardwarefwkservice/include/resourcemanager/db_adapter.h @@ -36,7 +36,7 @@ class DBAdapter : public std::enable_shared_from_this, public DistributedKv::KvStoreDeathRecipient { public: DBAdapter(const std::string &appId, const std::string &storeId, - const std::shared_ptr &changeListener); + const std::shared_ptr changeListener); virtual ~DBAdapter(); // default init auto-sync kv store diff --git a/services/distributedhardwarefwkservice/include/resourcemanager/local_capability_info_manager.h b/services/distributedhardwarefwkservice/include/resourcemanager/local_capability_info_manager.h index 3cea4064..4dfd4e7b 100644 --- a/services/distributedhardwarefwkservice/include/resourcemanager/local_capability_info_manager.h +++ b/services/distributedhardwarefwkservice/include/resourcemanager/local_capability_info_manager.h @@ -52,7 +52,7 @@ public: /* Queries capability information based on deviceId and dhId. */ int32_t GetCapability(const std::string &deviceId, const std::string &dhId, std::shared_ptr &capPtr); - int32_t GetDataByKey(const std::string &key, std::shared_ptr& capInfoPtr); + int32_t GetDataByKey(const std::string &key, std::shared_ptr &capInfoPtr); /* Query batch records by dhtype */ int32_t GetDataByDHType(const DHType dhType, CapabilityInfoMap &capabilityMap); /* Queries batch records in the database based on the prefix of the key. */ diff --git a/services/distributedhardwarefwkservice/include/resourcemanager/meta_info_manager.h b/services/distributedhardwarefwkservice/include/resourcemanager/meta_info_manager.h index 322eee04..94ab3401 100644 --- a/services/distributedhardwarefwkservice/include/resourcemanager/meta_info_manager.h +++ b/services/distributedhardwarefwkservice/include/resourcemanager/meta_info_manager.h @@ -58,7 +58,7 @@ public: class MetaInfoManagerEventHandler : public AppExecFwk::EventHandler { public: - MetaInfoManagerEventHandler(const std::shared_ptr &runner, + MetaInfoManagerEventHandler(const std::shared_ptr runner, std::shared_ptr metaInfoMgrPtr); ~MetaInfoManagerEventHandler() override = default; void ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event) override; diff --git a/services/distributedhardwarefwkservice/include/resourcemanager/version_info_manager.h b/services/distributedhardwarefwkservice/include/resourcemanager/version_info_manager.h index 427d4bd4..509646d7 100644 --- a/services/distributedhardwarefwkservice/include/resourcemanager/version_info_manager.h +++ b/services/distributedhardwarefwkservice/include/resourcemanager/version_info_manager.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 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 @@ -55,7 +55,7 @@ public: void OnChange(const DistributedKv::ChangeNotification &changeNotification) override; class VersionInfoManagerEventHandler : public AppExecFwk::EventHandler { public: - VersionInfoManagerEventHandler(const std::shared_ptr &runner, + VersionInfoManagerEventHandler(const std::shared_ptr runner, std::shared_ptr versionInfoMgrPtr); ~VersionInfoManagerEventHandler() override = default; void ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event) override; diff --git a/services/distributedhardwarefwkservice/include/task/task_executor.h b/services/distributedhardwarefwkservice/include/task/task_executor.h index 08a07192..6fa1f650 100644 --- a/services/distributedhardwarefwkservice/include/task/task_executor.h +++ b/services/distributedhardwarefwkservice/include/task/task_executor.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 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 @@ -30,7 +30,7 @@ DECLARE_SINGLE_INSTANCE_BASE(TaskExecutor); public: explicit TaskExecutor(); ~TaskExecutor(); - void PushTask(const std::shared_ptr& task); + void PushTask(const std::shared_ptr task); private: std::shared_ptr PopTask(); diff --git a/services/distributedhardwarefwkservice/include/transport/dh_comm_tool.h b/services/distributedhardwarefwkservice/include/transport/dh_comm_tool.h index a6d87c0a..ecb07a0b 100644 --- a/services/distributedhardwarefwkservice/include/transport/dh_comm_tool.h +++ b/services/distributedhardwarefwkservice/include/transport/dh_comm_tool.h @@ -53,7 +53,7 @@ public: class DHCommToolEventHandler : public AppExecFwk::EventHandler { public: - DHCommToolEventHandler(const std::shared_ptr &runner, + DHCommToolEventHandler(const std::shared_ptr runner, std::shared_ptr dhCommToolPtr); ~DHCommToolEventHandler() override = default; void ProcessEvent(const AppExecFwk::InnerEvent::Pointer &event) override; diff --git a/services/distributedhardwarefwkservice/include/utils/dh_context.h b/services/distributedhardwarefwkservice/include/utils/dh_context.h index 73e0eefc..2df71119 100644 --- a/services/distributedhardwarefwkservice/include/utils/dh_context.h +++ b/services/distributedhardwarefwkservice/include/utils/dh_context.h @@ -90,7 +90,7 @@ public: class CommonEventHandler : public AppExecFwk::EventHandler { public: - CommonEventHandler(const std::shared_ptr &runner); + CommonEventHandler(const std::shared_ptr runner); ~CommonEventHandler() override = default; bool PostTask(const Callback &callback, const std::string &name = std::string(), int64_t delayTime = 0); diff --git a/services/distributedhardwarefwkservice/src/componentmanager/component_manager.cpp b/services/distributedhardwarefwkservice/src/componentmanager/component_manager.cpp index e40358f8..066896db 100644 --- a/services/distributedhardwarefwkservice/src/componentmanager/component_manager.cpp +++ b/services/distributedhardwarefwkservice/src/componentmanager/component_manager.cpp @@ -663,7 +663,7 @@ DHType ComponentManager::GetDHType(const std::string &uuid, const std::string &d } int32_t ComponentManager::GetEnableCapParam(const std::string &networkId, const std::string &uuid, - DHType dhType, EnableParam ¶m, std::shared_ptr &capability) + DHType dhType, EnableParam ¶m, std::shared_ptr capability) { if (!IsIdLengthValid(networkId) || !IsIdLengthValid(uuid)) { return ERR_DH_FWK_PARA_INVALID; @@ -712,7 +712,7 @@ int32_t ComponentManager::GetEnableCapParam(const std::string &networkId, const } int32_t ComponentManager::GetEnableMetaParam(const std::string &networkId, const std::string &uuid, - DHType dhType, EnableParam ¶m, std::shared_ptr &metaCapPtr) + DHType dhType, EnableParam ¶m, std::shared_ptr metaCapPtr) { if (!IsIdLengthValid(networkId) || !IsIdLengthValid(uuid)) { return ERR_DH_FWK_PARA_INVALID; @@ -1061,7 +1061,7 @@ bool ComponentManager::FetchNeedRefreshTask(const std::pair &runner) : AppExecFwk::EventHandler(runner) + const std::shared_ptr runner) : AppExecFwk::EventHandler(runner) { DHLOGI("Ctor ComponentManagerEventHandler"); } diff --git a/services/distributedhardwarefwkservice/src/componentmanager/component_privacy.cpp b/services/distributedhardwarefwkservice/src/componentmanager/component_privacy.cpp index 9fd91d1a..939f6293 100644 --- a/services/distributedhardwarefwkservice/src/componentmanager/component_privacy.cpp +++ b/services/distributedhardwarefwkservice/src/componentmanager/component_privacy.cpp @@ -284,7 +284,7 @@ void ComponentPrivacy::ComponentEventHandler::ProcessEvent(const AppExecFwk::Inn } ComponentPrivacy::ComponentEventHandler::ComponentEventHandler( - const std::shared_ptr &runner, ComponentPrivacy *comPrivacy) + const std::shared_ptr runner, ComponentPrivacy *comPrivacy) : AppExecFwk::EventHandler(runner) { comPrivacyObj_ = comPrivacy; diff --git a/services/distributedhardwarefwkservice/src/distributed_hardware_service.cpp b/services/distributedhardwarefwkservice/src/distributed_hardware_service.cpp index 7510e1bb..7c6c2466 100644 --- a/services/distributedhardwarefwkservice/src/distributed_hardware_service.cpp +++ b/services/distributedhardwarefwkservice/src/distributed_hardware_service.cpp @@ -159,14 +159,14 @@ void DistributedHardwareService::OnStop() } int32_t DistributedHardwareService::RegisterPublisherListener(const DHTopic topic, - const sptr &listener) + const sptr listener) { Publisher::GetInstance().RegisterListener(topic, listener); return DH_FWK_SUCCESS; } int32_t DistributedHardwareService::UnregisterPublisherListener(const DHTopic topic, - const sptr &listener) + const sptr listener) { Publisher::GetInstance().UnregisterListener(topic, listener); return DH_FWK_SUCCESS; @@ -268,7 +268,7 @@ int32_t DistributedHardwareService::NotifyAVCenter(int32_t engineId, const AVTra } int32_t DistributedHardwareService::RegisterCtlCenterCallback(int32_t engineId, - const sptr &callback) + const sptr callback) { return AVTransControlCenter::GetInstance().RegisterCtlCenterCallback(engineId, callback); } diff --git a/services/distributedhardwarefwkservice/src/ipc/publisher_listener_proxy.cpp b/services/distributedhardwarefwkservice/src/ipc/publisher_listener_proxy.cpp index 6901d123..fc281609 100644 --- a/services/distributedhardwarefwkservice/src/ipc/publisher_listener_proxy.cpp +++ b/services/distributedhardwarefwkservice/src/ipc/publisher_listener_proxy.cpp @@ -20,7 +20,7 @@ namespace OHOS { namespace DistributedHardware { -PublisherListenerProxy::PublisherListenerProxy(const sptr &object) +PublisherListenerProxy::PublisherListenerProxy(const sptr object) : IRemoteProxy(object) { } diff --git a/services/distributedhardwarefwkservice/src/publisher/publisher.cpp b/services/distributedhardwarefwkservice/src/publisher/publisher.cpp index 6ccff2d9..e5a9729e 100644 --- a/services/distributedhardwarefwkservice/src/publisher/publisher.cpp +++ b/services/distributedhardwarefwkservice/src/publisher/publisher.cpp @@ -36,12 +36,12 @@ Publisher::~Publisher() { } -void Publisher::RegisterListener(const DHTopic topic, const sptr &listener) +void Publisher::RegisterListener(const DHTopic topic, const sptr listener) { publisherItems_[topic]->AddListener(listener); } -void Publisher::UnregisterListener(const DHTopic topic, const sptr &listener) +void Publisher::UnregisterListener(const DHTopic topic, const sptr listener) { publisherItems_[topic]->RemoveListener(listener); } diff --git a/services/distributedhardwarefwkservice/src/publisher/publisher_item.cpp b/services/distributedhardwarefwkservice/src/publisher/publisher_item.cpp index 55de2a01..be5cdff6 100644 --- a/services/distributedhardwarefwkservice/src/publisher/publisher_item.cpp +++ b/services/distributedhardwarefwkservice/src/publisher/publisher_item.cpp @@ -37,7 +37,7 @@ PublisherItem::~PublisherItem() listeners_.clear(); } -void PublisherItem::AddListener(const sptr &listener) +void PublisherItem::AddListener(const sptr listener) { if (listener == nullptr) { DHLOGE("Add null publisher listener"); @@ -48,7 +48,7 @@ void PublisherItem::AddListener(const sptr &listener) listeners_.insert(listener); } -void PublisherItem::RemoveListener(const sptr &listener) +void PublisherItem::RemoveListener(const sptr listener) { if (listener == nullptr) { DHLOGE("Remove null publisher listener"); diff --git a/services/distributedhardwarefwkservice/src/resourcemanager/capability_info_manager.cpp b/services/distributedhardwarefwkservice/src/resourcemanager/capability_info_manager.cpp index 49b1805e..50ad1fbb 100644 --- a/services/distributedhardwarefwkservice/src/resourcemanager/capability_info_manager.cpp +++ b/services/distributedhardwarefwkservice/src/resourcemanager/capability_info_manager.cpp @@ -50,7 +50,7 @@ std::shared_ptr CapabilityInfoManager::GetInstance() } CapabilityInfoManager::CapabilityInfoManagerEventHandler::CapabilityInfoManagerEventHandler( - const std::shared_ptr &runner, + const std::shared_ptr runner, std::shared_ptr capabilityInfoMgrPtr) : AppExecFwk::EventHandler(runner) { @@ -495,7 +495,7 @@ void CapabilityInfoManager::HandleCapabilityDeleteChange(const std::vector &cap, +bool CapabilityInfoManager::IsCapabilityMatchFilter(const std::shared_ptr cap, const CapabilityInfoFilter &filter, const std::string &value) { if (cap == nullptr) { diff --git a/services/distributedhardwarefwkservice/src/resourcemanager/db_adapter.cpp b/services/distributedhardwarefwkservice/src/resourcemanager/db_adapter.cpp index bb5dd980..8743f00f 100644 --- a/services/distributedhardwarefwkservice/src/resourcemanager/db_adapter.cpp +++ b/services/distributedhardwarefwkservice/src/resourcemanager/db_adapter.cpp @@ -44,7 +44,7 @@ namespace { } DBAdapter::DBAdapter(const std::string &appId, const std::string &storeId, - const std::shared_ptr &changeListener) + const std::shared_ptr changeListener) { this->appId_.appId = appId; this->storeId_.storeId = storeId; diff --git a/services/distributedhardwarefwkservice/src/resourcemanager/meta_info_manager.cpp b/services/distributedhardwarefwkservice/src/resourcemanager/meta_info_manager.cpp index 5f3195b2..f4c6762e 100644 --- a/services/distributedhardwarefwkservice/src/resourcemanager/meta_info_manager.cpp +++ b/services/distributedhardwarefwkservice/src/resourcemanager/meta_info_manager.cpp @@ -50,7 +50,7 @@ std::shared_ptr MetaInfoManager::GetInstance() } MetaInfoManager::MetaInfoManagerEventHandler::MetaInfoManagerEventHandler( - const std::shared_ptr &runner, std::shared_ptr metaInfoMgrPtr) + const std::shared_ptr runner, std::shared_ptr metaInfoMgrPtr) : AppExecFwk::EventHandler(runner), metaInfoMgrWPtr_(metaInfoMgrPtr) { DHLOGI("Ctor MetaInfoManagerEventHandler"); diff --git a/services/distributedhardwarefwkservice/src/resourcemanager/version_info_manager.cpp b/services/distributedhardwarefwkservice/src/resourcemanager/version_info_manager.cpp index 77248e7e..ff9c6644 100644 --- a/services/distributedhardwarefwkservice/src/resourcemanager/version_info_manager.cpp +++ b/services/distributedhardwarefwkservice/src/resourcemanager/version_info_manager.cpp @@ -41,7 +41,7 @@ VersionInfoManager::~VersionInfoManager() } VersionInfoManager::VersionInfoManagerEventHandler::VersionInfoManagerEventHandler( - const std::shared_ptr &runner, std::shared_ptr versionInfoMgrPtr) + const std::shared_ptr runner, std::shared_ptr versionInfoMgrPtr) : AppExecFwk::EventHandler(runner) { DHLOGI("Ctor VersionInfoManagerEventHandler"); diff --git a/services/distributedhardwarefwkservice/src/task/task_executor.cpp b/services/distributedhardwarefwkservice/src/task/task_executor.cpp index 262cab78..9aa1fc16 100644 --- a/services/distributedhardwarefwkservice/src/task/task_executor.cpp +++ b/services/distributedhardwarefwkservice/src/task/task_executor.cpp @@ -41,7 +41,7 @@ TaskExecutor::~TaskExecutor() taskThreadFlag_ = false; } -void TaskExecutor::PushTask(const std::shared_ptr& task) +void TaskExecutor::PushTask(const std::shared_ptr task) { if (task == nullptr) { DHLOGE("Task is null"); diff --git a/services/distributedhardwarefwkservice/src/transport/dh_comm_tool.cpp b/services/distributedhardwarefwkservice/src/transport/dh_comm_tool.cpp index 6a9a980e..07cabce9 100644 --- a/services/distributedhardwarefwkservice/src/transport/dh_comm_tool.cpp +++ b/services/distributedhardwarefwkservice/src/transport/dh_comm_tool.cpp @@ -150,7 +150,7 @@ FullCapsRsp DHCommTool::ParseAndSaveRemoteDHCaps(const std::string &remoteCaps) return capsRsp; } -DHCommTool::DHCommToolEventHandler::DHCommToolEventHandler(const std::shared_ptr &runner, +DHCommTool::DHCommToolEventHandler::DHCommToolEventHandler(const std::shared_ptr runner, std::shared_ptr dhCommToolPtr) : AppExecFwk::EventHandler(runner), dhCommToolWPtr_(dhCommToolPtr) { DHLOGI("Ctor DHCommToolEventHandler"); diff --git a/services/distributedhardwarefwkservice/src/utils/dh_context.cpp b/services/distributedhardwarefwkservice/src/utils/dh_context.cpp index 72659c99..1c59d85b 100644 --- a/services/distributedhardwarefwkservice/src/utils/dh_context.cpp +++ b/services/distributedhardwarefwkservice/src/utils/dh_context.cpp @@ -81,7 +81,7 @@ void DHContext::SetIsSleeping(bool isSleeping) isSleeping_ = isSleeping; } -DHContext::CommonEventHandler::CommonEventHandler(const std::shared_ptr &runner) +DHContext::CommonEventHandler::CommonEventHandler(const std::shared_ptr runner) : AppExecFwk::EventHandler(runner) { DHLOGI("Ctor CommonEventHandler"); diff --git a/services/distributedhardwarefwkservice/test/unittest/common/distributedhardwarestub/include/distributed_hardware_stub_test.h b/services/distributedhardwarefwkservice/test/unittest/common/distributedhardwarestub/include/distributed_hardware_stub_test.h index 59b44d30..55e90c90 100644 --- a/services/distributedhardwarefwkservice/test/unittest/common/distributedhardwarestub/include/distributed_hardware_stub_test.h +++ b/services/distributedhardwarefwkservice/test/unittest/common/distributedhardwarestub/include/distributed_hardware_stub_test.h @@ -35,14 +35,14 @@ public: class MockDistributedHardwareStub : public DistributedHardwareStub { public: -int32_t RegisterPublisherListener(const DHTopic topic, const sptr &listener) +int32_t RegisterPublisherListener(const DHTopic topic, const sptr listener) { (void)topic; (void)listener; return DH_FWK_SUCCESS; } -int32_t UnregisterPublisherListener(const DHTopic topic, const sptr &listener) +int32_t UnregisterPublisherListener(const DHTopic topic, const sptr listener) { (void)topic; (void)listener; @@ -89,7 +89,7 @@ int32_t NotifyAVCenter(int32_t engineId, const AVTransEvent &event) return DH_FWK_SUCCESS; } -int32_t RegisterCtlCenterCallback(int32_t engineId, const sptr &callback) +int32_t RegisterCtlCenterCallback(int32_t engineId, const sptr callback) { (void)engineId; (void)callback; diff --git a/services/distributedhardwarefwkservice/test/unittest/common/versioninfomanager/versioninfomanager/include/version_info_manager_test.h b/services/distributedhardwarefwkservice/test/unittest/common/versioninfomanager/versioninfomanager/include/version_info_manager_test.h index b85e45ca..05710af1 100644 --- a/services/distributedhardwarefwkservice/test/unittest/common/versioninfomanager/versioninfomanager/include/version_info_manager_test.h +++ b/services/distributedhardwarefwkservice/test/unittest/common/versioninfomanager/versioninfomanager/include/version_info_manager_test.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 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 @@ -36,7 +36,7 @@ public: class MockDBAdapter : public DBAdapter { public: MockDBAdapter(const std::string &appId, const std::string &storeId, - const std::shared_ptr &changeListener) + const std::shared_ptr changeListener) : DBAdapter(appId, storeId, changeListener) {} int32_t RemoveCapabilityInfoByKey(const std::string &key) diff --git a/utils/include/histreamer_query_tool.h b/utils/include/histreamer_query_tool.h index dbbb1398..b87dca5a 100644 --- a/utils/include/histreamer_query_tool.h +++ b/utils/include/histreamer_query_tool.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 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 @@ -13,8 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#ifndef HISTREAMER_ABILITY_TOOL_H +#define HISTREAMER_ABILITY_TOOL_H + #include #include + #include "single_instance.h" namespace OHOS { namespace DistributedHardware { @@ -34,4 +39,5 @@ private: void Init(); }; } -} \ No newline at end of file +} +#endif \ No newline at end of file -- Gitee