Fix LegacyProviderMigrationTest
Added 5s sleep after killing the MediaProvider (from clearing
data).
With FUSE, killing the MediaProvider causes a vold reset, and
unmounts all volumes. This means that even if the MediaProvider is
back up, the volumes may not be ready until a short while
after. Hence, any ContentResolver requests will fail until the volumes
are mounted.
Test: atest LegacyProviderMigrationTest
Bug: 148955744
Change-Id: Idb8cd9e16c9c92b3eaef36fc3934c6271b57bf0b
diff --git a/tests/client/src/com/android/providers/media/client/LegacyProviderMigrationTest.java b/tests/client/src/com/android/providers/media/client/LegacyProviderMigrationTest.java
index ae63ac3..94c2a74 100644
--- a/tests/client/src/com/android/providers/media/client/LegacyProviderMigrationTest.java
+++ b/tests/client/src/com/android/providers/media/client/LegacyProviderMigrationTest.java
@@ -212,6 +212,9 @@
// metadata from the legacy provider
executeShellCommand("pm clear " + modernProvider.applicationInfo.packageName, ui);
+ // Sleep to give the MediaProvider time to recover from being killed after clearing data
+ Thread.sleep(5000);
+
// And force a scan to confirm upgraded data survives
MediaStore.waitForIdle(context.getContentResolver());
MediaStore.scanVolume(context.getContentResolver(),