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

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

Merge "Use LE as default transport for GATT" into main

parents b301275f ddc94c30
Loading
Loading
Loading
Loading
+24 −18
Original line number Diff line number Diff line
@@ -332,6 +332,10 @@ void btif_gattc_open_impl(int client_if, RawAddress address, tBLE_ADDR_TYPE addr

  // Determine transport
  if (transport == BT_TRANSPORT_AUTO) {
    if (com::android::bluetooth::flags::default_gatt_transport()) {
      // Prefer LE transport when LE is supported
      transport = (device_type == BT_DEVICE_TYPE_BREDR) ? BT_TRANSPORT_BR_EDR : BT_TRANSPORT_LE;
    } else {
      switch (device_type) {
        case BT_DEVICE_TYPE_BREDR:
          transport = BT_TRANSPORT_BR_EDR;
@@ -347,11 +351,13 @@ void btif_gattc_open_impl(int client_if, RawAddress address, tBLE_ADDR_TYPE addr

        default:
          log::error("Unknown device type {}", DeviceTypeText(device_type));
        // transport must not be AUTO for finding control blocks. Use LE for backward compatibility.
          // transport must not be AUTO for finding control blocks. Use LE for backward
          // compatibility.
          transport = BT_TRANSPORT_LE;
          break;
      }
    }
  }

  // Connect!
  log::info("Transport={}, device type={}, address={}, address type={}, phy={}",