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

Commit 8d492838 authored by slki.shin's avatar slki.shin
Browse files

Skip SDP search with an empty service class id



This fixes pairing failure with a device which has an empty service
class id along with RFCOMM protocol descriptor attribute as a service
search attribute response.
This caused SDP_FindServiceUUIDInDb() and
SDP_FindProtocolListElemInRec(UUID_PROTOCOL_RFCOMM) make true which in
turn scn_found flag is set to ture.
RFCOMM SCN is strangely handled with current AOSP implementation, means
SCN value is passed in disc_res.result field.
Typically disc_res.result should be BTA_SUCCESS or BTA_FAILURE but in
this case result value is larger than zero.
As a result, btif_dm_search_services_evt() treats this as a SDP failure
and sends an empty UUID to the Android frameworks.
To avoid this problem, SDP_FindServiceUUIDInDb() will not be excuted
with an empty UUID.

This issue is seen with JETTOUR X70 carkit:
Attribute List
	Attribute: Service Record Handle
		Service Record Handle: 0x 00 01 00 04
	Attribute: Service Class ID List
		UUID: Unknown UUID
	Attribute: Protocol Descriptor List
		UUID: L2CAP
		UUID: RFCOMM
			Channel Number: 16
	Attribute: Browse Group List
		UUID: Public Browse Group
	Attribute: Service Name
		String: Serial Port

Change-Id: Ib91a0e20621664eb3778c1716d5a40cc92edf8c9
Signed-off-by: default avatarslki.shin <slki.shin@samsung.com>
parent bb8e74d7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1357,8 +1357,10 @@ void bta_dm_sdp_result(tBTA_DM_MSG* p_data) {
    do {
      p_sdp_rec = NULL;
      if (bta_dm_search_cb.service_index == (BTA_USER_SERVICE_ID + 1)) {
        if (!bta_dm_search_cb.uuid.IsEmpty()) {
          p_sdp_rec = SDP_FindServiceUUIDInDb(bta_dm_search_cb.p_sdp_db,
                                              bta_dm_search_cb.uuid, p_sdp_rec);
        }

        if (p_sdp_rec && SDP_FindProtocolListElemInRec(
                             p_sdp_rec, UUID_PROTOCOL_RFCOMM, &pe)) {