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

Commit 28bb19ef authored by Bhushan Shinkar's avatar Bhushan Shinkar Committed by Gerrit Code Review
Browse files

Merge "HFP: Closing Rfcomm connection instead of resetting the connection" into main

parents cb5d6167 eaccceb8
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -575,10 +575,13 @@ void bta_ag_rfc_acp_open(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) {
      }
    }
    if (dev_addr == ag_scb.peer_addr && p_scb != &ag_scb) {
      VLOG(1) << __func__ << ": fail outgoing connection before accepting "
              << ag_scb.peer_addr;
      LOG(INFO) << __func__ << ": close outgoing connection before accepting "
                << ag_scb.peer_addr << " with conn_handle="
                << ag_scb.conn_handle;
      if (!IS_FLAG_ENABLED(close_rfcomm_instead_of_reset)) {
        // Fail the outgoing connection to clean up any upper layer states
        bta_ag_rfc_fail(&ag_scb, tBTA_AG_DATA::kEmpty);
      }
      // If client port is opened, close it
      if (ag_scb.conn_handle > 0) {
        status = RFCOMM_RemoveConnection(ag_scb.conn_handle);
@@ -590,7 +593,7 @@ void bta_ag_rfc_acp_open(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) {
        }
      }
    }
    VLOG(1) << __func__ << ": dev_addr=" << dev_addr
    LOG(INFO) << __func__ << ": dev_addr=" << dev_addr
              << ", peer_addr=" << ag_scb.peer_addr
              << ", in_use=" << ag_scb.in_use
              << ", index=" << bta_ag_scb_to_idx(p_scb);