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

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

Merge changes Ic6259fac,Iff3d56fe,I796ded11,I014a2762 into main

* changes:
  mock: Link with libfmq and not a mock
  mock: mock_stack_btm_sco_hfp_hal:: Use fully qualified include path
  Re-include btcore::module
  Stat-ify btif::hh::bte_hh_evt
parents 6497a766 b9c9ce41
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -27,11 +27,8 @@
#include <mutex>
#include <unordered_map>

#include "check.h"
#include "common/message_loop_thread.h"
#include "osi/include/allocator.h"
#include "osi/include/log.h"
#include "osi/include/osi.h"
#include "os/log.h"

using bluetooth::common::MessageLoopThread;

+2 −2
Original line number Diff line number Diff line
@@ -606,7 +606,6 @@ cc_test {
        ":TestMockHci",
        ":TestMockMainShim",
        ":TestMockStack",
        ":TestMockSystemLibfmq",
        ":TestMockUdrv",
        ":TestMockUtils",
        "test/btif_hh_test.cc",
@@ -621,6 +620,7 @@ cc_test {
        "libbase",
        "libcrypto",
        "libcutils",
        "libfmq",
        "libhidlbase",
        "liblog",
        "libutils",
@@ -752,7 +752,6 @@ cc_test {
        ":TestMockHci",
        ":TestMockMainShim",
        ":TestMockStack",
        ":TestMockSystemLibfmq",
        ":TestMockUdrv",
        ":TestMockUtils",
        "test/btif_core_test.cc",
@@ -767,6 +766,7 @@ cc_test {
        "libbase",
        "libcrypto",
        "libcutils",
        "libfmq",
        "libhidlbase",
        "liblog",
        "libutils",
+15 −2
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ void bta_hh_co_send_hid_info(btif_hh_device_t* p_dev, const char* dev_name,
                             uint16_t version, uint8_t ctry_code, int dscp_len,
                             uint8_t* p_dscp);
void bta_hh_co_write(int fd, uint8_t* rpt, uint16_t len);
void bte_hh_evt(tBTA_HH_EVT event, tBTA_HH* p_data);
static void bte_hh_evt(tBTA_HH_EVT event, tBTA_HH* p_data);
void btif_dm_hh_open_failed(RawAddress* bdaddr);
void btif_hd_service_registration();
void btif_hh_timer_timeout(void* data);
@@ -1174,7 +1174,7 @@ static void btif_hh_hsdata_rpt_copy_cb(uint16_t event, char* p_dest,
 *
 ******************************************************************************/

void bte_hh_evt(tBTA_HH_EVT event, tBTA_HH* p_data) {
static void bte_hh_evt(tBTA_HH_EVT event, tBTA_HH* p_data) {
  bt_status_t status;
  int param_len = 0;
  tBTIF_COPY_CBACK* p_copy_cback = NULL;
@@ -1900,4 +1900,17 @@ void DumpsysHid(int fd) {
    }
  }
}

namespace bluetooth {
namespace legacy {
namespace testing {

void bte_hh_evt(tBTA_HH_EVT event, tBTA_HH* p_data) {
  ::bte_hh_evt(event, p_data);
}

}  // namespace testing
}  // namespace legacy
}  // namespace bluetooth

#undef DUMPSYS_TAG
+11 −2
Original line number Diff line number Diff line
@@ -47,11 +47,20 @@ module_t rust_module;

const tBTA_AG_RES_DATA tBTA_AG_RES_DATA::kEmpty = {};

void bte_hh_evt(tBTA_HH_EVT event, tBTA_HH* p_data);
const bthh_interface_t* btif_hh_get_interface();
bt_status_t btif_hh_connect(const RawAddress* bd_addr);
bt_status_t btif_hh_virtual_unplug(const RawAddress* bd_addr);

namespace bluetooth {
namespace legacy {
namespace testing {

void bte_hh_evt(tBTA_HH_EVT event, tBTA_HH* p_data);

}  // namespace testing
}  // namespace legacy
}  // namespace bluetooth

namespace test {
namespace mock {
extern bool bluetooth_shim_is_gd_stack_started_up;
@@ -256,7 +265,7 @@ TEST_F(BtifHhWithDevice, BTA_HH_GET_RPT_EVT) {
        g_bthh_callbacks_get_report_promise.set_value(report);
  };

  bte_hh_evt(BTA_HH_GET_RPT_EVT, &data);
  bluetooth::legacy::testing::bte_hh_evt(BTA_HH_GET_RPT_EVT, &data);
  osi_free(data.hs_data.rsp_data.p_rpt_data);

  ASSERT_EQ(std::future_status::ready, future.wait_for(2s));
+0 −7
Original line number Diff line number Diff line
@@ -280,13 +280,6 @@ filegroup {
    ],
}

filegroup {
    name: "TestMockSystemLibfmq",
    srcs: [
        "mock/mock_system_libfmq_*.cc",
    ],
}

filegroup {
    name: "TestMockUdrv",
    srcs: [
Loading