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

Commit 5706c1e4 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

Add a workaround for A2DP devices that request Role Change

Certain A2DP devices request Role Change after connection,
and typically the Phone grants it - as a result the Phone is the Slave.

However, with Multi-A2DP, follow-up A2DP connections require that the
Phone becomes the Master: within the existing stack we have function
bta_av_switch_if_needed() that checks whether the Phone needs to request
Role Change and become again the Master.
Some A2DP devices will refuse the Phone to become the Master again, and
this prevents/blocks the Phone from having multiple A2DP connections
that are open.

Test: Manual
Bug: 72122792
Bug: 70350399
Change-Id: I749c73a38e3fb10262143ba6b41a7d65309ddf49
parent d9b0b593
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -952,6 +952,10 @@ static void bta_av_sco_chg_cback(tBTA_SYS_CONN_STATUS status, uint8_t id,
 *
 ******************************************************************************/
bool bta_av_switch_if_needed(tBTA_AV_SCB* p_scb) {
  // TODO: A workaround for devices that are connected first, become
  // Master, and block follow-up role changes - b/72122792 .
  return false;
#if 0
  uint8_t role;
  bool needed = false;
  tBTA_AV_SCB* p_scbi;
@@ -987,6 +991,7 @@ bool bta_av_switch_if_needed(tBTA_AV_SCB* p_scb) {
    }
  }
  return needed;
#endif
}

/*******************************************************************************