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

Commit fecf5c56 authored by Ajay Panicker's avatar Ajay Panicker Committed by Andre Eisenbach
Browse files

Initialize the Media Player list at start

If the browsable list builder fails to receive any connect callbacks when
connecting to media services, we could be left in a state where the media
player list is uninitialized. This is fixed by always initializing the
media player list at the start of AVRCP.

Change-Id: I15088c1f4e8ffa2ac8a101339c9b47989fc17a5e
Fixes: 36151636
Test: Manually tested connecting AVRCP with AVIC-8100NEX
parent dfc2e8e7
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -270,14 +270,14 @@ public final class Avrcp {
        /* initialize BrowseMananger which manages Browse commands and response */
        mAvrcpBrowseManager = new AvrcpBrowseManager(mContext, mAvrcpMediaRsp);

        // Build the media players list
        buildMediaPlayersList();

        UserManager manager = UserManager.get(mContext);
        if (manager == null || manager.isUserUnlocked()) {
            if (DEBUG) Log.d(TAG, "User already unlocked, initializing player lists");
            // initialize browsable player list and build media player list
            (new BrowsablePlayerListBuilder()).start();
        } else {
            // Still build the media players list even if we can't browse.
            buildMediaPlayersList();
        }
    }