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

Commit 8bf98157 authored by Zhengping Jiang's avatar Zhengping Jiang
Browse files

floss: check privacy mode when return address with type

Check the privacy mode for ll privacy. Only return the random address
if ll privacy is not enabled.

Bug: 235218533
Bug: 271827442
Test: CTSV BLE Encrypted Client Test
Test: mma -j32

Change-Id: I716f01b1ad06c516996012030b05667a8d2ab8c2
parent bd27ec02
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -84,11 +84,12 @@ const tBLE_BD_ADDR convert_to_address_with_type(
    };
    };
  } else {
  } else {
    // Floss doesn't support LL Privacy (yet). To expedite ARC testing, always
    // Floss doesn't support LL Privacy (yet). To expedite ARC testing, always
    // connect to the latest LE random address (if available) rather than
    // connect to the latest LE random address (if available and LL Privacy is
    // redesign.
    // not enabled) rather than redesign.
    // TODO(b/235218533): Remove when LL Privacy is implemented.
    // TODO(b/235218533): Remove when LL Privacy is implemented.
#if TARGET_FLOSS
#if TARGET_FLOSS
    if (!p_dev_rec->ble.cur_rand_addr.IsEmpty()) {
    if (!p_dev_rec->ble.cur_rand_addr.IsEmpty() &&
        btm_cb.ble_ctr_cb.privacy_mode < BTM_PRIVACY_1_2) {
      return {
      return {
          .type = BLE_ADDR_RANDOM,
          .type = BLE_ADDR_RANDOM,
          .bda = p_dev_rec->ble.cur_rand_addr,
          .bda = p_dev_rec->ble.cur_rand_addr,