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

Commit bdcec97c authored by Himanshu Rawat's avatar Himanshu Rawat Committed by Gerrit Code Review
Browse files

Merge "Dead code removed from btif_hh.cc" into main

parents bd49ea5e 4f348de3
Loading
Loading
Loading
Loading
+4 −22
Original line number Diff line number Diff line
@@ -1581,17 +1581,10 @@ static bt_status_t connect(RawAddress* bd_addr, tBLE_ADDR_TYPE addr_type,
  }

  btif_hh_device_t* p_dev = btif_hh_find_connected_dev_by_link_spec(link_spec);
  if (p_dev) {
    if (p_dev->dev_status == BTHH_CONN_STATE_CONNECTED ||
        p_dev->dev_status == BTHH_CONN_STATE_CONNECTING) {
  if (p_dev != nullptr) {
    log::warn("device {} already connected",
              p_dev->link_spec.ToRedactedStringForLogging());
    return BT_STATUS_DONE;
    } else if (p_dev->dev_status == BTHH_CONN_STATE_DISCONNECTING) {
      log::warn("device {} is busy with disconnecting",
                p_dev->link_spec.ToRedactedStringForLogging());
      return BT_STATUS_BUSY;
    }
  }

  if (link_spec.transport == BT_TRANSPORT_AUTO) {
@@ -1658,17 +1651,6 @@ static bt_status_t disconnect(RawAddress* bd_addr, tBLE_ADDR_TYPE addr_type,
    return BT_STATUS_UNHANDLED;
  }

  if (p_dev->dev_status == BTHH_CONN_STATE_DISCONNECTED ||
      p_dev->dev_status == BTHH_CONN_STATE_DISCONNECTING) {
    log::error("device {} already disconnected.",
               p_dev->link_spec.ToRedactedStringForLogging());
    return BT_STATUS_DONE;
  } else if (p_dev->dev_status == BTHH_CONN_STATE_CONNECTING) {
    log::error("device {} is busy with disconnecting.",
               p_dev->link_spec.ToRedactedStringForLogging());
    return BT_STATUS_BUSY;
  }

  return btif_transfer_context(btif_hh_handle_evt, BTIF_HH_DISCONNECT_REQ_EVT,
                               (char*)&p_dev->link_spec, sizeof(tAclLinkSpec),
                               NULL);