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

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

Re-log stack/avdt/avdt_api::AVDT_Connect am: 13117dc4

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I7529f58ac46b28ac72cb6a2ae6634a7fb7cb0a5a
parents d57de5f0 13117dc4
Loading
Loading
Loading
Loading
+9 −10
Original line number Original line Diff line number Diff line
@@ -154,32 +154,31 @@ void AVDT_AbortReq(uint8_t handle) {
 ******************************************************************************/
 ******************************************************************************/
uint16_t AVDT_CreateStream(uint8_t peer_id, uint8_t* p_handle,
uint16_t AVDT_CreateStream(uint8_t peer_id, uint8_t* p_handle,
                           const AvdtpStreamConfig& avdtp_stream_config) {
                           const AvdtpStreamConfig& avdtp_stream_config) {
  uint16_t result = AVDT_SUCCESS;
  tAVDT_RESULT result = AVDT_SUCCESS;
  AvdtpScb* p_scb;
  AvdtpScb* p_scb;


  AVDT_TRACE_DEBUG("%s: peer_id=%d", __func__, peer_id);

  /* Verify parameters; if invalid, return failure */
  /* Verify parameters; if invalid, return failure */
  if (((avdtp_stream_config.cfg.psc_mask & (~AVDT_PSC)) != 0) ||
  if (((avdtp_stream_config.cfg.psc_mask & (~AVDT_PSC)) != 0) ||
      (avdtp_stream_config.p_avdt_ctrl_cback == NULL)) {
      (avdtp_stream_config.p_avdt_ctrl_cback == NULL)) {
    result = AVDT_BAD_PARAMS;
    result = AVDT_BAD_PARAMS;
    LOG_ERROR("Invalid AVDT stream endpoint parameters peer_id=%d scb_index=%d",
              peer_id, avdtp_stream_config.scb_index);
  }
  }

  /* Allocate scb; if no scbs, return failure */
  /* Allocate scb; if no scbs, return failure */
  else {
  else {
    p_scb = avdt_scb_alloc(peer_id, avdtp_stream_config);
    p_scb = avdt_scb_alloc(peer_id, avdtp_stream_config);
    if (p_scb == NULL) {
    if (p_scb == NULL) {
      LOG_ERROR("Unable to create AVDT stream endpoint peer_id=%d scb_index=%d",
                peer_id, avdtp_stream_config.scb_index);
      result = AVDT_NO_RESOURCES;
      result = AVDT_NO_RESOURCES;
    } else {
    } else {
      *p_handle = avdt_scb_to_hdl(p_scb);
      *p_handle = avdt_scb_to_hdl(p_scb);
      LOG_DEBUG("Created stream endpoint peer_id=%d handle=%hhu", peer_id,
                *p_handle);
    }
    }
  }
  }

  return static_cast<uint16_t>(result);
  if (result != AVDT_SUCCESS) {
    AVDT_TRACE_ERROR("%s: result=%d peer_id=%d scb_index=%d", __func__, result,
                     peer_id, avdtp_stream_config.scb_index);
  }

  return result;
}
}


/*******************************************************************************
/*******************************************************************************