Remove .get() and .next() from eventlib + move state to client.
This cl:
1) Removes leftover .get() and .next() methods from eventlib - these are
expensive to maintain and aren't used in any tests - if we need to add
them back in future we can fake them using .poll() with small timeouts
2) Moves all EventLib state to the client. Previously the service would
contain state (a list of events, the number of events to skip for
.next(), etc.) - this caused complex issues where state got out-of-sync
and the error showed up later - and also meant that it was difficult to
close the binding efficiently because if the service died we lost the
state. We have now moved all this state to the client and close the
binding after each query - this makes fetching multiple results from the
same query less efficient but this is rare.
3) Tidies up some of the usage of BlockingBroadcastReceiver - this
happened because I was chasing down a particular bug. Minor changes
here.
Test: atest TestAppTest
Test: atest EventLibTest
Test: atest CtsDevicePolicyTestCases
Bug: 197208798
Fixes: 197083691
Change-Id: Ib8049517ddc2685ec348e7c52c92244ee8fa5dfa
30 files changed