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

Commit 1ee89335 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Revert "Fix AVDT_open before Delay_report according to AVDTP v1.3"" am: c2272e18

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1893501

Change-Id: I0a2e31757f662456d8bb7da862761c10b16df26a
parents e1dba4f7 c2272e18
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -418,7 +418,6 @@ class AvdtpScb {
        media_seq(0),
        allocated(false),
        in_use(false),
        need_open(false),
        role(0),
        remove(false),
        state(0),
@@ -468,7 +467,6 @@ class AvdtpScb {
    media_seq = 0;
    allocated = false;
    in_use = false;
    need_open = false;
    role = 0;
    remove = false;
    state = 0;
@@ -493,7 +491,6 @@ class AvdtpScb {
  uint16_t media_seq;                // Media packet sequence number
  bool allocated;                    // True if the SCB is allocated
  bool in_use;                       // True if used by peer
  bool need_open;      // True if need open after receiving delay report (AVDT 1_3)
  uint8_t role;        // Initiator/acceptor role in current procedure
  bool remove;         // True if the SCB is marked for removal
  uint8_t state;       // State machine state
+8 −26
Original line number Diff line number Diff line
@@ -686,6 +686,7 @@ void avdt_scb_snd_snk_delay_rpt_req(AvdtpScb* p_scb,
 *
 ******************************************************************************/
void avdt_scb_hdl_setconfig_rsp(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
  tAVDT_EVT_HDR single;

  if (p_scb->p_ccb != NULL) {
    /* save configuration */
@@ -695,21 +696,13 @@ void avdt_scb_hdl_setconfig_rsp(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
    // Delay reporting is sent before open request (i.e., in configured state).
    avdt_scb_snd_snk_delay_rpt_req(p_scb, p_data);

    p_scb->need_open = false;
    /* Check if both local and SEP support AVDT version 1.3*/
    if (A2DP_GetAvdtpVersion() >= AVDT_VERSION_1_3 &&
      (p_scb->stream_config.cfg.psc_mask & AVDT_PSC_DELAY_RPT)) {
       p_scb->need_open = true;
    } else {
      /* Initiate open */
      tAVDT_EVT_HDR single;
    /* initiate open */
    single.seid = p_scb->peer_seid;
    tAVDT_SCB_EVT avdt_scb_evt;
    avdt_scb_evt.msg.single = single;
    avdt_scb_event(p_scb, AVDT_SCB_API_OPEN_REQ_EVT, &avdt_scb_evt);
  }
}
}

/*******************************************************************************
 *
@@ -870,20 +863,9 @@ void avdt_scb_hdl_delay_rpt_cmd(AvdtpScb* p_scb, tAVDT_SCB_EVT* p_data) {
      p_scb->p_ccb ? p_scb->p_ccb->peer_addr : RawAddress::kEmpty,
      AVDT_DELAY_REPORT_EVT, (tAVDT_CTRL*)&p_data->msg.hdr,
      p_scb->stream_config.scb_index);
  if (p_scb->p_ccb) {

  if (p_scb->p_ccb)
    avdt_msg_send_rsp(p_scb->p_ccb, AVDT_SIG_DELAY_RPT, &p_data->msg);
    /* Check if we need open stream after set_config */
    if (p_scb->need_open) {
      /* Initiate open */
      tAVDT_EVT_HDR single;
      single.seid = p_scb->peer_seid;
      tAVDT_SCB_EVT avdt_scb_evt;
      avdt_scb_evt.msg.single = single;
      avdt_scb_event(p_scb, AVDT_SCB_API_OPEN_REQ_EVT, &avdt_scb_evt);
      /* Clear flag */
      p_scb->need_open = false;
    }
  }
  else
    avdt_scb_rej_not_in_use(p_scb, p_data);
}