Bluetooth: GAP: Allow only one pairing from btif layer at one time
This patch prevents any new pairing request from some other remote
device if pairing has been initiated with a particular remote
device.
CRs-Fixed: 753366
Change-Id: Id17e3f90904d2c53f1466a72253a25a38d753138
diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c
index 35627af..649f2ba 100644
--- a/btif/src/btif_dm.c
+++ b/btif/src/btif_dm.c
@@ -943,6 +943,13 @@
/* check for auto pair possiblity only if bond was initiated by local device */
if (pairing_cb.is_local_initiated && (p_pin_req->min_16_digit == FALSE))
{
+ if (bdcmp(pairing_cb.bd_addr, bd_addr.address))
+ {
+ /* Pin code from different device reject it as we dont support more than 1 pairing */
+ BTIF_TRACE_DEBUG("%s()rejecting pairing request", __FUNCTION__);
+ BTA_DmPinReply( (UINT8*)bd_addr.address, FALSE, 0, NULL);
+ return;
+ }
if (check_cod(&bd_addr, COD_AV_HEADSETS) ||
check_cod(&bd_addr, COD_AV_HANDSFREE) ||
check_cod(&bd_addr, COD_AV_HEADPHONES) ||