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

Commit 13cc253f authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

csis: Fix bonding dual mode devices

Failing scenario fixed in this patch
1. ANdroid bonded with Dual Mode device over BR/EDR and later over LE
   using CTKD
2. CSIS having cached Advertising Reports, sends to Java RPA of already
   bonded device as a next set member
3. The above leads to read second set member being no bonded.

Bug: 290914667
Test: atest bluetooth_csis_test   for regression
Test: manual 10 times pairing in the raw
Tag: #feature
Change-Id: I7e543ff4feeb4dab650bdeb5bb60593ba065c1f8
parent 24c5630c
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -1314,6 +1314,18 @@ class CsisClientImpl : public CsisClient {
      return;
    }

    /* Make sure device is not already bonded which could
     * be a case for dual mode devices where
     */
    tBTM_SEC_DEV_REC* p_dev = btm_find_dev(result->bd_addr);
    if (p_dev && p_dev->is_le_link_key_known()) {
      LOG_VERBOSE(
          "Device %s already bonded. Identity address: %s",
          ADDRESS_TO_LOGGABLE_CSTR(result->bd_addr),
          ADDRESS_TO_LOGGABLE_CSTR(p_dev->ble.identity_address_with_type));
      return;
    }

    auto all_rsi = GetAllRsiFromAdvertising(result);
    if (all_rsi.empty()) return;

@@ -1454,6 +1466,18 @@ class CsisClientImpl : public CsisClient {
      return;
    }

    /* Make sure device is not already bonded which could
     * be a case for dual mode devices where
     */
    tBTM_SEC_DEV_REC* p_dev = btm_find_dev(result->bd_addr);
    if (p_dev && p_dev->is_le_link_key_known()) {
      LOG_VERBOSE(
          "Device %s already bonded. Identity address: %s",
          ADDRESS_TO_LOGGABLE_CSTR(result->bd_addr),
          ADDRESS_TO_LOGGABLE_CSTR(p_dev->ble.identity_address_with_type));
      return;
    }

    auto all_rsi = GetAllRsiFromAdvertising(result);
    if (all_rsi.empty()) return;