diff options
author | RoboErik <epastern@google.com> | 2014-09-26 15:25:55 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-09-26 15:25:55 +0000 |
commit | 4932877113fe7fc7d673a60d311c578fcb71c92f (patch) | |
tree | 9f131cf269b0fc88ed275227dace35f873056e07 /tests/OneMedia | |
parent | 2255f771f0ec4fe8cf9a0edce3c544860985836d (diff) | |
parent | 00bbe915de17df7e8210361f18e6dc53b4a0b382 (diff) | |
download | frameworks_base-4932877113fe7fc7d673a60d311c578fcb71c92f.zip frameworks_base-4932877113fe7fc7d673a60d311c578fcb71c92f.tar.gz frameworks_base-4932877113fe7fc7d673a60d311c578fcb71c92f.tar.bz2 |
am 00cbb751: am 5e8f023d: am a59c7f03: am dff59b8b: am 23df1c46: Merge "Allow null queues to be set in MediaSession" into lmp-dev
* commit '00cbb751533bf683480ba80f0c450c59c6ca96a1':
Allow null queues to be set in MediaSession
Diffstat (limited to 'tests/OneMedia')
-rw-r--r-- | tests/OneMedia/src/com/android/onemedia/PlayerSession.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/OneMedia/src/com/android/onemedia/PlayerSession.java b/tests/OneMedia/src/com/android/onemedia/PlayerSession.java index 9afcf24..141a209 100644 --- a/tests/OneMedia/src/com/android/onemedia/PlayerSession.java +++ b/tests/OneMedia/src/com/android/onemedia/PlayerSession.java @@ -25,6 +25,7 @@ import android.media.routing.MediaRouter.ConnectionRequest; import android.media.routing.MediaRouter.DestinationInfo; import android.media.routing.MediaRouter.RouteInfo; import android.media.session.MediaSession; +import android.media.session.MediaSession.QueueItem; import android.media.session.MediaSessionManager; import android.media.session.PlaybackState; import android.os.Bundle; @@ -53,6 +54,8 @@ public class PlayerSession { protected MediaSession.Callback mCallback; protected Renderer.Listener mRenderListener; protected MediaMetadata.Builder mMetadataBuilder; + protected ArrayList<MediaSession.QueueItem> mQueue; + protected boolean mUseQueue; protected PlaybackState mPlaybackState; protected Listener mListener; @@ -67,6 +70,7 @@ public class PlayerSession { PlaybackState.Builder psBob = new PlaybackState.Builder(); psBob.setActions(PlaybackState.ACTION_PAUSE | PlaybackState.ACTION_PLAY); mPlaybackState = psBob.build(); + mQueue = new ArrayList<MediaSession.QueueItem>(); mRenderer.registerListener(mRenderListener); @@ -138,6 +142,8 @@ public class PlayerSession { public void setIcon(Bitmap icon) { mMetadataBuilder.putBitmap(MediaMetadata.METADATA_KEY_DISPLAY_ICON, icon); + mQueue.clear(); + mQueue.add(new QueueItem(mMetadataBuilder.build().getDescription(), 11)); updateMetadata(); } @@ -146,6 +152,10 @@ public class PlayerSession { // code if (mSession != null && mSession.isActive()) { mSession.setMetadata(mMetadataBuilder.build()); + // Just toggle the queue every time we update for testing + mSession.setQueue(mUseQueue ? mQueue : null); + mSession.setQueueTitle(mUseQueue ? "Queue title" : null); + mUseQueue = !mUseQueue; } } @@ -165,6 +175,8 @@ public class PlayerSession { "OneMedia display title"); mMetadataBuilder.putString(MediaMetadata.METADATA_KEY_DISPLAY_SUBTITLE, "OneMedia display subtitle"); + + mQueue.add(new QueueItem(mMetadataBuilder.build().getDescription(), 11)); } public interface Listener { |