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

Commit fc15bc80 authored by Chris Manton's avatar Chris Manton
Browse files

Use proper type tHCI_REASON btm_get_acl_disc_reason_code

Toward readable code

Bug: 163134718
Test: gd/cert/run
Tag: #refactor
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: I7b2adfaa55feb96c620adfa5a6cb997055f1ce10
parent 71208d13
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -211,9 +211,9 @@ uint16_t acl_get_supported_packet_types() {
  mock_function_count_map[__func__]++;
  return 0;
}
uint16_t btm_get_acl_disc_reason_code(void) {
tHCI_REASON btm_get_acl_disc_reason_code(void) {
  mock_function_count_map[__func__]++;
  return 0;
  return HCI_SUCCESS;
}
uint8_t BTM_SetTraceLevel(uint8_t new_level) {
  mock_function_count_map[__func__]++;
+7 −2
Original line number Diff line number Diff line
@@ -1542,11 +1542,16 @@ static void btif_dm_upstreams_evt(uint16_t event, char* p_param) {
      btm_set_bond_type_dev(p_data->link_down.bd_addr,
                            tBTM_SEC_DEV_REC::BOND_TYPE_UNKNOWN);
      btif_av_acl_disconnected(bd_addr);
      BTIF_TRACE_DEBUG(
          "BTA_DM_LINK_DOWN_EVT. Sending BT_ACL_STATE_DISCONNECTED");
      invoke_acl_state_changed_cb(BT_STATUS_SUCCESS, bd_addr,
                                  BT_ACL_STATE_DISCONNECTED,
                                  static_cast<bt_hci_error_code_t>(btm_get_acl_disc_reason_code()));
      LOG_DEBUG(
          "Sent BT_ACL_STATE_DISCONNECTED upward as ACL link down event "
          "device:%s reason:%s",
          PRIVATE_ADDRESS(bd_addr),
          hci_reason_code_text(
              static_cast<tHCI_REASON>(btm_get_acl_disc_reason_code()))
              .c_str());
      break;

    case BTA_DM_BLE_KEY_EVT:
+0 −1
Original line number Diff line number Diff line
@@ -275,7 +275,6 @@ class AclConnectionTracker : public ConnectionManagementCallbacks {

  void on_read_remote_supported_features_status(CommandStatusView view) {
    ASSERT_LOG(view.IsValid(), "Bad status packet!");
    LOG_INFO("UNIMPLEMENTED called: %s", hci::ErrorCodeText(view.GetStatus()).c_str());
  }

  void on_read_remote_extended_features_status(CommandStatusView view) {
+2 −2
Original line number Diff line number Diff line
@@ -210,9 +210,9 @@ uint16_t acl_get_supported_packet_types() {
  mock_function_count_map[__func__]++;
  return 0;
}
uint16_t btm_get_acl_disc_reason_code(void) {
tHCI_REASON btm_get_acl_disc_reason_code(void) {
  mock_function_count_map[__func__]++;
  return 0;
  return HCI_SUCCESS;
}
uint8_t BTM_SetTraceLevel(uint8_t new_level) {
  mock_function_count_map[__func__]++;
+1 −1
Original line number Diff line number Diff line
@@ -1206,7 +1206,7 @@ uint16_t BTM_GetNumAclLinks(void) {
 * Returns          true if connection is up, else false.
 *
 ******************************************************************************/
uint16_t btm_get_acl_disc_reason_code(void) {
tHCI_REASON btm_get_acl_disc_reason_code(void) {
  return btm_cb.acl_cb_.get_disconnect_reason();
}

Loading