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

Skip to content
Commit 08b574f9 authored by Siarhei Vishniakou's avatar Siarhei Vishniakou
Browse files

Add busy wait for consume() call

We have no guarantee that consume() will find an available event right
away.
If we send an event to InputDispatcher, it may take some time for
dispatcher to process the event. Only when the event is processed can we
expect that it will be written to the socket.

In the test, we currently allow no time for this to complete. For the
upcoming tests, the work performed by dispatcher might be too large, so
the tests would start to fail.

If there is no event available at the socket, WOULD_BLOCK would be
returned. So if we are sure an event is coming, we can busily wait, as
long as the consume call is returning WOULD_BLOCK.

Bug: none
Test: atest inputflinger_tests
The change was tested with a child CL for notifyDeviceReset.

Change-Id: Ib9557c4de03c1b1d4a4eb1573d527f47facbf249
parent 39988e32
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