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

Commit 0b20b77f authored by Mike Lockwood's avatar Mike Lockwood
Browse files

MediaStore: Make definitions for Files table public



This provides a public API for the new MediaProvider support for
arbitrary file types.  MediaProvider is no longer limited to supporting
only media (audio, video, image and playlist files).
This also allows querying across multiple media file types and supports
navigating the directory hierarchy of the media storage via database queries.

BUG: 2984284

Change-Id: I6222a6d601a4641cc7e544335e45d05b194532b1
Signed-off-by: default avatarMike Lockwood <lockwood@google.com>
parent 4e331a78
Loading
Loading
Loading
Loading
+154 −0
Original line number Original line Diff line number Diff line
@@ -157199,6 +157199,160 @@
>
>
</field>
</field>
</interface>
</interface>
<class name="MediaStore.Files"
 extends="java.lang.Object"
 abstract="false"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
<constructor name="MediaStore.Files"
 type="android.provider.MediaStore.Files"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</constructor>
<method name="getContentUri"
 return="android.net.Uri"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="volumeName" type="java.lang.String">
</parameter>
</method>
<method name="getContentUri"
 return="android.net.Uri"
 abstract="false"
 native="false"
 synchronized="false"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="volumeName" type="java.lang.String">
</parameter>
<parameter name="rowId" type="long">
</parameter>
</method>
</class>
<interface name="MediaStore.Files.FileColumns"
 abstract="true"
 static="true"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<implements name="android.provider.MediaStore.MediaColumns">
</implements>
<field name="MEDIA_TYPE"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;media_type&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="MEDIA_TYPE_AUDIO"
 type="int"
 transient="false"
 volatile="false"
 value="2"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="MEDIA_TYPE_IMAGE"
 type="int"
 transient="false"
 volatile="false"
 value="1"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="MEDIA_TYPE_NONE"
 type="int"
 transient="false"
 volatile="false"
 value="0"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="MEDIA_TYPE_PLAYLIST"
 type="int"
 transient="false"
 volatile="false"
 value="4"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="MEDIA_TYPE_VIDEO"
 type="int"
 transient="false"
 volatile="false"
 value="3"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="MIME_TYPE"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;mime_type&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="PARENT"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;parent&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="TITLE"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;title&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
</interface>
<class name="MediaStore.Images"
<class name="MediaStore.Images"
 extends="java.lang.Object"
 extends="java.lang.Object"
 abstract="false"
 abstract="false"
+34 −7
Original line number Original line Diff line number Diff line
@@ -266,36 +266,62 @@ public final class MediaStore {
     }
     }


    /**
    /**
     * Media provider table containing an index of all files in the storage.
     * Media provider table containing an index of all files in the media storage,
     * This can be used by applications to find all documents of a particular type
     * including non-media files.  This should be used by applications that work with
     * and is also used internally by the device side MTP implementation.
     * non-media file types (text, HTML, PDF, etc) as well as applications that need to
     * @hide
     * work with multiple media file types in a single query.
     */
     */
    public static final class Files {
    public static final class Files {


        /**
         * Get the content:// style URI for the files table on the
         * given volume.
         *
         * @param volumeName the name of the volume to get the URI for
         * @return the URI to the files table on the given volume
         */
        public static Uri getContentUri(String volumeName) {
        public static Uri getContentUri(String volumeName) {
            return Uri.parse(CONTENT_AUTHORITY_SLASH + volumeName +
            return Uri.parse(CONTENT_AUTHORITY_SLASH + volumeName +
                    "/file");
                    "/file");
        }
        }


        /**
         * Get the content:// style URI for a single row in the files table on the
         * given volume.
         *
         * @param volumeName the name of the volume to get the URI for
         * @param rowId the file to get the URI for
         * @return the URI to the files table on the given volume
         */
        public static final Uri getContentUri(String volumeName,
        public static final Uri getContentUri(String volumeName,
                long fileId) {
                long rowId) {
            return Uri.parse(CONTENT_AUTHORITY_SLASH + volumeName
            return Uri.parse(CONTENT_AUTHORITY_SLASH + volumeName
                    + "/file/" + fileId);
                    + "/file/" + rowId);
        }
        }


        /**
         * For use only by the MTP implementation.
         * @hide
         */
        public static Uri getMtpObjectsUri(String volumeName) {
        public static Uri getMtpObjectsUri(String volumeName) {
            return Uri.parse(CONTENT_AUTHORITY_SLASH + volumeName +
            return Uri.parse(CONTENT_AUTHORITY_SLASH + volumeName +
                    "/object");
                    "/object");
        }
        }


        /**
         * For use only by the MTP implementation.
         * @hide
         */
        public static final Uri getMtpObjectsUri(String volumeName,
        public static final Uri getMtpObjectsUri(String volumeName,
                long fileId) {
                long fileId) {
            return Uri.parse(CONTENT_AUTHORITY_SLASH + volumeName
            return Uri.parse(CONTENT_AUTHORITY_SLASH + volumeName
                    + "/object/" + fileId);
                    + "/object/" + fileId);
        }
        }


        // Used to implement the MTP GetObjectReferences and SetObjectReferences commands.
        /**
         * Used to implement the MTP GetObjectReferences and SetObjectReferences commands.
         * @hide
         */
        public static final Uri getMtpReferencesUri(String volumeName,
        public static final Uri getMtpReferencesUri(String volumeName,
                long fileId) {
                long fileId) {
            return Uri.parse(CONTENT_AUTHORITY_SLASH + volumeName
            return Uri.parse(CONTENT_AUTHORITY_SLASH + volumeName
@@ -310,6 +336,7 @@ public final class MediaStore {
            /**
            /**
             * The MTP format code of the file
             * The MTP format code of the file
             * <P>Type: INTEGER</P>
             * <P>Type: INTEGER</P>
             * @hide
             */
             */
            public static final String FORMAT = "format";
            public static final String FORMAT = "format";