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

Commit 19dd98e8 authored by Myles Watson's avatar Myles Watson Committed by Android (Google) Code Review
Browse files

Merge "GD: Create remote address with correct type fix" into tm-dev

parents dbb86c2e 8e92a883
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) {