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

Commit 89556f65 authored by Cheney Ni's avatar Cheney Ni Committed by Automerger Merge Worker
Browse files

Merge "AVDTP: static IOP database for AVDTP SUSPEND" am: 32653a19

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1560333

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Iecaddaa510cf2ed558c2024fd4cf89ee15c5051b
parents 5ffebc2d 32653a19
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -1148,6 +1148,7 @@ void bta_av_setconfig_rsp(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
 ******************************************************************************/
void bta_av_str_opened(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
  tBTA_AV_CONN_CHG msg;
  char remote_name[BTM_MAX_REM_BD_NAME_LEN] = "";
  uint8_t* p;

  APPL_TRACE_DEBUG("%s: peer %s bta_handle: 0x%x", __func__,
@@ -1161,6 +1162,15 @@ void bta_av_str_opened(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
  /* set the congestion flag, so AV would not send media packets by accident */
  p_scb->cong = true;
  p_scb->offload_start_pending = false;
  // Don't use AVDTP SUSPEND for restrict listed devices
  btif_storage_get_stored_remote_name(p_scb->PeerAddress(), remote_name);
  if (interop_match_name(INTEROP_DISABLE_AVDTP_SUSPEND, remote_name) ||
      interop_match_addr(INTEROP_DISABLE_AVDTP_SUSPEND,
                         &p_scb->PeerAddress())) {
    LOG_INFO("%s: disable AVDTP SUSPEND: interop matched name %s address %s",
             __func__, remote_name, p_scb->PeerAddress().ToString().c_str());
    p_scb->suspend_sup = false;
  }

  p_scb->stream_mtu =
      p_data->str_msg.msg.open_ind.peer_mtu - AVDT_MEDIA_HDR_SIZE;
@@ -2468,10 +2478,6 @@ void bta_av_suspend_cfm(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {

  suspend_rsp.status = BTA_AV_SUCCESS;
  if (err_code && (err_code != AVDT_ERR_BAD_STATE)) {
    /* Disable suspend feature only with explicit rejection(not with timeout) */
    if (err_code != AVDT_ERR_TIMEOUT) {
      p_scb->suspend_sup = false;
    }
    suspend_rsp.status = BTA_AV_FAIL;

    APPL_TRACE_ERROR("%s: suspend failed, closing connection", __func__);
@@ -2685,11 +2691,6 @@ void bta_av_suspend_cont(tBTA_AV_SCB* p_scb, tBTA_AV_DATA* p_data) {
      bta_av_ssm_execute(p_scb, BTA_AV_STR_DISC_FAIL_EVT, NULL);
    } else {
      APPL_TRACE_ERROR("%s: suspend rejected, try close", __func__);
      /* Disable suspend feature only with explicit rejection(not with timeout)
       */
      if (err_code != AVDT_ERR_TIMEOUT) {
        p_scb->suspend_sup = false;
      }
      /* drop the buffers queued in L2CAP */
      L2CA_FlushChannel(p_scb->l2c_cid, L2CAP_FLUSH_CHANS_ALL);

+5 −1
Original line number Diff line number Diff line
@@ -107,7 +107,11 @@ typedef enum {
  // Disable sniff mode for headsets/car-kits
  // Some car kits supports sniff mode but when DUT initiates sniff req
  // Remote will go to bad state and its leads to LMP time out.
  INTEROP_DISABLE_SNIFF
  INTEROP_DISABLE_SNIFF,

  // Do not send AVDTP SUSPEND while the playback is paused.
  // Some older A2DP Sink devices might not support to pause the streaming.
  INTEROP_DISABLE_AVDTP_SUSPEND
} interop_feature_t;

// Check if a given |addr| matches a known interoperability workaround as
+1 −0
Original line number Diff line number Diff line
@@ -133,6 +133,7 @@ static const char* interop_feature_string_(const interop_feature_t feature) {
    CASE_RETURN_STR(INTEROP_DISABLE_NAME_REQUEST)
    CASE_RETURN_STR(INTEROP_AVRCP_1_4_ONLY)
    CASE_RETURN_STR(INTEROP_DISABLE_SNIFF)
    CASE_RETURN_STR(INTEROP_DISABLE_AVDTP_SUSPEND)
  }

  return "UNKNOWN";