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

Commit ac84df6e authored by AnubhavGupta's avatar AnubhavGupta Committed by Andre Eisenbach
Browse files

Do not request AVRC_CAP_COMPANY_ID if A2DP Sink is not enabled

Also fixed AVRC_PDU_GET_PLAY_STATUS timeout response.

Bug: 28177785
Change-Id: Icde64a5c1806453850abe101f9707fff61566566
(cherry picked from commit 1c512b851d76deac860fce1232e4a1fa1a097f1c)
parent e479cfbd
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -79,6 +79,17 @@ btif_sm_handle_t btif_av_get_sm_handle(void);

bt_bdaddr_t btif_av_get_addr(void);

/*******************************************************************************
** Function         btif_av_is_sink_enabled
**
** Description      Checks if A2DP Sink is enabled or not
**
** Returns          TRUE if A2DP Sink is enabled, false otherwise
**
*******************************************************************************/

BOOLEAN btif_av_is_sink_enabled(void);

/*******************************************************************************
**
** Function         btif_av_stream_ready
+14 −0
Original line number Diff line number Diff line
@@ -1426,6 +1426,20 @@ bt_bdaddr_t btif_av_get_addr(void)
    return btif_av_cb.peer_bda;
}

/*******************************************************************************
** Function         btif_av_is_sink_enabled
**
** Description      Checks if A2DP Sink is enabled or not
**
** Returns          TRUE if A2DP Sink is enabled, false otherwise
**
*******************************************************************************/

BOOLEAN btif_av_is_sink_enabled(void)
{
    return (bt_av_sink_callbacks != NULL) ? TRUE : FALSE;
}

/*******************************************************************************
**
** Function         btif_av_stream_ready
+5 −3
Original line number Diff line number Diff line
@@ -457,6 +457,8 @@ void handle_rc_ctrl_features(BD_ADDR bd_addr)
             * update.
             */
            btif_rc_cb.rc_features_processed = TRUE;

            if (btif_av_is_sink_enabled())
                getcapabilities_cmd (AVRC_CAP_COMPANY_ID);
        }
        BTIF_TRACE_DEBUG("%s Update rc features to CTRL %d", __FUNCTION__, rc_features);
@@ -2090,8 +2092,8 @@ static void btif_rc_status_cmd_timeout_handler(UNUSED_ATTR uint16_t event,
        break;

    case AVRC_PDU_GET_PLAY_STATUS:
        avrc_response.get_caps.status = BTIF_RC_STS_TIMEOUT;
        handle_get_capability_response(&meta_msg, &avrc_response.get_caps);
        avrc_response.get_play_status.status = BTIF_RC_STS_TIMEOUT;
        handle_get_playstatus_response(&meta_msg, &avrc_response.get_play_status);
        break;
    }
    release_transaction(p_context->rc_status_cmd.label);