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

Commit 012702d7 authored by Himanshu Rawat's avatar Himanshu Rawat Committed by Gerrit Code Review
Browse files

Merge "Expose btif_dm_update_remote_properties() outside btif" into main

parents 822a3610 4e233a67
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -141,8 +141,8 @@ typedef struct {
void btif_dm_load_ble_local_keys(void);
void btif_dm_get_ble_local_keys(tBTA_DM_BLE_LOCAL_KEY_MASK* p_key_mask, Octet16* p_er,
                                tBTA_BLE_LOCAL_ID_KEYS* p_id_keys);
void btif_dm_update_ble_remote_properties(const RawAddress& bd_addr, BD_NAME bd_name,
                                          DEV_CLASS dev_class, tBT_DEVICE_TYPE dev_type);
void btif_update_remote_properties(const RawAddress& bd_addr, BD_NAME bd_name, DEV_CLASS dev_class,
                                   tBT_DEVICE_TYPE dev_type);

bool check_cod_hid(const RawAddress& bd_addr);
bool check_cod_hid_major(const RawAddress& bd_addr, uint32_t cod);
+8 −15
Original line number Diff line number Diff line
@@ -274,8 +274,6 @@ static btif_dm_oob_cb_t oob_cb;
static btif_dm_metadata_cb_t metadata_cb{.le_audio_cache{40}};
static void btif_dm_cb_create_bond(const RawAddress bd_addr, tBT_TRANSPORT transport);
static void btif_dm_cb_create_bond_le(const RawAddress bd_addr, tBLE_ADDR_TYPE addr_type);
static void btif_update_remote_properties(const RawAddress& bd_addr, BD_NAME bd_name,
                                          DEV_CLASS dev_class, tBT_DEVICE_TYPE dev_type);
static btif_dm_local_key_cb_t ble_local_key_cb;
static void btif_dm_ble_key_notif_evt(tBTA_DM_SP_KEY_NOTIF* p_ssp_key_notif);
static void btif_dm_ble_auth_cmpl_evt(tBTA_DM_AUTH_CMPL* p_auth_cmpl);
@@ -655,8 +653,8 @@ static void btif_update_remote_version_property(RawAddress* p_bd) {
  }
}

