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

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

btm_loghistory: Add codec reconfig am: 771c552e am: a5cf28dc am: 99055edc

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

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I2854ac0313c03c021dfff4a3534acbc36c4d0e10
parents a6da2149 99055edc
Loading
Loading
Loading
Loading
+20 −9
Original line number Original line Diff line number Diff line
@@ -29,6 +29,7 @@
#include "bt_target.h"
#include "bt_target.h"


#include <base/logging.h>
#include <base/logging.h>
#include <base/strings/stringprintf.h>
#include <string.h>
#include <string.h>
#include <vector>
#include <vector>


@@ -52,6 +53,12 @@
#include "stack/include/btm_client_interface.h"
#include "stack/include/btm_client_interface.h"
#include "utl.h"
#include "utl.h"


namespace {

constexpr char kBtmLogTag[] = "A2DP";

}

/*****************************************************************************
/*****************************************************************************
 *  Constants
 *  Constants
 ****************************************************************************/
 ****************************************************************************/
@@ -1970,16 +1977,20 @@ void bta_av_reconfig(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {


  alarm_cancel(p_scb->avrc_ct_timer);
  alarm_cancel(p_scb->avrc_ct_timer);


  APPL_TRACE_DEBUG(
  LOG_DEBUG("p_scb->sep_info_idx=%d p_scb->rcfg_idx=%d p_rcfg->sep_info_idx=%d",
      "%s: p_scb->sep_info_idx=%d p_scb->rcfg_idx=%d p_rcfg->sep_info_idx=%d",
            p_scb->sep_info_idx, p_scb->rcfg_idx, p_rcfg->sep_info_idx);
      __func__, p_scb->sep_info_idx, p_scb->rcfg_idx, p_rcfg->sep_info_idx);
  LOG_DEBUG("Peer capable codec: %s",
  APPL_TRACE_DEBUG("%s: codec: %s", __func__,
            A2DP_CodecInfoString(p_scb->peer_cap.codec_info).c_str());
            A2DP_CodecInfoString(p_scb->peer_cap.codec_info).c_str());
  APPL_TRACE_DEBUG("%s: codec: %s", __func__,
  LOG_DEBUG("Current codec: %s",
            A2DP_CodecInfoString(p_scb->cfg.codec_info).c_str());
            A2DP_CodecInfoString(p_scb->cfg.codec_info).c_str());
  APPL_TRACE_DEBUG("%s: codec: %s", __func__,
  LOG_DEBUG("Reconfig codec: %s",
            A2DP_CodecInfoString(p_rcfg->codec_info).c_str());
            A2DP_CodecInfoString(p_rcfg->codec_info).c_str());


  BTM_LogHistory(
      kBtmLogTag, p_scb->PeerAddress(), "Codec reconfig",
      base::StringPrintf("%s => %s", A2DP_CodecName(p_scb->cfg.codec_info),
                         A2DP_CodecName(p_rcfg->codec_info)));

  p_cfg->num_protect = p_rcfg->num_protect;
  p_cfg->num_protect = p_rcfg->num_protect;
  memcpy(p_cfg->codec_info, p_rcfg->codec_info, AVDT_CODEC_SIZE);
  memcpy(p_cfg->codec_info, p_rcfg->codec_info, AVDT_CODEC_SIZE);
  memcpy(p_cfg->protect_info, p_rcfg->p_protect_info, p_rcfg->num_protect);
  memcpy(p_cfg->protect_info, p_rcfg->p_protect_info, p_rcfg->num_protect);