From ade654f3dc3b8ff825d3b2158739de2e3d885b90 Mon Sep 17 00:00:00 2001 From: Satish Kodishala Date: Thu, 11 Aug 2016 10:21:48 +0530 Subject: [PATCH] Do SDP when HSP connection starts by remote Test: 1. Enable only HSP profile on AG. 2. Connect to AG from BT headset supporting HSP profile only with VGS 3. VOIP call (eg. skype, hangout) 4. Control the volume using AG volume keys. Failure: Volume changes are not taking affect. Rootcause: When remote is doing SDP first, HSP AG is skipping SDP. As a result, AG is not aware if remote supports remote volume control feature. Fix: Don't skip SDP when remote does SDP first. Do SDP always so that AG could find out if remote supports remote volume control feature. Fixes: 35657384 Change-Id: I73707f774dc4ec53cbd510ded15f28f87659eec3 --- bta/ag/bta_ag_sdp.cc | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/bta/ag/bta_ag_sdp.cc b/bta/ag/bta_ag_sdp.cc index 6be47a295..3920f1ed4 100644 --- a/bta/ag/bta_ag_sdp.cc +++ b/bta/ag/bta_ag_sdp.cc @@ -295,7 +295,8 @@ bool bta_ag_sdp_find_attr(tBTA_AG_SCB* p_scb, tBTA_SERVICE_MASK service) { uuid = UUID_SERVCLASS_HEADSET_HS; p_scb->peer_version = HSP_VERSION_1_2; /* Default version */ } else { - return result; + uuid = UUID_SERVCLASS_HEADSET_HS; + p_scb->peer_version = HSP_VERSION_1_0; } /* loop through all records we found */ @@ -410,9 +411,21 @@ void bta_ag_do_disc(tBTA_AG_SCB* p_scb, tBTA_SERVICE_MASK service) { uuid_list[0] = Uuid::From16Bit(UUID_SERVCLASS_HEADSET); } } - /* HSP acceptor; no discovery */ + /* HSP acceptor; get features */ else { - return; + attr_list[0] = ATTR_ID_SERVICE_CLASS_ID_LIST; + attr_list[1] = ATTR_ID_PROTOCOL_DESC_LIST; + attr_list[2] = ATTR_ID_BT_PROFILE_DESC_LIST; + attr_list[3] = ATTR_ID_REMOTE_AUDIO_VOLUME_CONTROL; + num_attr = 4; + + if (p_scb->hsp_version >= HSP_VERSION_1_2) { + uuid_list[0] = Uuid::From16Bit(UUID_SERVCLASS_HEADSET_HS); + num_uuid = 2; + } else { + /* Legacy from HSP v1.0 */ + uuid_list[0] = Uuid::From16Bit(UUID_SERVCLASS_HEADSET); + } } /* allocate buffer for sdp database */ -- 2.11.0