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

Commit e1e2ba51 authored by Henri Chataing's avatar Henri Chataing
Browse files

Remove unused function BTA_GetEirService

Bug: 331817295
Test: m com.android.btservices
Flag: EXEMPT, dead code removal
Change-Id: Iadc45a68356d846449eb0c4726547c8d9ef48a03
parent 07344160
Loading
Loading
Loading
Loading
+0 −45
Original line number Diff line number Diff line
@@ -117,51 +117,6 @@ void BTA_DmDiscover(const RawAddress& bd_addr,
  bta_dm_disc_start_service_discovery(cbacks, bd_addr, transport);
}

/*******************************************************************************
 *
 * Function         BTA_GetEirService
 *
 * Description      This function is called to get BTA service mask from EIR.
 *
 * Parameters       p_eir - pointer of EIR significant part
 *                  p_services - return the BTA service mask
 *
 * Returns          None
 *
 ******************************************************************************/
extern const uint16_t bta_service_id_to_uuid_lkup_tbl[];
void BTA_GetEirService(const uint8_t* p_eir, size_t eir_len,
                       tBTA_SERVICE_MASK* p_services) {
  uint8_t xx, yy;
  uint8_t num_uuid, max_num_uuid = 32;
  uint8_t uuid_list[32 * Uuid::kNumBytes16];
  uint16_t* p_uuid16 = (uint16_t*)uuid_list;
  tBTA_SERVICE_MASK mask;

  get_btm_client_interface().eir.BTM_GetEirUuidList(
      p_eir, eir_len, Uuid::kNumBytes16, &num_uuid, uuid_list, max_num_uuid);
  for (xx = 0; xx < num_uuid; xx++) {
    mask = 1;
    for (yy = 0; yy < BTA_MAX_SERVICE_ID; yy++) {
      if (*(p_uuid16 + xx) == bta_service_id_to_uuid_lkup_tbl[yy]) {
        *p_services |= mask;
        break;
      }
      mask <<= 1;
    }

    /* for HSP v1.2 only device */
    if (*(p_uuid16 + xx) == UUID_SERVCLASS_HEADSET_HS)
      *p_services |= BTA_HSP_SERVICE_MASK;

    if (*(p_uuid16 + xx) == UUID_SERVCLASS_HDP_SOURCE)
      *p_services |= BTA_HL_SERVICE_MASK;

    if (*(p_uuid16 + xx) == UUID_SERVCLASS_HDP_SINK)
      *p_services |= BTA_HL_SERVICE_MASK;
  }
}

/*******************************************************************************
 *
 * Function         BTA_DmGetConnectionState
+0 −16
Original line number Diff line number Diff line
@@ -582,22 +582,6 @@ void BTA_DmDiscover(const RawAddress& bd_addr,
tBTA_STATUS BTA_DmGetCachedRemoteName(const RawAddress& remote_device,
                                      uint8_t** pp_cached_name);

/*******************************************************************************
 *
 * Function         BTA_GetEirService
 *
 * Description      This function is called to get BTA service mask from EIR.
 *
 * Parameters       p_eir - pointer of EIR significant part
 *                  eir_len - EIR length
 *                  p_services - return the BTA service mask
 *
 * Returns          None
 *
 ******************************************************************************/
void BTA_GetEirService(const uint8_t* p_eir, size_t eir_len,
                       tBTA_SERVICE_MASK* p_services);

/*******************************************************************************
 *
 * Function         BTA_DmGetConnectionState
+0 −6
Original line number Diff line number Diff line
@@ -81,7 +81,6 @@ struct BTA_DmSetLocalDiRecord BTA_DmSetLocalDiRecord;
struct BTA_DmSirkConfirmDeviceReply BTA_DmSirkConfirmDeviceReply;
struct BTA_DmSirkSecCbRegister BTA_DmSirkSecCbRegister;
struct BTA_EnableTestMode BTA_EnableTestMode;
struct BTA_GetEirService BTA_GetEirService;
struct BTA_VendorInit BTA_VendorInit;
struct BTA_dm_init BTA_dm_init;

@@ -304,11 +303,6 @@ void BTA_EnableTestMode(void) {
  inc_func_call_count(__func__);
  test::mock::bta_dm_api::BTA_EnableTestMode();
}
void BTA_GetEirService(const uint8_t* p_eir, size_t eir_len,
                       tBTA_SERVICE_MASK* p_services) {
  inc_func_call_count(__func__);
  test::mock::bta_dm_api::BTA_GetEirService(p_eir, eir_len, p_services);
}
void BTA_VendorInit(void) {
  inc_func_call_count(__func__);
  test::mock::bta_dm_api::BTA_VendorInit();
+0 −15
Original line number Diff line number Diff line
@@ -567,21 +567,6 @@ struct BTA_EnableTestMode {
};
extern struct BTA_EnableTestMode BTA_EnableTestMode;

// Name: BTA_GetEirService
// Params: const uint8_t* p_eir, size_t eir_len, tBTA_SERVICE_MASK* p_services
// Return: void
struct BTA_GetEirService {
  std::function<void(const uint8_t* p_eir, size_t eir_len,
                     tBTA_SERVICE_MASK* p_services)>
      body{[](const uint8_t* /* p_eir */, size_t /* eir_len */,
              tBTA_SERVICE_MASK* /* p_services */) {}};
  void operator()(const uint8_t* p_eir, size_t eir_len,
                  tBTA_SERVICE_MASK* p_services) {
    body(p_eir, eir_len, p_services);
  };
};
extern struct BTA_GetEirService BTA_GetEirService;

// Name: BTA_VendorInit
// Params: void
// Return: void