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

Commit 8114d0bb authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "legacy: Use get_btm_client_interface().eir.BTM_GetEirSupportedServices" am: e8fe88b1

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1869995

Change-Id: I95fcc8b54464e21cdde8441cea5f1306547ce3ff
parents c177125d e8fe88b1
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2909,8 +2909,8 @@ static void bta_dm_set_eir(char* local_name) {
    num_uuid = p_bta_dm_eir_cfg->bta_dm_eir_uuid16_len / Uuid::kNumBytes16;
#else   // BTA_EIR_CANNED_UUID_LIST
    max_num_uuid = (free_eir_length - 2) / Uuid::kNumBytes16;
    data_type = BTM_GetEirSupportedServices(bta_dm_cb.eir_uuid, &p,
                                            max_num_uuid, &num_uuid);
    data_type = get_btm_client_interface().eir.BTM_GetEirSupportedServices(
        bta_dm_cb.eir_uuid, &p, max_num_uuid, &num_uuid);
    p = (uint8_t*)p_buf + BTM_HCI_EIR_OFFSET; /* reset p */
#endif  // BTA_EIR_CANNED_UUID_LIST

@@ -2967,8 +2967,8 @@ static void bta_dm_set_eir(char* local_name) {
    num_uuid = 0;

    max_num_uuid = (free_eir_length - 2) / Uuid::kNumBytes16;
    data_type = BTM_GetEirSupportedServices(bta_dm_cb.eir_uuid, &p,
                                            max_num_uuid, &num_uuid);
    data_type = get_btm_client_interface().eir.BTM_GetEirSupportedServices(
        bta_dm_cb.eir_uuid, &p, max_num_uuid, &num_uuid);

    if (data_type == HCI_EIR_MORE_16BITS_UUID_TYPE) {
      APPL_TRACE_WARNING("BTA EIR: UUID 16-bit list is truncated");
+0 −12
Original line number Diff line number Diff line
@@ -924,18 +924,6 @@ void bluetooth::shim::BTM_RemoveEirService(uint32_t* p_eir_uuid,
  CHECK(p_eir_uuid != nullptr);
}

uint8_t bluetooth::shim::BTM_GetEirSupportedServices(uint32_t* p_eir_uuid,
                                                     uint8_t** p,
                                                     uint8_t max_num_uuid16,
                                                     uint8_t* p_num_uuid16) {
  LOG_INFO("UNIMPLEMENTED %s", __func__);
  CHECK(p_eir_uuid != nullptr);
  CHECK(p != nullptr);
  CHECK(*p != nullptr);
  CHECK(p_num_uuid16 != nullptr);
  return BTM_NO_RESOURCES;
}

void bluetooth::shim::BTM_SecAddBleDevice(const RawAddress& bd_addr,
                                          tBT_DEVICE_TYPE dev_type,
                                          tBLE_ADDR_TYPE addr_type) {
+0 −20
Original line number Diff line number Diff line
@@ -364,26 +364,6 @@ void BTM_AddEirService(uint32_t* p_eir_uuid, uint16_t uuid16);
 ******************************************************************************/
void BTM_RemoveEirService(uint32_t* p_eir_uuid, uint16_t uuid16);

/*******************************************************************************
 *
 * Function         BTM_GetEirSupportedServices
 *
 * Description      This function is called to get UUID list from bit map UUID
 *                  list.
 *
 * Parameters       p_eir_uuid - bit mask of UUID list for EIR
 *                  p - reference of current pointer of EIR
 *                  max_num_uuid16 - max number of UUID can be written in EIR
 *                  num_uuid16 - number of UUID have been written in EIR
 *
 * Returns          HCI_EIR_MORE_16BITS_UUID_TYPE, if it has more than max
 *                  HCI_EIR_COMPLETE_16BITS_UUID_TYPE, otherwise
 *
 ******************************************************************************/
uint8_t BTM_GetEirSupportedServices(uint32_t* p_eir_uuid, uint8_t** p,
                                    uint8_t max_num_uuid16,
                                    uint8_t* p_num_uuid16);

/*******************************************************************************
 *
 * Function         BTM_SecAddBleDevice
+0 −7
Original line number Diff line number Diff line
@@ -244,13 +244,6 @@ uint8_t bluetooth::shim::BTM_BleMaxMultiAdvInstanceCount() {
  mock_function_count_map[__func__]++;
  return 0;
}
uint8_t bluetooth::shim::BTM_GetEirSupportedServices(uint32_t* p_eir_uuid,
                                                     uint8_t** p,
                                                     uint8_t max_num_uuid16,
                                                     uint8_t* p_num_uuid16) {
  mock_function_count_map[__func__]++;
  return 0;
}
void bluetooth::shim::BTM_AddEirService(uint32_t* p_eir_uuid, uint16_t uuid16) {
  mock_function_count_map[__func__]++;
}
+7 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
 * Generated mock file from original source file
 */

#include "stack/include/btm_api.h"
#include "stack/include/btm_ble_api_types.h"
#include "stack/include/btm_client_interface.h"
#include "types/raw_address.h"
@@ -29,7 +30,12 @@ void BTM_BleBackgroundObserve(bool enable, tBTM_INQ_RESULTS_CB* p_results_cb) {}
void BTM_BleReadControllerFeatures(tBTM_BLE_CTRL_FEATURES_CBACK* p_vsc_cback) {}
uint8_t BTM_GetAcceptlistSize() { return 0; }

struct btm_client_interface_s btm_client_interface = {};
struct btm_client_interface_s btm_client_interface = {
    .eir =
        {
            .BTM_GetEirSupportedServices = BTM_GetEirSupportedServices,
        },
};

struct btm_client_interface_s& get_btm_client_interface() {
  return btm_client_interface;