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

Commit 586516a1 authored by Paul Wang's avatar Paul Wang Committed by Automerger Merge Worker
Browse files

Merge "Fix avdtp not start" into main am: d36f682e

parents 77369fb1 d36f682e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ extern bool btif_av_both_enable(void);
extern bool btif_av_src_sink_coexist_enabled(void);
extern bool btif_av_is_sink_enabled(void);
extern bool btif_av_peer_is_connected_sink(const RawAddress& peer_address);
extern const RawAddress& btif_av_find_by_handle(tBTA_AV_HNDL bta_handle);

/*******************************************************************************
 *
@@ -1554,6 +1555,12 @@ static uint8_t bta_av_find_lcb_index_by_scb_and_address(
      continue;
    }
    if (!p_scb->IsAssigned()) {
      const RawAddress& btif_addr = btif_av_find_by_handle(p_scb->hndl);
      if (!btif_addr.IsEmpty() && btif_addr != peer_address) {
        LOG_DEBUG("%s: btif_addr = %s, index=%d!",
                         __func__, btif_addr.ToString().c_str(), index);
        continue;
      }
      return index;
    }
  }
+9 −2
Original line number Diff line number Diff line
@@ -233,6 +233,7 @@ tBTA_AV_SCB* bta_av_addr_to_scb(const RawAddress& bd_addr) {
  return p_scb;
}

extern const RawAddress& btif_av_find_by_handle(tBTA_AV_HNDL bta_handle);
int BTA_AvObtainPeerChannelIndex(const RawAddress& peer_address) {
  // Find the entry for the peer (if exists)
  tBTA_AV_SCB* p_scb = bta_av_addr_to_scb(peer_address);
@@ -247,6 +248,12 @@ int BTA_AvObtainPeerChannelIndex(const RawAddress& peer_address) {
      continue;
    }
    if (p_scb->PeerAddress().IsEmpty()) {
      const RawAddress& btif_addr = btif_av_find_by_handle(p_scb->hndl);
      if (!btif_addr.IsEmpty() && btif_addr != peer_address)  {
        APPL_TRACE_DEBUG("%s: btif_addr = %s, index=%d!",
                         __func__, btif_addr.ToString().c_str(), index);
        continue;
      }
      return p_scb->hdi;
    }
  }
@@ -402,8 +409,8 @@ void bta_av_conn_cback(UNUSED_ATTR uint8_t handle, const RawAddress& bd_addr,
      APPL_TRACE_DEBUG("%s: bta_handle x%x, role x%x", __func__, p_scb->hndl,
                       p_scb->role);
    }
    LOG_INFO("%s: conn_cback bd_addr: %s", __func__,
             ADDRESS_TO_LOGGABLE_CSTR(bd_addr));
    LOG_INFO("%s: conn_cback bd_addr: %s, scb_index: %d", __func__,
             ADDRESS_TO_LOGGABLE_CSTR(bd_addr), scb_index);
    bta_sys_sendmsg(p_msg);
  }
}