From: Andre Eisenbach Date: Tue, 23 Jul 2013 22:57:27 +0000 (-0700) Subject: LE: Fix for back-to-back GATT connection request issues X-Git-Tag: android-x86-4.4-r1~47^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ce7b04f96f5e2a083ae46b56f5c69be306b72fc1;p=android-x86%2Fexternal-bluetooth-bluedroid.git LE: Fix for back-to-back GATT connection request issues When two GATT client connections were sent back to back, the first connection will not be processed due to an address comparison error. This patch corrects the error. Change-Id: I8eb97cd2a34a81da460f448dc71445b2898a5d32 --- diff --git a/bta/gatt/bta_gattc_utils.c b/bta/gatt/bta_gattc_utils.c index 151b7ba..8392f8d 100644 --- a/bta/gatt/bta_gattc_utils.c +++ b/bta/gatt/bta_gattc_utils.c @@ -172,8 +172,7 @@ tBTA_GATTC_CLCB * bta_gattc_find_clcb_by_cif (UINT8 client_if, BD_ADDR remote_bd { if (p_clcb->in_use && p_clcb->p_rcb->client_if == client_if && - p_clcb->p_srcb && - bdcmp(p_clcb->p_srcb->server_bda, remote_bda) == 0) + bdcmp(p_clcb->bda, remote_bda) == 0) return p_clcb; } return NULL; @@ -400,7 +399,7 @@ tBTA_GATTC_SERV * bta_gattc_srcb_alloc(BD_ADDR bda) /* if not found, try to recycle one known device */ if (!found && !p_recycle) p_tcb = NULL; - else if (p_recycle) + else if (!found && p_recycle) p_tcb = p_recycle; if (p_tcb != NULL)