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

Commit 2cf942c2 authored by Zhihai Xu's avatar Zhihai Xu
Browse files

treat BTA_BUSY as success to avoid unpair the BLE device

when switch from peripheral mode, both server and client will
call btif_gatt_check_encrypted_link, the first call will start the
encryption. the second call will get callback with BTA_BUSY status,
before encryption complete, which cause unpair with the remote device.
we shouldnot treat BTA_BUSY as error.

bug:13417692
Change-Id: I065432dde2553e8ccee3a14a7b321b85bca8d3ba
parent 45d4a673
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -271,7 +271,7 @@ static BOOLEAN btif_gatt_is_link_encrypted (BD_ADDR bd_addr)

static void btif_gatt_set_encryption_cb (BD_ADDR bd_addr, tBTA_STATUS result)
{
    if (result != BTA_SUCCESS)
    if (result != BTA_SUCCESS && result != BTA_BUSY)
    {
        bt_bdaddr_t bda;
        bdcpy(bda.address, bd_addr);
+1 −1
Original line number Diff line number Diff line
@@ -287,7 +287,7 @@ static BOOLEAN btm_ble_match_random_bda(UINT16 rec_index)
    {
        p_dev_rec = &btm_cb.sec_dev_rec[rec_index];

        BTM_TRACE_ERROR2("sec_flags = %02x device_type = %d", p_dev_rec->sec_flags, p_dev_rec->device_type);
        BTM_TRACE_DEBUG2("sec_flags = %02x device_type = %d", p_dev_rec->sec_flags, p_dev_rec->device_type);

        if ((p_dev_rec->device_type == BT_DEVICE_TYPE_BLE) &&
            (p_dev_rec->ble.key_type & BTM_LE_KEY_PID))