Unhide MediaMetadata.Description
This unhides the method and inner class for getting a small version
of the metadata for display.
Change-Id: I22f484cecd5f0630ac22bb648baad842d211d135
diff --git a/api/current.txt b/api/current.txt
index 8467400..152760f 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -15150,6 +15150,7 @@
method public boolean containsKey(java.lang.String);
method public int describeContents();
method public android.graphics.Bitmap getBitmap(java.lang.String);
+ method public android.media.MediaMetadata.Description getDescription();
method public long getLong(java.lang.String);
method public android.media.Rating getRating(java.lang.String);
method public java.lang.String getString(java.lang.String);
@@ -15197,6 +15198,14 @@
method public android.media.MediaMetadata.Builder putText(java.lang.String, java.lang.CharSequence);
}
+ public final class MediaMetadata.Description {
+ method public java.lang.CharSequence getDescription();
+ method public android.graphics.Bitmap getIcon();
+ method public android.net.Uri getIconUri();
+ method public java.lang.CharSequence getSubtitle();
+ method public java.lang.CharSequence getTitle();
+ }
+
public abstract deprecated class MediaMetadataEditor {
method public synchronized void addEditableKey(int);
method public abstract void apply();
diff --git a/media/java/android/media/MediaMetadata.java b/media/java/android/media/MediaMetadata.java
index bbf6a3b..90badd4 100644
--- a/media/java/android/media/MediaMetadata.java
+++ b/media/java/android/media/MediaMetadata.java
@@ -190,8 +190,8 @@
private static final String[] PREFERRED_DESCRIPTION_ORDER = {
METADATA_KEY_TITLE,
- METADATA_KEY_ALBUM,
METADATA_KEY_ARTIST,
+ METADATA_KEY_ALBUM,
METADATA_KEY_ALBUM_ARTIST,
METADATA_KEY_WRITER,
METADATA_KEY_AUTHOR,
@@ -406,7 +406,6 @@
* Returns a simple description of this metadata for display purposes.
*
* @return A simple description of this metadata.
- * @hide
*/
public @NonNull Description getDescription() {
if (mDescription != null) {
@@ -673,43 +672,86 @@
/**
* A simple form of the metadata that can be used for display.
- *
- * @hide
*/
public final class Description {
/**
* A primary title suitable for display or null.
*/
- public final CharSequence title;
+ private final CharSequence mTitle;
/**
* A subtitle suitable for display or null.
*/
- public final CharSequence subtitle;
+ private final CharSequence mSubtitle;
/**
* A description suitable for display or null.
*/
- public final CharSequence description;
+ private final CharSequence mDescription;
/**
* A bitmap icon suitable for display or null.
*/
- public final Bitmap icon;
+ private final Bitmap mIcon;
/**
* A Uri for an icon suitable for display or null.
*/
- public final Uri iconUri;
+ private final Uri mIconUri;
+
+ /**
+ * Returns the best available title or null.
+ *
+ * @return A title or null.
+ */
+ public @Nullable CharSequence getTitle() {
+ return mTitle;
+ }
+
+ /**
+ * Returns the best available subtitle or null.
+ *
+ * @return A subtitle or null.
+ */
+ public @Nullable CharSequence getSubtitle() {
+ return mSubtitle;
+ }
+
+ /**
+ * Returns the best available description or null.
+ *
+ * @return A description or null.
+ */
+ public @Nullable CharSequence getDescription() {
+ return mDescription;
+ }
+
+ /**
+ * Returns the best available icon or null.
+ *
+ * @return An icon or null.
+ */
+ public @Nullable Bitmap getIcon() {
+ return mIcon;
+ }
+
+ /**
+ * Returns the best available icon Uri or null.
+ *
+ * @return An icon uri or null.
+ */
+ public @Nullable Uri getIconUri() {
+ return mIconUri;
+ }
private Description(CharSequence title, CharSequence subtitle, CharSequence description,
Bitmap icon, Uri iconUri) {
- this.title = title;
- this.subtitle = subtitle;
- this.description = description;
- this.icon = icon;
- this.iconUri = iconUri;
+ mTitle = title;
+ mSubtitle = subtitle;
+ mDescription = description;
+ mIcon = icon;
+ mIconUri = iconUri;
}
@Override
public String toString() {
- return title + ", " + subtitle + ", " + description;
+ return mTitle + ", " + mSubtitle + ", " + mDescription;
}
}