Attempt at fixing Cuttlefish flaky tests.

We've seen evidence that LegacyProviderMigrationTest is failing on
Cuttlefish after recent changes to enable a secondary SD card, and
it appears to be a race condition during vold reset, where the
passthrough filesystem isn't yet mounted by the time the legacy
migration logic tries running.  (The reset logic is being delayed by
the vfat fsck taking a long time.)

This change introduces waitForPassthrough() which ensures that the
passthrough storage has been mounted before proceeding with the
legacy migration.

Bug: 157219547
Test: atest MediaProviderClientTests:com.android.providers.media.client.LegacyProviderMigrationTest#testLegacy_Pending --rerun-until-failure 100
Change-Id: I4aa1de19204fdbac180b32885771ef546707de1c
2 files changed