From 3d4999e0d0024e60e2526f1cb728f8118ca8515a Mon Sep 17 00:00:00 2001 From: li-tiangang4 Date: Wed, 31 Jul 2024 14:52:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=99=BA=E8=83=BD=E6=8C=87?= =?UTF-8?q?=E9=92=88=E4=BC=A0=E5=BC=95=E7=94=A8?= 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 ++++---- .../inner_kits/include/distributed_hardware_fwk_kit.h | 4 ++-- .../include/ipc/distributed_hardware_proxy.h | 10 +++++----- .../inner_kits/src/distributed_hardware_fwk_kit.cpp | 2 +- .../inner_kits/src/ipc/distributed_hardware_proxy.cpp | 6 +++--- .../dhfwk_sa_manager/include/dhfwk_sa_manager_test.h | 6 +++--- .../include/distributed_hardware_proxy_test.h | 6 +++--- .../include/componentmanager/component_manager.h | 10 +++++----- .../include/componentmanager/component_privacy.h | 2 +- .../include/distributed_hardware_service.h | 8 ++++---- .../include/ipc/publisher_listener_proxy.h | 2 +- .../include/publisher/publisher.h | 6 +++--- .../include/publisher/publisher_item.h | 6 +++--- .../include/resourcemanager/capability_info_manager.h | 8 ++++---- .../include/resourcemanager/capability_utils.h | 2 +- .../include/resourcemanager/db_adapter.h | 2 +- .../resourcemanager/local_capability_info_manager.h | 4 ++-- .../include/resourcemanager/meta_info_manager.h | 6 +++--- .../include/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 +- .../src/componentmanager/component_manager.cpp | 10 +++++----- .../src/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 ++-- .../src/resourcemanager/capability_info_manager.cpp | 8 ++++---- .../src/resourcemanager/db_adapter.cpp | 2 +- .../resourcemanager/local_capability_info_manager.cpp | 4 ++-- .../src/resourcemanager/meta_info_manager.cpp | 6 +++--- .../src/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 ++-- 38 files changed, 88 insertions(+), 88 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..a5282bc8 100644 --- a/interfaces/inner_kits/include/distributed_hardware_fwk_kit.h +++ b/interfaces/inner_kits/include/distributed_hardware_fwk_kit.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 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 @@ -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/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 782e2dd5..27f24f35 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/distributed_hardware_proxy.cpp b/interfaces/inner_kits/src/ipc/distributed_hardware_proxy.cpp index a1abe8eb..c862067e 100644 --- a/interfaces/inner_kits/src/ipc/distributed_hardware_proxy.cpp +++ b/interfaces/inner_kits/src/ipc/distributed_hardware_proxy.cpp @@ -36,7 +36,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"); @@ -85,7 +85,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/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 cdb9e2b9..ade8648e 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,12 +130,12 @@ 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); - int32_t GetCapParam(const std::string &uuid, const std::string &dhId, std::shared_ptr &capability); + 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); + std::shared_ptr metaCapPtr); private: std::map compSource_; 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..1d54fcf5 100644 --- a/services/distributedhardwarefwkservice/include/ipc/publisher_listener_proxy.h +++ b/services/distributedhardwarefwkservice/include/ipc/publisher_listener_proxy.h @@ -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 24420a9d..ec459c4b 100644 --- a/services/distributedhardwarefwkservice/include/resourcemanager/capability_info_manager.h +++ b/services/distributedhardwarefwkservice/include/resourcemanager/capability_info_manager.h @@ -58,7 +58,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, @@ -66,8 +66,8 @@ 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); + std::shared_ptr capPtr); + 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. */ @@ -79,7 +79,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/capability_utils.h b/services/distributedhardwarefwkservice/include/resourcemanager/capability_utils.h index a7557c39..15cde43a 100644 --- a/services/distributedhardwarefwkservice/include/resourcemanager/capability_utils.h +++ b/services/distributedhardwarefwkservice/include/resourcemanager/capability_utils.h @@ -39,7 +39,7 @@ enum class CapabilityInfoFilter : uint32_t { }; template -int32_t GetCapabilityByValue(const std::string &value, std::shared_ptr &capPtr) +int32_t GetCapabilityByValue(const std::string &value, std::shared_ptr capPtr) { if (capPtr == nullptr) { capPtr = std::make_shared(); diff --git a/services/distributedhardwarefwkservice/include/resourcemanager/db_adapter.h b/services/distributedhardwarefwkservice/include/resourcemanager/db_adapter.h index 825cbd62..fec4d690 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 b51c2d5b..accd64a5 100644 --- a/services/distributedhardwarefwkservice/include/resourcemanager/local_capability_info_manager.h +++ b/services/distributedhardwarefwkservice/include/resourcemanager/local_capability_info_manager.h @@ -50,8 +50,8 @@ public: std::vector> &resInfos); /* 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); + std::shared_ptr capPtr); + 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 1fe71e9c..e8347a9d 100644 --- a/services/distributedhardwarefwkservice/include/resourcemanager/meta_info_manager.h +++ b/services/distributedhardwarefwkservice/include/resourcemanager/meta_info_manager.h @@ -45,7 +45,7 @@ public: int32_t GetDataByKeyPrefix(const std::string &keyPrefix, MetaCapInfoMap &metaCapMap); int32_t RemoveMetaInfoByKey(const std::string &key); int32_t GetMetaCapInfo(const std::string &udidHash, const std::string &dhId, - std::shared_ptr &metaCapPtr); + std::shared_ptr metaCapPtr); void GetMetaCapInfosByUdidHash(const std::string &udidHash, std::vector> &metaCapInfos); /* Database data changes callback */ @@ -55,7 +55,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; @@ -66,7 +66,7 @@ public: private: MetaInfoManager(); - int32_t GetMetaCapByValue(const std::string &value, std::shared_ptr &metaCapPtr); + int32_t GetMetaCapByValue(const std::string &value, std::shared_ptr metaCapPtr); void HandleMetaCapabilityAddChange(const std::vector &insertRecords); void HandleMetaCapabilityUpdateChange(const std::vector &updateRecords); void HandleMetaCapabilityDeleteChange(const std::vector &deleteRecords); diff --git a/services/distributedhardwarefwkservice/include/resourcemanager/version_info_manager.h b/services/distributedhardwarefwkservice/include/resourcemanager/version_info_manager.h index 53cedfd3..211b8430 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 @@ -54,7 +54,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 ac7bace6..8f85620d 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 3d546458..5019647c 100644 --- a/services/distributedhardwarefwkservice/include/utils/dh_context.h +++ b/services/distributedhardwarefwkservice/include/utils/dh_context.h @@ -89,7 +89,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 525268eb..b711014a 100644 --- a/services/distributedhardwarefwkservice/src/componentmanager/component_manager.cpp +++ b/services/distributedhardwarefwkservice/src/componentmanager/component_manager.cpp @@ -634,7 +634,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) { DeviceInfo sourceDeviceInfo = GetLocalDeviceInfo(); std::vector> sourceCapInfos; @@ -680,7 +680,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) { DeviceInfo sourceDeviceInfo = GetLocalDeviceInfo(); std::vector> sourceMetaInfos; @@ -712,7 +712,7 @@ int32_t ComponentManager::GetEnableMetaParam(const std::string &networkId, const } int32_t ComponentManager::GetCapParam(const std::string &uuid, const std::string &dhId, - std::shared_ptr &capability) + std::shared_ptr capability) { std::string deviceId = GetDeviceIdByUUID(uuid); auto ret = CapabilityInfoManager::GetInstance()->GetCapability(deviceId, dhId, capability); @@ -733,7 +733,7 @@ int32_t ComponentManager::GetCapParam(const std::string &uuid, const std::string } int32_t ComponentManager::GetMetaParam(const std::string &uuid, const std::string &dhId, - std::shared_ptr &metaCapPtr) + std::shared_ptr metaCapPtr) { auto ret = MetaInfoManager::GetInstance()->GetMetaCapInfo(DHContext::GetInstance().GetUdidHashIdByUUID(uuid), dhId, metaCapPtr); @@ -993,7 +993,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 6e836376..da697f00 100644 --- a/services/distributedhardwarefwkservice/src/componentmanager/component_privacy.cpp +++ b/services/distributedhardwarefwkservice/src/componentmanager/component_privacy.cpp @@ -268,7 +268,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 3f2bf503..7a34192e 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 11fdf70a..96f51a17 100644 --- a/services/distributedhardwarefwkservice/src/ipc/publisher_listener_proxy.cpp +++ b/services/distributedhardwarefwkservice/src/ipc/publisher_listener_proxy.cpp @@ -19,7 +19,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 fd757809..8af0159c 100644 --- a/services/distributedhardwarefwkservice/src/publisher/publisher_item.cpp +++ b/services/distributedhardwarefwkservice/src/publisher/publisher_item.cpp @@ -35,7 +35,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"); @@ -46,7 +46,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 6b4cc38a..1cbe3ad2 100644 --- a/services/distributedhardwarefwkservice/src/resourcemanager/capability_info_manager.cpp +++ b/services/distributedhardwarefwkservice/src/resourcemanager/capability_info_manager.cpp @@ -54,7 +54,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) { @@ -487,7 +487,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) { @@ -553,7 +553,7 @@ bool CapabilityInfoManager::HasCapability(const std::string &deviceId, const std } int32_t CapabilityInfoManager::GetCapability(const std::string &deviceId, const std::string &dhId, - std::shared_ptr &capPtr) + std::shared_ptr capPtr) { std::lock_guard lock(capInfoMgrMutex_); std::string key = GetCapabilityKey(deviceId, dhId); @@ -565,7 +565,7 @@ int32_t CapabilityInfoManager::GetCapability(const std::string &deviceId, const return DH_FWK_SUCCESS; } -int32_t CapabilityInfoManager::GetDataByKey(const std::string &key, std::shared_ptr &capInfoPtr) +int32_t CapabilityInfoManager::GetDataByKey(const std::string &key, std::shared_ptr capInfoPtr) { std::lock_guard lock(capInfoMgrMutex_); if (dbAdapterPtr_ == nullptr) { diff --git a/services/distributedhardwarefwkservice/src/resourcemanager/db_adapter.cpp b/services/distributedhardwarefwkservice/src/resourcemanager/db_adapter.cpp index cadc081b..3991fe55 100644 --- a/services/distributedhardwarefwkservice/src/resourcemanager/db_adapter.cpp +++ b/services/distributedhardwarefwkservice/src/resourcemanager/db_adapter.cpp @@ -43,7 +43,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/local_capability_info_manager.cpp b/services/distributedhardwarefwkservice/src/resourcemanager/local_capability_info_manager.cpp index 574e9842..06cf14b1 100644 --- a/services/distributedhardwarefwkservice/src/resourcemanager/local_capability_info_manager.cpp +++ b/services/distributedhardwarefwkservice/src/resourcemanager/local_capability_info_manager.cpp @@ -175,7 +175,7 @@ void LocalCapabilityInfoManager::GetCapabilitiesByDeviceId(const std::string &de } int32_t LocalCapabilityInfoManager::GetCapability(const std::string &deviceId, const std::string &dhId, - std::shared_ptr &capPtr) + std::shared_ptr capPtr) { std::lock_guard lock(capInfoMgrMutex_); std::string key = GetCapabilityKey(deviceId, dhId); @@ -187,7 +187,7 @@ int32_t LocalCapabilityInfoManager::GetCapability(const std::string &deviceId, c return DH_FWK_SUCCESS; } -int32_t LocalCapabilityInfoManager::GetDataByKey(const std::string &key, std::shared_ptr &capInfoPtr) +int32_t LocalCapabilityInfoManager::GetDataByKey(const std::string &key, std::shared_ptr capInfoPtr) { std::lock_guard lock(capInfoMgrMutex_); if (dbAdapterPtr_ == nullptr) { diff --git a/services/distributedhardwarefwkservice/src/resourcemanager/meta_info_manager.cpp b/services/distributedhardwarefwkservice/src/resourcemanager/meta_info_manager.cpp index 3fdc1fc2..b46e64bd 100644 --- a/services/distributedhardwarefwkservice/src/resourcemanager/meta_info_manager.cpp +++ b/services/distributedhardwarefwkservice/src/resourcemanager/meta_info_manager.cpp @@ -54,7 +54,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"); @@ -268,7 +268,7 @@ int32_t MetaInfoManager::RemoveMetaInfoByKey(const std::string &key) } int32_t MetaInfoManager::GetMetaCapInfo(const std::string &udidHash, - const std::string &dhId, std::shared_ptr &metaCapPtr) + const std::string &dhId, std::shared_ptr metaCapPtr) { std::lock_guard lock(metaInfoMgrMutex_); std::string key = GetCapabilityKey(udidHash, dhId); @@ -291,7 +291,7 @@ void MetaInfoManager::GetMetaCapInfosByUdidHash(const std::string &udidHash, } } -int32_t MetaInfoManager::GetMetaCapByValue(const std::string &value, std::shared_ptr &metaCapPtr) +int32_t MetaInfoManager::GetMetaCapByValue(const std::string &value, std::shared_ptr metaCapPtr) { if (metaCapPtr == nullptr) { metaCapPtr = std::make_shared(); diff --git a/services/distributedhardwarefwkservice/src/resourcemanager/version_info_manager.cpp b/services/distributedhardwarefwkservice/src/resourcemanager/version_info_manager.cpp index b26557e6..d29a2583 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 3998af7e..b8d796c5 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 4f0aba35..193f6976 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) -- Gitee