Merge "Wait until any background events are processed." into stage-aosp-master
am: 0589325300
Change-Id: I198e5863a5f4f3e8b7dec0e5ae13be2548719285
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