diff options
author | Ravi Nagarajan <nravi@broadcom.com> | 2012-06-12 15:04:47 +0530 |
---|---|---|
committer | Matthew Xie <mattx@google.com> | 2012-07-14 11:19:22 -0700 |
commit | bc95df786e2192ef45500f0ef31a2d057a19f831 (patch) | |
tree | cbee1e0b4536c6321a84cd8da231aa62e2ea6dd2 | |
parent | 9732649df910f59414250198494726c70a056a69 (diff) | |
download | external_bluetooth_bluedroid-bc95df786e2192ef45500f0ef31a2d057a19f831.zip external_bluetooth_bluedroid-bc95df786e2192ef45500f0ef31a2d057a19f831.tar.gz external_bluetooth_bluedroid-bc95df786e2192ef45500f0ef31a2d057a19f831.tar.bz2 |
Handle service discovery failure
For HID connection, hid and sdp connections could be attempted at the
same time. Some devices, that are short on resources, do not handle
this well, and reject our SDP L2CAP connection. SDP discovery failure
was not handled, leading to GKI exception. This has been resolved
Change-Id: Ib49d66c62a2d05a83b44b733d3c9c4259b5d4c6f
-rwxr-xr-x | btif/src/btif_dm.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c index 5e81480..a655364 100755 --- a/btif/src/btif_dm.c +++ b/btif/src/btif_dm.c @@ -513,10 +513,13 @@ static void search_services_copy_cb(UINT16 event, char *p_dest, char *p_src) { case BTA_DM_DISC_RES_EVT: { - if (p_src_data->disc_res.num_uuids > 0) + if ((p_src_data->disc_res.result == BTA_SUCCESS) && + (p_src_data->disc_res.num_uuids > 0)) + { p_dest_data->disc_res.p_uuid_list = (UINT8*)(p_dest + sizeof(tBTA_DM_SEARCH)); memcpy(p_dest_data->disc_res.p_uuid_list, p_src_data->disc_res.p_uuid_list, - p_src_data->disc_res.num_uuids*MAX_UUID_SIZE); + p_src_data->disc_res.num_uuids*MAX_UUID_SIZE); + } } break; } } @@ -986,7 +989,7 @@ static void btif_dm_search_services_evt(UINT16 event, char *p_param) p_data->disc_res.result, p_data->disc_res.services); prop.type = BT_PROPERTY_UUIDS; prop.len = 0; - if (p_data->disc_res.num_uuids > 0) + if ((p_data->disc_res.result == BTA_SUCCESS) && (p_data->disc_res.num_uuids > 0)) { prop.val = p_data->disc_res.p_uuid_list; prop.len = p_data->disc_res.num_uuids * MAX_UUID_SIZE; @@ -1391,7 +1394,7 @@ static void bte_dm_search_services_evt(tBTA_DM_SEARCH_EVT event, tBTA_DM_SEARCH { case BTA_DM_DISC_RES_EVT: { - if (p_data->disc_res.num_uuids > 0) { + if ((p_data->disc_res.result == BTA_SUCCESS) && (p_data->disc_res.num_uuids > 0)) { param_len += (p_data->disc_res.num_uuids * MAX_UUID_SIZE); } } break; |