mirror of
https://github.com/openharmony/distributedhardware_distributed_input.git
synced 2026-07-21 05:45:23 -04:00
!125 Debug级别部分日志打印太频繁,影响正常问题定位
Merge pull request !125 from zhangchuang/master
This commit is contained in:
@@ -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<InputDevice> InputHub::GetAllInputDevices()
|
||||
|
||||
void InputHub::ScanInputDevices(const std::string &dirName)
|
||||
{
|
||||
DHLOGD("ScanInputDevices enter, dirName %s.", dirName.c_str());
|
||||
std::vector<std::string> 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);
|
||||
@@ -734,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);
|
||||
}
|
||||
}
|
||||
@@ -750,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;
|
||||
@@ -762,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(), 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);
|
||||
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);
|
||||
@@ -796,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;
|
||||
|
||||
@@ -351,7 +351,6 @@ void ScanInputDevicesPath(const std::string &dirName, std::vector<std::string> &
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user