From 0b20b77ff5a67a054695954bc65f1c5c473b348b Mon Sep 17 00:00:00 2001 From: Mike Lockwood Date: Thu, 4 Nov 2010 13:16:48 -0400 Subject: 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: Mike Lockwood --- core/java/android/provider/MediaStore.java | 41 +++++++++++++++++++++++++----- 1 file changed, 34 insertions(+), 7 deletions(-) (limited to 'core/java/android') diff --git a/core/java/android/provider/MediaStore.java b/core/java/android/provider/MediaStore.java index b74e76f19864..f111ef23ad99 100644 --- a/core/java/android/provider/MediaStore.java +++ b/core/java/android/provider/MediaStore.java @@ -266,36 +266,62 @@ public final class MediaStore { } /** - * Media provider table containing an index of all files in the storage. - * This can be used by applications to find all documents of a particular type - * and is also used internally by the device side MTP implementation. - * @hide + * Media provider table containing an index of all files in the media storage, + * including non-media files. This should be used by applications that work with + * non-media file types (text, HTML, PDF, etc) as well as applications that need to + * work with multiple media file types in a single query. */ 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) { return Uri.parse(CONTENT_AUTHORITY_SLASH + volumeName + "/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, - long fileId) { + long rowId) { 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) { return Uri.parse(CONTENT_AUTHORITY_SLASH + volumeName + "/object"); } + /** + * For use only by the MTP implementation. + * @hide + */ public static final Uri getMtpObjectsUri(String volumeName, long fileId) { return Uri.parse(CONTENT_AUTHORITY_SLASH + volumeName + "/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, long fileId) { return Uri.parse(CONTENT_AUTHORITY_SLASH + volumeName @@ -310,6 +336,7 @@ public final class MediaStore { /** * The MTP format code of the file *

Type: INTEGER

+ * @hide */ public static final String FORMAT = "format"; -- cgit v1.2.3