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

Commit 25c7bdf3 authored by Himanshu Rawat's avatar Himanshu Rawat Committed by Gerrit Code Review
Browse files

Merge "Prefer connected transport for service discovery on dual mode devices" into main

parents 2ec46359 f3b4d707
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1276,6 +1276,14 @@ static tBT_TRANSPORT bta_dm_determine_discovery_transport(
    BTM_ReadDevInfo(remote_bd_addr, &dev_type, &addr_type);
    if (dev_type == BT_DEVICE_TYPE_BLE || addr_type == BLE_ADDR_RANDOM) {
      transport = BT_TRANSPORT_LE;
    } else if (dev_type == BT_DEVICE_TYPE_DUMO) {
      if (get_btm_client_interface().peer.BTM_IsAclConnectionUp(
              remote_bd_addr, BT_TRANSPORT_BR_EDR)) {
        transport = BT_TRANSPORT_BR_EDR;
      } else if (get_btm_client_interface().peer.BTM_IsAclConnectionUp(
                     remote_bd_addr, BT_TRANSPORT_LE)) {
        transport = BT_TRANSPORT_LE;
      }
    }
  } else {
    transport = bta_dm_search_cb.transport;
+6 −0
Original line number Diff line number Diff line
@@ -54,9 +54,15 @@ uint16_t BTM_GetMaxPacketSize(const RawAddress& addr) {
  return RFCOMM_DEFAULT_MTU;
}

bool BTM_IsAclConnectionUp(const RawAddress& remote_bda,
                           tBT_TRANSPORT transport) {
  return true;
}

struct btm_client_interface_t btm_client_interface = {
    .peer =
        {
            .BTM_IsAclConnectionUp = BTM_IsAclConnectionUp,
            .BTM_GetMaxPacketSize = BTM_GetMaxPacketSize,
        },
};