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

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

Remove unused function BTM_BothEndsSupportSecureConnections

Bug: 331817295
Test: m com.android.btservices
Flag: EXEMPT, dead code removal
Change-Id: I64132cac2bc489deedbfa0774237c1ed023b7ce6
parent 809ea597
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -1299,25 +1299,6 @@ void BTM_RemoteOobDataReply(tBTM_STATUS res, const RawAddress& bd_addr,
  }
}

/*******************************************************************************
 *
 * Function         BTM_BothEndsSupportSecureConnections
 *
 * Description      This function is called to check if both the local device
 *                  and the peer device specified by bd_addr support BR/EDR
 *                  Secure Connections.
 *
 * Parameters:      bd_addr - address of the peer
 *
 * Returns          true if BR/EDR Secure Connections are supported by both
 *                  local and the remote device, else false.
 *
 ******************************************************************************/
bool BTM_BothEndsSupportSecureConnections(const RawAddress& bd_addr) {
  return ((bluetooth::shim::GetController()->SupportsSecureConnections()) &&
          (BTM_PeerSupportsSecureConnections(bd_addr)));
}

/*******************************************************************************
 *
 * Function         BTM_PeerSupportsSecureConnections
+0 −16
Original line number Diff line number Diff line
@@ -328,22 +328,6 @@ void BTM_ReadLocalOobData(void);
void BTM_RemoteOobDataReply(tBTM_STATUS res, const RawAddress& bd_addr,
                            const Octet16& c, const Octet16& r);

/*******************************************************************************
 *
 * Function         BTM_BothEndsSupportSecureConnections
 *
 * Description      This function is called to check if both the local device
 *                  and the peer device specified by bd_addr support BR/EDR
 *                  Secure Connections.
 *
 * Parameters:      bd_addr - address of the peer
 *
 * Returns          true if BR/EDR Secure Connections are supported by both
 *                  local and the remote device, else false.
 *
 ******************************************************************************/
bool BTM_BothEndsSupportSecureConnections(const RawAddress& bd_addr);

/*******************************************************************************
 *
 * Function         BTM_PeerSupportsSecureConnections
+0 −8
Original line number Diff line number Diff line
@@ -39,8 +39,6 @@ namespace mock {
namespace stack_btm_sec {

// Function state capture and return values, if needed
struct BTM_BothEndsSupportSecureConnections
    BTM_BothEndsSupportSecureConnections;
struct BTM_CanReadDiscoverableCharacteristics
    BTM_CanReadDiscoverableCharacteristics;
struct BTM_ConfirmReqReply BTM_ConfirmReqReply;
@@ -118,7 +116,6 @@ namespace test {
namespace mock {
namespace stack_btm_sec {

bool BTM_BothEndsSupportSecureConnections::return_value = false;
bool BTM_CanReadDiscoverableCharacteristics::return_value = false;
uint16_t BTM_GetClockOffset::return_value = 0;
tBT_DEVICE_TYPE BTM_GetPeerDeviceTypeFromFeatures::return_value = 0;
@@ -153,11 +150,6 @@ bool BTM_IsRemoteNameKnown::return_value = false;
}  // namespace test

// Mocked functions, if any
bool BTM_BothEndsSupportSecureConnections(const RawAddress& bd_addr) {
  inc_func_call_count(__func__);
  return test::mock::stack_btm_sec::BTM_BothEndsSupportSecureConnections(
      bd_addr);
}
bool BTM_CanReadDiscoverableCharacteristics(const RawAddress& bd_addr) {
  inc_func_call_count(__func__);
  return test::mock::stack_btm_sec::BTM_CanReadDiscoverableCharacteristics(
+0 −13
Original line number Diff line number Diff line
@@ -45,19 +45,6 @@ namespace test {
namespace mock {
namespace stack_btm_sec {

// Shared state between mocked functions and tests
// Name: BTM_BothEndsSupportSecureConnections
// Params: const RawAddress& bd_addr
// Return: bool
struct BTM_BothEndsSupportSecureConnections {
  static bool return_value;
  std::function<bool(const RawAddress& bd_addr)> body{
      [](const RawAddress& /* bd_addr */) { return return_value; }};
  bool operator()(const RawAddress& bd_addr) { return body(bd_addr); };
};
extern struct BTM_BothEndsSupportSecureConnections
    BTM_BothEndsSupportSecureConnections;

// Name: BTM_CanReadDiscoverableCharacteristics
// Params: const RawAddress& bd_addr
// Return: bool