Commit 1c512b85 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
parent 3e4f01ad
......@@ -82,6 +82,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
......
......@@ -1424,6 +1424,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
......
......@@ -457,7 +457,9 @@ void handle_rc_ctrl_features(BD_ADDR bd_addr)
* update.
*/
btif_rc_cb.rc_features_processed = TRUE;
getcapabilities_cmd (AVRC_CAP_COMPANY_ID);
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);
HAL_CBACK(bt_rc_ctrl_callbacks, getrcfeatures_cb, &rc_addr, 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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment