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

Commit 8ae07f08 authored by Zach Johnson's avatar Zach Johnson Committed by Automerger Merge Worker
Browse files

Merge changes I7a6cab84,Icbc20044 am: 42d1c7cf

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

Change-Id: I792d115c6860d53239de27d8c9bc882838bac95b
parents 8eef8cc4 42d1c7cf
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include "l2c_api.h"
#include "l2cdefs.h"
#include "osi/include/osi.h"
#include "stack/btm/btm_sec.h"

AvdtpScb* AvdtpAdaptationLayer::LookupAvdtpScb(
    const AvdtpTransportChannel& tc) {
@@ -550,6 +551,8 @@ void avdt_ad_open_req(uint8_t type, AvdtpCcb* p_ccb, AvdtpScb* p_scb,
  else {
    p_tbl->state = AVDT_AD_ST_CONN;

    BTM_SetOutService(p_ccb->peer_addr, BTM_SEC_SERVICE_AVDTP, type);

    /* call l2cap connect req */
    lcid = L2CA_ConnectReq(AVDT_PSM, p_ccb->peer_addr);
    if (lcid != 0) {
+0 −1
Original line number Diff line number Diff line
@@ -77,7 +77,6 @@ static void avdt_ccb_clear_ccb(AvdtpCcb* p_ccb) {
 *
 ******************************************************************************/
void avdt_ccb_chan_open(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
  BTM_SetOutService(p_ccb->peer_addr, BTM_SEC_SERVICE_AVDTP, AVDT_CHAN_SIG);
  avdt_ad_open_req(AVDT_CHAN_SIG, p_ccb, NULL, AVDT_INT);
}

+4 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include "bnep_api.h"
#include <string.h>
#include "bnep_int.h"
#include "stack/btm/btm_sec.h"

using bluetooth::Uuid;

@@ -126,7 +127,8 @@ void BNEP_Deregister(void) {
 *
 ******************************************************************************/
tBNEP_RESULT BNEP_Connect(const RawAddress& p_rem_bda, const Uuid& src_uuid,
                          const Uuid& dst_uuid, uint16_t* p_handle) {
                          const Uuid& dst_uuid, uint16_t* p_handle,
                          uint32_t mx_chan_id) {
  uint16_t cid;
  tBNEP_CONN* p_bcb = bnepu_find_bcb_by_bd_addr(p_rem_bda);

@@ -166,6 +168,7 @@ tBNEP_RESULT BNEP_Connect(const RawAddress& p_rem_bda, const Uuid& src_uuid,
     */
    p_bcb->con_state = BNEP_STATE_CONN_START;

    BTM_SetOutService(p_rem_bda, BTM_SEC_SERVICE_BNEP_PANU, mx_chan_id);
    cid = L2CA_ConnectReq(BT_PSM_BNEP, p_bcb->rem_bda);
    if (cid != 0) {
      p_bcb->l2cap_cid = cid;
+1 −1
Original line number Diff line number Diff line
@@ -249,7 +249,7 @@ extern void BNEP_Deregister(void);
extern tBNEP_RESULT BNEP_Connect(const RawAddress& p_rem_bda,
                                 const bluetooth::Uuid& src_uuid,
                                 const bluetooth::Uuid& dst_uuid,
                                 uint16_t* p_handle);
                                 uint16_t* p_handle, uint32_t mx_chan_id);

/*******************************************************************************
 *
+3 −3
Original line number Diff line number Diff line
@@ -344,7 +344,6 @@ tPAN_RESULT PAN_Connect(const RawAddress& rem_bda, uint8_t src_role,
    PAN_TRACE_ERROR("PAN Connection failed because of no resources");
    return PAN_NO_RESOURCES;
  }
  BTM_SetOutService(rem_bda, BTM_SEC_SERVICE_BNEP_PANU, mx_chan_id);

  VLOG(0) << __func__ << " for BD Addr: " << rem_bda;
  if (pcb->con_state == PAN_STATE_IDLE) {
@@ -362,8 +361,9 @@ tPAN_RESULT PAN_Connect(const RawAddress& rem_bda, uint8_t src_role,
  pcb->src_uuid = src_uuid;
  pcb->dst_uuid = dst_uuid;

  tBNEP_RESULT ret = BNEP_Connect(rem_bda, Uuid::From16Bit(src_uuid),
                                  Uuid::From16Bit(dst_uuid), &(pcb->handle));
  tBNEP_RESULT ret =
      BNEP_Connect(rem_bda, Uuid::From16Bit(src_uuid),
                   Uuid::From16Bit(dst_uuid), &(pcb->handle), mx_chan_id);
  if (ret != BNEP_SUCCESS) {
    pan_release_pcb(pcb);
    return ret;