Commit db685247 authored by Matt Reynolds's avatar Matt Reynolds Committed by Commit Bot

[gamepad] Expand gamepad blocklist

The gamepad blocklist is used to exclude HID devices that look
like gamepads to our HID gamepad heuristics but are not gamepads.

This CL blocks all devices from these vendors, none of which are known
to make gamepads:

Alps Electric Co., Ltd
D-WAV Scientific Co., Ltd
Elan Microelectronics Corp.
Elo TouchSystems
LG Display Co., Ltd.
Quanta Computer, Inc.
Silicon Integrated Systems Corp.
Sun Microsystems, Inc.
Synaptics, Inc.
Wacom Co., Ltd

Additionally, some devices from these vendors are blocked:

Apple, Inc.
Atmel Corp.
Award Software International
Corsair
Cypress Semiconductor Corp.
Darfon Electronics Corp.
Holtek Semiconductor, Inc.
Lenovo
Microsoft Corp.

BUG=994457

Change-Id: I10aabb56ff4945391d1bfb01be90fc9748e4dfbc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1759007Reviewed-by: default avatarOvidio de Jesús Ruiz-Henríquez <odejesush@chromium.org>
Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688731}
parent 2e5df015
......@@ -12,10 +12,25 @@
namespace device {
namespace {
constexpr uint16_t kVendorAlps = 0x044e;
constexpr uint16_t kVendorApple = 0x05ac;
constexpr uint16_t kVendorAtmel = 0x03eb;
constexpr uint16_t kVendorAwardSoftware = 0x0412;
constexpr uint16_t kVendorBlue = 0xb58e;
constexpr uint16_t kVendorCorsair = 0x1b3c;
constexpr uint16_t kVendorCypressSemiconductor = 0x04b4;
constexpr uint16_t kVendorDarfonElectronics = 0x0d62;
constexpr uint16_t kVendorDWav = 0x0eef;
constexpr uint16_t kVendorElanMicroelectronics = 0x04f3;
constexpr uint16_t kVendorEloTouchSystems = 0x04e7;
constexpr uint16_t kVendorHoltekSemiconductor = 0x04d9;
constexpr uint16_t kVendorLenovo = 0x17ef;
constexpr uint16_t kVendorLgd = 0x1fd2;
constexpr uint16_t kVendorMicrosoft = 0x045e;
constexpr uint16_t kVendorOculus = 0x2833;
constexpr uint16_t kVendorQuantaComputer = 0x0408;
constexpr uint16_t kVendorSiliconIntegratedSystems = 0x0457;
constexpr uint16_t kVendorSunMicrosystems = 0x0430;
constexpr uint16_t kVendorSynaptics = 0x06cb;
constexpr uint16_t kVendorWacom = 0x056a;
......@@ -23,16 +38,34 @@ constexpr struct VendorProductPair {
uint16_t vendor;
uint16_t product;
} kBlockedDevices[] = {
// BLUETOOTH HID v0.01 Mouse.
{kVendorApple, 0x3232},
// Wooting one keyboard.
{kVendorAtmel, 0xff01},
// Wooting two keyboard.
{kVendorAtmel, 0xff02},
// Keyboard.
{kVendorAwardSoftware, 0x7121},
// Corsair Gaming HARPOON RGB Mouse.
{kVendorCorsair, 0x1b3c},
// PenPower Touchpad.
{kVendorCypressSemiconductor, 0xfef3},
// USB-HID Keyboard.
{kVendorDarfonElectronics, 0x9a1a},
// USB-HID Keyboards.
{kVendorHoltekSemiconductor, 0x8008},
{kVendorHoltekSemiconductor, 0x8009},
{kVendorHoltekSemiconductor, 0xa292},
// LiteOn Lenovo USB Keyboard with TrackPoint.
{kVendorLenovo, 0x6009},
// LiteOn Lenovo Traditional USB Keyboard.
{kVendorLenovo, 0x6099},
// The Surface Pro 2017's detachable keyboard is a composite device with
// several HID sub-devices. Filter out the keyboard's device ID to avoid
// treating these sub-devices as gamepads.
// Microsoft Wired Keyboard 600.
{kVendorMicrosoft, 0x0750},
// Surface Keyboard.
{kVendorMicrosoft, 0x07cd},
// Surface Keyboard.
{kVendorMicrosoft, 0x0922},
// The Lenovo X1 Yoga's Synaptics touchpad is recognized as a HID gamepad.
{kVendorSynaptics, 0x000f},
// The Lenovo X1 Yoga's Wacom touchscreen is recognized as a HID gamepad.
{kVendorWacom, 0x50b8},
};
// Devices from these vendors are always blocked.
......@@ -41,6 +74,17 @@ constexpr uint16_t kBlockedVendors[] = {
kVendorBlue,
// Block all Oculus devices. Oculus VR controllers are handled by WebXR.
kVendorOculus,
// Touchpad and touchscreen vendors.
kVendorAlps,
kVendorDWav,
kVendorElanMicroelectronics,
kVendorEloTouchSystems,
kVendorLgd,
kVendorQuantaComputer,
kVendorSiliconIntegratedSystems,
kVendorSunMicrosystems,
kVendorSynaptics,
kVendorWacom,
};
} // namespace
......
......@@ -13,8 +13,7 @@ namespace {
// Blocked devices, taken from the gamepad blocklist.
constexpr std::pair<uint16_t, uint16_t> kBlockedDevices[] = {
{0x045e, 0x0922}, // Microsoft keyboard
{0x056a, 0x50b8}, // Wacom touchpad
{0x06cb, 0x000f}, // Synaptics touchpad
{0x05ac, 0x3232}, // Apple(?) bluetooth mouse
{0x17ef, 0x6099}, // Lenovo keyboard
};
constexpr size_t kBlockedDevicesLength = base::size(kBlockedDevices);
......@@ -22,6 +21,8 @@ constexpr size_t kBlockedDevicesLength = base::size(kBlockedDevices);
// Known devices from blocked vendors, taken from usb.ids.
// http://www.linux-usb.org/usb.ids
constexpr std::pair<uint16_t, uint16_t> kBlockedVendorDevices[] = {
{0x056a, 0x50b8}, // Wacom touchpad
{0x06cb, 0x000f}, // Synaptics touchpad
{0x2833, 0x0001}, // Oculus Rift DK1 head tracker
{0x2833, 0x0021}, // Oculus Rift DK2 USB hub
{0x2833, 0x0031}, // Oculus Rift CV1 subdevice
......
......@@ -155,8 +155,6 @@ constexpr struct GamepadInfo {
{0x0583, 0xb031, kXInputTypeNone},
// Vetronix Corp.
{0x05a0, 0x3232, kXInputTypeNone},
// Apple, Inc.
{0x05ac, 0x3232, kXInputTypeNone},
// Genesys Logic, Inc.
{0x05e3, 0x0596, kXInputTypeNone},
// InterAct, Inc.
......
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