Support multiple EventHub devices per InputDevice
Some physical devices contain more functions than can be addressed by a single Linux evdev device. Examples of such devices are the Sony DualShock 4 and Wacom Tablets, which appear as multiple evdev devices sharing the same value for the EVIOCGUNIQ ioctl. As more instances of such devices hit the market, apps need a way of figuring out which InputDevices are part of the same physical device. Per conversation with the android input team, a solution proposed to this problem is to merge multiple EventHub devices (which have a 1:1 relation with evdev) into a single android InputDevice. Changes: Decouple the EventHub device id ("eventHubId") from the InputDevice device id ("deviceId"). This requires InputDeviceContext to track the the EventHub devices it represents. Most logic changes are inside InputDeviceContext, so there are minimal changes to InputMappers. Added enum value END_RESERVED_ID to represent the first available id that can be assigned to a normal InputDevice. The android framework assumes specific values for the virtual keyboard and built-in hardware keyboard, so for these two cases, the "deviceId" must match the "eventHubId." Added "EVENTHUB_ID" constants to tests and changed where applicable. Cherry-picked from pa/1475694. Bug: 38511270 Test: atest inputflinger_tests libinput_tests Change-Id: I89df085fadc1c09bc999599ac5db35c9277c4a2a
Loading
Please register or sign in to comment