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

Commit 9721f849 authored by Kyunglyul Hyun's avatar Kyunglyul Hyun Committed by Android Build Coastguard Worker
Browse files

Use TRANSPORT_LE for unknown device type

This commit fixes an issue where using BT_TRANSPORT_AUTO
with an unknown device type resulted in
the allocation of a control block for TRANSPORT_AUTO,
preventing callbacks from being invoked after connection.

This change effectively reverts the logic unintentionally
introduced in aosp/3185968, which caused this issue.

Bug: 369765048
Flag: EXEMPT, revert of aosp/3185968
Test: atest GattClientTest
(cherry picked from https://android-review.googlesource.com/q/commit:374b17a6ce8674e837a8db416e4fc727d22fb330)
Merged-In: I4858d89ba0390890936dd71955c66793d52085e3
Change-Id: I4858d89ba0390890936dd71955c66793d52085e3
parent 5ef6e310
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -349,6 +349,8 @@ 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 = BT_TRANSPORT_LE;
        break;
    }
  }
+4 −0
Original line number Diff line number Diff line
@@ -322,6 +322,8 @@ static void btif_gatts_open_impl(int server_if, const RawAddress& address, bool

      default:
        log::error("Unknown device type {}", DeviceTypeText(device_type));
        // transport must not be AUTO for finding control blocks. Use LE for backward compatibility.
        transport = BT_TRANSPORT_LE;
        break;
    }
  }
@@ -355,6 +357,8 @@ static void btif_gatts_open_impl_use_address_type(int server_if, const RawAddres

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