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

Commit 8e92a883 authored by bidsharma's avatar bidsharma Committed by Myles Watson
Browse files

GD: Create remote address with correct type fix

Just the fix from the other CL.

Bug: 230123996
Test: cert/run LeAclManagerTest
Tag: #refactor

From this Id I72e0b3822a934cc22c975ffbd487af957e49fdb8

Change-Id: I88fc78ac92d08db1ebbbfa79ee8bc0222ca7ed6c
parent 9a35057e
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -365,15 +365,20 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
      on_le_connection_canceled_on_pause();
      return;
    }
    AddressWithType remote_address(address, peer_address_type);
    // The address added to the connect list is the one that callbacks
    // should be sent for, given that is the address passed in
    // call to BluetoothDevice#connectGatt and tied to app layer callbacks.
    if (!peer_resolvable_address.IsEmpty() &&
        is_device_in_connect_list(AddressWithType(peer_resolvable_address, AddressType::RANDOM_DEVICE_ADDRESS))) {
      LOG_INFO("Using resolvable address");
      remote_address = AddressWithType(peer_resolvable_address, AddressType::RANDOM_DEVICE_ADDRESS);

    AddressType remote_address_type;

    switch (peer_address_type) {
      case AddressType::PUBLIC_DEVICE_ADDRESS:
      case AddressType::PUBLIC_IDENTITY_ADDRESS:
        remote_address_type = AddressType::PUBLIC_DEVICE_ADDRESS;
        break;
      case AddressType::RANDOM_DEVICE_ADDRESS:
      case AddressType::RANDOM_IDENTITY_ADDRESS:
        remote_address_type = AddressType::RANDOM_DEVICE_ADDRESS;
        break;
    }
    AddressWithType remote_address(address, remote_address_type);

    on_common_le_connection_complete(remote_address);
    if (status == ErrorCode::UNKNOWN_CONNECTION) {