diff options
| author | 2019-01-04 14:17:48 -0700 | |
|---|---|---|
| committer | 2019-01-04 14:33:49 -0700 | |
| commit | 7b148d7ae7c54315cbb33d71396bb87747aa722d (patch) | |
| tree | 0e397b52b2f899b11c4dacc34c04eeb3e4ed5e8a | |
| parent | c54ffd28f7efa82054ebc4443c7c6a396e07ddd6 (diff) | |
Define secondary media item bucketing.
The existing buckets work well for first-level clustering of related
media, but it's common for multiple media items within a directory
to form a conceptual unit. To support this, we're creating a
second-level of bucketing which is formed using the first part of
the file name.
This supports common industry-standard patterns like:
IMG1024.JPG
IMG1024.CR2
While also opening the door to further flexibility in the future:
IMG1024.JPG
IMG1024.HDR.JPG
IMG1024.BURST001.JPG
IMG1024.BURST002.JPG
IMG1024.BURST003.JPG
IMG1024.DNG
IMG1024.DEBUG.BIN
We're currently advocating that the default representation of one of
these secondary clusters is the shortest .JPG filename contained
inside, with length ties broken alphabetically.
Clean up database management so that upgraded schema always matches
pristine schema, with tests to verify. Generate views using the
actual projection mappings used at runtime.
Bug: 115377970
Test: atest MediaProviderTests
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: Ic679055ab6c884d2048626f51670a5dd370281c0
| -rw-r--r-- | api/current.txt | 2 | ||||
| -rw-r--r-- | core/java/android/provider/MediaStore.java | 52 |
2 files changed, 42 insertions, 12 deletions
diff --git a/api/current.txt b/api/current.txt index fad607ccefec..90ce66e91c9a 100644 --- a/api/current.txt +++ b/api/current.txt @@ -38078,6 +38078,7 @@ package android.provider { field public static final deprecated java.lang.String MINI_THUMB_MAGIC = "mini_thumb_magic"; field public static final java.lang.String ORIENTATION = "orientation"; field public static final deprecated java.lang.String PICASA_ID = "picasa_id"; + field public static final java.lang.String SECONDARY_BUCKET_ID = "secondary_bucket_id"; } public static final class MediaStore.Images.Media implements android.provider.MediaStore.Images.ImageColumns { @@ -38202,6 +38203,7 @@ package android.provider { field public static final deprecated java.lang.String LONGITUDE = "longitude"; field public static final deprecated java.lang.String MINI_THUMB_MAGIC = "mini_thumb_magic"; field public static final java.lang.String RESOLUTION = "resolution"; + field public static final java.lang.String SECONDARY_BUCKET_ID = "secondary_bucket_id"; field public static final java.lang.String TAGS = "tags"; } diff --git a/core/java/android/provider/MediaStore.java b/core/java/android/provider/MediaStore.java index c4e2b1299fc2..29a8922c167c 100644 --- a/core/java/android/provider/MediaStore.java +++ b/core/java/android/provider/MediaStore.java @@ -1251,18 +1251,32 @@ public final class MediaStore { public static final String MINI_THUMB_MAGIC = "mini_thumb_magic"; /** - * The bucket id of the image. This is a read-only property that - * is automatically computed from the DATA column. - * <P>Type: TEXT</P> + * The primary bucket ID of this media item. This can be useful to + * present the user a first-level clustering of related media items. + * This is a read-only column that is automatically computed. + * <p> + * Type: INTEGER */ public static final String BUCKET_ID = "bucket_id"; /** - * The bucket display name of the image. This is a read-only property that - * is automatically computed from the DATA column. - * <P>Type: TEXT</P> + * The primary bucket display name of this media item. This can be + * useful to present the user a first-level clustering of related + * media items. This is a read-only column that is automatically + * computed. + * <p> + * Type: TEXT */ public static final String BUCKET_DISPLAY_NAME = "bucket_display_name"; + + /** + * The secondary bucket ID of this media item. This can be useful to + * present the user a second-level clustering of related media + * items. This is a read-only column that is automatically computed. + * <p> + * Type: INTEGER + */ + public static final String SECONDARY_BUCKET_ID = "secondary_bucket_id"; } public static final class Media implements ImageColumns { @@ -2500,20 +2514,34 @@ public final class MediaStore { public static final String MINI_THUMB_MAGIC = "mini_thumb_magic"; /** - * The bucket id of the video. This is a read-only property that - * is automatically computed from the DATA column. - * <P>Type: TEXT</P> + * The primary bucket ID of this media item. This can be useful to + * present the user a first-level clustering of related media items. + * This is a read-only column that is automatically computed. + * <p> + * Type: INTEGER */ public static final String BUCKET_ID = "bucket_id"; /** - * The bucket display name of the video. This is a read-only property that - * is automatically computed from the DATA column. - * <P>Type: TEXT</P> + * The primary bucket display name of this media item. This can be + * useful to present the user a first-level clustering of related + * media items. This is a read-only column that is automatically + * computed. + * <p> + * Type: TEXT */ public static final String BUCKET_DISPLAY_NAME = "bucket_display_name"; /** + * The secondary bucket ID of this media item. This can be useful to + * present the user a second-level clustering of related media + * items. This is a read-only column that is automatically computed. + * <p> + * Type: INTEGER + */ + public static final String SECONDARY_BUCKET_ID = "secondary_bucket_id"; + + /** * The bookmark for the video. Time in ms. Represents the location in the video that the * video should start playing at the next time it is opened. If the value is null or * out of the range 0..DURATION-1 then the video should start playing from the |