Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca923a9a authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge "Update DownloadStorageProvider to include MediaStore.Downloads."

parents 49db8e03 e93db512
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1067,7 +1067,12 @@ public class DownloadManager {
     * COLUMN_* constants.
     */
    public Cursor query(Query query) {
        Cursor underlyingCursor = query.runQuery(mResolver, UNDERLYING_COLUMNS, mBaseUri);
        return query(query, UNDERLYING_COLUMNS);
    }

    /** @hide */
    public Cursor query(Query query, String[] projection) {
        Cursor underlyingCursor = query.runQuery(mResolver, projection, mBaseUri);
        if (underlyingCursor == null) {
            return null;
        }
+14 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ public class Environment {

    /** {@hide} */
    public static final String DIR_ANDROID = "Android";
    private static final String DIR_SANDBOX = "sandbox";
    private static final String DIR_DATA = "data";
    private static final String DIR_MEDIA = "media";
    private static final String DIR_OBB = "obb";
@@ -117,6 +118,10 @@ public class Environment {
            return buildPaths(getExternalDirs(), type);
        }

        public File[] buildExternalStorageAndroidSandboxDirs() {
            return buildPaths(getExternalDirs(), DIR_ANDROID, DIR_SANDBOX);
        }

        public File[] buildExternalStorageAndroidDataDirs() {
            return buildPaths(getExternalDirs(), DIR_ANDROID, DIR_DATA);
        }
@@ -820,6 +825,15 @@ public class Environment {
        return sCurrentUser.buildExternalStoragePublicDirs(type)[0];
    }

    /**
     * Returns the path for android-specific data on the SD card.
     * @hide
     */
    public static File[] buildExternalStorageAndroidSandboxDirs() {
        throwIfUserRequired();
        return sCurrentUser.buildExternalStorageAndroidSandboxDirs();
    }

    /**
     * Returns the path for android-specific data on the SD card.
     * @hide
+8 −0
Original line number Diff line number Diff line
@@ -837,6 +837,14 @@ public final class Downloads {
        }
    }

    /** @hide */
    public static final String MEDIASTORE_DOWNLOADS_DELETED_CALL = "mediastore_downloads_deleted";

    /** @hide */
    public static final String EXTRA_IDS = "ids";
    /** @hide */
    public static final String EXTRA_MIME_TYPES = "mime_types";

    /**
     * Query where clause for general querying.
     */
+13 −1
Original line number Diff line number Diff line
@@ -158,6 +158,8 @@ public final class MediaStore {
    public static final String PARAM_PROGRESS = "progress";
    /** {@hide} */
    public static final String PARAM_REQUIRE_ORIGINAL = "requireOriginal";
    /** {@hide} */
    public static final String PARAM_LIMIT = "limit";

    /**
     * Activity Action: Launch a music player.
@@ -513,7 +515,12 @@ public final class MediaStore {
     * @see MediaStore#createPending(Context, PendingParams)
     */
    public static @NonNull Uri setIncludePending(@NonNull Uri uri) {
        return uri.buildUpon().appendQueryParameter(PARAM_INCLUDE_PENDING, "1").build();
        return setIncludePending(uri.buildUpon()).build();
    }

    /** @hide */
    public static @NonNull Uri.Builder setIncludePending(@NonNull Uri.Builder uriBuilder) {
        return uriBuilder.appendQueryParameter(PARAM_INCLUDE_PENDING, "1");
    }

    /**
@@ -982,6 +989,11 @@ public final class MediaStore {
     * work with multiple media file types in a single query.
     */
    public static final class Files {
        /** @hide */
        public static final String TABLE = "files";

        /** @hide */
        public static final Uri EXTERNAL_CONTENT_URI = getContentUri(VOLUME_EXTERNAL);

        /**
         * Get the content:// style URI for the files table on the
+2 −1
Original line number Diff line number Diff line
@@ -1277,7 +1277,8 @@ public class MediaScanner implements AutoCloseable {
                // we need to query the database in small batches, to avoid problems
                // with CursorWindow positioning.
                long lastId = Long.MIN_VALUE;
                Uri limitUri = mFilesUri.buildUpon().appendQueryParameter("limit", "1000").build();
                Uri limitUri = mFilesUri.buildUpon()
                        .appendQueryParameter(MediaStore.PARAM_LIMIT, "1000").build();

                while (true) {
                    selectionArgs[0] = "" + lastId;