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..a5282bc86232dc51f3341a1d83c1adacd912f7ca 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 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 782e2dd5c0308a2a8eee2ac8e5c7d79748f54cc9..27f24f351e169931478d2ce24ee3305df440d242 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 a1abe8eb752b6a7d7c0c3c7ef79644d8af8dde6b..c862067e6fa421a54bd2c7e6c1435381311f8bab 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 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/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 cdb9e2b901e03d130febd5391fd6a16a1271a2f5..ade8648e1ba48b3b6abeaee28b92d4ae5f90f955 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 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..1d54fcf5d194c7973270ab19afd8c95a45f39aa7 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 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 24420a9dc7bea04c8f27e690eb8847e5b4be9a72..ec459c4bfce80400a7518170276b36be74ed9d7b 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 a7557c396acc2f575fbde45e6912189290a634a4..15cde43abf598af0f335597e94c9b8223d2c8607 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 825cbd62ad0bbfae0f6c93f7043ac77d4f8a0827..fec4d6904132f8012769fb3e37b1bc454a5f7eb9 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 b51c2d5b85b603d9392182ab959f8df4a2ca8921..accd64a5f2b6918d4e746d958a15a93836986956 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 1fe71e9c4abbf3e29af80bb82d5561477cb9f9e1..e8347a9dcc4c29b48897b5a86dca1a825b5235b4 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 53cedfd3e44bbf990a2f4439e1ccf234d563020e..211b8430672a196483707d81f2f5c520b5c268e4 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 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 ac7bace674e9fef73b2f0e572cee1800d3d9641a..8f85620d20016caf5bfd4f5f6b2189b539ca8e9a 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 3d546458a2c369bd825058a05d47f4333f3cfbd4..5019647cf84005f6da9a97e260ef0aedb0edfb11 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 525268eb97bb786d0e11a57cfb2ed28a74ca1782..b711014a133d0187291693162790a7f9538aaaf4 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 6e836376f618fd83bc1d4f3f6802cabcabe7d8a0..da697f00b4b37df82707919b6850371d4f274e4c 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 3f2bf503b2dc8057132b67a82b5964d5ec1c5747..7a34192ec60f86657bebfeed6fa6df569ea1d874 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 11fdf70a7863b72dcfd2bfc571c5a9c3487e4c9b..96f51a175d36652d6a2d41dbbcaac95cf7a54ecc 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 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 fd757809ff46b6221dc521ac409b53f4e78cda3c..8af0159cbcbe7c2ac04b5d515d0c28091ec19a9b 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 6b4cc38a62830c790f44fca8e01eb08d64835946..1cbe3ad2cb7c8e67a863f68c5693086dc8a549fd 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 cadc081bbec9c51770b5c5bbe225eecb057c96c3..3991fe55a48f051b8b33f32adbf88c43e96f184f 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 574e98429fc468404cf0868235df5347109906d9..06cf14b1cb0f51cb205bdd966c69849163c7a4d3 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 3fdc1fc26392952b190ebad93f11d508ad4ef0de..b46e64bde1815387dfcef4dae36352f45d6bc7ff 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 b26557e68803a4f1b2fb3c3e7a95adbdb2b2ad4d..d29a2583a46e03639b0444d254bee92b425e0f37 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 3998af7e699aa331e46eb742d73ded3c0d3266dd..b8d796c55926e71e024d2ef54fb7e335cb515910 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 4f0aba35c96e195485dfbf4cf75a0a681c4b700c..193f6976ad4e261eab3913aa507b5a47e6b716d9 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)