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

Commit 1bf3ae8c authored by Nitin Arora's avatar Nitin Arora Committed by nitin arora
Browse files

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
parent f5e7138c
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -332,8 +332,12 @@ BOOLEAN btm_update_bg_conn_list(BOOLEAN to_add, BD_ADDR bd_addr, UINT8 *p_attr_t
                p_cb->bg_dev_num --;
                p_cb->bg_dev_num --;
                p_cur = p_bg_dev;
                p_cur = p_bg_dev;
                p_next = p_bg_dev + 1;
                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));
                    memcpy(p_cur, p_next, sizeof(tBTM_LE_BG_CONN_DEV));
                    memset(p_next, 0, sizeof(tBTM_LE_BG_CONN_DEV));
                }
            }
            }
            ret = TRUE;
            ret = TRUE;
            break;
            break;