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

Commit b9e1f3ed authored by Chris Manton's avatar Chris Manton Committed by Gerrit Code Review
Browse files

Merge changes Ibe26844b,Ib3cbe9ef,Id0935c0f,I828a96d1,I73d1623f into main

* changes:
  mock: [45/63] Remove BTM_RemoveEirService
  mock: [44/63] Remove BTM_RegForEScoEvt
  mock: [43/63] Remove BTM_ReadRSSI
  mock: [42/63] Remove BTM_ReadRemoteVersion
  mock: [41/63] Remove BTM_ReadRemoteFeatures
parents 588b6762 7ed0f8d6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -638,7 +638,7 @@ static void bta_ag_codec_negotiation_timer_cback(void* data) {
 ******************************************************************************/
void bta_ag_codec_negotiate(tBTA_AG_SCB* p_scb) {
  bta_ag_cb.sco.p_curr_scb = p_scb;
  uint8_t* p_rem_feat = BTM_ReadRemoteFeatures(p_scb->peer_addr);
  uint8_t* p_rem_feat = get_btm_client_interface().peer.BTM_ReadRemoteFeatures(p_scb->peer_addr);
  bool sdp_wbs_support = p_scb->peer_sdp_features & BTA_AG_FEAT_WBS_SUPPORT;

  if (p_rem_feat == nullptr) {
+4 −2
Original line number Diff line number Diff line
@@ -43,7 +43,6 @@
#include "osi/include/allocator.h"
#include "osi/include/properties.h"
#include "stack/btm/btm_sec.h"
#include "stack/include/acl_api.h"        // BTM_ReadRSSI
#include "stack/include/acl_api_types.h"  // tBTM_RSSI_RESULT
#include "stack/include/bt_hdr.h"
#include "stack/include/bt_types.h"
@@ -1973,7 +1972,10 @@ private:
      if (device->num_intervals_since_last_rssi_read >= PERIOD_TO_READ_RSSI_IN_INTERVALS) {
        device->num_intervals_since_last_rssi_read = 0;
        log::debug("bd_addr={}", device->address);
        BTM_ReadRSSI(device->address, read_rssi_callback);
        if (get_btm_client_interface().link_controller.BTM_ReadRSSI(
                    device->address, read_rssi_callback) != BTM_SUCCESS) {
          log::warn("Unable to read RSSI peer:{}", device->address);
        }
      }
    }
  }
+2 −1
Original line number Diff line number Diff line
@@ -263,7 +263,8 @@ static void bta_hf_client_sco_create(tBTA_HF_CLIENT_CB* client_cb, bool is_orig)
          &client_cb->peer_addr, is_orig, params.packet_types, &client_cb->sco_idx,
          bta_hf_client_sco_conn_cback, bta_hf_client_sco_disc_cback);
  if (status == BTM_CMD_STARTED && !is_orig) {
    if (!BTM_RegForEScoEvts(client_cb->sco_idx, bta_hf_client_esco_connreq_cback)) {
    if (get_btm_client_interface().sco.BTM_RegForEScoEvts(
                client_cb->sco_idx, bta_hf_client_esco_connreq_cback) == BTM_SUCCESS) {
      log::verbose("SCO registration success");
    }
  }
+12 −5
Original line number Diff line number Diff line
@@ -351,17 +351,24 @@ TEST_F_WITH_FLAGS(BtaAgCmdTest, handle_swb_at_event__qcs_ev_codec_q1_fallback_to
  ASSERT_TRUE(enable_aptx_voice_property(false));
}

namespace {
uint8_t data[3] = {1, 2, 3};
}  // namespace

class BtaAgScoTest : public BtaAgTest {
protected:
  void SetUp() override {
    BtaAgTest::SetUp();
    test::mock::stack_acl::BTM_ReadRemoteFeatures.body = [this](const RawAddress& addr) {
      return this->data;
    reset_mock_btm_client_interface();
    mock_btm_client_interface.peer.BTM_ReadRemoteFeatures = [](const RawAddress& addr) {
      inc_func_call_count("BTM_ReadRemoteFeatures");
      return data;
    };
  }
  void TearDown() override { BtaAgTest::TearDown(); }

  uint8_t data[3] = {1, 2, 3};
  void TearDown() override {
    reset_mock_btm_client_interface();
    BtaAgTest::TearDown();
  }
};

TEST_F_WITH_FLAGS(BtaAgScoTest, codec_negotiate__aptx_state_on,
+3 −1
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@
#include "stack/include/acl_api.h"
#include "stack/include/acl_api_types.h"
#include "stack/include/bt_hdr.h"
#include "stack/include/btm_client_interface.h"
#include "types/raw_address.h"

using bluetooth::audio::a2dp::BluetoothAudioStatus;
@@ -914,7 +915,8 @@ static bool btif_a2dp_source_enqueue_callback(BT_HDR* p_buf, size_t frames_n,

    // Request additional debug info if we had to flush buffers
    RawAddress peer_bda = btif_av_source_active_peer();
    tBTM_STATUS status = BTM_ReadRSSI(peer_bda, btm_read_rssi_cb);
    tBTM_STATUS status =
            get_btm_client_interface().link_controller.BTM_ReadRSSI(peer_bda, btm_read_rssi_cb);
    if (status != BTM_CMD_STARTED) {
      log::warn("Cannot read RSSI: status {}", status);
    }
Loading