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

Commit f8ee9a62 authored by Hui Peng's avatar Hui Peng Committed by Gerrit Code Review
Browse files

Merge "Replace Log Statements in system/stack"

parents c35e9d1d f08da107
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1353,7 +1353,7 @@ void btm_rejectlist_role_change_device(const RawAddress& bd_addr,
      LOG_WARN(
      LOG_WARN(
          "Device %s rejectlisted for role switching - "
          "Device %s rejectlisted for role switching - "
          "multiple role switch failed attempts: %u",
          "multiple role switch failed attempts: %u",
          bd_addr.ToString().c_str(), p->switch_role_failed_attempts);
          ADDRESS_TO_LOGGABLE_CSTR(bd_addr), p->switch_role_failed_attempts);
      interop_database_add(INTEROP_DYNAMIC_ROLE_SWITCH, &bd_addr, 3);
      interop_database_add(INTEROP_DYNAMIC_ROLE_SWITCH, &bd_addr, 3);
    }
    }
  }
  }
+11 −10
Original line number Original line Diff line number Diff line
@@ -280,7 +280,7 @@ uint16_t AVDT_DiscoverReq(const RawAddress& bd_addr, uint8_t channel_index,


  if (result != AVDT_SUCCESS) {
  if (result != AVDT_SUCCESS) {
    AVDT_TRACE_ERROR("%s: result=%d address=%s", __func__, result,
    AVDT_TRACE_ERROR("%s: result=%d address=%s", __func__, result,
                     bd_addr.ToString().c_str());
                     ADDRESS_TO_LOGGABLE_CSTR(bd_addr));
  }
  }
  return result;
  return result;
}
}
@@ -333,7 +333,7 @@ static uint16_t avdt_get_cap_req(const RawAddress& bd_addr,


  if (result != AVDT_SUCCESS) {
  if (result != AVDT_SUCCESS) {
    AVDT_TRACE_ERROR("%s: result=%d address=%s", __func__, result,
    AVDT_TRACE_ERROR("%s: result=%d address=%s", __func__, result,
                     bd_addr.ToString().c_str());
                     ADDRESS_TO_LOGGABLE_CSTR(bd_addr));
  }
  }
  return result;
  return result;
}
}
@@ -382,7 +382,7 @@ uint16_t AVDT_GetCapReq(const RawAddress& bd_addr, uint8_t channel_index,


  if (result != AVDT_SUCCESS) {
  if (result != AVDT_SUCCESS) {
    AVDT_TRACE_ERROR("%s: result=%d address=%s", __func__, result,
    AVDT_TRACE_ERROR("%s: result=%d address=%s", __func__, result,
                     bd_addr.ToString().c_str());
                     ADDRESS_TO_LOGGABLE_CSTR(bd_addr));
  }
  }
  return result;
  return result;
}
}
@@ -448,7 +448,7 @@ uint16_t AVDT_OpenReq(uint8_t handle, const RawAddress& bd_addr,
  tAVDT_SCB_EVT evt;
  tAVDT_SCB_EVT evt;


  AVDT_TRACE_API("%s: address=%s avdt_handle=%d seid=%d", __func__,
  AVDT_TRACE_API("%s: address=%s avdt_handle=%d seid=%d", __func__,
                 bd_addr.ToString().c_str(), handle, seid);
                 ADDRESS_TO_LOGGABLE_CSTR(bd_addr), handle, seid);


  /* verify SEID */
  /* verify SEID */
  if ((seid < AVDT_SEID_MIN) || (seid > AVDT_SEID_MAX)) {
  if ((seid < AVDT_SEID_MIN) || (seid > AVDT_SEID_MAX)) {
@@ -485,7 +485,7 @@ uint16_t AVDT_OpenReq(uint8_t handle, const RawAddress& bd_addr,
    avdt_scb_event(p_scb, AVDT_SCB_API_SETCONFIG_REQ_EVT, &evt);
    avdt_scb_event(p_scb, AVDT_SCB_API_SETCONFIG_REQ_EVT, &evt);
  } else {
  } else {
    AVDT_TRACE_ERROR("%s: result=%d address=%s avdt_handle=%d", __func__,
    AVDT_TRACE_ERROR("%s: result=%d address=%s avdt_handle=%d", __func__,
                     result, bd_addr.ToString().c_str(), handle);
                     result, ADDRESS_TO_LOGGABLE_CSTR(bd_addr), handle);
  }
  }


  return result;
  return result;
@@ -908,7 +908,7 @@ uint16_t AVDT_ConnectReq(const RawAddress& bd_addr, uint8_t channel_index,
  tAVDT_CCB_EVT evt;
  tAVDT_CCB_EVT evt;


  AVDT_TRACE_WARNING("%s: address=%s channel_index=%d", __func__,
  AVDT_TRACE_WARNING("%s: address=%s channel_index=%d", __func__,
                     bd_addr.ToString().c_str(), channel_index);
                     ADDRESS_TO_LOGGABLE_CSTR(bd_addr), channel_index);


  /* find channel control block for this bd addr; if none, allocate one */
  /* find channel control block for this bd addr; if none, allocate one */
  p_ccb = avdt_ccb_by_bd(bd_addr);
  p_ccb = avdt_ccb_by_bd(bd_addr);
@@ -932,7 +932,7 @@ uint16_t AVDT_ConnectReq(const RawAddress& bd_addr, uint8_t channel_index,
  }
  }


  AVDT_TRACE_WARNING("%s: address=%s result=%d", __func__,
  AVDT_TRACE_WARNING("%s: address=%s result=%d", __func__,
                     bd_addr.ToString().c_str(), result);
                     ADDRESS_TO_LOGGABLE_CSTR(bd_addr), result);


  return result;
  return result;
}
}
@@ -1037,7 +1037,7 @@ void stack_debug_avdtp_api_dump(int fd) {
      continue;
      continue;
    }
    }
    dprintf(fd, "\n  Channel control block: %zu peer: %s\n", i,
    dprintf(fd, "\n  Channel control block: %zu peer: %s\n", i,
            ccb.peer_addr.ToString().c_str());
            ADDRESS_TO_LOGGABLE_CSTR(ccb.peer_addr));
    dprintf(fd, "    Allocated: %s\n", ccb.allocated ? "true" : "false");
    dprintf(fd, "    Allocated: %s\n", ccb.allocated ? "true" : "false");
    dprintf(fd, "    State: %d\n", ccb.state);
    dprintf(fd, "    State: %d\n", ccb.state);
    dprintf(fd, "    Link-layer opened: %s\n",
    dprintf(fd, "    Link-layer opened: %s\n",
@@ -1074,7 +1074,8 @@ void stack_debug_avdtp_api_dump(int fd) {
                  ? "Scheduled"
                  ? "Scheduled"
                  : "Not scheduled");
                  : "Not scheduled");
      dprintf(fd, "      Channel control block peer: %s\n",
      dprintf(fd, "      Channel control block peer: %s\n",
              (scb.p_ccb != nullptr) ? scb.p_ccb->peer_addr.ToString().c_str()
              (scb.p_ccb != nullptr)
                  ? ADDRESS_TO_LOGGABLE_CSTR(scb.p_ccb->peer_addr)
                  : "null");
                  : "null");
      dprintf(fd, "      Allocated: %s\n", scb.allocated ? "true" : "false");
      dprintf(fd, "      Allocated: %s\n", scb.allocated ? "true" : "false");
      dprintf(fd, "      In use: %s\n", scb.in_use ? "true" : "false");
      dprintf(fd, "      In use: %s\n", scb.in_use ? "true" : "false");
+8 −6
Original line number Original line Diff line number Diff line
@@ -445,7 +445,7 @@ AvdtpCcb* avdt_ccb_alloc(const RawAddress& bd_addr) {
    if (!p_ccb->allocated) {
    if (!p_ccb->allocated) {
      p_ccb->Allocate(bd_addr);
      p_ccb->Allocate(bd_addr);
      AVDT_TRACE_DEBUG("%s: allocated (index %d) for peer %s", __func__, i,
      AVDT_TRACE_DEBUG("%s: allocated (index %d) for peer %s", __func__, i,
                       bd_addr.ToString().c_str());
                       ADDRESS_TO_LOGGABLE_CSTR(bd_addr));
      return p_ccb;
      return p_ccb;
    }
    }
  }
  }
