summaryrefslogtreecommitdiffstats
path: root/device
diff options
context:
space:
mode:
authorjosephsih <josephsih@chromium.org>2016-03-22 20:17:22 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-23 03:19:47 +0000
commitac6354573b954185640f67f246c55fad47e6b1b5 (patch)
treeb016fe7a79eba6969b3b7077ed9cb490ed43292b /device
parentc27b5e8077a8f42d931c41fa5201d972531c434b (diff)
downloadchromium_src-ac6354573b954185640f67f246c55fad47e6b1b5.zip
chromium_src-ac6354573b954185640f67f246c55fad47e6b1b5.tar.gz
chromium_src-ac6354573b954185640f67f246c55fad47e6b1b5.tar.bz2
Add bluetooth BLE devices as TYPE_BLUETOOTH
When a bluetooth low-energy (BLE) keyboard is paired with a keyboard-less chrome os device, e.g., Mickey, on the OOBE screen and a user uses a usb mouse to click the "Continue" button to proceed to login screen, the bluetooth adapter of the device would be powered off which makes the BLE keyboard un-usable. The root cause of the issue is that a BLE device is not registered under the bluetooth/hid subsystems in Linux as a classic bluetooth device is. Instead, a BLE device is registered under the virtual misc/hid subsystems. The OnContinueButtonClicked() in hid_detection_screen.cc regards that there is no bluetooth device used and thus switches off the bluetooth adapter. For more details about an example BLE device in /dev/input/event2: $ udevadm info -a /dev/input/event2 looking at device '/devices/virtual/misc/uhid/0005:0000:0000.0019/input/input26/event2': ... looking at parent device '/devices/virtual/misc/uhid/0005:0000:0000.0019': SUBSYSTEMS=="hid" ... looking at parent device '/devices/virtual/misc/uhid': SUBSYSTEMS=="misc" ... For an example classic bluetooth device in /dev/input/event2: $ udevadm info -a /dev/input/event2 looking at device '/devices/ff180000.serial/tty/ttyS0/hci0/hci0:11:23/0005:04E8:A006.0016/input/input23/event2': ... looking at parent device '/devices/ff180000.serial/tty/ttyS0/hci0/hci0:11:23/0005:04E8:A006.0016': SUBSYSTEMS=="hid" ... looking at parent device '/devices/ff180000.serial/tty/ttyS0/hci0/hci0:11:23': SUBSYSTEMS=="bluetooth" ... This patch adds the additional condition about misc/hid subsystems for BLE when determining bluetooth type. BUG=chrome-os-partner:48868 TEST=Execute the steps below: 1. Boot a keyboard-less chrome os machine, e.g., Mickey, into OOBE. 2. Pair a BLE keyboard, e.g., Microsoft Universal Foldable Keyboard, to the machine. 3. Plug in a usb mouse to click the "Continue" button on OOBE to proceed to login screen. 4. Confirm that the bluetooth adapter is still powered on in the system tray on the bottom right-hand corner and the BLE keyboard works correctly. Review URL: https://codereview.chromium.org/1820803002 Cr-Commit-Position: refs/heads/master@{#382781}
Diffstat (limited to 'device')
-rw-r--r--device/hid/input_service_linux.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/device/hid/input_service_linux.cc b/device/hid/input_service_linux.cc
index dd8b38b..05b2cec 100644
--- a/device/hid/input_service_linux.cc
+++ b/device/hid/input_service_linux.cc
@@ -19,6 +19,7 @@ namespace {
const char kSubsystemHid[] = "hid";
const char kSubsystemInput[] = "input";
+const char kSubsystemMisc[] = "misc";
const char kTypeBluetooth[] = "bluetooth";
const char kTypeUsb[] = "usb";
const char kTypeSerio[] = "serio";
@@ -50,8 +51,14 @@ bool GetBoolProperty(udev_device* device, const char* key) {
}
InputServiceLinux::InputDeviceInfo::Type GetDeviceType(udev_device* device) {
- if (udev_device_get_parent_with_subsystem_devtype(
- device, kTypeBluetooth, NULL)) {
+ // Bluetooth classic hid devices are registered under bluetooth subsystem.
+ // Bluetooth LE hid devices are registered under virtual misc/hid subsystems.
+ if (udev_device_get_parent_with_subsystem_devtype(device, kTypeBluetooth,
+ NULL) ||
+ (udev_device_get_parent_with_subsystem_devtype(device, kSubsystemHid,
+ NULL) &&
+ udev_device_get_parent_with_subsystem_devtype(device, kSubsystemMisc,
+ NULL))) {
return InputServiceLinux::InputDeviceInfo::TYPE_BLUETOOTH;
}
if (udev_device_get_parent_with_subsystem_devtype(device, kTypeUsb, NULL))