hal: optimize switch from combo to solo device
For playback usecases routing change, audio HAL disables sound device
if existing sound device does not match derived sound device and
enables the derived sound device. It does not check whether existing
sound device is a combination multiple devices and if one of those
devices matches with the derived sound device.
With scenarios like ringtone over speaker-and-bt-a2dp followed by
a2dp playback, we disable and re-enable bt-a2dp. This is unneeded
if a2dp backend is already active. Optimze such scenarios by
disabling only devices that do not match the derived sound device.
This change squashes the followings.
I171fbead85746a2a34632f7580f56ef40505665c
(hal: Prevent superfluous device tear down on routing change)
Id1bd00bfa5f0236400529e5771851749421ac84c
(hal: Fix combo device issue with routing change)
I4afb4a573de68f17d0ff9af63403713065bfec12
(hal: align ref_cnt of combo device and its split devices)
Change-Id: I359b8a98c76206acd9085431c393825aa6dd0425
3 files changed