diff options
author | spang <spang@chromium.org> | 2015-04-02 10:40:51 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-02 17:41:15 +0000 |
commit | 9fc7b041bcebf9ea1dd1937690e8d02ebff36ca2 (patch) | |
tree | 170e4dc761b539fa0783ba271ca885126730c99c | |
parent | 2f3d52eb5ddf4bad7a8ae4666e63a3f5e64c2e6d (diff) | |
download | chromium_src-9fc7b041bcebf9ea1dd1937690e8d02ebff36ca2.zip chromium_src-9fc7b041bcebf9ea1dd1937690e8d02ebff36ca2.tar.gz chromium_src-9fc7b041bcebf9ea1dd1937690e8d02ebff36ca2.tar.bz2 |
events: devices: Mark all uhid virtual devices as external
This driver is currently used for Bluetooth LE, and should be marked
external. Since it's a virtual device it's organized a bit differently.
Terminate and return INPUT_DEVICE_EXTERNAL if we hit the "uhid" device
itself.
BUG=470888
TEST=Ran uhid-example on link to create such a device,
& verified it is detected as external.
Review URL: https://codereview.chromium.org/1051093003
Cr-Commit-Position: refs/heads/master@{#323533}
-rw-r--r-- | ui/events/devices/device_util_linux.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/events/devices/device_util_linux.cc b/ui/events/devices/device_util_linux.cc index 90fad3d..858ee84 100644 --- a/ui/events/devices/device_util_linux.cc +++ b/ui/events/devices/device_util_linux.cc @@ -33,6 +33,11 @@ InputDeviceType GetInputDeviceTypeFromPath(const base::FilePath& path) { // Check ancestor devices for a known bus attachment. for (base::FilePath path = sysfs_path; path != base::FilePath("/"); path = path.DirName()) { + // Bluetooth LE devices are virtual "uhid" devices. + if (path == + base::FilePath(FILE_PATH_LITERAL("/sys/devices/virtual/misc/uhid"))) + return InputDeviceType::INPUT_DEVICE_EXTERNAL; + std::string subsystem_path = base::MakeAbsoluteFilePath(path.Append(FILE_PATH_LITERAL("subsystem"))) .value(); |