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

Commit d1d2f886 authored by Ben YoungTae Kim's avatar Ben YoungTae Kim Committed by Pavlin Radoslavov
Browse files

Set the A2DP media channel as a high priority L2CAP link

Use dynamic ACL buffer allocation for high priority links:
1. Ensure dedicated ACL buffers for high priority links
2. Adjust buffer allocation if the priority of the link changes

Test: Manually tested with 4 HID devices and A2DP streaming scenario
Bug: 30787081
Change-Id: Id3c4a76e360aee322e9f8073bd399807e7987990
parent c11bdda2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1330,8 +1330,8 @@ void bta_av_str_opened(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
                   p_scb->l2c_cid, p_scb->stream_mtu, mtu);
  if (mtu == 0 || mtu > p_scb->stream_mtu) mtu = p_scb->stream_mtu;

  /* Set the media channel as medium priority */
  L2CA_SetTxPriority(p_scb->l2c_cid, L2CAP_CHNL_PRIORITY_MEDIUM);
  /* Set the media channel as high priority */
  L2CA_SetTxPriority(p_scb->l2c_cid, L2CAP_CHNL_PRIORITY_HIGH);
  L2CA_SetChnlFlushability(p_scb->l2c_cid, true);

  bta_sys_conn_open(BTA_ID_AV, p_scb->app_id, p_scb->peer_addr);
+6 −6
Original line number Diff line number Diff line
@@ -2390,14 +2390,14 @@ bool l2cu_set_acl_priority(const bt_bdaddr_t& bd_addr, uint8_t priority,
      BTM_VendorSpecificCommand(HCI_BRCM_SET_ACL_PRIORITY,
                                HCI_BRCM_ACL_PRIORITY_PARAM_SIZE, command,
                                NULL);
    }
  }

  /* Adjust lmp buffer allocation for this channel if priority changed */
  if (p_lcb->acl_priority != priority) {
    p_lcb->acl_priority = priority;
    l2c_link_adjust_allocation();
  }
    }
  }
  return (true);
}