Wait for state refreshed in TileQueryHelper
When adding the stock tiles for TileAdapter, TileQueryHelper will set
them to listening for a brief period of time to refresh the state and
show the current state. It used to work because all the operations were
done in the background thread.
After switching the lifecycle logic to the main thread, there was a race
condition preventing the new state (between RESUMED and STARTED) to be
collected before it was copied.
This CL adds a class TileCollector that will wait until all tiles have
properly refreshed at least once before collecting their state.
Test: manual
Test: atest TileQueryHelperTest
Fixes: 168444501
Change-Id: I5f356ae4648e837cbe1bcdbaec9ba6d5b7c09891
4 files changed