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

Commit 8b266fe5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "legacy: Use proper conversion [to|from]_ble_addr_type" am: 9e558205...

Merge "legacy: Use proper conversion [to|from]_ble_addr_type" am: 9e558205 am: cf758d5d am: eff2a8b8

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2030646



Change-Id: I99437bcea727ef675a960bd64a1f1144ab10bdc0
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 4e0e14e2 eff2a8b8
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -120,7 +120,7 @@ void Btm::ScanningCallbacks::OnScanResult(
    uint8_t primary_phy, uint8_t secondary_phy, uint8_t advertising_sid,
    uint8_t primary_phy, uint8_t secondary_phy, uint8_t advertising_sid,
    int8_t tx_power, int8_t rssi, uint16_t periodic_advertising_interval,
    int8_t tx_power, int8_t rssi, uint16_t periodic_advertising_interval,
    std::vector<uint8_t> advertising_data) {
    std::vector<uint8_t> advertising_data) {
  tBLE_ADDR_TYPE ble_address_type = static_cast<tBLE_ADDR_TYPE>(address_type);
  tBLE_ADDR_TYPE ble_address_type = to_ble_addr_type(address_type);
  uint16_t extended_event_type = 0;
  uint16_t extended_event_type = 0;


  RawAddress raw_address;
  RawAddress raw_address;
+2 −2
Original line number Original line Diff line number Diff line
@@ -1211,7 +1211,7 @@ void L2CA_ReadConnectionAddr(const RawAddress& pseudo_addr,
  }
  }
  auto local = channel->second->GetLinkOptions()->GetLocalAddress();
  auto local = channel->second->GetLinkOptions()->GetLocalAddress();
  conn_addr = ToRawAddress(local.GetAddress());
  conn_addr = ToRawAddress(local.GetAddress());
  *p_addr_type = static_cast<tBLE_ADDR_TYPE>(local.GetAddressType());
  *p_addr_type = to_ble_addr_type(static_cast<uint8_t>(local.GetAddressType()));
}
}


bool L2CA_ReadRemoteConnectionAddr(const RawAddress& pseudo_addr,
bool L2CA_ReadRemoteConnectionAddr(const RawAddress& pseudo_addr,
@@ -1224,7 +1224,7 @@ bool L2CA_ReadRemoteConnectionAddr(const RawAddress& pseudo_addr,
  }
  }
  auto info = le_link_property_listener_shim_.info_[remote].address_with_type;
  auto info = le_link_property_listener_shim_.info_[remote].address_with_type;
  conn_addr = ToRawAddress(info.GetAddress());
  conn_addr = ToRawAddress(info.GetAddress());
  *p_addr_type = static_cast<tBLE_ADDR_TYPE>(info.GetAddressType());
  *p_addr_type = to_ble_addr_type(static_cast<uint8_t>(info.GetAddressType()));
  return true;
  return true;
}
}


+8 −7
Original line number Original line Diff line number Diff line
@@ -338,28 +338,29 @@ void BleScannerInterfaceImpl::OnScanResult(
    int8_t tx_power, int8_t rssi, uint16_t periodic_advertising_interval,
    int8_t tx_power, int8_t rssi, uint16_t periodic_advertising_interval,
    std::vector<uint8_t> advertising_data) {
    std::vector<uint8_t> advertising_data) {
  RawAddress raw_address = ToRawAddress(address);
  RawAddress raw_address = ToRawAddress(address);
  tBLE_ADDR_TYPE ble_addr_type = to_ble_addr_type(address_type);


  if (address_type != BLE_ADDR_ANONYMOUS) {
  if (ble_addr_type != BLE_ADDR_ANONYMOUS) {
    btm_ble_process_adv_addr(raw_address, &address_type);
    btm_ble_process_adv_addr(raw_address, &ble_addr_type);
  }
  }


  do_in_jni_thread(
  do_in_jni_thread(
      FROM_HERE,
      FROM_HERE,
      base::BindOnce(&BleScannerInterfaceImpl::handle_remote_properties,
      base::BindOnce(&BleScannerInterfaceImpl::handle_remote_properties,
                     base::Unretained(this), raw_address, address_type,
                     base::Unretained(this), raw_address, ble_addr_type,
                     advertising_data));
                     advertising_data));


  do_in_jni_thread(
  do_in_jni_thread(
      FROM_HERE,
      FROM_HERE,
      base::BindOnce(&ScanningCallbacks::OnScanResult,
      base::BindOnce(&ScanningCallbacks::OnScanResult,
                     base::Unretained(scanning_callbacks_), event_type,
                     base::Unretained(scanning_callbacks_), event_type,
                     address_type, raw_address, primary_phy, secondary_phy,
                     static_cast<uint8_t>(address_type), raw_address,
                     advertising_sid, tx_power, rssi,
                     primary_phy, secondary_phy, advertising_sid, tx_power,
                     periodic_advertising_interval, advertising_data));
                     rssi, periodic_advertising_interval, advertising_data));


  // TODO: Remove when StartInquiry in GD part implemented
  // TODO: Remove when StartInquiry in GD part implemented
  btm_ble_process_adv_pkt_cont_for_inquiry(
  btm_ble_process_adv_pkt_cont_for_inquiry(
      event_type, address_type, raw_address, primary_phy, secondary_phy,
      event_type, ble_addr_type, raw_address, primary_phy, secondary_phy,
      advertising_sid, tx_power, rssi, periodic_advertising_interval,
      advertising_sid, tx_power, rssi, periodic_advertising_interval,
      advertising_data);
      advertising_data);
}
}
+2 −2
Original line number Original line Diff line number Diff line
@@ -649,7 +649,7 @@ void BTM_LE_PF_set(tBTM_BLE_PF_FILT_INDEX filt_index,
      case BTM_BLE_PF_ADDR_FILTER: {
      case BTM_BLE_PF_ADDR_FILTER: {
        tBLE_BD_ADDR target_addr;
        tBLE_BD_ADDR target_addr;
        target_addr.bda = cmd.address;
        target_addr.bda = cmd.address;
        target_addr.type = cmd.addr_type;
        target_addr.type = to_ble_addr_type(cmd.addr_type);


        BTM_LE_PF_addr_filter(action, filt_index, target_addr,
        BTM_LE_PF_addr_filter(action, filt_index, target_addr,
                              base::DoNothing());
                              base::DoNothing());
@@ -688,7 +688,7 @@ void BTM_LE_PF_set(tBTM_BLE_PF_FILT_INDEX filt_index,
          // Set the IRK
          // Set the IRK
          tBTM_LE_PID_KEYS pid_keys;
          tBTM_LE_PID_KEYS pid_keys;
          pid_keys.irk = cmd.irk;
          pid_keys.irk = cmd.irk;
          pid_keys.identity_addr_type = cmd.addr_type;
          pid_keys.identity_addr_type = to_ble_addr_type(cmd.addr_type);
          pid_keys.identity_addr = cmd.address;
          pid_keys.identity_addr = cmd.address;
          // Add it to the union to pass to SecAddBleKey
          // Add it to the union to pass to SecAddBleKey
          tBTM_LE_KEY_VALUE le_key;
          tBTM_LE_KEY_VALUE le_key;
+1 −1
Original line number Original line Diff line number Diff line
@@ -126,7 +126,7 @@ void btm_ble_batchscan_filter_track_adv_vse_cback(uint8_t len,


    // Make sure the device is known
    // Make sure the device is known
    BTM_SecAddBleDevice(adv_data.bd_addr, BT_DEVICE_TYPE_BLE,
    BTM_SecAddBleDevice(adv_data.bd_addr, BT_DEVICE_TYPE_BLE,
                        adv_data.addr_type);
                        to_ble_addr_type(adv_data.addr_type));


    ble_advtrack_cb.p_track_cback(&adv_data);
    ble_advtrack_cb.p_track_cback(&adv_data);
    return;
    return;
Loading