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

Commit 307cb8fb authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes Ic2f7bb9e,Ic6f79471,Id698ddfa,I5aa56744,I6fe90086 into main

* changes:
  mock: [60/63] Remove BTM_UseLeLink
  mock: [59/63] Remove BTM_unblock_sniff_mode_for
  mock: [58/63] Remove BTM_unblock_role_switch_for
  mock: [57/63] Remove BTM_SwitchRoleToCentral
  mock: [56/63] Remove BTM_SetSsrParams
parents aa575a0b ebb4f8c3
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -873,7 +873,8 @@ void bta_av_restore_switch(void) {
    mask = BTA_AV_HNDL_TO_MSK(i);
    if (p_cb->conn_audio == mask) {
      if (p_cb->p_scb[i]) {
        BTM_unblock_role_switch_for(p_cb->p_scb[i]->PeerAddress());
        get_btm_client_interface().link_policy.BTM_unblock_role_switch_for(
                p_cb->p_scb[i]->PeerAddress());
      }
      break;
    }
@@ -922,7 +923,7 @@ static void bta_av_sys_rs_cback(tBTA_SYS_CONN_STATUS /* status */, tHCI_ROLE new
  if ((HCI_SUCCESS != hci_status) &&
      (get_btm_client_interface().link_policy.BTM_GetRole(peer_addr, &cur_role) == BTM_SUCCESS) &&
      (cur_role == HCI_ROLE_PERIPHERAL)) {
    BTM_unblock_role_switch_for(peer_addr);
    get_btm_client_interface().link_policy.BTM_unblock_role_switch_for(peer_addr);
  }

  /* if BTA_AvOpen() was called for other device, which caused the role switch
@@ -1089,7 +1090,8 @@ bool bta_av_link_role_ok(tBTA_AV_SCB* p_scb, uint8_t bits) {
            "conn_audio:0x{:x} bits:{} features:0x{:x}",
            p_scb->PeerAddress(), p_scb->hndl, RoleText(role), bta_av_cb.conn_audio, bits,
            bta_av_cb.features);
    const tBTM_STATUS status = BTM_SwitchRoleToCentral(p_scb->PeerAddress());
    const tBTM_STATUS status =
            get_btm_client_interface().link_policy.BTM_SwitchRoleToCentral(p_scb->PeerAddress());
    switch (status) {
      case BTM_CMD_STARTED:
        break;
+5 −7
Original line number Diff line number Diff line
@@ -34,17 +34,13 @@
#include "bta/include/bta_hh_api.h"
#include "bta/include/bta_hh_co.h"
#include "bta/sys/bta_sys.h"
#include "btif/include/btif_storage.h"
#include "os/log.h"
#include "osi/include/allocator.h"
#include "stack/include/acl_api.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_uuid16.h"
#include "stack/include/btm_client_interface.h"
#include "stack/include/btm_log_history.h"
#include "stack/include/hiddefs.h"
#include "stack/include/hidh_api.h"
#include "stack/include/sdp_api.h"
#include "types/bluetooth/uuid.h"
#include "types/raw_address.h"

using namespace bluetooth::legacy::stack::sdp;
@@ -925,7 +921,9 @@ void bta_hh_maint_dev_act(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) {
      if (p_cb->hid_handle == BTA_HH_INVALID_HANDLE) {
        tBT_TRANSPORT transport = p_data->api_maintdev.link_spec.transport;
        if (!com::android::bluetooth::flags::allow_switching_hid_and_hogp()) {
          transport = BTM_UseLeLink(p_data->api_maintdev.link_spec.addrt.bda) ? BT_TRANSPORT_LE
          transport = get_btm_client_interface().ble.BTM_UseLeLink(
                              p_data->api_maintdev.link_spec.addrt.bda)
                              ? BT_TRANSPORT_LE
                              : BT_TRANSPORT_BR_EDR;
        }
        if (transport == BT_TRANSPORT_LE) {
+2 −2
Original line number Diff line number Diff line
@@ -848,7 +848,7 @@ tBTM_STATUS BTM_CancelRemoteDeviceName(void) {
  if (com::android::bluetooth::flags::rnr_store_device_type()) {
    is_le = (btm_cb.rnr.remname_dev_type == BT_DEVICE_TYPE_BLE);
  } else {
    is_le = BTM_UseLeLink(btm_cb.rnr.remname_bda);
    is_le = get_btm_client_interface().ble.BTM_UseLeLink(btm_cb.rnr.remname_bda);
  }

  if (is_le) {
@@ -1922,7 +1922,7 @@ void btm_process_remote_name(const RawAddress* bda, const BD_NAME bdn, uint16_t
  if (com::android::bluetooth::flags::rnr_store_device_type()) {
    on_le_link = (btm_cb.rnr.remname_dev_type == BT_DEVICE_TYPE_BLE);
  } else {
    on_le_link = BTM_UseLeLink(btm_cb.rnr.remname_bda);
    on_le_link = get_btm_client_interface().ble.BTM_UseLeLink(btm_cb.rnr.remname_bda);
  }

  /* If the inquire BDA and remote DBA are the same, then stop the timer and set
+6 −2
Original line number Diff line number Diff line
@@ -808,7 +808,8 @@ tBTM_STATUS BTM_SecBond(const RawAddress& bd_addr, tBLE_ADDR_TYPE addr_type,
                        tBT_TRANSPORT transport, tBT_DEVICE_TYPE /* device_type */) {
  if (transport == BT_TRANSPORT_AUTO) {
    if (addr_type == BLE_ADDR_PUBLIC) {
      transport = BTM_UseLeLink(bd_addr) ? BT_TRANSPORT_LE : BT_TRANSPORT_BR_EDR;
      transport = get_btm_client_interface().ble.BTM_UseLeLink(bd_addr) ? BT_TRANSPORT_LE
                                                                        : BT_TRANSPORT_BR_EDR;
    } else {
      log::info("Forcing transport LE (was auto) because of the address type");
      transport = BT_TRANSPORT_LE;
@@ -3115,7 +3116,10 @@ void btm_sec_auth_complete(uint16_t handle, tHCI_STATUS status) {
        log::info(
                "auth completed in role=peripheral, try to switch role and "
                "encrypt");
        BTM_SwitchRoleToCentral(p_dev_rec->RemoteAddress());
        if (get_btm_client_interface().link_policy.BTM_SwitchRoleToCentral(
                    p_dev_rec->RemoteAddress()) != BTM_CMD_STARTED) {
          log::warn("Unable to switch role to central peer:{}", p_dev_rec->RemoteAddress());
        }
      }

      l2cu_start_post_bond_timer(p_dev_rec->hci_handle);
+2 −3
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include "osi/include/mutex.h"
#include "stack/btm/btm_sec.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/btm_client_interface.h"
#include "types/raw_address.h"

using namespace bluetooth;
@@ -103,8 +104,6 @@ static tGAP_CCB* gap_allocate_ccb(void);
static void gap_release_ccb(tGAP_CCB* p_ccb);
static void gap_checks_con_flags(tGAP_CCB* p_ccb);

bool BTM_UseLeLink(const RawAddress& bd_addr);

/*******************************************************************************
 *
 * Function         gap_conn_init
@@ -622,7 +621,7 @@ static void gap_connect_ind(const RawAddress& bd_addr, uint16_t l2cap_cid, uint1
    log::warn("*******");

    /* Disconnect because it is an unexpected connection */
    if (BTM_UseLeLink(bd_addr)) {
    if (get_btm_client_interface().ble.BTM_UseLeLink(bd_addr)) {
      if (!L2CA_DisconnectLECocReq(l2cap_cid)) {
        log::warn("Unable to request L2CAP disconnect le_coc peer:{} cid:{}", bd_addr, l2cap_cid);
      }
Loading