SCO: Don't set active device if a diconnect message is defered
- Fix a pin-pon scenario in HeadsetService.
- If a headset B is set as active deivce while headset A is connecting SCO,
HeadsetService request headset A's state machine to do disconnect SCO.
- However, when state machine is at AudioConnecting state, DISCONNECT_AUDIO
would be pending in defered meesage queue and will be handled in next state.
- Once headset A entered AndioOn state, it set it self to as active device again
then start handling DISCONNECT_AUDIO.
- After headset A finally disconnect SCO, HeadsetService won't reconnect
it and rout to headset B since active device is still headset A.
- Active deivce would be like A->B->A, and no device SCO stay connected.
Bug: 110642515
Test: Manual test, make a call and switch path A->speaker->B on phone UI
Change-Id: I7dde255c2ba9f04aec86b7fdd30e7bfadfdd5068
(cherry picked from commit aebfbb7e35ca4cafaa9167d74a37fdb9bc8f62bc)
1 file changed