Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cfccb929 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "AVRCP: Cache queue in isMetadataSynced" am: 3be43222

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Bluetooth/+/1455920

Change-Id: I1cd16dacb15d96b6d4e69657bffafb3d6ef3d882
parents fd35a6ac 3be43222
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -212,11 +212,12 @@ public class MediaPlayerWrapper {
     * Return whether the queue, metadata, and queueID are all in sync.
     * Return whether the queue, metadata, and queueID are all in sync.
     */
     */
    boolean isMetadataSynced() {
    boolean isMetadataSynced() {
        if (getQueue() != null && getActiveQueueID() != -1) {
        List<MediaSession.QueueItem> queue = getQueue();
        if (queue != null && getActiveQueueID() != -1) {
            // Check if currentPlayingQueueId is in the current Queue
            // Check if currentPlayingQueueId is in the current Queue
            MediaSession.QueueItem currItem = null;
            MediaSession.QueueItem currItem = null;


            for (MediaSession.QueueItem item : getQueue()) {
            for (MediaSession.QueueItem item : queue) {
                if (item.getQueueId()
                if (item.getQueueId()
                        == getActiveQueueID()) { // The item exists in the current queue
                        == getActiveQueueID()) { // The item exists in the current queue
                    currItem = item;
                    currItem = item;