Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit ba2cf0f2 authored by Francois Gaffie's avatar Francois Gaffie Committed by Eric Laurent
Browse files

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: default avatarFrancois Gaffie <francois.gaffie@renault.com>
parent ffb2516c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment