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

Commit 28c3aa1f authored by Yuyang Huang's avatar Yuyang Huang
Browse files

change log level to trace BTA_AG_FAIL_RESOURCES

Test: compile
Bug: 274000898
Change-Id: I226774470ee60596f184c529fff60cff42cd7b71
parent ad29c656
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -326,6 +326,7 @@ void bta_ag_disc_fail(tBTA_AG_SCB* p_scb,
 ******************************************************************************/
void bta_ag_open_fail(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) {
  /* call open cback w. failure */
  LOG_DEBUG("state [0x%02x]", p_scb->state);
  bta_ag_cback_open(p_scb, data.api_open.bd_addr, BTA_AG_FAIL_RESOURCES);
}

@@ -844,8 +845,7 @@ void bta_ag_setcodec(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) {
      (codec_type != BTM_SCO_CODEC_MSBC) && (codec_type != BTM_SCO_CODEC_LC3)) {
    val.num = codec_type;
    val.hdr.status = BTA_AG_FAIL_RESOURCES;
    APPL_TRACE_ERROR("bta_ag_setcodec error: unsupported codec type %d",
                     codec_type);
    LOG_ERROR("bta_ag_setcodec error: unsupported codec type %d", codec_type);
    (*bta_ag_cb.p_cback)(BTA_AG_CODEC_EVT, (tBTA_AG*)&val);
    return;
  }
@@ -860,8 +860,7 @@ void bta_ag_setcodec(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) {
  } else {
    val.num = codec_type;
    val.hdr.status = BTA_AG_FAIL_RESOURCES;
    APPL_TRACE_ERROR("bta_ag_setcodec error: unsupported codec type %d",
                     codec_type);
    LOG_ERROR("bta_ag_setcodec error: unsupported codec type %d", codec_type);
  }

  (*bta_ag_cb.p_cback)(BTA_AG_CODEC_EVT, (tBTA_AG*)&val);
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ tBTA_STATUS BTA_AgEnable(tBTA_AG_CBACK* p_cback) {
  /* Error if AG is already enabled, or AG is in the middle of disabling. */
  for (const tBTA_AG_SCB& scb : bta_ag_cb.scb) {
    if (scb.in_use) {
      APPL_TRACE_ERROR("BTA_AgEnable: FAILED, AG already enabled.");
      LOG_ERROR("BTA_AgEnable: FAILED, AG already enabled.");
      return BTA_FAILURE;
    }
  }
+5 −3
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ static tBTA_AG_SCB* bta_ag_scb_alloc(void) {
  if (i == BTA_AG_MAX_NUM_CLIENTS) {
    /* out of scbs */
    p_scb = nullptr;
    APPL_TRACE_WARNING("%s: Out of scbs", __func__);
    LOG_WARN("Out of scbs");
  }
  return p_scb;
}
@@ -317,7 +317,7 @@ bool bta_ag_other_scb_open(tBTA_AG_SCB* p_curr_scb) {
    }
  }
  /* no other scb found */
  APPL_TRACE_DEBUG("No other ag scb open");
  LOG_DEBUG("No other ag scb open");
  return false;
}

@@ -402,6 +402,7 @@ void bta_ag_resume_open(tBTA_AG_SCB* p_scb) {
 ******************************************************************************/
void bta_ag_api_enable(tBTA_AG_CBACK* p_cback) {
  /* initialize control block */
  LOG_INFO("AG api enable");
  for (tBTA_AG_SCB& scb : bta_ag_cb.scb) {
    alarm_free(scb.ring_timer);
    alarm_free(scb.codec_negotiation_timer);
@@ -474,8 +475,9 @@ void bta_ag_api_register(tBTA_SERVICE_MASK services, tBTA_AG_FEAT features,
                         const std::vector<std::string>& service_names,
                         uint8_t app_id) {
  tBTA_AG_SCB* p_scb = bta_ag_scb_alloc();
  LOG_DEBUG("bta_ag_api_register: p_scb allocation %s",
            p_scb == nullptr ? "failed" : "success");
  if (p_scb) {
    APPL_TRACE_DEBUG("bta_ag_api_register: p_scb 0x%08x ", p_scb);
    tBTA_AG_DATA data = {};
    data.api_register.features = features;
    data.api_register.services = services;
+1 −0
Original line number Diff line number Diff line
@@ -358,6 +358,7 @@ void bta_ag_rfc_do_open(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) {
 ******************************************************************************/
void bta_ag_rfc_do_close(tBTA_AG_SCB* p_scb,
                         UNUSED_ATTR const tBTA_AG_DATA& data) {
  LOG_INFO("p_scb->conn_handle: 0x%04x", p_scb->conn_handle);
  if (p_scb->conn_handle) {
    RFCOMM_RemoveConnection(p_scb->conn_handle);
  } else {
+1 −0
Original line number Diff line number Diff line
@@ -1587,6 +1587,7 @@ bt_status_t HeadsetInterface::SetActiveDevice(RawAddress* active_device_addr) {
 *
 ******************************************************************************/
bt_status_t ExecuteService(bool b_enable) {
  LOG_INFO("service starts to: %s", b_enable ? "Initialize" : "Shutdown");
  const char* service_names_raw[] = BTIF_HF_SERVICE_NAMES;
  std::vector<std::string> service_names;
  for (const char* service_name_raw : service_names_raw) {