diff --git a/services/distributedfiledaemon/include/network/devsl_dispatcher.h b/services/distributedfiledaemon/include/network/devsl_dispatcher.h index d01d6bf5374536ea4692b2fe5c330230a970c7fc..42b343af50e4df38d4e46dad973030306c0ed0dd 100644 --- a/services/distributedfiledaemon/include/network/devsl_dispatcher.h +++ b/services/distributedfiledaemon/include/network/devsl_dispatcher.h @@ -43,11 +43,11 @@ public: static void DevslGottonCallback(DEVSLQueryParams *queryParams, int32_t result, uint32_t levelInfo); static uint32_t DevslGetRegister(const std::string &cid, std::weak_ptr); static bool CompareDevslWithLocal(const std::string &peerNetworkId, const std::vector &paths); + static int32_t GetDeviceDevsl(const std::string &networkId); private: static DEVSLQueryParams MakeDevslQueryParams(const std::string &cid); static void DevslGottonCallbackAsync(const std::string udid, uint32_t devsl); - static int32_t GetDeviceDevsl(const std::string &networkId); static int32_t GetSecurityLabel(const std::string &path); static std::map>> talkersMap_; static std::map idMap_; diff --git a/services/distributedfiledaemon/src/ipc/daemon.cpp b/services/distributedfiledaemon/src/ipc/daemon.cpp index 333ee17fcbb761405fc84a09c3bb1742a573bacd..6dc310f055b6fea9d2f628b064cef7bd72dbdc1a 100644 --- a/services/distributedfiledaemon/src/ipc/daemon.cpp +++ b/services/distributedfiledaemon/src/ipc/daemon.cpp @@ -50,6 +50,7 @@ #include "network/softbus/softbus_session_dispatcher.h" #include "network/softbus/softbus_session_listener.h" #include "network/softbus/softbus_session_pool.h" +#include "network/devsl_dispatcher.h" #include "remote_file_share.h" #include "sandbox_helper.h" #include "system_ability_definition.h" @@ -237,6 +238,7 @@ int32_t Daemon::ConnectionCount(const DistributedHardware::DmDeviceInfo &deviceI int32_t ret = 0; if (!ConnectCount::GetInstance()->CheckCount(networkId)) { ret = DeviceManagerAgent::GetInstance()->OnDeviceP2POnline(deviceInfo); + DevslDispatcher::GetDeviceDevsl(networkId); if (ret == NO_ERROR) { ret = ConnectionDetector::RepeatGetConnectionStatus(targetDir, networkId); } diff --git a/services/distributedfiledaemon/src/network/kernel_talker.cpp b/services/distributedfiledaemon/src/network/kernel_talker.cpp index 57381becd042232ee0f630165859af69144806e2..b6c44313f955a80f8baf4b4e04ae778acbd44899 100644 --- a/services/distributedfiledaemon/src/network/kernel_talker.cpp +++ b/services/distributedfiledaemon/src/network/kernel_talker.cpp @@ -98,8 +98,8 @@ void KernelTalker::SinkSessionTokernel(shared_ptr session, const st return; } SetCmd(cmd); - - DevslDispatcher::DevslGetRegister(cid, shared_from_this()); + int32_t remoteDevsl = DevslDispatcher::GetDeviceDevsl(cid); + SinkDevslTokernel(cid, remoteDevsl); } void KernelTalker::SinkDevslTokernel(const std::string &cid, uint32_t devsl)