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

Commit 70c7cfb2 authored by Omair Kamil's avatar Omair Kamil Committed by Automerger Merge Worker
Browse files

Merge "Clean up flag ensure_valid_adv_flag." into main am: 4e69680f

parents 72f1ecfc 4e69680f
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -113,16 +113,6 @@ flag {
    }
}

flag {
    name: "ensure_valid_adv_flag"
    namespace: "bluetooth"
    description: "Check ADV flag is valid before processing"
    bug: "329888460"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "ble_gatt_server_use_address_type_in_connection"
    namespace: "bluetooth"
+6 −31
Original line number Diff line number Diff line
@@ -304,10 +304,6 @@ static bool ble_evt_type_is_scannable(uint16_t evt_type) {
  return evt_type & (1 << BLE_EVT_SCANNABLE_BIT);
}

static bool ble_evt_type_is_directed(uint16_t evt_type) {
  return evt_type & (1 << BLE_EVT_DIRECTED_BIT);
}

static bool ble_evt_type_is_scan_resp(uint16_t evt_type) {
  return evt_type & (1 << BLE_EVT_SCAN_RESPONSE_BIT);
}
@@ -2053,7 +2049,6 @@ static void btm_ble_update_inq_result(tINQ_DB_ENT* p_i, uint8_t addr_type,
        break;
      }
    }
    if (com::android::bluetooth::flags::ensure_valid_adv_flag()) {
    // Non-connectable packets may omit flags entirely, in which case nothing
    // should be assumed about their values (CSSv10, 1.3.1). Thus, do not
    // interpret the device type unless this packet has the flags set or is
@@ -2076,26 +2071,6 @@ static void btm_ble_update_inq_result(tINQ_DB_ENT* p_i, uint8_t addr_type,
  }
}

  if (!com::android::bluetooth::flags::ensure_valid_adv_flag()) {
    // Non-connectable packets may omit flags entirely, in which case nothing
    // should be assumed about their values (CSSv10, 1.3.1). Thus, do not
    // interpret the device type unless this packet has the flags set or is
    // connectable.
    bool should_process_flags = has_advertising_flags || ble_evt_type_is_connectable(evt_type);
    if (should_process_flags && (p_cur->flag & BTM_BLE_BREDR_NOT_SPT) == 0 &&
        !ble_evt_type_is_directed(evt_type)) {
      if (p_cur->ble_addr_type != BLE_ADDR_RANDOM) {
        log::verbose("NOT_BR_EDR support bit not set, treat device as DUMO");
        p_cur->device_type |= BT_DEVICE_TYPE_DUMO;
      } else {
        log::verbose("Random address, treat device as LE only");
      }
    } else {
      log::verbose("NOT_BR/EDR support bit set, treat device as LE only");
    }
  }
}

void btm_ble_process_adv_addr(RawAddress& bda, tBLE_ADDR_TYPE* addr_type) {
  /* map address to security record */
  bool match = btm_identity_addr_to_random_pseudo(&bda, addr_type, false);