From 481f1baf68c34a0158af71a68f634ddcc2415afa Mon Sep 17 00:00:00 2001 From: hwzhangchuang Date: Mon, 11 Dec 2023 14:26:46 +0800 Subject: [PATCH 1/4] remove debug log that too much Signed-off-by: hwzhangchuang --- common/include/input_hub.cpp | 4 ---- utils/src/dinput_utils_tool.cpp | 1 - 2 files changed, 5 deletions(-) diff --git a/common/include/input_hub.cpp b/common/include/input_hub.cpp index 141c761..46a456a 100644 --- a/common/include/input_hub.cpp +++ b/common/include/input_hub.cpp @@ -107,7 +107,6 @@ bool InputHub::IsInputNodeNoNeedScan(const std::string &path) } if (path.find(MOUSE_NODE_KEY) != std::string::npos) { - DHLOGD("Skip mouse node for no permission, path: %s", path.c_str()); return true; } @@ -116,7 +115,6 @@ bool InputHub::IsInputNodeNoNeedScan(const std::string &path) void InputHub::ScanAndRecordInputDevices() { - DHLOGD("Scan local input devices."); ScanInputDevices(DEVICE_PATH); { @@ -506,12 +504,10 @@ std::vector InputHub::GetAllInputDevices() void InputHub::ScanInputDevices(const std::string &dirName) { - DHLOGD("ScanInputDevices enter, dirName %s.", dirName.c_str()); std::vector inputDevPaths; ScanInputDevicesPath(dirName, inputDevPaths); for (const auto &tempPath: inputDevPaths) { if (IsInputNodeNoNeedScan(tempPath)) { - DHLOGD("This input node path should skip. Path: %s", tempPath.c_str()); continue; } OpenInputDeviceLocked(tempPath); diff --git a/utils/src/dinput_utils_tool.cpp b/utils/src/dinput_utils_tool.cpp index ecd2273..167a59d 100644 --- a/utils/src/dinput_utils_tool.cpp +++ b/utils/src/dinput_utils_tool.cpp @@ -351,7 +351,6 @@ void ScanInputDevicesPath(const std::string &dirName, std::vector & continue; } std::string tmpDevName = dirName + "/" + std::string(de->d_name); - DHLOGD("Find input node path: %s", tmpDevName.c_str()); vecInputDevPath.push_back(tmpDevName); } closedir(dir); -- Gitee From 336a31040d48b769a81dd21b5387122f2ac55479 Mon Sep 17 00:00:00 2001 From: hwzhangchuang Date: Mon, 11 Dec 2023 14:56:34 +0800 Subject: [PATCH 2/4] add Signed-off-by: hwzhangchuang --- common/include/input_hub.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/common/include/input_hub.cpp b/common/include/input_hub.cpp index 46a456a..0b8a662 100644 --- a/common/include/input_hub.cpp +++ b/common/include/input_hub.cpp @@ -730,7 +730,6 @@ void InputHub::GetEventTypes(struct libevdev *dev, InputDevice &identifier) DHLOGD("The device is not support eventType: %d", eventType); continue; } - DHLOGI("QueryInputDeviceInfo eventType: %d", eventType); identifier.eventTypes.push_back(eventType); } } @@ -746,7 +745,6 @@ int32_t InputHub::GetEventKeys(struct libevdev *dev, InputDevice &identifier) DHLOGD("The device is not support eventKey: %d", eventKey); continue; } - DHLOGD("QueryInputDeviceInfo eventKey: %d", eventKey); identifier.eventKeys.push_back(eventKey); } return DH_SUCCESS; @@ -758,22 +756,18 @@ int32_t InputHub::GetABSInfo(struct libevdev *dev, InputDevice &identifier) DHLOGE("The device doesn't has EV_ABS type!"); return ERR_DH_INPUT_HUB_QUERY_INPUT_DEVICE_INFO_FAIL; } - DHLOGI("The device has abs info, devName: %s, dhId: %s!", identifier.name.c_str(), - GetAnonyString(identifier.descriptor).c_str()); + DHLOGI("The device has abs info, devName: %s, dhId: %s!", identifier.name.c_str(), dentifier.descriptor); for (uint32_t absType = 0; absType < ABS_CNT; absType++) { if (!libevdev_has_event_code(dev, EV_ABS, absType)) { DHLOGD("The device is not support absType: %d", absType); continue; } - DHLOGI("QueryInputDeviceInfo abs type: %d", absType); identifier.absTypes.push_back(absType); const struct input_absinfo *abs = libevdev_get_abs_info(dev, absType); if (abs == nullptr) { DHLOGE("absInfo is nullptr!"); continue; } - DHLOGI("QueryInputDeviceInfo abs info value: %d, min: %d, max: %d, fuzz: %d, flat: %d, res: %d", abs->value, - abs->minimum, abs->maximum, abs->fuzz, abs->flat, abs->resolution); identifier.absInfos[absType].push_back(abs->value); identifier.absInfos[absType].push_back(abs->minimum); identifier.absInfos[absType].push_back(abs->maximum); @@ -792,10 +786,9 @@ int32_t InputHub::GetRELTypes(struct libevdev *dev, InputDevice &identifier) } for (uint32_t code = 0; code < REL_CNT; code++) { if (!libevdev_has_event_code(dev, EV_REL, code)) { - DHLOGD("The device is not support eventCode: %d", code); + DHLOGD("The device is not support rel code: %d", code); continue; } - DHLOGI("QueryInputDeviceInfo rel types: %d", code); identifier.relTypes.push_back(code); } return DH_SUCCESS; -- Gitee From 9af1ca86a5d2e192b7c7e6eb102a4c1273cacde5 Mon Sep 17 00:00:00 2001 From: hwzhangchuang Date: Mon, 11 Dec 2023 14:57:19 +0800 Subject: [PATCH 3/4] add Signed-off-by: hwzhangchuang --- common/include/input_hub.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/include/input_hub.cpp b/common/include/input_hub.cpp index 0b8a662..2d853eb 100644 --- a/common/include/input_hub.cpp +++ b/common/include/input_hub.cpp @@ -756,7 +756,7 @@ int32_t InputHub::GetABSInfo(struct libevdev *dev, InputDevice &identifier) DHLOGE("The device doesn't has EV_ABS type!"); return ERR_DH_INPUT_HUB_QUERY_INPUT_DEVICE_INFO_FAIL; } - DHLOGI("The device has abs info, devName: %s, dhId: %s!", identifier.name.c_str(), dentifier.descriptor); + DHLOGI("The device has abs info, devName: %s, dhId: %s!", identifier.name.c_str(), dentifier.descriptor.c_str()); for (uint32_t absType = 0; absType < ABS_CNT; absType++) { if (!libevdev_has_event_code(dev, EV_ABS, absType)) { DHLOGD("The device is not support absType: %d", absType); -- Gitee From 0b0bd36b351d9b549808446bc22441c403199cc5 Mon Sep 17 00:00:00 2001 From: hwzhangchuang Date: Mon, 11 Dec 2023 16:15:58 +0800 Subject: [PATCH 4/4] add Signed-off-by: hwzhangchuang --- common/include/input_hub.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/include/input_hub.cpp b/common/include/input_hub.cpp index 2d853eb..ceac892 100644 --- a/common/include/input_hub.cpp +++ b/common/include/input_hub.cpp @@ -756,7 +756,7 @@ int32_t InputHub::GetABSInfo(struct libevdev *dev, InputDevice &identifier) DHLOGE("The device doesn't has EV_ABS type!"); return ERR_DH_INPUT_HUB_QUERY_INPUT_DEVICE_INFO_FAIL; } - DHLOGI("The device has abs info, devName: %s, dhId: %s!", identifier.name.c_str(), dentifier.descriptor.c_str()); + DHLOGI("The device has abs info, devName: %s, dhId: %s!", identifier.name.c_str(), identifier.descriptor.c_str()); for (uint32_t absType = 0; absType < ABS_CNT; absType++) { if (!libevdev_has_event_code(dev, EV_ABS, absType)) { DHLOGD("The device is not support absType: %d", absType); -- Gitee