TWSP-A2DP: check connection state before set active device to other earbud
Active A2DP device is not set to NULL after both earbuds disconnected in a short
interval.
1) A2dp connection of Both EB1 and EB2 change to disconnected state in A2dpService
2) ActiveDeviceManager receive EB1 A2DP_ACTION_CONNECTION_STATE_CHANGED to disconnected
state intent, then it attempt to setA2dpActiveDevice to EB2, but current a2dp state
in A2dpService is disconnected, so setActiveDevice to EB2 failed and mA2dpActiveDevice
in ActiveDeviceManager is still EB1.
3) ActiveDeviceManager receive EB2 A2DP_ACTION_CONNECTION_STATE_CHANGED to disconnected
state intent, because current mA2dpActiveDevice is EB1, so EB2 A2dp disconnected will
not trigger setActiveDevice to NULL.
Change-Id: I8661296ac90979dc5304425fe022fe2246f76f08
CRs-Fixed: 2353899
1 file changed