Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91d69c63 authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

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
parent 7b593ca2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment