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

Commit eb23fd64 authored by Chienyuan's avatar Chienyuan Committed by Automerger Merge Worker
Browse files

Do not consolidate pure LE device am: ac098f93

parents 6a99fdce ac098f93
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -945,6 +945,10 @@ static void remove_devices_with_sample_ltk() {
void btif_storage_load_consolidate_devices(void) {
  btif_bonded_devices_t bonded_devices;
  btif_in_fetch_bonded_devices(&bonded_devices, 1);
  std::unordered_set<RawAddress> bonded_addresses;
  for (uint16_t i = 0; i < bonded_devices.num_devices; i++) {
    bonded_addresses.insert(bonded_devices.devices[i]);
  }

  std::vector<std::pair<RawAddress, RawAddress>> consolidated_devices;
  for (uint16_t i = 0; i < bonded_devices.num_devices; i++) {
@@ -953,7 +957,9 @@ void btif_storage_load_consolidate_devices(void) {
    if (btif_storage_get_ble_bonding_key(
            bonded_devices.devices[i], BTM_LE_KEY_PID, (uint8_t*)&key,
            sizeof(tBTM_LE_PID_KEYS)) == BT_STATUS_SUCCESS) {
      if (bonded_devices.devices[i] != key.pid_key.identity_addr) {
      if (bonded_devices.devices[i] != key.pid_key.identity_addr &&
          bonded_addresses.find(key.pid_key.identity_addr) !=
              bonded_addresses.end()) {
        LOG_INFO("found consolidated device %s %s",
                 bonded_devices.devices[i].ToString().c_str(),
                 key.pid_key.identity_addr.ToString().c_str());