@@ -459,18 +459,20 @@ AvdtpCcb* avdt_ccb_alloc_by_channel_index(const RawAddress& bd_addr,
  // Allocate the entry for the specified channel index
  // Allocate the entry for the specified channel index
  if (channel_index >= AVDT_NUM_LINKS) {
  if (channel_index >= AVDT_NUM_LINKS) {
    AVDT_TRACE_ERROR("%s: peer %s invalid channel index %d (max %d)", __func__,
    AVDT_TRACE_ERROR("%s: peer %s invalid channel index %d (max %d)", __func__,
                     bd_addr.ToString().c_str(), channel_index, AVDT_NUM_LINKS);
                     ADDRESS_TO_LOGGABLE_CSTR(bd_addr), channel_index,
                     AVDT_NUM_LINKS);
    return nullptr;
    return nullptr;
  }
  }
  AvdtpCcb* p_ccb = &avdtp_cb.ccb[channel_index];
  AvdtpCcb* p_ccb = &avdtp_cb.ccb[channel_index];
  if (p_ccb->allocated) {
  if (p_ccb->allocated) {
    AVDT_TRACE_ERROR("%s: peer %s channel index %d already allocated", __func__,
    AVDT_TRACE_ERROR("%s: peer %s channel index %d already allocated", __func__,
                     bd_addr.ToString().c_str(), channel_index);
                     ADDRESS_TO_LOGGABLE_CSTR(bd_addr), channel_index);
    return nullptr;
    return nullptr;
  }
  }
  p_ccb->Allocate(bd_addr);
  p_ccb->Allocate(bd_addr);
  AVDT_TRACE_DEBUG("%s: allocated (index %d) peer=%s p_ccb=%p", __func__,
  AVDT_TRACE_DEBUG("%s: allocated (index %d) peer=%s p_ccb=%p", __func__,
                   channel_index, p_ccb->peer_addr.ToString().c_str(), p_ccb);
                   channel_index, ADDRESS_TO_LOGGABLE_CSTR(p_ccb->peer_addr),
                   p_ccb);
  return p_ccb;
  return p_ccb;
}
}


