FileDocCategorySizeDatePackage
MediaSessionCompatApi19.javaAPI DocAndroid 5.1 API3805Thu Mar 12 22:22:56 GMT 2015android.support.v4.media.session

MediaSessionCompatApi19

public class MediaSessionCompatApi19 extends Object

Fields Summary
private static final String
METADATA_KEY_ART
MediaMetadata keys
private static final String
METADATA_KEY_ALBUM_ART
private static final String
METADATA_KEY_USER_RATING
private static final String
METADATA_KEY_RATING
Constructors Summary
Methods Summary
static voidaddNewMetadata(android.os.Bundle metadata, RemoteControlClient.MetadataEditor editor)

        if (metadata.containsKey(METADATA_KEY_RATING)) {
            editor.putObject(MediaMetadataEditor.RATING_KEY_BY_OTHERS,
                    metadata.getParcelable(METADATA_KEY_RATING));
        }
        if (metadata.containsKey(METADATA_KEY_USER_RATING)) {
            editor.putObject(MediaMetadataEditor.RATING_KEY_BY_USER,
                    metadata.getParcelable(METADATA_KEY_USER_RATING));
        }
        if (metadata.containsKey(METADATA_KEY_ART)) {
            Bitmap art = metadata.getParcelable(METADATA_KEY_ART);
            editor.putBitmap(MediaMetadataEditor.BITMAP_KEY_ARTWORK, art);
        } else if (metadata.containsKey(METADATA_KEY_ALBUM_ART)) {
            // Fall back to album art if the track art wasn't available
            Bitmap art = metadata.getParcelable(METADATA_KEY_ALBUM_ART);
            editor.putBitmap(MediaMetadataEditor.BITMAP_KEY_ARTWORK, art);
        }
    
public static java.lang.ObjectcreateMetadataUpdateListener(MediaSessionCompatApi14.Callback callback)


         
        return new OnMetadataUpdateListener<MediaSessionCompatApi14.Callback>(callback);
    
public static voidsetMetadata(java.lang.Object rccObj, android.os.Bundle metadata, boolean supportRating)

        RemoteControlClient.MetadataEditor editor = ((RemoteControlClient) rccObj).editMetadata(
                true);
        MediaSessionCompatApi14.buildOldMetadata(metadata, editor);
        addNewMetadata(metadata, editor);
        if (supportRating && android.os.Build.VERSION.SDK_INT > 19) {
            editor.addEditableKey(RemoteControlClient.MetadataEditor.RATING_KEY_BY_USER);
        }
        editor.apply();
    
public static voidsetOnMetadataUpdateListener(java.lang.Object rccObj, java.lang.Object onMetadataUpdateObj)

        ((RemoteControlClient) rccObj).setMetadataUpdateListener(
                (RemoteControlClient.OnMetadataUpdateListener) onMetadataUpdateObj);