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

Commit 555f3080 authored by Myles Watson's avatar Myles Watson
Browse files

Remove dev_class_copy

Bug: 314889276
Test: mma -j32
Flag: EXEMPT, no logical change
Change-Id: I88cfaef10c579da8ea6493f0f58baa6f455d8c24
parent 3a718352
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -493,8 +493,7 @@ static tBTM_STATUS bta_dm_sp_cback(tBTM_SP_EVT event,
           BTM_SP_KEY_NOTIF_EVT,
           copy these values into key_notif from cfm_req */
        sec_event.key_notif.bd_addr = p_data->cfm_req.bd_addr;
        dev_class_copy(sec_event.key_notif.dev_class,
                       p_data->cfm_req.dev_class);
        sec_event.key_notif.dev_class = p_data->cfm_req.dev_class;
        bd_name_copy(sec_event.key_notif.bd_name, p_data->cfm_req.bd_name);
        /* Due to the switch case falling through below to BTM_SP_KEY_NOTIF_EVT,
           call remote name request using values from cfm_req */
@@ -506,7 +505,7 @@ static tBTM_STATUS bta_dm_sp_cback(tBTM_SP_EVT event,
          bta_dm_sec_cb.rmt_auth_req = sec_event.cfm_req.rmt_auth_req;
          bta_dm_sec_cb.loc_auth_req = sec_event.cfm_req.loc_auth_req;

          dev_class_copy(bta_dm_sec_cb.pin_dev_class, p_data->cfm_req.dev_class);
          bta_dm_sec_cb.pin_dev_class = p_data->cfm_req.dev_class;
          {
            const tBTM_STATUS btm_status =
                get_btm_client_interface().peer.BTM_ReadRemoteDeviceName(
+4 −4
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_CFM_REQ_EVT_WithName) {
              .rmt_io_caps = BTM_IO_CAP_NONE,
          },
  };
  dev_class_copy(data.cfm_req.dev_class, kDeviceClass);
  data.cfm_req.dev_class = kDeviceClass;
  bd_name_copy(data.cfm_req.bd_name, kRemoteName);

  ASSERT_EQ(btm_status_text(BTM_CMD_STARTED),
@@ -136,7 +136,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_CFM_REQ_EVT_WithoutName_RNRSuccess) {
              .rmt_io_caps = BTM_IO_CAP_NONE,
          },
  };
  dev_class_copy(data.cfm_req.dev_class, kDeviceClass);
  data.cfm_req.dev_class = kDeviceClass;

  ASSERT_EQ(btm_status_text(BTM_CMD_STARTED),
            btm_status_text(bluetooth::legacy::testing::bta_dm_sp_cback(
@@ -177,7 +177,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_CFM_REQ_EVT_WithoutName_RNRFail) {
              .rmt_io_caps = BTM_IO_CAP_NONE,
          },
  };
  dev_class_copy(data.cfm_req.dev_class, kDeviceClass);
  data.cfm_req.dev_class = kDeviceClass;

  ASSERT_EQ(btm_status_text(BTM_CMD_STARTED),
            btm_status_text(bluetooth::legacy::testing::bta_dm_sp_cback(
@@ -220,7 +220,7 @@ TEST_F(BtaSecTest, bta_dm_sp_cback__BTM_SP_KEY_NOTIF_EVT) {
              .passkey = kPassKey,
          },
  };
  dev_class_copy(data.key_notif.dev_class, kDeviceClass);
  data.key_notif.dev_class = kDeviceClass;
  bd_name_copy(data.key_notif.bd_name, kRemoteName);

  ASSERT_EQ(btm_status_text(BTM_CMD_STARTED),
+0 −8
Original line number Diff line number Diff line
@@ -118,13 +118,6 @@ inline constexpr DEV_CLASS kDevClassEmpty = {};
    (pd)[0] = (sv) >> 8;                                \
  }

#ifdef __cplusplus
inline void dev_class_copy(DEV_CLASS& dst, const DEV_CLASS& src) {
  dst[0] = src[0];
  dst[1] = src[1];
  dst[2] = src[2];
}

#include <sstream>
inline std::string dev_class_text(const DEV_CLASS& dev_class) {
  std::ostringstream oss;
@@ -137,7 +130,6 @@ inline std::string dev_class_text(const DEV_CLASS& dev_class) {
      << std::to_string(sv);
  return oss.str();
}
#endif  // __cplusplus

#define DEVCLASS_TO_STREAM(p, a)                \
  {                                             \