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

Commit ce9bce66 authored by Sal Savage's avatar Sal Savage
Browse files

Disable browsed cover art by default

It has become difficult to provide browsed cover artwork given the race
condition between change path commands causing an OBEX level connection
refresh and a connection being required when we browse to receive image
handles at all. As a result, we typically miss the first 15-20 items'
image handles while we're waiting for the BIP connection to complete.

We were able to solve this for current track metadata by asking for it
again upon connecting, but it will require lots of work to be able to do
something similar with browsed content.

For the time being, for the sake of stability and a good UX, we will
disable browsed cover art.

Tag: #compatibility
Bug: 158036761
Test: atest BluetoothInstrumentationTests
Change-Id: I3ba17cf70728501bb7befe9db9439943f546872a
parent beda35e5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -75,6 +75,9 @@
    <!-- For enabling the AVRCP Controller Cover Artwork feature -->
    <bool name="avrcp_controller_enable_cover_art">false</bool>

    <!-- For enabling browsed cover art with the AVRCP Controller Cover Artwork feature -->
    <bool name="avrcp_controller_cover_art_browsed_images">false</bool>

    <!-- For enabling the hfp client connection service -->
    <bool name="hfp_client_connection_service_enabled">false</bool>

+10 −2
Original line number Diff line number Diff line
@@ -704,9 +704,12 @@ class AvrcpControllerStateMachine extends StateMachine {
                            + " received " + folderList.size());

                    // Queue up image download if the item has an image and we don't have it yet
                    // Only do this if the feature is enabled.
                    if (shouldDownloadBrowsedImages()) {
                        for (AvrcpItem track : folderList) {
                            downloadImageIfNeeded(track);
                        }
                    }

                    // Always update the node so that the user does not wait forever
                    // for the list to populate.
@@ -974,6 +977,11 @@ class AvrcpControllerStateMachine extends StateMachine {
        return newIndex;
    }

    private boolean shouldDownloadBrowsedImages() {
        return mService.getResources()
                .getBoolean(R.bool.avrcp_controller_cover_art_browsed_images);
    }

    private void downloadImageIfNeeded(AvrcpItem track) {
        if (mCoverArtManager == null) return;
        String handle = track.getCoverArtHandle();