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

Commit 497252f9 authored by William Escande's avatar William Escande Committed by Automerger Merge Worker
Browse files

Merge changes I3e7ee29b,I83541dcc,If4c2632d am: c3c3c2c3 am: 2e5eecc9

parents cefb855f 2e5eecc9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -45,6 +45,9 @@
    {
      "name": "net_test_device"
    },
    {
      "name": "net_test_device_iot_config"
    },
    {
      "name": "net_test_gatt_conn_multiplexing"
    },
+1 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ if (defined(use.android) && use.android) {
  group("android_bluetooth_tests") {
    deps = [
      "//bt/system/device:net_test_device",
      "//bt/system/device:net_test_device_iot_config",
      "//bt/system/hci:net_test_hci",
      "//bt/system/osi:net_test_osi",
      "//bt/system/test/suite:net_test_bluetooth",
+1 −0
Original line number Diff line number Diff line
@@ -331,6 +331,7 @@ cc_test {
    ],
    static_libs: [
        "libbluetooth-types",
        "libbtdevice",
        "libbt-common",
        "libbt-protos-lite",
        "libbtcore",
+21 −2
Original line number Diff line number Diff line
@@ -22,19 +22,20 @@
 *
 ******************************************************************************/

#include <base/logging.h>

#include <cstdint>
#include <cstring>

#include "bta/ag/bta_ag_int.h"
#include "bta/include/bta_dm_api.h"
#include "btif/include/btif_config.h"
#include "device/include/device_iot_config.h"
#include "osi/include/osi.h"  // UNUSED_ATTR
#include "stack/include/l2c_api.h"
#include "stack/include/port_api.h"
#include "types/raw_address.h"

#include <base/logging.h>

/*****************************************************************************
 *  Constants
 ****************************************************************************/
@@ -222,6 +223,10 @@ void bta_ag_disc_int_res(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) {

      /* send ourselves sdp ok event */
      event = BTA_AG_DISC_OK_EVT;

      DEVICE_IOT_CONFIG_ADDR_SET_HEX_IF_GREATER(
          p_scb->peer_addr, IOT_CONF_KEY_HFP_VERSION, p_scb->peer_version,
          IOT_CONF_BYTE_NUM_2);
    }
  }

@@ -269,6 +274,9 @@ void bta_ag_disc_acp_res(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) {
      data.disc_result.status == SDP_DB_FULL) {
    /* get attributes */
    bta_ag_sdp_find_attr(p_scb, bta_ag_svc_mask[p_scb->conn_service]);
    DEVICE_IOT_CONFIG_ADDR_SET_HEX_IF_GREATER(
        p_scb->peer_addr, IOT_CONF_KEY_HFP_VERSION, p_scb->peer_version,
        IOT_CONF_BYTE_NUM_2);
  }

  /* free discovery db */
@@ -520,6 +528,7 @@ void bta_ag_rfc_acp_open(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) {

  /* get bd addr of peer */
  uint16_t lcid = 0;
  uint16_t hfp_version = 0;
  RawAddress dev_addr = RawAddress::kEmpty;
  int status = PORT_CheckConnection(data.rfc.port_handle, &dev_addr, &lcid);
  if (status != PORT_SUCCESS) {
@@ -583,6 +592,16 @@ void bta_ag_rfc_acp_open(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) {
  bta_ag_close_servers(
      p_scb, (p_scb->reg_services & ~bta_ag_svc_mask[p_scb->conn_service]));

  size_t version_value_size = sizeof(hfp_version);
  bool get_version =
      btif_config_get_bin(p_scb->peer_addr.ToString(), HFP_VERSION_CONFIG_KEY,
                          (uint8_t*)&hfp_version, &version_value_size);

  if (p_scb->conn_service == BTA_AG_HFP && get_version) {
    DEVICE_IOT_CONFIG_ADDR_SET_HEX_IF_GREATER(p_scb->peer_addr,
                                              IOT_CONF_KEY_HFP_VERSION,
                                              hfp_version, IOT_CONF_BYTE_NUM_2);
  }
  /* do service discovery to get features */
  bta_ag_do_disc(p_scb, bta_ag_svc_mask[p_scb->conn_service]);

+14 −2
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
#include "btif/include/btif_av_co.h"
#include "btif/include/btif_config.h"
#include "btif/include/btif_storage.h"
#include "device/include/device_iot_config.h"
#include "device/include/interop.h"
#include "main/shim/dumpsys.h"
#include "osi/include/allocator.h"
@@ -533,6 +534,10 @@ static void bta_av_a2dp_sdp_cback(bool found, tA2DP_Service* p_service,
  }
  if (found && (p_service != NULL)) {
    p_scb->SetAvdtpVersion(p_service->avdt_version);
    DEVICE_IOT_CONFIG_ADDR_SET_HEX_IF_GREATER(
        p_scb->PeerAddress(), IOT_CONF_KEY_A2DP_VERSION,
        p_service->avdt_version, IOT_CONF_BYTE_NUM_2);

    if (p_service->avdt_version != 0) {
      if (btif_config_set_bin(p_scb->PeerAddress().ToString(),
                              AVDTP_VERSION_CONFIG_KEY,
@@ -970,10 +975,17 @@ void bta_av_config_ind(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
    p_info->seid = p_data->str_msg.msg.config_ind.int_seid;

    /* Sep type of Peer will be oppsite role to our local sep */
    if (local_sep == AVDT_TSEP_SRC)
    if (local_sep == AVDT_TSEP_SRC) {
      p_info->tsep = AVDT_TSEP_SNK;
    else if (local_sep == AVDT_TSEP_SNK)
      DEVICE_IOT_CONFIG_ADDR_SET_INT(p_scb->PeerAddress(),
                                     IOT_CONF_KEY_A2DP_ROLE,
                                     IOT_CONF_VAL_A2DP_ROLE_SINK);
    } else if (local_sep == AVDT_TSEP_SNK) {
      p_info->tsep = AVDT_TSEP_SRC;
      DEVICE_IOT_CONFIG_ADDR_SET_INT(p_scb->PeerAddress(),
                                     IOT_CONF_KEY_A2DP_ROLE,
                                     IOT_CONF_VAL_A2DP_ROLE_SOURCE);
    }

    p_scb->role |= BTA_AV_ROLE_AD_ACP;
    p_scb->cur_psc_mask = p_evt_cfg->psc_mask;
Loading