Loading
Do not process events after InputEventReceiver has been disposed
The expected behaviour of InputEventReceiver is that after "dispose" is called, there will be no more events received by it. However, in practice, that was not the case. This is confirmed by the added unit test in `InputEventSenderAndReceiverTest`. In this CL, we make InputConsumer nullable inside the receiver. It's possible for the receiver to live past "dispose' call (and in fact, it's likely). InputEventReceiver is stored by sp, and its life can be extended by various java methods. The consumer will now be destroyed when "dispose" is called, which will make it impossible to get any more events. At the same time, do some minor refactoring to simplify the code. Bug: 376713684 Test: atest InputEventSenderAndReceiverTest Flag: EXEMPT refactor Change-Id: Ia947921376f3e9e9bd407d9688147da9112a7289