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

Commit dec51835 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Fix pairing multiple devices in a row

If we don't cleanup the control block, pairing can get "stuck" and
pairing next device would be impossible without restarting Bluetooth.

Without this patch, folowing scenario fails:
1. Pair Dual mode capable LE Audio earbuds (set CSIS devices)
2. Pair another dual mode capable LE Audio earbuds (set of CSIS devices)
3. Pair HID remote (FAILS)

Sometimes step 2 is not needed for step 3 to fail.

Test: see commit message
Bug: 248340112
Change-Id: Idef1fe5e6c50d42c1a65281e02cfcfd7db2cdad3
parent 69a8fbed
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -1680,11 +1680,8 @@ static void btif_dm_search_services_evt(tBTA_DM_SEARCH_EVT event,
              btif_dm_pairing_cb_t::ServiceDiscoveryState::SCHEDULED) {
        // Both SDP and bonding are either done, or not scheduled, we are safe
        // to clear the service discovery part of CB.
        pairing_cb.gatt_over_le =
            btif_dm_pairing_cb_t::ServiceDiscoveryState::NOT_STARTED;
        pairing_cb.sdp_over_classic =
            btif_dm_pairing_cb_t::ServiceDiscoveryState::NOT_STARTED;
        LOG_INFO("clearing service discovery part of pairing_cb");
        LOG_INFO("clearing pairing_cb");
        pairing_cb = {};
      }
    } break;