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

Commit 90ccb0ad authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

Use Api stack/acl/btm_acl::acl_write_automatic_flush_timeout am: e7837622

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1406659

Change-Id: Ife1ae12badc6074d0a216ffb28912c66b0069a0f
parents df1a78a6 e7837622
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1244,7 +1244,7 @@ bool L2CA_SetFlushTimeout(const RawAddress& bd_addr,
    if ((p_lcb) && (p_lcb->in_use) && (p_lcb->link_state == LST_CONNECTED)) {
      if (p_lcb->LinkFlushTimeout() != flush_timeout_in_ms) {
        p_lcb->SetLinkFlushTimeout(flush_timeout_in_ms);
        btsnd_hcic_write_auto_flush_tout(p_lcb->handle, flush_timeout_in_slots);
        acl_write_automatic_flush_timeout(bd_addr, flush_timeout_in_slots);
      }
    } else {
      LOG(WARNING) << __func__ << " No lcb for bd_addr " << bd_addr;
@@ -1252,12 +1252,11 @@ bool L2CA_SetFlushTimeout(const RawAddress& bd_addr,
    }
  } else {
    tL2C_LCB* p_lcb = &l2cb.lcb_pool[0];

    for (int xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_lcb++) {
      if ((p_lcb->in_use) && (p_lcb->link_state == LST_CONNECTED)) {
        if (p_lcb->LinkFlushTimeout() != flush_timeout_in_ms) {
          p_lcb->SetLinkFlushTimeout(flush_timeout_in_ms);
          btsnd_hcic_write_auto_flush_tout(p_lcb->handle,
          acl_write_automatic_flush_timeout(p_lcb->remote_bd_addr,
                                            flush_timeout_in_slots);
        }
      }
+2 −1
Original line number Diff line number Diff line
@@ -1965,7 +1965,8 @@ void l2cu_process_our_cfg_req(tL2C_CCB* p_ccb, tL2CAP_CFG_INFO* p_cfg) {
        if (p_cfg->flush_to <= ((HCI_MAX_AUTOMATIC_FLUSH_TIMEOUT * 5) / 8)) {
          /* Convert flush timeout to 0.625 ms units, with round */
          hci_flush_to = ((p_cfg->flush_to * 8) + 3) / 5;
          btsnd_hcic_write_auto_flush_tout(p_lcb->handle, hci_flush_to);
          acl_write_automatic_flush_timeout(p_lcb->remote_bd_addr,
                                            hci_flush_to);
        }
      }
    }