diff options
author | Brad Stenning <stenning@google.com> | 2017-08-16 11:26:11 -0700 |
---|---|---|
committer | Brad Stenning <stenning@google.com> | 2017-08-16 11:26:11 -0700 |
commit | d95a94eb57f87b30fe993365f4ee3ae0779ae535 (patch) | |
tree | c0c09bc7078b6f67117d1475e6232ff8e61adb9a | |
parent | 5a26f65866c011d4a519c563e61dc75b32e70532 (diff) | |
download | LocalMediaPlayer-d95a94eb57f87b30fe993365f4ee3ae0779ae535.tar.gz |
Internal queue was set to the same queue as the one in the data model.
This protects the queue from changes by external classes.
Bug: 62352340
Test: If using default install you can use first select the the playlist
from artist (has 154 elements) and play something from deep in the
list (greater than 25) then play from the album list (it's size is
24). It would crash immediately before this fix.
Change-Id: I64d9f392a3427ff37480469a22fd4a291ee66560
-rw-r--r-- | src/com/android/car/media/localmediaplayer/Player.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/com/android/car/media/localmediaplayer/Player.java b/src/com/android/car/media/localmediaplayer/Player.java index 6c1cc56..6ed15aa 100644 --- a/src/com/android/car/media/localmediaplayer/Player.java +++ b/src/com/android/car/media/localmediaplayer/Player.java @@ -319,7 +319,7 @@ public class Player extends MediaSession.Callback { return; } - mQueue = queue; + mQueue = new ArrayList<>(queue); mCurrentQueueIdx = foundIdx; QueueItem current = mQueue.get(mCurrentQueueIdx); String path = current.getDescription().getExtras().getString(DataModel.PATH_KEY); |