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

Commit 35268f67 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Omit SDP records for GATT services if GATT over BR/EDR is disabled."

parents 0d548eb2 b059caa9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -304,7 +304,7 @@ tGATT_STATUS GATTS_AddService(tGATT_IF gatt_if, btgatt_db_element_t* service,
  elem.type = list.asgn_range.is_primary ? GATT_UUID_PRI_SERVICE
                                         : GATT_UUID_SEC_SERVICE;

  if (elem.type == GATT_UUID_PRI_SERVICE) {
  if (elem.type == GATT_UUID_PRI_SERVICE && gatt_cb.over_br_enabled) {
    Uuid* p_uuid = gatts_get_service_uuid(elem.p_db);
    if (*p_uuid != Uuid::From16Bit(UUID_SERVCLASS_GMCS_SERVER) &&
        *p_uuid != Uuid::From16Bit(UUID_SERVCLASS_GTBS_SERVER)) {
+1 −0
Original line number Diff line number Diff line
@@ -450,6 +450,7 @@ typedef struct {
  tGATT_APPL_INFO cb_info;

  tGATT_HDL_CFG hdl_cfg;
  bool over_br_enabled;
} tGATT_CB;

#define GATT_SIZE_OF_SRV_CHG_HNDL_RANGE 4
+3 −3
Original line number Diff line number Diff line
@@ -125,10 +125,10 @@ 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);
  gatt_cb.over_br_enabled =
      osi_property_get_bool("bluetooth.gatt.over_bredr.enabled", true);
  /* Now, register with L2CAP for ATT PSM over BR/EDR */
  if (!gatt_over_br_is_disabled &&
  if (gatt_cb.over_br_enabled &&
      !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";