From f855936bd6af90f8abced528c3bdaec89375cd09 Mon Sep 17 00:00:00 2001 From: hwzhangchuang Date: Sat, 2 Dec 2023 10:41:44 +0800 Subject: [PATCH] add Signed-off-by: hwzhangchuang --- .../inputinject/include/distributed_input_node_manager.h | 4 ++-- .../inputinject/src/distributed_input_node_manager.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/services/source/inputinject/include/distributed_input_node_manager.h b/services/source/inputinject/include/distributed_input_node_manager.h index 3c733a6..defc5bb 100644 --- a/services/source/inputinject/include/distributed_input_node_manager.h +++ b/services/source/inputinject/include/distributed_input_node_manager.h @@ -57,9 +57,9 @@ public: int32_t OpenDevicesNode(const std::string &devId, const std::string &dhId, const std::string ¶meters); - int32_t GetDevice(const std::string &networkId, const std::string &dhId, VirtualDevice *&device); + int32_t GetDevice(const std::string &devId, const std::string &dhId, VirtualDevice *&device); void ReportEvent(const std::string &devId, const std::vector &events); - int32_t CloseDeviceLocked(const std::string &networkId, const std::string &dhId); + int32_t CloseDeviceLocked(const std::string &devId, const std::string &dhId); void StartInjectThread(); void StopInjectThread(); int32_t CreateVirtualTouchScreenNode(const std::string &devId, const std::string &dhId, const uint64_t srcWinId, diff --git a/services/source/inputinject/src/distributed_input_node_manager.cpp b/services/source/inputinject/src/distributed_input_node_manager.cpp index 520eebc..53e638d 100644 --- a/services/source/inputinject/src/distributed_input_node_manager.cpp +++ b/services/source/inputinject/src/distributed_input_node_manager.cpp @@ -402,12 +402,12 @@ void DistributedInputNodeManager::AddDeviceLocked(const std::string &networkId, } } -int32_t DistributedInputNodeManager::CloseDeviceLocked(const std::string &networkId, const std::string &dhId) +int32_t DistributedInputNodeManager::CloseDeviceLocked(const std::string &devId, const std::string &dhId) { DHLOGI("CloseDeviceLocked called, deviceId=%s, dhId=%s", GetAnonyString(networkId).c_str(), GetAnonyString(dhId).c_str()); std::lock_guard lock(virtualDeviceMapMutex_); - DhUniqueID dhUniqueId = {networkId, dhId}; + DhUniqueID dhUniqueId = {devId, dhId}; std::map>::iterator iter = virtualDeviceMap_.find(dhUniqueId); if (iter != virtualDeviceMap_.end()) { DHLOGI("CloseDeviceLocked called success, deviceId=%s, dhId=%s", @@ -420,11 +420,11 @@ int32_t DistributedInputNodeManager::CloseDeviceLocked(const std::string &networ return ERR_DH_INPUT_SERVER_SOURCE_CLOSE_DEVICE_FAIL; } -int32_t DistributedInputNodeManager::GetDevice(const std::string &networkId, const std::string &dhId, +int32_t DistributedInputNodeManager::GetDevice(const std::string &devId, const std::string &dhId, VirtualDevice *&device) { std::lock_guard lock(virtualDeviceMapMutex_); - auto iter = virtualDeviceMap_.find({ networkId, dhId }); + auto iter = virtualDeviceMap_.find({ devId, dhId }); if (iter != virtualDeviceMap_.end()) { device = iter->second.get(); return DH_SUCCESS;