A2DP Revert "Move A2dp State to Disconnected when BT is Turned OFF"
Original change ID: I17bc620551bf735f39327eff59102c14551bcf26
There is a race condition in A2DP state machine where state transition
to Connected state may not complete before doQuit() is called. In this
case, state machine has sent state transition going from CONNECTING to
CONNECTED, whereas doQuit() will see the state as CONNECTING and will
send a state transition intent going from CONNECTING TO DISCONNECTED,
causing a disruption in the state transition.
* This CL reverts and older commit that created this behaviour as no
other profiles send this intent during doQuit. Currently, when
Bluetooth is turned off, the turning OFF intent should supersede all
other profile state change intent until further changes are made to
all profiles.
* That is, if BluetoothAdapter.ACTION_STATE_CHANGED intent's EXTRA_STATE
extra is STATE_OFF, all existing profile states are invalidated and
defaulted to DISCONNECTED
* This is the behaviour for all profiles at this moment until plans are
made to change it
Bug: 67419965
Test: Pair and repeatly toggle Bluetooth
Change-Id: I81b28067af031818c8668c9bd6fd1d807ad7fb8f
1 file changed