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

Commit 7181c6d9 authored by Josh Wu's avatar Josh Wu Committed by William Escande
Browse files

GATT: Disable GATT over BR/EDR

Current stack does not handle dual-transport GATT well. When there are
multiple connections to a device on both transports, stack may not
operate the correct connection. So, as a walkaround, GATT over BR/EDR
should be disabled on Wear device considering their limited usage.

Test: gd/cert/run
Bug: 221946083
Bug: 225784319
Change-Id: I9a8f2455cb2aac813e4f1ea03d49b32c7ca61f10
(cherry picked from commit 41e9de3f1af7987b83ca997e5a02e9275f9a24af)
parent a17e14bf
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include "l2c_api.h"
#include "osi/include/allocator.h"
#include "osi/include/osi.h"
#include "osi/include/properties.h"
#include "stack/btm/btm_ble_int.h"
#include "stack/btm/btm_dev.h"
#include "stack/btm/btm_sec.h"
@@ -122,8 +123,11 @@ void gatt_init(void) {

  L2CA_RegisterFixedChannel(L2CAP_ATT_CID, &fixed_reg);

  bool gatt_over_br_is_disabled =
      osi_property_get_bool("bluetooth.gatt_over_bredr.disabled", false);
  /* Now, register with L2CAP for ATT PSM over BR/EDR */
  if (!L2CA_Register2(BT_PSM_ATT, dyn_info, false /* enable_snoop */, nullptr,
  if (!gatt_over_br_is_disabled &&
      !L2CA_Register2(BT_PSM_ATT, dyn_info, false /* enable_snoop */, nullptr,
                      GATT_MAX_MTU_SIZE, 0, BTM_SEC_NONE)) {
    LOG(ERROR) << "ATT Dynamic Registration failed";
  }