Accumulate NotifyArgs inside the lock before notifying
Currently, mQueuedListener is used both with and without a lock inside
InputReader. This is problematic because things like 'vibrate' could
modify the collection inside QueuedInputListener while it's accessing
it.
This causes a crash.
To avoid this, explicitly accumulate the events inside a lock, and then
notify all args when the lock is released, but from a swapped variable.
Bug: 293260512
Test: atest inputflinger_tests
Change-Id: Ib9891b22e6c2632395ddfcec6af3aefe3151b4c4
(cherry picked from commit 23a98bf1478eb6b1509416a4734bcf38112255aa)
2 files changed