modify unprepare can not stop all dhid

Signed-off-by: hwzhangchuang <zhangchuang.zhang@huawei.com>
This commit is contained in:
hwzhangchuang
2024-02-07 00:16:29 +08:00
parent dbd404361d
commit 8479e954f7
10 changed files with 48 additions and 29 deletions
+13
View File
@@ -1210,6 +1210,19 @@ AffectDhIds InputHub::SetSharingDevices(bool enabled, std::vector<std::string> d
return affDhIds;
}
std::vector<std::string> InputHub::GetSharingDevices()
{
std::vector<std::string> sharingDevices;
std::lock_guard<std::mutex> deviceLock(devicesMutex_);
for (const auto &[id, device] : devices_) {
if (device->isShare) {
DHLOGI("Find sharing dhid: %s", GetAnonyString(device->identifier.descriptor).c_str());
sharingDevices.push_back(device->identifier.descriptor);
}
}
return sharingDevices;
}
void InputHub::GetSharedMousePathByDhId(const std::vector<std::string> &dhIds, std::string &sharedMousePath,
std::string &sharedMouseDhId)
{