Commit 0f9cb68f authored by Michael Spang's avatar Michael Spang Committed by Commit Bot

events: Use case sensitive matches for evdev device name

Input device node names always start with exactly "event".

Bug: none
Test: compile

Change-Id: I7e332f16901fa979eff7b1553ae6439a0806b9fd

Reviewed-on: https://chromium-review.googlesource.com/c/1287103
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#600968}
parent c752d8a2
...@@ -22,8 +22,7 @@ InputDeviceType GetInputDeviceTypeFromPath(const base::FilePath& path) { ...@@ -22,8 +22,7 @@ InputDeviceType GetInputDeviceTypeFromPath(const base::FilePath& path) {
base::AssertBlockingAllowedDeprecated(); base::AssertBlockingAllowedDeprecated();
std::string event_node = path.BaseName().value(); std::string event_node = path.BaseName().value();
if (event_node.empty() || if (event_node.empty() ||
!base::StartsWith(event_node, "event", !base::StartsWith(event_node, "event", base::CompareCase::SENSITIVE))
base::CompareCase::INSENSITIVE_ASCII))
return InputDeviceType::INPUT_DEVICE_UNKNOWN; return InputDeviceType::INPUT_DEVICE_UNKNOWN;
base::FilePath sysfs_path = GetInputPathInSys(path); base::FilePath sysfs_path = GetInputPathInSys(path);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment