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

Commit 8cdd2ee7 authored by yuanlongquan's avatar yuanlongquan Committed by Yuan Longquan
Browse files

when A2dp sink and source coexist, AVRCP data process twice



Problem: Currently, when A2dp sink and source coexist,when
we process avrcp data, in function avct_bcb_msg_ind and
avct_lcb_msg_ind , pid was parsed twice,

Solution: in function avct_bcb_msg_ind and avct_lcb_msg_ind
,we only parse pid once

Flag: EXEMPT, no logical change
Bug: 331817295
Test: m com.android.btservices

Change-Id: I2b56dca0bed6aac042f9a82878749a67d53d942a
Signed-off-by: default avataryuanlongquan <yuanlongquan753@gmail.com>
parent 72e1584c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -554,7 +554,7 @@ void avct_bcb_msg_ind(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) {

  bool bind = false;
  if (btif_av_src_sink_coexist_enabled()) {
    bind = avct_msg_ind_for_src_sink_coexist(p_lcb, p_data, label, cr_ipid);
    bind = avct_msg_ind_for_src_sink_coexist(p_lcb, p_data, label, cr_ipid, pid);
    osi_free_and_reset((void**)&p_data->p_buf);
    if (bind) {
      return;
+1 −1
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ uint8_t avct_ccb_to_idx(tAVCT_CCB* p_ccb);
tAVCT_CCB* avct_ccb_by_idx(uint8_t idx);

extern bool avct_msg_ind_for_src_sink_coexist(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data,
                                              uint8_t label, uint8_t cr_ipid);
                                              uint8_t label, uint8_t cr_ipid, uint16_t pid);

/*****************************************************************************
 * global data
+2 −8
Original line number Diff line number Diff line
@@ -696,7 +696,7 @@ void avct_lcb_msg_ind(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data) {

  bool bind = false;
  if (btif_av_src_sink_coexist_enabled()) {
    bind = avct_msg_ind_for_src_sink_coexist(p_lcb, p_data, label, cr_ipid);
    bind = avct_msg_ind_for_src_sink_coexist(p_lcb, p_data, label, cr_ipid, pid);
    osi_free_and_reset((void**)&p_data->p_buf);
    if (bind) {
      return;
@@ -734,16 +734,10 @@ void avct_lcb_msg_ind(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data) {
}

bool avct_msg_ind_for_src_sink_coexist(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data, uint8_t label,
                                       uint8_t cr_ipid) {
                                       uint8_t cr_ipid, uint16_t pid) {
  bool bind = false;
  tAVCT_CCB* p_ccb;
  int p_buf_len;
  uint8_t* p;
  uint16_t pid, type;

  p = (uint8_t*)(p_data->p_buf + 1) + p_data->p_buf->offset;
  AVCT_PARSE_HDR(p, label, type, cr_ipid);
  BE_STREAM_TO_UINT16(pid, p);

  p_ccb = &avct_cb.ccb[0];
  p_data->p_buf->offset += AVCT_HDR_LEN_SINGLE;