From 43e561436d924f195625ad09124ed1ae5fbf2fef Mon Sep 17 00:00:00 2001 From: Jin1K <1061208093@qq.com> Date: Mon, 26 May 2025 15:05:17 +0800 Subject: [PATCH] bind to lambda Signed-off-by: Jin1K <1061208093@qq.com> Change-Id: If06696a0ff1c354f2f3094231a0547edab9f089b --- .../service/data_share/data_share_service_impl.cpp | 5 +++-- .../service/data_share/data_share_service_impl.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/services/distributeddataservice/service/data_share/data_share_service_impl.cpp b/services/distributeddataservice/service/data_share/data_share_service_impl.cpp index 99bff919b..076bdd96d 100644 --- a/services/distributeddataservice/service/data_share/data_share_service_impl.cpp +++ b/services/distributeddataservice/service/data_share/data_share_service_impl.cpp @@ -879,8 +879,9 @@ void DataShareServiceImpl::RegisterDataShareServiceInfo() void DataShareServiceImpl::RegisterHandler() { - Handler handler = - std::bind(&DataShareServiceImpl::DumpDataShareServiceInfo, this, std::placeholders::_1, std::placeholders::_2); + Handler handler = [] (int fd, std::map> ¶ms) { + DumpDataShareServiceInfo(fd, params); + }; DumpManager::GetInstance().AddHandler("FEATURE_INFO", uintptr_t(this), handler); } diff --git a/services/distributeddataservice/service/data_share/data_share_service_impl.h b/services/distributeddataservice/service/data_share/data_share_service_impl.h index 3baf32251..8cc9ca889 100644 --- a/services/distributeddataservice/service/data_share/data_share_service_impl.h +++ b/services/distributeddataservice/service/data_share/data_share_service_impl.h @@ -79,7 +79,7 @@ public: int32_t OnAppUpdate(const std::string &bundleName, int32_t user, int32_t index) override; int32_t OnUserChange(uint32_t code, const std::string &user, const std::string &account) override; void NotifyObserver(const std::string &uri) override; - void DumpDataShareServiceInfo(int fd, std::map> ¶ms); + static void DumpDataShareServiceInfo(int fd, std::map> ¶ms); int32_t OnInitialize() override; int32_t EnableSilentProxy(const std::string &uri, bool enable) override; int32_t GetSilentProxyStatus(const std::string &uri, bool isCreateHelper) override; @@ -118,7 +118,7 @@ private: void RegisterDataShareServiceInfo(); void RegisterHandler(); bool SubscribeTimeChanged(); - bool NotifyChange(const std::string &uri, int32_t userId); + bool NotifyChange(const std::string &uri, int32_t userId); bool GetCallerBundleName(std::string &bundleName); std::pair ExecuteEx(const std::string &uri, const std::string &extUri, const int32_t tokenId, bool isRead, ExecuteCallbackEx callback); -- Gitee