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

Commit f8e61f80 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Use CSVD D1 eSCO config param for SCO connection" am: 1d4b1bb9 am:...

Merge "Use CSVD D1 eSCO config param for SCO connection" am: 1d4b1bb9 am: 6f2c001a am: e8773dc5

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2163277



Change-Id: I82ef19cf7fb0ea1398d349cbb7acf8cad3753e98
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents a46151ae e8773dc5
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -34,12 +34,16 @@
#include "main/shim/dumpsys.h"
#include "osi/include/log.h"
#include "osi/include/osi.h"  // UNUSED_ATTR
#include "stack/btm/btm_int_types.h"
#include "stack/btm/btm_sco.h"
#include "stack/btm/btm_sco_hfp_hal.h"
#include "stack/include/acl_api.h"
#include "stack/include/btm_api.h"
#include "stack/include/btu.h"  // do_in_main_thread
#include "types/raw_address.h"

extern tBTM_CB btm_cb;

/* Codec negotiation timeout */
#ifndef BTA_AG_CODEC_NEGOTIATION_TIMEOUT_MS
#define BTA_AG_CODEC_NEGOTIATION_TIMEOUT_MS (3 * 1000) /* 3 seconds */
@@ -512,6 +516,15 @@ static void bta_ag_create_pending_sco(tBTA_AG_SCB* p_scb, bool is_local) {
      params = esco_parameters_for_codec(ESCO_CODEC_CVSD_S3, offload);
    }

    // HFP v1.8 5.7.3 CVSD coding
    tSCO_CONN* p_sco = NULL;
    if (p_scb->sco_idx < BTM_MAX_SCO_LINKS)
      p_sco = &btm_cb.sco_cb.sco_db[p_scb->sco_idx];
    if (p_sco && (p_sco->esco.data.link_type == BTM_LINK_TYPE_SCO ||
                  !sco_peer_supports_esco_ev3(p_sco->esco.data.bd_addr))) {
      params = esco_parameters_for_codec(SCO_CODEC_CVSD_D1, offload);
    }

    BTM_EScoConnRsp(p_scb->sco_idx, HCI_SUCCESS, &params);
    APPL_TRACE_DEBUG("%s: listening for SCO connection", __func__);
  }
+0 −4
Original line number Diff line number Diff line
@@ -143,10 +143,6 @@ static void btm_esco_conn_rsp(uint16_t sco_inx, uint8_t hci_status,
    /* If parameters not specified use the default */
    if (p_parms) {
      *p_setup = *p_parms;
    } else if (p_sco->esco.data.link_type == BTM_LINK_TYPE_SCO ||
               !sco_peer_supports_esco_ev3(bda)) {
      *p_setup = esco_parameters_for_codec(
          SCO_CODEC_CVSD_D1, hfp_hal_interface::get_offload_enabled());
    } else {
      /* Use the last setup passed thru BTM_SetEscoMode (or defaults) */
      *p_setup = btm_cb.sco_cb.def_esco_parms;