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

Commit bd5ca43e authored by Etienne Ruffieux's avatar Etienne Ruffieux
Browse files

Remove album comparison in queue update.

The isQueueUpdated method is comparing album but this is a value
that some players don't provide until the song is playing.
As we are comparing the queue elements, we can't base it on album
metadata.

Flag: exempt trivial
Test: atest BluetoothInstrumentationTests
Bug: 346730065
Change-Id: I31691a94879c0c4d4e79d312bc5dddbc7939648d
parent 285e9ff7
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -607,8 +607,7 @@ public class AvrcpTargetService extends ProfileService {
            Metadata newMetadata = newQueue.get(index);

            if (!Objects.equals(currentMetadata.title, newMetadata.title)
                    || !Objects.equals(currentMetadata.artist, newMetadata.artist)
                    || !Objects.equals(currentMetadata.album, newMetadata.album)) {
                    || !Objects.equals(currentMetadata.artist, newMetadata.artist)) {
                return true;
            }
        }
+1 −4
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ public class AvrcpTargetServiceTest {
        assertThat(AvrcpTargetService.isQueueUpdated(firstQueue, secondQueue)).isTrue();

        firstQueue.add(createEmptyMetadata());
        firstQueue.get(1).album = TEST_DATA;
        firstQueue.get(1).genre = TEST_DATA;
        firstQueue.get(1).mediaId = TEST_DATA;
        firstQueue.get(1).trackNum = TEST_DATA;
@@ -68,10 +69,6 @@ public class AvrcpTargetServiceTest {
        secondQueue.set(1, createEmptyMetadata());
        secondQueue.get(1).artist = TEST_DATA;
        assertThat(AvrcpTargetService.isQueueUpdated(firstQueue, secondQueue)).isTrue();

        secondQueue.set(1, createEmptyMetadata());
        secondQueue.get(1).album = TEST_DATA;
        assertThat(AvrcpTargetService.isQueueUpdated(firstQueue, secondQueue)).isTrue();
    }

    private Metadata createEmptyMetadata() {