Loading core/api/current.txt +8 −8 Original line number Original line Diff line number Diff line Loading @@ -24648,13 +24648,13 @@ package android.media { public final class MediaMetadata implements android.os.Parcelable { public final class MediaMetadata implements android.os.Parcelable { method public boolean containsKey(String); method public boolean containsKey(String); method public int describeContents(); method public int describeContents(); method public android.graphics.Bitmap getBitmap(String); method @Nullable public android.graphics.Bitmap getBitmap(String); method @IntRange(from=1) public int getBitmapDimensionLimit(); method @IntRange(from=1) public int getBitmapDimensionLimit(); method @NonNull public android.media.MediaDescription getDescription(); method @NonNull public android.media.MediaDescription getDescription(); method public long getLong(String); method public long getLong(String); method public android.media.Rating getRating(String); method @Nullable public android.media.Rating getRating(String); method public String getString(String); method @Nullable public String getString(String); method public CharSequence getText(String); method @Nullable public CharSequence getText(String); method public java.util.Set<java.lang.String> keySet(); method public java.util.Set<java.lang.String> keySet(); method public int size(); method public int size(); method public void writeToParcel(android.os.Parcel, int); method public void writeToParcel(android.os.Parcel, int); Loading Loading @@ -24694,11 +24694,11 @@ package android.media { ctor public MediaMetadata.Builder(); ctor public MediaMetadata.Builder(); ctor public MediaMetadata.Builder(android.media.MediaMetadata); ctor public MediaMetadata.Builder(android.media.MediaMetadata); method public android.media.MediaMetadata build(); method public android.media.MediaMetadata build(); method public android.media.MediaMetadata.Builder putBitmap(String, android.graphics.Bitmap); method public android.media.MediaMetadata.Builder putBitmap(String, @Nullable android.graphics.Bitmap); method public android.media.MediaMetadata.Builder putLong(String, long); method public android.media.MediaMetadata.Builder putLong(String, long); method public android.media.MediaMetadata.Builder putRating(String, android.media.Rating); method public android.media.MediaMetadata.Builder putRating(String, @Nullable android.media.Rating); method public android.media.MediaMetadata.Builder putString(String, String); method public android.media.MediaMetadata.Builder putString(String, @Nullable String); method public android.media.MediaMetadata.Builder putText(String, CharSequence); method public android.media.MediaMetadata.Builder putText(String, @Nullable CharSequence); method @NonNull public android.media.MediaMetadata.Builder setBitmapDimensionLimit(@IntRange(from=1) int); method @NonNull public android.media.MediaMetadata.Builder setBitmapDimensionLimit(@IntRange(from=1) int); } } media/java/android/media/MediaMetadata.java +14 −5 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.media; import android.annotation.IntRange; import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.StringDef; import android.annotation.StringDef; import android.compat.annotation.UnsupportedAppUsage; import android.compat.annotation.UnsupportedAppUsage; import android.content.ContentResolver; import android.content.ContentResolver; Loading Loading @@ -459,6 +460,7 @@ public final class MediaMetadata implements Parcelable { * @param key The key the value is stored under * @param key The key the value is stored under * @return a CharSequence value, or null * @return a CharSequence value, or null */ */ @Nullable public CharSequence getText(@TextKey String key) { public CharSequence getText(@TextKey String key) { return mBundle.getCharSequence(key); return mBundle.getCharSequence(key); } } Loading @@ -472,6 +474,7 @@ public final class MediaMetadata implements Parcelable { * @param key The key the value is stored under * @param key The key the value is stored under * @return a String value, or null * @return a String value, or null */ */ @Nullable public String getString(@TextKey String key) { public String getString(@TextKey String key) { CharSequence text = getText(key); CharSequence text = getText(key); if (text != null) { if (text != null) { Loading @@ -498,12 +501,13 @@ public final class MediaMetadata implements Parcelable { * @param key The key the value is stored under * @param key The key the value is stored under * @return A {@link Rating} or null * @return A {@link Rating} or null */ */ @Nullable public Rating getRating(@RatingKey String key) { public Rating getRating(@RatingKey String key) { Rating rating = null; Rating rating = null; try { try { rating = mBundle.getParcelable(key, android.media.Rating.class); rating = mBundle.getParcelable(key, android.media.Rating.class); } catch (Exception e) { } catch (Exception e) { // ignore, value was not a bitmap // ignore, value was not a rating Log.w(TAG, "Failed to retrieve a key as Rating.", e); Log.w(TAG, "Failed to retrieve a key as Rating.", e); } } return rating; return rating; Loading @@ -516,6 +520,7 @@ public final class MediaMetadata implements Parcelable { * @param key The key the value is stored under * @param key The key the value is stored under * @return A {@link Bitmap} or null * @return A {@link Bitmap} or null */ */ @Nullable public Bitmap getBitmap(@BitmapKey String key) { public Bitmap getBitmap(@BitmapKey String key) { Bitmap bmp = null; Bitmap bmp = null; try { try { Loading Loading @@ -662,6 +667,7 @@ public final class MediaMetadata implements Parcelable { * @hide * @hide */ */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) @Nullable public static String getKeyFromMetadataEditorKey(int editorKey) { public static String getKeyFromMetadataEditorKey(int editorKey) { return EDITOR_KEY_MAPPING.get(editorKey, null); return EDITOR_KEY_MAPPING.get(editorKey, null); } } Loading Loading @@ -798,7 +804,8 @@ public final class MediaMetadata implements Parcelable { * @param value The CharSequence value to store * @param value The CharSequence value to store * @return The Builder to allow chaining * @return The Builder to allow chaining */ */ public Builder putText(@TextKey String key, CharSequence value) { public Builder putText( @TextKey String key, @Nullable CharSequence value) { if (METADATA_KEYS_TYPE.containsKey(key)) { if (METADATA_KEYS_TYPE.containsKey(key)) { if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_TEXT) { if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_TEXT) { throw new IllegalArgumentException("The " + key throw new IllegalArgumentException("The " + key Loading Loading @@ -840,7 +847,7 @@ public final class MediaMetadata implements Parcelable { * @param value The String value to store * @param value The String value to store * @return The Builder to allow chaining * @return The Builder to allow chaining */ */ public Builder putString(@TextKey String key, String value) { public Builder putString(@TextKey String key, @Nullable String value) { if (METADATA_KEYS_TYPE.containsKey(key)) { if (METADATA_KEYS_TYPE.containsKey(key)) { if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_TEXT) { if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_TEXT) { throw new IllegalArgumentException("The " + key throw new IllegalArgumentException("The " + key Loading Loading @@ -891,7 +898,8 @@ public final class MediaMetadata implements Parcelable { * @param value The Rating value to store * @param value The Rating value to store * @return The Builder to allow chaining * @return The Builder to allow chaining */ */ public Builder putRating(@RatingKey String key, Rating value) { public Builder putRating( @RatingKey String key, @Nullable Rating value) { if (METADATA_KEYS_TYPE.containsKey(key)) { if (METADATA_KEYS_TYPE.containsKey(key)) { if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_RATING) { if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_RATING) { throw new IllegalArgumentException("The " + key throw new IllegalArgumentException("The " + key Loading Loading @@ -921,7 +929,8 @@ public final class MediaMetadata implements Parcelable { * @param value The Bitmap to store * @param value The Bitmap to store * @return The Builder to allow chaining * @return The Builder to allow chaining */ */ public Builder putBitmap(@BitmapKey String key, Bitmap value) { public Builder putBitmap( @BitmapKey String key, @Nullable Bitmap value) { if (METADATA_KEYS_TYPE.containsKey(key)) { if (METADATA_KEYS_TYPE.containsKey(key)) { if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_BITMAP) { if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_BITMAP) { throw new IllegalArgumentException("The " + key throw new IllegalArgumentException("The " + key Loading Loading
core/api/current.txt +8 −8 Original line number Original line Diff line number Diff line Loading @@ -24648,13 +24648,13 @@ package android.media { public final class MediaMetadata implements android.os.Parcelable { public final class MediaMetadata implements android.os.Parcelable { method public boolean containsKey(String); method public boolean containsKey(String); method public int describeContents(); method public int describeContents(); method public android.graphics.Bitmap getBitmap(String); method @Nullable public android.graphics.Bitmap getBitmap(String); method @IntRange(from=1) public int getBitmapDimensionLimit(); method @IntRange(from=1) public int getBitmapDimensionLimit(); method @NonNull public android.media.MediaDescription getDescription(); method @NonNull public android.media.MediaDescription getDescription(); method public long getLong(String); method public long getLong(String); method public android.media.Rating getRating(String); method @Nullable public android.media.Rating getRating(String); method public String getString(String); method @Nullable public String getString(String); method public CharSequence getText(String); method @Nullable public CharSequence getText(String); method public java.util.Set<java.lang.String> keySet(); method public java.util.Set<java.lang.String> keySet(); method public int size(); method public int size(); method public void writeToParcel(android.os.Parcel, int); method public void writeToParcel(android.os.Parcel, int); Loading Loading @@ -24694,11 +24694,11 @@ package android.media { ctor public MediaMetadata.Builder(); ctor public MediaMetadata.Builder(); ctor public MediaMetadata.Builder(android.media.MediaMetadata); ctor public MediaMetadata.Builder(android.media.MediaMetadata); method public android.media.MediaMetadata build(); method public android.media.MediaMetadata build(); method public android.media.MediaMetadata.Builder putBitmap(String, android.graphics.Bitmap); method public android.media.MediaMetadata.Builder putBitmap(String, @Nullable android.graphics.Bitmap); method public android.media.MediaMetadata.Builder putLong(String, long); method public android.media.MediaMetadata.Builder putLong(String, long); method public android.media.MediaMetadata.Builder putRating(String, android.media.Rating); method public android.media.MediaMetadata.Builder putRating(String, @Nullable android.media.Rating); method public android.media.MediaMetadata.Builder putString(String, String); method public android.media.MediaMetadata.Builder putString(String, @Nullable String); method public android.media.MediaMetadata.Builder putText(String, CharSequence); method public android.media.MediaMetadata.Builder putText(String, @Nullable CharSequence); method @NonNull public android.media.MediaMetadata.Builder setBitmapDimensionLimit(@IntRange(from=1) int); method @NonNull public android.media.MediaMetadata.Builder setBitmapDimensionLimit(@IntRange(from=1) int); } }
media/java/android/media/MediaMetadata.java +14 −5 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.media; import android.annotation.IntRange; import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.StringDef; import android.annotation.StringDef; import android.compat.annotation.UnsupportedAppUsage; import android.compat.annotation.UnsupportedAppUsage; import android.content.ContentResolver; import android.content.ContentResolver; Loading Loading @@ -459,6 +460,7 @@ public final class MediaMetadata implements Parcelable { * @param key The key the value is stored under * @param key The key the value is stored under * @return a CharSequence value, or null * @return a CharSequence value, or null */ */ @Nullable public CharSequence getText(@TextKey String key) { public CharSequence getText(@TextKey String key) { return mBundle.getCharSequence(key); return mBundle.getCharSequence(key); } } Loading @@ -472,6 +474,7 @@ public final class MediaMetadata implements Parcelable { * @param key The key the value is stored under * @param key The key the value is stored under * @return a String value, or null * @return a String value, or null */ */ @Nullable public String getString(@TextKey String key) { public String getString(@TextKey String key) { CharSequence text = getText(key); CharSequence text = getText(key); if (text != null) { if (text != null) { Loading @@ -498,12 +501,13 @@ public final class MediaMetadata implements Parcelable { * @param key The key the value is stored under * @param key The key the value is stored under * @return A {@link Rating} or null * @return A {@link Rating} or null */ */ @Nullable public Rating getRating(@RatingKey String key) { public Rating getRating(@RatingKey String key) { Rating rating = null; Rating rating = null; try { try { rating = mBundle.getParcelable(key, android.media.Rating.class); rating = mBundle.getParcelable(key, android.media.Rating.class); } catch (Exception e) { } catch (Exception e) { // ignore, value was not a bitmap // ignore, value was not a rating Log.w(TAG, "Failed to retrieve a key as Rating.", e); Log.w(TAG, "Failed to retrieve a key as Rating.", e); } } return rating; return rating; Loading @@ -516,6 +520,7 @@ public final class MediaMetadata implements Parcelable { * @param key The key the value is stored under * @param key The key the value is stored under * @return A {@link Bitmap} or null * @return A {@link Bitmap} or null */ */ @Nullable public Bitmap getBitmap(@BitmapKey String key) { public Bitmap getBitmap(@BitmapKey String key) { Bitmap bmp = null; Bitmap bmp = null; try { try { Loading Loading @@ -662,6 +667,7 @@ public final class MediaMetadata implements Parcelable { * @hide * @hide */ */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) @Nullable public static String getKeyFromMetadataEditorKey(int editorKey) { public static String getKeyFromMetadataEditorKey(int editorKey) { return EDITOR_KEY_MAPPING.get(editorKey, null); return EDITOR_KEY_MAPPING.get(editorKey, null); } } Loading Loading @@ -798,7 +804,8 @@ public final class MediaMetadata implements Parcelable { * @param value The CharSequence value to store * @param value The CharSequence value to store * @return The Builder to allow chaining * @return The Builder to allow chaining */ */ public Builder putText(@TextKey String key, CharSequence value) { public Builder putText( @TextKey String key, @Nullable CharSequence value) { if (METADATA_KEYS_TYPE.containsKey(key)) { if (METADATA_KEYS_TYPE.containsKey(key)) { if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_TEXT) { if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_TEXT) { throw new IllegalArgumentException("The " + key throw new IllegalArgumentException("The " + key Loading Loading @@ -840,7 +847,7 @@ public final class MediaMetadata implements Parcelable { * @param value The String value to store * @param value The String value to store * @return The Builder to allow chaining * @return The Builder to allow chaining */ */ public Builder putString(@TextKey String key, String value) { public Builder putString(@TextKey String key, @Nullable String value) { if (METADATA_KEYS_TYPE.containsKey(key)) { if (METADATA_KEYS_TYPE.containsKey(key)) { if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_TEXT) { if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_TEXT) { throw new IllegalArgumentException("The " + key throw new IllegalArgumentException("The " + key Loading Loading @@ -891,7 +898,8 @@ public final class MediaMetadata implements Parcelable { * @param value The Rating value to store * @param value The Rating value to store * @return The Builder to allow chaining * @return The Builder to allow chaining */ */ public Builder putRating(@RatingKey String key, Rating value) { public Builder putRating( @RatingKey String key, @Nullable Rating value) { if (METADATA_KEYS_TYPE.containsKey(key)) { if (METADATA_KEYS_TYPE.containsKey(key)) { if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_RATING) { if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_RATING) { throw new IllegalArgumentException("The " + key throw new IllegalArgumentException("The " + key Loading Loading @@ -921,7 +929,8 @@ public final class MediaMetadata implements Parcelable { * @param value The Bitmap to store * @param value The Bitmap to store * @return The Builder to allow chaining * @return The Builder to allow chaining */ */ public Builder putBitmap(@BitmapKey String key, Bitmap value) { public Builder putBitmap( @BitmapKey String key, @Nullable Bitmap value) { if (METADATA_KEYS_TYPE.containsKey(key)) { if (METADATA_KEYS_TYPE.containsKey(key)) { if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_BITMAP) { if (METADATA_KEYS_TYPE.get(key) != METADATA_TYPE_BITMAP) { throw new IllegalArgumentException("The " + key throw new IllegalArgumentException("The " + key Loading