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

Commit 911de1a5 authored by Satish Kodishala's avatar Satish Kodishala Committed by Myles Watson
Browse files

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
parent 0d7fb838
Loading
Loading
Loading
Loading
+16 −3
Original line number Diff line number Diff line
@@ -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 */