resolve DTS2023121217154

Signed-off-by: l30054665 <lishang21@huawei.com>
This commit is contained in:
l30054665
2023-12-16 18:32:28 +08:00
parent 5ea2d5d3d5
commit 388412afc7
7 changed files with 63 additions and 12 deletions
+7 -1
View File
@@ -532,7 +532,6 @@ int32_t InputHub::OpenInputDeviceLocked(const std::string &devicePath)
int fd = OpenInputDeviceFdByPath(devicePath);
if (fd == UN_INIT_FD_VALUE) {
DHLOGE("The fd open failed, devicePath %s.", devicePath.c_str());
RecordSkipDevicePath(devicePath);
return ERR_DH_INPUT_HUB_OPEN_DEVICEPATH_FAIL;
}
@@ -1562,6 +1561,13 @@ void InputHub::ClearDeviceStates()
DInputState::GetInstance().ClearDeviceStates();
}
void InputHub::ClearSkipDevicePaths()
{
DHLOGI("Clear Skip device path");
std::lock_guard<std::mutex> lock(skipDevicePathsMutex_);
skipDevicePaths_.clear();
}
InputHub::Device::Device(int fd, const std::string &path)
: next(nullptr), fd(fd), path(path), identifier({}), classes(0), enabled(false),
isShare(false), isVirtual(fd < 0) {