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

Commit 0ee965b8 authored by Yuyang Huang's avatar Yuyang Huang
Browse files

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

This reverts commit 5057c3ce9ba31003628a6dd43ce9a5664ad6e266.

Reason for revert: In current logic, when the phone receives an incoming call, user can accept the call on any device. So in a similar way, it is better to allow user to terminate call on any device.

Bug: 290856532
Test: atest BluetoothInCallServiceTest
Change-Id: I179eebf406e6dd6d4cbcc820a0011a9964098be5
parent 65c3d5b9
Loading
Loading
Loading
Loading
+1 −12
Original line number Diff line number Diff line
@@ -899,22 +899,11 @@ 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 = BTA_AG_ENABLE_EVT;
        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 */