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

Commit 16c94626 authored by Srinu Jella's avatar Srinu Jella Committed by Andre Eisenbach
Browse files

Remove stored link key for temporarily paired devices

Problem: Device shows up in paired list during just work pairing

1. Create a connection from DUT to remote.
2. Remove the link key in remote.
3. Send a file from remote to DUT.
4. Turn OFF BT. Turn ON.

Failure: Device should not move to paired list after BT on/off
as device removed from UI during just work pairing

Root cause: remote device is not removed from btif but
its removed from UI during justworks pairing

Fix: remote device is removed from btif during justworks
pairing to sync up UI and btif paired list

Bug: 19417758
Change-Id: I73de0a94c4f7ada644d258790a9e3e4bf11fc4e5
parent ab82de6c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -133,6 +133,18 @@ bt_status_t btif_storage_add_bonded_device(bt_bdaddr_t *remote_bd_addr,
*******************************************************************************/
bt_status_t btif_storage_remove_bonded_device(bt_bdaddr_t *remote_bd_addr);

/******************************************************************************
**
** Function         btif_storage_is_device_bonded
**
** Description      BTIF storage API - checks if device present in bonded list
**
** Returns          TRUE if the device is bonded,
**                  FALSE otherwise
**
*******************************************************************************/
BOOLEAN btif_storage_is_device_bonded(bt_bdaddr_t *remote_bd_addr);

/*******************************************************************************
**
** Function         btif_storage_remove_bonded_device
+3 −0
Original line number Diff line number Diff line
@@ -1108,6 +1108,9 @@ static void btif_dm_auth_cmpl_evt (tBTA_DM_AUTH_CMPL *p_auth_cmpl)
            {
                BTIF_TRACE_DEBUG("%s: sending BT_BOND_STATE_NONE for Temp pairing",
                        __FUNCTION__);
                if (btif_storage_is_device_bonded(&bd_addr) == TRUE) {
                    btif_storage_remove_bonded_device(&bd_addr);
                }
                bond_state_changed(BT_STATUS_SUCCESS, &bd_addr, BT_BOND_STATE_NONE);
                return;
            }
+17 −0
Original line number Diff line number Diff line
@@ -591,6 +591,23 @@ static void btif_read_le_key(const uint8_t key_type, const size_t key_len, bt_bd
 * the property->type.
 *******************************************************************************/

/*****************************************************************************
**
** Function         btif_storage_is_device_bonded
**
** Description      BTIF storage API - checks if device present in bonded list
**
** Returns          TRUE if the device is bonded,
**                  FALSE otherwise
**
*******************************************************************************/
BOOLEAN btif_storage_is_device_bonded(bt_bdaddr_t *remote_bd_addr)
{
    bdstr_t bdstr;
    bdaddr_to_string(remote_bd_addr, bdstr, sizeof(bdstr));
    return (btif_in_fetch_bonded_device(bdstr) == BT_STATUS_SUCCESS);
}

/*******************************************************************************
**
** Function         btif_storage_get_adapter_property