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

Commit 7964718e authored by Marie Janssen's avatar Marie Janssen Committed by android-build-merger
Browse files

Merge "AVRCP: workaround invalid setBrowsedPlayer id"

am: d69d0128

Change-Id: I74d022ef04caa573f5b8c910ed6134c9f2fc81f7
parents dfaea129 d69d0128
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1550,8 +1550,15 @@ public final class Avrcp {
        // checking for error cases
        if (mMediaPlayerInfoList.isEmpty()) {
            status = AvrcpConstants.RSP_NO_AVBL_PLAY;
            Log.w(TAG, " No Available Players to set, sending response back ");
            Log.w(TAG, "setBrowsedPlayer: No available players! ");
        } else {
            // Workaround for broken controllers selecting ID 0
            // Seen at least on Ford, Chevrolet MyLink
            if (selectedId == 0) {
                Log.w(TAG, "setBrowsedPlayer: workaround invalid id 0");
                selectedId = mCurrAddrPlayerID;
            }

            // update current browse player id and start browsing service
            updateNewIds(mCurrAddrPlayerID, selectedId);
            String browsedPackage = getPackageName(selectedId);