audiopolicy: fix dynamic device & explicit routing management
While a playback is ongoing using explicit routing
and the device is disconnected, setOutputDevices() will bail out
if the new device is incompatible with the io profile. So the device
will not be reset in the output.
Moreover, if another device of the same type/address is connected,
this device will have a new unique ID.
If a track wants to use it as explicit, as the first playback/capture is still
on going, the function findPreferredDevice will return the previous device id.
This CL enforces:
-setOutputDevices() to check if new device is not compatible AND previous devices
are still available
- When a device is disconnected, go over all clients to clear any preferred device
referring to the device being removed.
- Sanitize preferred device received by get<Output|Input>ForAttr() according to
connected devices.
Test: AudioPolicyTests --gtest_filter=DynamicAddressOutputDevice/DeviceConnectionTest.DeviceConnectionState/*
Test: audio smoke tests
Test: CTS tests for AudioTrack, AudioRecord, AudioRouting
Change-Id: Ib3a2d54d902def0fcfc2a623c25bb92d65b1ab98
Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
Loading
Please register or sign in to comment