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

Commit b509b783 authored by Jakub Pawlowski's avatar Jakub Pawlowski Committed by Jakub Pawłowski
Browse files

Adjust existing connections after ecosystem base interval is set

When ecosystem base interval is set, every new LE connection update would take it into account.

However, existing connections won't change parameters, and controller might have trouble scheduling them. Therefore, trigger update, and intervals will get adjusted to ecosystem base interval.

Flag: l2cap_update_existing_conn_interval_with_base_interval
Test: connect with HID device, then with LE Audio device
Test: m -j;
Bug: 346968428
Bug: 348209161
Change-Id: I197a11053707b0022579e25e2c1607a08df504cc
parent 7a8e25ee
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1446,4 +1446,19 @@ void L2CA_SetEcosystemBaseInterval(uint32_t base_interval) {
          return;
        }
      }));

  if (com::android::bluetooth::flags::
          l2cap_update_existing_conn_interval_with_base_interval() &&
      base_interval != 0) {
    tL2C_LCB* p_lcb = &l2cb.lcb_pool[0];

    for (int i = 0; i < MAX_L2CAP_LINKS; i++, p_lcb++) {
      if ((p_lcb->in_use) && p_lcb->transport == BT_TRANSPORT_LE) {
        bool ret = L2CA_UpdateBleConnParams(
            p_lcb->remote_bd_addr, p_lcb->min_interval, p_lcb->max_interval,
            p_lcb->latency, p_lcb->timeout, p_lcb->min_ce_len,
            p_lcb->max_ce_len);
      }
    }
  }
}