static void btif_update_remote_properties(const RawAddress& bdaddr, BD_NAME bd_name,
                                          DEV_CLASS dev_class, tBT_DEVICE_TYPE device_type) {
void btif_update_remote_properties(const RawAddress& bdaddr, BD_NAME bd_name, DEV_CLASS dev_class,
                                   tBT_DEVICE_TYPE device_type) {
  std::vector<bt_property_t> properties;
  bt_status_t status = BT_STATUS_UNHANDLED;
  uint32_t cod;
@@ -3241,8 +3239,8 @@ static void btif_dm_ble_key_notif_evt(tBTA_DM_SP_KEY_NOTIF* p_ssp_key_notif) {
  if (!btif_get_device_type(p_ssp_key_notif->bd_addr, &dev_type)) {
    dev_type = BT_DEVICE_TYPE_BLE;
  }
  btif_dm_update_ble_remote_properties(p_ssp_key_notif->bd_addr, p_ssp_key_notif->bd_name,
                                       kDevClassEmpty, (tBT_DEVICE_TYPE)dev_type);
  btif_update_remote_properties(p_ssp_key_notif->bd_addr, p_ssp_key_notif->bd_name, kDevClassEmpty,
                                (tBT_DEVICE_TYPE)dev_type);
  bd_addr = p_ssp_key_notif->bd_addr;

  bond_state_changed(BT_STATUS_SUCCESS, bd_addr, BT_BOND_STATE_BONDING);
@@ -3518,7 +3516,7 @@ static void btif_dm_ble_sec_req_evt(tBTA_DM_BLE_SEC_REQ* p_ble_req, bool is_cons
  if (!btif_get_device_type(p_ble_req->bd_addr, &dev_type)) {
    dev_type = BT_DEVICE_TYPE_BLE;
  }
  btif_dm_update_ble_remote_properties(p_ble_req->bd_addr, p_ble_req->bd_name, kDevClassEmpty,
  btif_update_remote_properties(p_ble_req->bd_addr, p_ble_req->bd_name, kDevClassEmpty,
                                (tBT_DEVICE_TYPE)dev_type);

  RawAddress bd_addr = p_ble_req->bd_addr;
@@ -3554,7 +3552,7 @@ static void btif_dm_ble_passkey_req_evt(tBTA_DM_PIN_REQ* p_pin_req) {
  if (!btif_get_device_type(p_pin_req->bd_addr, &dev_type)) {
    dev_type = BT_DEVICE_TYPE_BLE;
  }
  btif_dm_update_ble_remote_properties(p_pin_req->bd_addr, p_pin_req->bd_name, kDevClassEmpty,
  btif_update_remote_properties(p_pin_req->bd_addr, p_pin_req->bd_name, kDevClassEmpty,
                                (tBT_DEVICE_TYPE)dev_type);

  RawAddress bd_addr = p_pin_req->bd_addr;
@@ -3673,11 +3671,6 @@ static void btif_dm_ble_sc_oob_req_evt(tBTA_DM_SP_RMT_OOB* req_oob_type) {
  BTM_BleSecureConnectionOobDataReply(req_oob_type->bd_addr, oob_data_to_use.c, oob_data_to_use.r);
}

void btif_dm_update_ble_remote_properties(const RawAddress& bd_addr, BD_NAME bd_name,
                                          DEV_CLASS dev_class, tBT_DEVICE_TYPE dev_type) {
  btif_update_remote_properties(bd_addr, bd_name, dev_class, dev_type);
}

static void btif_dm_ble_tx_test_cback(void* p) {
  char* p_param = (char*)p;
  uint8_t status;
+4 −4
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ void btm_ble_process_adv_pkt_cont_for_inquiry(uint16_t event_type, tBLE_ADDR_TYP
                                              uint16_t periodic_adv_int,
                                              std::vector<uint8_t> advertising_data);

extern void btif_dm_update_ble_remote_properties(const RawAddress& bd_addr, BD_NAME bd_name,
extern void btif_update_remote_properties(const RawAddress& bd_addr, BD_NAME bd_name,
                                          DEV_CLASS dev_class, tBT_DEVICE_TYPE dev_type);

void btm_ble_process_adv_addr(RawAddress& raw_address, tBLE_ADDR_TYPE* address_type);
@@ -708,13 +708,13 @@ void BleScannerInterfaceImpl::handle_remote_properties(RawAddress bd_addr, tBLE_
      if (remote_name_len < BD_NAME_LEN + 1) {
        bdname.name[remote_name_len] = '\0';
      }
      btif_dm_update_ble_remote_properties(bd_addr, bdname.name, kDevClassEmpty, device_type);
      btif_update_remote_properties(bd_addr, bdname.name, kDevClassEmpty, device_type);
    }
  }

  DEV_CLASS dev_class = btm_ble_get_appearance_as_cod(advertising_data);
  if (dev_class != kDevClassUnclassified) {
    btif_dm_update_ble_remote_properties(bd_addr, bdname.name, dev_class, device_type);
    btif_update_remote_properties(bd_addr, bdname.name, dev_class, device_type);
  }

  auto* storage_module = bluetooth::shim::GetStorage();
+2 −3
Original line number Diff line number Diff line
@@ -138,9 +138,8 @@ void btif_dm_ssp_reply(const RawAddress /* bd_addr */, bt_ssp_variant_t /* varia
  inc_func_call_count(__func__);
}
void btif_dm_start_discovery(void) { inc_func_call_count(__func__); }
void btif_dm_update_ble_remote_properties(const RawAddress& /* bd_addr */, BD_NAME /* bd_name */,
                                          DEV_CLASS /* dev_class */,
                                          tBT_DEVICE_TYPE /* dev_type */) {
void btif_update_remote_properties(const RawAddress& /* bd_addr */, BD_NAME /* bd_name */,
                                   DEV_CLASS /* dev_class */, tBT_DEVICE_TYPE /* dev_type */) {
  inc_func_call_count(__func__);
}