Bluetooth: Updates background conn list properly during unpair
This ensures background connection devices order properly so that
unpaired devices are removed and there is no duplicates for
same remote device and hence no unneccessary pending LE
create connection
Change-Id: Ia4af0b00c598983c04e0f5109d1eb54be924e9f8
diff --git a/stack/btm/btm_ble_bgconn.c b/stack/btm/btm_ble_bgconn.c
index b61fcb9..628a5d0 100644
--- a/stack/btm/btm_ble_bgconn.c
+++ b/stack/btm/btm_ble_bgconn.c
@@ -332,8 +332,12 @@
p_cb->bg_dev_num --;
p_cur = p_bg_dev;
p_next = p_bg_dev + 1;
- for (j = i + 1 ;j < BTM_BLE_MAX_BG_CONN_DEV_NUM && p_next->in_use ; j ++, p_cur ++, p_next ++ )
+ for (j = i + 1; j < BTM_BLE_MAX_BG_CONN_DEV_NUM && p_next->in_use;
+ j ++, p_cur ++, p_next ++)
+ {
memcpy(p_cur, p_next, sizeof(tBTM_LE_BG_CONN_DEV));
+ memset(p_next, 0, sizeof(tBTM_LE_BG_CONN_DEV));
+ }
}
ret = TRUE;
break;