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

Commit 788c863d authored by Nitin Arora's avatar Nitin Arora Committed by Andre Eisenbach
Browse files

Clear background conn list entries during BT power off

This clears whitelist entries and resets  bgconn device lists

Change-Id: I551791d63fa826071c113abd383540838f6c59b2
parent c28001d9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -435,6 +435,9 @@ void bta_dm_disable (tBTA_DM_MSG *p_data)
    bta_dm_disable_search_and_disc();
    bta_dm_cb.disabling = TRUE;

#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
    BTM_BleClearBgConnDev();
#endif

    if(BTM_GetNumAclLinks()==0)
    {
+1 −0
Original line number Diff line number Diff line
@@ -224,6 +224,7 @@ void btm_ble_clear_white_list (void)
{
    BTM_TRACE_EVENT ("btm_ble_clear_white_list");
    btsnd_hcic_ble_clear_white_list();
    memset(&btm_cb.ble_ctr_cb.bg_dev_list, 0, (sizeof(tBTM_LE_BG_CONN_DEV)*BTM_BLE_MAX_BG_CONN_DEV_NUM));
}

/*******************************************************************************
+21 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@
#include "vendor_ble.h"
#endif
#include "gattdefs.h"
#include "gatt_int.h"

#include "btm_ble_int.h"

@@ -701,6 +702,26 @@ BOOLEAN BTM_BleSetBgConnType(tBTM_BLE_CONN_TYPE bg_conn_type,
    return started;
}

/*******************************************************************************
**
** Function         BTM_BleClearBgConnDev
**
** Description      This function is called to clear the whitelist,
**                  end any pending whitelist connections,
*                   and reset the local bg device list.
**
** Parameters       void
**
** Returns          void
**
*******************************************************************************/
void BTM_BleClearBgConnDev(void)
{
    btm_ble_start_auto_conn(FALSE);
    btm_ble_clear_white_list();
    gatt_reset_bgdev_list();
}

/*******************************************************************************
**
** Function         BTM_BleUpdateBgConnDev
+14 −0
Original line number Diff line number Diff line
@@ -771,6 +771,20 @@ BTM_API extern BOOLEAN BTM_BleSetBgConnType(tBTM_BLE_CONN_TYPE conn_type,
*******************************************************************************/
BTM_API extern BOOLEAN BTM_BleUpdateBgConnDev(BOOLEAN add_remove, BD_ADDR   remote_bda);

/*******************************************************************************
**
** Function         BTM_BleClearBgConnDev
**
** Description      This function is called to clear the whitelist,
**                  end any pending whitelist connections,
*                   and reset the local bg device list.
**
** Parameters       void
**
** Returns          void
**
*******************************************************************************/
BTM_API extern void BTM_BleClearBgConnDev(void);

/********************************************************
**