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

Commit e6c4bf28 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "HFP: Only active BT device can hung up call"

parents 5e61a630 73f743c9
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -860,12 +860,22 @@ void bta_ag_at_hfp_cback(tBTA_AG_SCB* p_scb, uint16_t cmd, uint8_t arg_type,
    case BTA_AG_AT_A_EVT:
    case BTA_AG_SPK_EVT:
    case BTA_AG_MIC_EVT:
    case BTA_AG_AT_CHUP_EVT:
    case BTA_AG_AT_CBC_EVT:
      /* send OK */
      bta_ag_send_ok(p_scb);
      break;

    case BTA_AG_AT_CHUP_EVT:
      if (!bta_ag_sco_is_active_device(p_scb->peer_addr)) {
        LOG(WARNING) << __func__ << ": AT+CHUP rejected as " << p_scb->peer_addr
                << " is not the active device";
        event = 0;
        bta_ag_send_error(p_scb, BTA_AG_ERR_OP_NOT_ALLOWED);
      } else {
        bta_ag_send_ok(p_scb);
      }
      break;

    case BTA_AG_AT_BLDN_EVT:
      /* Do not send OK, App will send error or OK depending on
      ** last dial number enabled or not */