Look up devices by fd
Instead of storing deviceIndex inside epoll_data_t in the epoll_event,
store the file descriptors instead. Since we already have the file
descriptors for wake pipe and inotify, we can avoid storing magic
numbers. More importantly, this allows us to add video device
monitoring. For video devices, the old approach would no longer work,
because the same device index would apply to both video device file
descriptor and the input device file descriptor.
By storing the file descriptor, we can differentiate between the two
portions of the same EventHub::Device.
Test: atest inputflinger_tests libinput_tests
Test: touch interaction with the booted phone
Bug: 111480215
Change-Id: Iadb95f2b14499d600167c89f86fde5db82608af0
2 files changed