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

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

Merge changes Id96c9649,I53c30033,I057ed202,I152e7ea4,I855bad23 into main

* changes:
  mock: [55/63] Remove BTM_SetPowerMode
  mock: [54/63] Remove BTM_SetLocalDeviceName
  mock: [53/63] Remove BTM_SetEScoMode
  mock: [52/63] Remove BTM_SetDeviceClass
  mock: [51/63] Remove BTM_SetConsolidationCallback
parents 0ed128c0 e695e98e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ void BTA_dm_init() {
  /* if UUID list is not provided as static data */
  bta_sys_eir_register(bta_dm_eir_update_uuid);
  bta_sys_cust_eir_register(bta_dm_eir_update_cust_uuid);
  BTM_SetConsolidationCallback(bta_dm_consolidate);
  get_btm_client_interface().ble.BTM_SetConsolidationCallback(bta_dm_consolidate);
}

/** Enables bluetooth device under test mode */
+1 −1
Original line number Diff line number Diff line
@@ -212,7 +212,7 @@ bool utl_set_device_class(tBTA_UTL_COD* p_cod, uint8_t cmd) {
  DEV_CLASS dev_class;
  FIELDS_TO_COD(dev_class, minor, major, service);

  if (BTM_SetDeviceClass(dev_class) == BTM_SUCCESS) {
  if (get_btm_client_interface().local.BTM_SetDeviceClass(dev_class) == BTM_SUCCESS) {
    return true;
  }

+1 −1
Original line number Diff line number Diff line
@@ -352,7 +352,7 @@ tBTM_STATUS BTM_SetDiscoverability(uint16_t inq_mode) {
    }

    FIELDS_TO_COD(cod, minor, major, service_class);
    (void)BTM_SetDeviceClass(cod);
    (void)get_btm_client_interface().local.BTM_SetDeviceClass(cod);
  }

  return BTM_SUCCESS;
+5 −5
Original line number Diff line number Diff line
@@ -91,19 +91,19 @@ protected:

TEST_F(StackBtmPowerMode, BTM_SetPowerMode__Undefined) {
  tBTM_PM_PWR_MD mode = {};
  ASSERT_EQ(BTM_UNKNOWN_ADDR, BTM_SetPowerMode(pm_id_, kRawAddress, &mode));
  ASSERT_EQ(BTM_UNKNOWN_ADDR, ::BTM_SetPowerMode(pm_id_, kRawAddress, &mode));
}

TEST_F(StackBtmPowerModeConnected, BTM_SetPowerMode__AlreadyActive) {
  tBTM_PM_PWR_MD mode = {};
  ASSERT_EQ(BTM_SUCCESS, BTM_SetPowerMode(pm_id_, kRawAddress, &mode));
  ASSERT_EQ(BTM_SUCCESS, ::BTM_SetPowerMode(pm_id_, kRawAddress, &mode));
}

TEST_F(StackBtmPowerModeConnected, BTM_SetPowerMode__ActiveToSniff) {
  tBTM_PM_PWR_MD mode = {
          .mode = BTM_PM_MD_SNIFF,
  };
  ASSERT_EQ("BTM_CMD_STARTED", btm_status_text(BTM_SetPowerMode(pm_id_, kRawAddress, &mode)));
  ASSERT_EQ("BTM_CMD_STARTED", btm_status_text(::BTM_SetPowerMode(pm_id_, kRawAddress, &mode)));
  ASSERT_EQ(1, get_func_call_count("btsnd_hcic_sniff_mode"));

  // Respond with successful command status for mode command
@@ -154,7 +154,7 @@ TEST_F(StackBtmPowerModeConnected, BTM_SetPowerMode__ActiveToSniffTwice) {
  tBTM_PM_PWR_MD mode = {
          .mode = BTM_PM_MD_SNIFF,
  };
  ASSERT_EQ("BTM_CMD_STARTED", btm_status_text(BTM_SetPowerMode(pm_id_, kRawAddress, &mode)));
  ASSERT_EQ("BTM_CMD_STARTED", btm_status_text(::BTM_SetPowerMode(pm_id_, kRawAddress, &mode)));
  ASSERT_EQ(1, get_func_call_count("btsnd_hcic_sniff_mode"));

  // Respond with successful command status for mode command
@@ -180,7 +180,7 @@ TEST_F(StackBtmPowerModeConnected, BTM_SetPowerMode__ActiveToSniffTwice) {
  }

  // Send a second active to sniff command
  ASSERT_EQ("BTM_CMD_STORED", btm_status_text(BTM_SetPowerMode(pm_id_, kRawAddress, &mode)));
  ASSERT_EQ("BTM_CMD_STORED", btm_status_text(::BTM_SetPowerMode(pm_id_, kRawAddress, &mode)));
  // No command should be issued
  ASSERT_EQ(1, get_func_call_count("btsnd_hcic_sniff_mode"));

+0 −5
Original line number Diff line number Diff line
@@ -54,11 +54,6 @@ uint32_t BTM_PM_ReadBleScanDutyCycle(void) {
  inc_func_call_count(__func__);
  return 0;
}
tBTM_STATUS BTM_SetPowerMode(uint8_t /* pm_id */, const RawAddress& /* remote_bda */,
                             const tBTM_PM_PWR_MD* /* p_mode */) {
  inc_func_call_count(__func__);
  return BTM_SUCCESS;
}
tBTM_STATUS BTM_SetSsrParams(const RawAddress& /* remote_bda */, uint16_t /* max_lat */,
                             uint16_t /* min_rmt_to */, uint16_t /* min_loc_to */) {
  inc_func_call_count(__func__);
Loading