Merge "Wait until any background events are processed." into stage-aosp-master am: 0589325300 am: 8cf1cab8c4
am: 120715a56b
Change-Id: I1a0a379061ba3e2d79d1f0600a400167ae8c74eb
This commit is contained in:
@@ -2326,6 +2326,7 @@ package android.provider {
|
||||
method public static android.net.Uri scanFile(android.content.Context, java.io.File);
|
||||
method public static android.net.Uri scanFileFromShell(android.content.Context, java.io.File);
|
||||
method public static void scanVolume(android.content.Context, java.io.File);
|
||||
method public static void waitForIdle(android.content.Context);
|
||||
}
|
||||
|
||||
public final class Settings {
|
||||
|
||||
@@ -136,6 +136,8 @@ public final class MediaStore {
|
||||
*/
|
||||
public static final String VOLUME_EXTERNAL_PRIMARY = "external_primary";
|
||||
|
||||
/** {@hide} */
|
||||
public static final String WAIT_FOR_IDLE_CALL = "wait_for_idle";
|
||||
/** {@hide} */
|
||||
public static final String SCAN_FILE_CALL = "scan_file";
|
||||
/** {@hide} */
|
||||
@@ -3560,6 +3562,17 @@ public final class MediaStore {
|
||||
}
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@TestApi
|
||||
public static void waitForIdle(Context context) {
|
||||
final ContentResolver resolver = context.getContentResolver();
|
||||
try (ContentProviderClient client = resolver.acquireContentProviderClient(AUTHORITY)) {
|
||||
client.call(WAIT_FOR_IDLE_CALL, null, null);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowAsRuntimeException();
|
||||
}
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@TestApi
|
||||
public static Uri scanFile(Context context, File file) {
|
||||
|
||||
Reference in New Issue
Block a user