Loading core/api/current.txt +8 −8 Original line number Diff line number Diff line Loading @@ -24667,13 +24667,13 @@ package android.media { public final class MediaMetadata implements android.os.Parcelable { method public boolean containsKey(String); 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 @NonNull public android.media.MediaDescription getDescription(); method public long getLong(String); method public android.media.Rating getRating(String); method public String getString(String); method public CharSequence getText(String); method @Nullable public android.media.Rating getRating(String); method @Nullable public String getString(String); method @Nullable public CharSequence getText(String); method public java.util.Set<java.lang.String> keySet(); method public int size(); method public void writeToParcel(android.os.Parcel, int); Loading Loading @@ -24713,11 +24713,11 @@ package android.media { ctor public MediaMetadata.Builder(); ctor public MediaMetadata.Builder(android.media.MediaMetadata); 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 putRating(String, android.media.Rating); method public android.media.MediaMetadata.Builder putString(String, String); method public android.media.MediaMetadata.Builder putText(String, CharSequence); method public android.media.MediaMetadata.Builder putRating(String, @Nullable android.media.Rating); method public android.media.MediaMetadata.Builder putString(String, @Nullable String); method public android.media.MediaMetadata.Builder putText(String, @Nullable CharSequence); method @NonNull public android.media.MediaMetadata.Builder setBitmapDimensionLimit(@IntRange(from=1) int); } media/java/android/media/MediaMetadata.java +14 −5 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.media; import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.StringDef; import android.compat.annotation.UnsupportedAppUsage; 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 * @return a CharSequence value, or null */ @Nullable public CharSequence getText(@TextKey String 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 * @return a String value, or null */ @Nullable public String getString(@TextKey String key) { CharSequence text = getText(key); if (text != null) { Loading @@ -498,12 +501,13 @@ public final class MediaMetadata implements Parcelable { * @param key The key the value is stored under * @return A {@link Rating} or null */ @Nullable public Rating getRating(@RatingKey String key) { Rating rating = null; try { rating = mBundle.getParcelable(key, android.media.Rating.class); } 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); } return rating; Loading @@ -516,6 +520,7 @@ public final class MediaMetadata implements Parcelable { * @param key The key the value is stored under * @return A {@link Bitmap} or null */ @Nullable public Bitmap getBitmap(@BitmapKey String key) { Bitmap bmp = null; try { Loading Loading @@ -662,6 +667,7 @@ public final class MediaMetadata implements Parcelable { * @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) @Nullable public static String getKeyFromMetadataEditorKey(int editorKey) { 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 * @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.get(key) != METADATA_TYPE_TEXT) { throw new IllegalArgumentException("The " + key Loading Loading @@ -840,7 +847,7 @@ public final class MediaMetadata implements Parcelable { * @param value The String value to store * @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.get(key) != METADATA_TYPE_TEXT) { throw new IllegalArgumentException("The " + key Loading Loading @@ -891,7 +898,8 @@ public final class MediaMetadata implements Parcelable { * @param value The Rating value to store * @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.get(key) != METADATA_TYPE_RATING) { throw new IllegalArgumentException("The " + key Loading Loading @@ -921,7 +929,8 @@ public final class MediaMetadata implements Parcelable { * @param value The Bitmap to store * @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.get(key) != METADATA_TYPE_BITMAP) { throw new IllegalArgumentException("The " + key Loading Loading
core/api/current.txt +8 −8 Original line number Diff line number Diff line Loading @@ -24667,13 +24667,13 @@ package android.media { public final class MediaMetadata implements android.os.Parcelable { method public boolean containsKey(String); 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 @NonNull public android.media.MediaDescription getDescription(); method public long getLong(String); method public android.media.Rating getRating(String); method public String getString(String); method public CharSequence getText(String); method @Nullable public android.media.Rating getRating(String); method @Nullable public String getString(String); method @Nullable public CharSequence getText(String); method public java.util.Set<java.lang.String> keySet(); method public int size(); method public void writeToParcel(android.os.Parcel, int); Loading Loading @@ -24713,11 +24713,11 @@ package android.media { ctor public MediaMetadata.Builder(); ctor public MediaMetadata.Builder(android.media.MediaMetadata); 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 putRating(String, android.media.Rating); method public android.media.MediaMetadata.Builder putString(String, String); method public android.media.MediaMetadata.Builder putText(String, CharSequence); method public android.media.MediaMetadata.Builder putRating(String, @Nullable android.media.Rating); method public android.media.MediaMetadata.Builder putString(String, @Nullable String); method public android.media.MediaMetadata.Builder putText(String, @Nullable CharSequence); method @NonNull public android.media.MediaMetadata.Builder setBitmapDimensionLimit(@IntRange(from=1) int); }
media/java/android/media/MediaMetadata.java +14 −5 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.media; import android.annotation.IntRange; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.StringDef; import android.compat.annotation.UnsupportedAppUsage; 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 * @return a CharSequence value, or null */ @Nullable public CharSequence getText(@TextKey String 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 * @return a String value, or null */ @Nullable public String getString(@TextKey String key) { CharSequence text = getText(key); if (text != null) { Loading @@ -498,12 +501,13 @@ public final class MediaMetadata implements Parcelable { * @param key The key the value is stored under * @return A {@link Rating} or null */ @Nullable public Rating getRating(@RatingKey String key) { Rating rating = null; try { rating = mBundle.getParcelable(key, android.media.Rating.class); } 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); } return rating; Loading @@ -516,6 +520,7 @@ public final class MediaMetadata implements Parcelable { * @param key The key the value is stored under * @return A {@link Bitmap} or null */ @Nullable public Bitmap getBitmap(@BitmapKey String key) { Bitmap bmp = null; try { Loading Loading @@ -662,6 +667,7 @@ public final class MediaMetadata implements Parcelable { * @hide */ @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) @Nullable public static String getKeyFromMetadataEditorKey(int editorKey) { 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 * @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.get(key) != METADATA_TYPE_TEXT) { throw new IllegalArgumentException("The " + key Loading Loading @@ -840,7 +847,7 @@ public final class MediaMetadata implements Parcelable { * @param value The String value to store * @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.get(key) != METADATA_TYPE_TEXT) { throw new IllegalArgumentException("The " + key Loading Loading @@ -891,7 +898,8 @@ public final class MediaMetadata implements Parcelable { * @param value The Rating value to store * @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.get(key) != METADATA_TYPE_RATING) { throw new IllegalArgumentException("The " + key Loading Loading @@ -921,7 +929,8 @@ public final class MediaMetadata implements Parcelable { * @param value The Bitmap to store * @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.get(key) != METADATA_TYPE_BITMAP) { throw new IllegalArgumentException("The " + key Loading