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

Commit 44101c45 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4807121 from 563b011b to pi-release

Change-Id: Ie780ac62eeebe47c7bdc4a1b0d905547e14a773f
parents bcd71721 563b011b
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -296,10 +296,11 @@ void bta_ag_disc_fail(tBTA_AG_SCB* p_scb,
  /* reinitialize stuff */

  /* clear the remote BD address */
  RawAddress peer_addr = p_scb->peer_addr;
  p_scb->peer_addr = RawAddress::kEmpty;

  /* call open cback w. failure */
  bta_ag_cback_open(p_scb, RawAddress::kEmpty, BTA_AG_FAIL_SDP);
  bta_ag_cback_open(p_scb, peer_addr, BTA_AG_FAIL_SDP);
}

/*******************************************************************************
@@ -534,14 +535,17 @@ void bta_ag_rfc_acp_open(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) {
  for (tBTA_AG_SCB& ag_scb : bta_ag_cb.scb) {
    // Cancel any pending collision timers
    if (ag_scb.in_use && alarm_is_scheduled(ag_scb.collision_timer)) {
      VLOG(1) << __func__ << ": cancel collision alarm for "
              << ag_scb.peer_addr;
      alarm_cancel(ag_scb.collision_timer);
      if (dev_addr != ag_scb.peer_addr && p_scb != &ag_scb) {
        // Resume outgoing connection if incoming is not on the same device
        bta_ag_resume_open(&ag_scb);
      }
      break;
    }
    if (dev_addr == ag_scb.peer_addr && p_scb != &ag_scb) {
      VLOG(1) << __func__ << ": fail outgoing connection before accepting "
              << ag_scb.peer_addr;
      // 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
@@ -555,6 +559,10 @@ void bta_ag_rfc_acp_open(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) {
        }
      }
    }
    VLOG(1) << __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);
  }

  p_scb->peer_addr = dev_addr;
@@ -607,11 +615,13 @@ void bta_ag_rfc_data(tBTA_AG_SCB* p_scb, UNUSED_ATTR const tBTA_AG_DATA& data) {
    /* read data from rfcomm; if bad status, we're done */
    if (PORT_ReadData(p_scb->conn_handle, buf, BTA_AG_RFC_READ_MAX, &len) !=
        PORT_SUCCESS) {
      LOG(ERROR) << __func__ << ": failed to read data " << p_scb->peer_addr;
      break;
    }

    /* if no data, we're done */
    if (len == 0) {
      LOG(WARNING) << __func__ << ": no data for " << p_scb->peer_addr;
      break;
    }

@@ -794,6 +804,7 @@ void bta_ag_svc_conn_open(tBTA_AG_SCB* p_scb,
void bta_ag_setcodec(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& data) {
  tBTA_AG_PEER_CODEC codec_type = data.api_setcodec.codec;
  tBTA_AG_VAL val = {};
  val.hdr.handle = bta_ag_scb_to_idx(p_scb);

  /* Check if the requested codec type is valid */
  if ((codec_type != BTA_AG_CODEC_NONE) && (codec_type != BTA_AG_CODEC_CVSD) &&
+6 −1
Original line number Diff line number Diff line
@@ -79,11 +79,16 @@ static void bta_ag_port_cback(UNUSED_ATTR uint32_t code, uint16_t port_handle,
  if (p_scb != nullptr) {
    /* ignore port events for port handles other than connected handle */
    if (port_handle != p_scb->conn_handle) {
      APPL_TRACE_DEBUG(
      APPL_TRACE_ERROR(
          "ag_port_cback ignoring handle:%d conn_handle = %d other handle = %d",
          port_handle, p_scb->conn_handle, handle);
      return;
    }
    if (!bta_ag_scb_open(p_scb)) {
      LOG(ERROR) << __func__ << ": rfcomm data on an unopened control block "
                 << handle << " peer_addr " << p_scb->peer_addr << " state "
                 << std::to_string(p_scb->state);
    }
    do_in_bta_thread(FROM_HERE,
                     base::Bind(&bta_ag_sm_execute_by_handle, handle,
                                BTA_AG_RFC_DATA_EVT, tBTA_AG_DATA::kEmpty));
+1 −0
Original line number Diff line number Diff line
@@ -898,6 +898,7 @@ void bta_av_cleanup(tBTA_AV_SCB* p_scb, UNUSED_ATTR tBTA_AV_DATA* p_data) {
  /* if de-registering shut everything down */
  msg.hdr.layer_specific = p_scb->hndl;
  p_scb->started = false;
  p_scb->offload_started = false;
  p_scb->use_rtp_header_marker_bit = false;
  p_scb->cong = false;
  p_scb->role = role;
+0 −5
Original line number Diff line number Diff line
@@ -82,11 +82,6 @@ bool btif_a2dp_on_started(const RawAddress& peer_addr,
          }
          ack = true;
        }
      } else {
        // We were started remotely
        if (btif_av_is_a2dp_offload_enabled()) {
          btif_av_stream_start_offload();
        }
      }

      /* media task is autostarted upon a2dp audiopath connection */
+6 −5
Original line number Diff line number Diff line
@@ -214,7 +214,7 @@ void btif_a2dp_audio_interface_start_session() {

void btif_a2dp_audio_interface_end_session() {
  LOG_INFO(LOG_TAG, "%s", __func__);
  CHECK(btAudio != nullptr);
  if (btAudio == nullptr) return;
  auto ret = btAudio->endSession();
  if (!ret.isOk()) {
    LOG_ERROR(LOG_TAG, "HAL server is dead");
@@ -260,6 +260,7 @@ void btif_a2dp_audio_send_start_req() {
  }
}
void btif_a2dp_audio_send_suspend_req() {
  LOG_INFO(LOG_TAG, "%s", __func__);
  uint8_t resp;
  resp = btif_a2dp_audio_process_request(A2DP_CTRL_CMD_SUSPEND);
  if (btAudio != nullptr) {
@@ -278,7 +279,7 @@ void btif_a2dp_audio_send_suspend_req() {
}*/

uint8_t btif_a2dp_audio_process_request(uint8_t cmd) {
  APPL_TRACE_DEBUG("%s: cmd: %s", __func__,
  LOG_INFO(LOG_TAG, "%s: cmd: %s", __func__,
           audio_a2dp_hw_dump_ctrl_event((tA2DP_CTRL_CMD)cmd));
  a2dp_cmd_pending = cmd;
  uint8_t status;
@@ -362,7 +363,7 @@ uint8_t btif_a2dp_audio_process_request(uint8_t cmd) {
      status = A2DP_CTRL_ACK_FAILURE;
      break;
  }
  APPL_TRACE_DEBUG("a2dp-ctrl-cmd : %s DONE returning status %d",
  LOG_INFO(LOG_TAG, "a2dp-ctrl-cmd : %s DONE returning status %d",
           audio_a2dp_hw_dump_ctrl_event((tA2DP_CTRL_CMD)cmd), status);
  return status;
}
Loading