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

Commit d05b1e21 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Fix order of parameters to BTA_GATTC_Open

Different order of parameters in different flavours of method caused
bug in btif_gatt_client.cc, where every client would be started as
opportunistic. This issue was introduced in commit
fb052951

Bug: 34951749
Test: sl4a GattReadTest was flaky without this patch
Change-Id: I243b11bd8e2c0da9f01cbd3eab95dc808bd54006
parent 5e7aae58
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -134,13 +134,13 @@ void BTA_GATTC_AppDeregister(tBTA_GATTC_IF client_if) {
void BTA_GATTC_Open(tBTA_GATTC_IF client_if, BD_ADDR remote_bda, bool is_direct,
                    tBTA_GATT_TRANSPORT transport, bool opportunistic) {
  uint8_t phy = controller_get_interface()->get_le_all_initiating_phys();
  BTA_GATTC_Open(client_if, remote_bda, is_direct, transport, phy,
                 opportunistic);
  BTA_GATTC_Open(client_if, remote_bda, is_direct, transport, opportunistic,
                 phy);
}

void BTA_GATTC_Open(tBTA_GATTC_IF client_if, BD_ADDR remote_bda, bool is_direct,
                    tBTA_GATT_TRANSPORT transport, uint8_t initiating_phys,
                    bool opportunistic) {
                    tBTA_GATT_TRANSPORT transport, bool opportunistic,
                    uint8_t initiating_phys) {
  tBTA_GATTC_API_OPEN* p_buf =
      (tBTA_GATTC_API_OPEN*)osi_malloc(sizeof(tBTA_GATTC_API_OPEN));

+1 −1
Original line number Diff line number Diff line
@@ -643,7 +643,7 @@ extern void BTA_GATTC_Open(tBTA_GATTC_IF client_if, BD_ADDR remote_bda,
                           bool opportunistic);
extern void BTA_GATTC_Open(tBTA_GATTC_IF client_if, BD_ADDR remote_bda,
                           bool is_direct, tBTA_GATT_TRANSPORT transport,
                           uint8_t initiating_phys, bool opportunistic);
                           bool opportunistic, uint8_t initiating_phys);

/*******************************************************************************
 *
+2 −1
Original line number Diff line number Diff line
@@ -310,7 +310,8 @@ void btif_gattc_open_impl(int client_if, BD_ADDR address, bool is_direct,
  // Connect!
  BTIF_TRACE_DEBUG("%s Transport=%d, device type=%d, phy=%d", __func__,
                   transport, device_type, initiating_phys);
  BTA_GATTC_Open(client_if, address, is_direct, transport, initiating_phys);
  BTA_GATTC_Open(client_if, address, is_direct, transport, false,
                 initiating_phys);
}

bt_status_t btif_gattc_open(int client_if, const bt_bdaddr_t* bd_addr,