Search in sources :

Example 11 with QueueItem

use of android.media.session.MediaSession.QueueItem in project android_frameworks_base by DirtyUnicorns.

the class MediaSessions method dump.

private static void dump(int n, PrintWriter writer, MediaController c) {
    writer.println("  Controller " + n + ": " + c.getPackageName());
    final Bundle extras = c.getExtras();
    final long flags = c.getFlags();
    final MediaMetadata mm = c.getMetadata();
    final PlaybackInfo pi = c.getPlaybackInfo();
    final PlaybackState playbackState = c.getPlaybackState();
    final List<QueueItem> queue = c.getQueue();
    final CharSequence queueTitle = c.getQueueTitle();
    final int ratingType = c.getRatingType();
    final PendingIntent sessionActivity = c.getSessionActivity();
    writer.println("    PlaybackState: " + Util.playbackStateToString(playbackState));
    writer.println("    PlaybackInfo: " + Util.playbackInfoToString(pi));
    if (mm != null) {
        writer.println("  MediaMetadata.desc=" + mm.getDescription());
    }
    writer.println("    RatingType: " + ratingType);
    writer.println("    Flags: " + flags);
    if (extras != null) {
        writer.println("    Extras:");
        for (String key : extras.keySet()) {
            writer.println("      " + key + "=" + extras.get(key));
        }
    }
    if (queueTitle != null) {
        writer.println("    QueueTitle: " + queueTitle);
    }
    if (queue != null && !queue.isEmpty()) {
        writer.println("    Queue:");
        for (QueueItem qi : queue) {
            writer.println("      " + qi);
        }
    }
    if (pi != null) {
        writer.println("    sessionActivity: " + sessionActivity);
    }
}
Also used : Bundle(android.os.Bundle) PlaybackInfo(android.media.session.MediaController.PlaybackInfo) MediaMetadata(android.media.MediaMetadata) PlaybackState(android.media.session.PlaybackState) QueueItem(android.media.session.MediaSession.QueueItem) PendingIntent(android.app.PendingIntent)

Example 12 with QueueItem

use of android.media.session.MediaSession.QueueItem in project android_frameworks_base by DirtyUnicorns.

the class PlayerSession method setIcon.

public void setIcon(Bitmap icon) {
    mMetadataBuilder.putBitmap(MediaMetadata.METADATA_KEY_DISPLAY_ICON, icon);
    mQueue.clear();
    mQueue.add(new QueueItem(mMetadataBuilder.build().getDescription(), 11));
    updateMetadata();
}
Also used : QueueItem(android.media.session.MediaSession.QueueItem)

Example 13 with QueueItem

use of android.media.session.MediaSession.QueueItem in project android_frameworks_base by ResurrectionRemix.

the class MediaSessions method dump.

private static void dump(int n, PrintWriter writer, MediaController c) {
    writer.println("  Controller " + n + ": " + c.getPackageName());
    final Bundle extras = c.getExtras();
    final long flags = c.getFlags();
    final MediaMetadata mm = c.getMetadata();
    final PlaybackInfo pi = c.getPlaybackInfo();
    final PlaybackState playbackState = c.getPlaybackState();
    final List<QueueItem> queue = c.getQueue();
    final CharSequence queueTitle = c.getQueueTitle();
    final int ratingType = c.getRatingType();
    final PendingIntent sessionActivity = c.getSessionActivity();
    writer.println("    PlaybackState: " + Util.playbackStateToString(playbackState));
    writer.println("    PlaybackInfo: " + Util.playbackInfoToString(pi));
    if (mm != null) {
        writer.println("  MediaMetadata.desc=" + mm.getDescription());
    }
    writer.println("    RatingType: " + ratingType);
    writer.println("    Flags: " + flags);
    if (extras != null) {
        writer.println("    Extras:");
        for (String key : extras.keySet()) {
            writer.println("      " + key + "=" + extras.get(key));
        }
    }
    if (queueTitle != null) {
        writer.println("    QueueTitle: " + queueTitle);
    }
    if (queue != null && !queue.isEmpty()) {
        writer.println("    Queue:");
        for (QueueItem qi : queue) {
            writer.println("      " + qi);
        }
    }
    if (pi != null) {
        writer.println("    sessionActivity: " + sessionActivity);
    }
}
Also used : Bundle(android.os.Bundle) PlaybackInfo(android.media.session.MediaController.PlaybackInfo) MediaMetadata(android.media.MediaMetadata) PlaybackState(android.media.session.PlaybackState) QueueItem(android.media.session.MediaSession.QueueItem) PendingIntent(android.app.PendingIntent)

Aggregations

QueueItem (android.media.session.MediaSession.QueueItem)13 MediaMetadata (android.media.MediaMetadata)9 PendingIntent (android.app.PendingIntent)5 PlaybackInfo (android.media.session.MediaController.PlaybackInfo)5 PlaybackState (android.media.session.PlaybackState)5 Bundle (android.os.Bundle)5