AudioService: manage single audio device type in APM
The AudioPolicyManager currently only handles one device per
audio device type. Thus sending a disconnection event for an
unused second A2DP device to the APM when one was already
connected, would cause A2DP to be unavailable completely for
audio routing. This happened in the case of fast connection /
disconnection of different A2DP devices.
The fix consists in keeping track in AudioDeviceInventory
of which audio device is seen by the APM, and only connect
one at a time, and never disconnect an unused device.
Also remove mention of "BT dock" since identification of
BT devices as docks is obsolete.
Bug: 145627818
Test: atest AudioDeviceBrokerTest
Change-Id: I18d5094bb388d4b0f614b611cbc086019742f229
3 files changed