@@ -497,8 +499,8 @@ void AvdtpCcb::Allocate(const RawAddress& peer_address) {
 ******************************************************************************/
 ******************************************************************************/
void avdt_ccb_dealloc(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
void avdt_ccb_dealloc(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
  AVDT_TRACE_DEBUG("%s: deallocated (index %d) peer=%s p_ccb=%p", __func__,
  AVDT_TRACE_DEBUG("%s: deallocated (index %d) peer=%s p_ccb=%p", __func__,
                   avdt_ccb_to_idx(p_ccb), p_ccb->peer_addr.ToString().c_str(),
                   avdt_ccb_to_idx(p_ccb),
                   p_ccb);
                   ADDRESS_TO_LOGGABLE_CSTR(p_ccb->peer_addr), p_ccb);
  p_ccb->ResetCcb();
  p_ccb->ResetCcb();
}
}


+4 −3
Original line number Original line Diff line number Diff line
@@ -1001,7 +1001,8 @@ void avdt_ccb_ll_closed(AvdtpCcb* p_ccb, UNUSED_ATTR tAVDT_CCB_EVT* p_data) {
  tAVDT_CTRL_CBACK* p_cback;
  tAVDT_CTRL_CBACK* p_cback;
  tAVDT_CTRL avdt_ctrl;
  tAVDT_CTRL avdt_ctrl;


  AVDT_TRACE_DEBUG("%s peer %s", __func__, p_ccb->peer_addr.ToString().c_str());
  AVDT_TRACE_DEBUG("%s peer %s", __func__,
                   ADDRESS_TO_LOGGABLE_CSTR(p_ccb->peer_addr));


  /* clear any pending commands */
  /* clear any pending commands */
  avdt_ccb_clear_cmds(p_ccb, NULL);
  avdt_ccb_clear_cmds(p_ccb, NULL);
@@ -1037,8 +1038,8 @@ void avdt_ccb_ll_opened(AvdtpCcb* p_ccb, tAVDT_CCB_EVT* p_data) {
  tAVDT_CTRL avdt_ctrl;
  tAVDT_CTRL avdt_ctrl;


  AVDT_TRACE_DEBUG("%s peer %s BtaAvScbIndex=%d p_ccb=%p", __func__,
  AVDT_TRACE_DEBUG("%s peer %s BtaAvScbIndex=%d p_ccb=%p", __func__,
                   p_ccb->peer_addr.ToString().c_str(), p_ccb->BtaAvScbIndex(),
                   ADDRESS_TO_LOGGABLE_CSTR(p_ccb->peer_addr),
                   p_ccb);
                   p_ccb->BtaAvScbIndex(), p_ccb);
  p_ccb->ll_opened = true;
  p_ccb->ll_opened = true;


  if (!p_ccb->p_conn_cback) p_ccb->p_conn_cback = avdtp_cb.p_conn_cback;
  if (!p_ccb->p_conn_cback) p_ccb->p_conn_cback = avdtp_cb.p_conn_cback;
+2 −2
Original line number Original line Diff line number Diff line
@@ -1399,9 +1399,9 @@ void AVRC_SaveControllerVersion(const RawAddress& bdaddr,
                 (const uint8_t*)&new_version, sizeof(new_version))) {
                 (const uint8_t*)&new_version, sizeof(new_version))) {
    btif_config_save();
    btif_config_save();
    LOG_INFO("store AVRC controller version %x for %s into config.",
    LOG_INFO("store AVRC controller version %x for %s into config.",
             new_version, bdaddr.ToString().c_str());
             new_version, ADDRESS_TO_LOGGABLE_CSTR(bdaddr));
  } else {
  } else {
    LOG_WARN("Failed to store AVRC controller version for %s",
    LOG_WARN("Failed to store AVRC controller version for %s",
             bdaddr.ToString().c_str());
             ADDRESS_TO_LOGGABLE_CSTR(bdaddr));
  }
  }
}
}
Loading