diff --git a/common/utils/include/idistributed_hardware.h b/common/utils/include/idistributed_hardware.h index 090e700598a620bf97f563b06902cbb7ad6ce25c..f7390e53ddedeee9c1432880d110ad6dbb1869e3 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 e4d34565b4cfd0cd4967d7d01caa5c075aecc19e..c66ef9de77a982f295bc327bfd05d3a788833790 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 ecf215212a50c9b5a0d5a261cd53d0be377be7f3..831fafebe966b774f55d6339eac9cf5ae97509f8 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 17c324e1aaca4ea012025480020bc39501e4b801..c0533a7d1f4c67ad551bdaa6f5b9cd4184ae8755 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 40e6749c764248ba08bcd95fd1f81712a66d4e30..a37929a9053dcd29e792edbcd36aaaaeec453f24 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 b1e43ee23d324f212bd45006221f89de6fb37be4..78c24914b2e6a828d11102c4229c69c8538235af 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 0b1c3910dccf93907055a56563e9d1cdb1abd3d4..68135245616bb038084456ace1c3c153433e4f12 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 64ae929157d5dcacd8a4cfaf2428c61a6b01c44f..15182bd66a3bf678b4aa189d83b9f263ccf3de11 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 2a2c89e1d1cbac01bb655f617dca2b1b42ba2914..8b3a7a7711733adab4b01945e7d6bf415e36600d 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 704ac0b6dcf33fda950bbe06a0c5a43c5ee9b3db..a1f75ea9949d63eadf5833e957721e2f260f1a25 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 09b9cfdb6377f023c10b7261d2999a18fda815ae..9ac3cdffb80c5f61e5d0e079df1e0920f6e94c85 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 12b90d7c9fd3f980c1e0cd2a74edc867599420fa..09d331437a31f3abba55a7ccadfc96bcbc1f5096 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 426c6bcd77bb8b4f8b6b9e943b59300f1044797f..cb6d740846eb82f28c76d7528f020080dc3a6055 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 549b8f09a8ee20c83a32a7ae67791554bb3cf461..e84e4c5534d30a624e8260b4d1217c33ec97fab9 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 a90e73ef431c7523b0e1e981f329ddf1bc0c096a..e7307c5bfb6da46dbb465a8f6df1380c36b3d062 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 c63be2fe608f36b0625aef281ae54ae94e028b40..6194d342e4dd35f540cdf6060b0db1a3436147f6 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 ca9cec7a6c8cd2fa89d7a18c9900160f4efa6c20..6474dbae753341ad493c8e2e4c1a2548cc4a0fbf 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 4f5aae439c336d2eda1689d41b8ea64c6c45e3e6..bb731b01e4aac6d383b00491c9361b49329d180a 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 3cea4064093309a1215afe71921dbbb9c08ac609..4dfd4e7b682b3cdf0fe02f65705e320068ab5257 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 322eee04f5a56e89afc038d189ec8957ab30f3b1..94ab340193345b8205c582a4aaff9be113d5c69f 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 427d4bd48a28ea2c64d9f55ba81c2709d1cb45a0..509646d7e5d1e6f5c2d619635c45c24bee6872c2 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 08a0719264feb040d18b33b56575e940143139bf..6fa1f650d4864d92e9d0cf2393b3481342f603df 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 a6d87c0a4c7d43095fdb0c0e90f5ca4fcc549e0a..ecb07a0b3c3852c23a862160fc90960b10795db0 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 73e0eefc6663996797286886708b894a04690ded..2df711195163f6863e86dd07e7ef9711943b1b3f 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 e40358f86486326e6529e1ae05c31a05948339ca..066896dbb3080ecb453e21855fa8d6708e97c333 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 9fd91d1a4b0a04d9c1184d40cabea666b4dab967..939f6293948e5a2d07d38c41165fe425020e999c 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 7510e1bb7962ecc644fd60f4e0368a99765274fe..7c6c246697813cca09bd675a5c561c721f388a6f 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 6901d123000cc6c49a4fd21c9e3f3d584f5f4dc8..fc281609e99cd28a8e013f95ea7e7d274db84891 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 6ccff2d91b328d2f5d87f2027430c1ae805575cb..e5a9729e6ed546339c9af26c81ecf161d4614ede 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 55de2a0137968bf3c2cb88b0fed8e6a63b47e0f5..be5cdff66b9c215a534a04e65f2fbf34f4965229 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 49b1805e5e35b1ca8f0ffb10ad0617c58c7c94bf..50ad1fbb57a1c69cce9c5b02741be3a8598f3a69 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 bb5dd9800fd35f8600bc927d4adb1c8289e40b2d..8743f00f938d8e1d3d2e19daebd9a8374e652b76 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 5f3195b22b25014407b66e8f20919089225fbec5..f4c6762e2585aab1f5a45e28cf55808d3b3e3d0d 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 77248e7eb6271f243c36403ec2d72c5907288060..ff9c6644f0c635ba1c4a4fa99f6116158ef6fe06 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 262cab78004b3d2c6055454720fcdff1455840af..9aa1fc1639e5871fb17932403fa80c2d468061dd 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 6a9a980e3b4c30271e8250042fa26af5243f2611..07cabce942ee363aead2bb4abfab0df3cdc361c2 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 72659c990289f75022ff622f2de2cb6199062343..1c59d85b878a39ffcb14dcfd61b830f872a263fe 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 59b44d30ef94ae8be83fb5a202a8589fedf3c6fa..55e90c9087015b8cd221adca3f4bc3cecb6d8004 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 b85e45ca4abe78729842334545c5b82474c7da31..05710af1b3b82f92ad9644e91a791d94373a22cb 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 dbbb1398582a1a4fc817f69228de444a7599c6cc..b87dca5ac7a27e7047d4a55a9fb91a6076fe5548 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