Skip to content
Commit 6f3996fc authored by Martijn Coenen's avatar Martijn Coenen
Browse files

Use futures for binding and talking to the ExternalStorageService.

The existing CountdownLatch logic had some corner cases where it would
continue waiting for the latch to count down, even when it was already
clear that the operation couldn't succeed (eg, a bind failed).

To fix this, as well as try and simplify some of this code, switch to
using futures, which have a nicely defined way of cancelling outstanding
operations.

Additionally, switch to using a dedicated handler thread for receiving
bind events for all users, not just demo users. This avoids having to
wait for a long time when the system_server main thread is busy.

Bug: 170284679
Test: atest AdoptableHostTest
      atest CtsScopedStorageHostTest
Change-Id: Id3e4f4ced66193536c7c51b18c0fea31c556d567
parent 3acf806a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment