Reset the Active device to null if a wired headset is connected
If a Bluetooth headset is connected, it will become the Active device
for A2DP/HFP, and will be used for audio output. Then, if a wired
headset is connected, audio is automatically rerouted to the wired headset
by the Audio Framework. However, from Bluetooth perspective, the Active
device hasn't changed, therefore attempts to (re)set the Active device
to the Bluetooth headset will not be successful (the processing
will be no-op).
The solution is to keep track in the ActiveDeviceManager whether
a wired headset is connected - if yes, then explicitly reset the
Active device to null.
Bug: 78212654
Test: Manual - (1) connect a wired headset and Bluetooth headsets.
(2) Switch the Active device to a Bluetooth headset.
Unit tests added
Change-Id: I1cecd9a096ff5e5bc39583e21f6c8053610d2ee0
Merged-In: I1cecd9a096ff5e5bc39583e21f6c8053610d2ee0
(cherry picked from commit 3669a243e7aaebef705ef6e0c188e7f7b7a4461a)
3 files changed