audio policy: refactor preferred route implementation
Remove SessionRoute class and replace by use of
preferredDevice and active state in ClientDescriptor
Also fix the behavior for other clients using same strategy as
client with preferred route: the preferred route is only used if
no other clients using the same strategy are active without a preferred
route.
If all clients have a preferred route, the route of the last active
client is used.
Also fixed getOutputForAttr() to return correct selected device ID when
dynamic policies are used.
Test: CTS RoutingTest, AudioPlayRoutingNative, AudioRecordRoutingNative
Test: Manual: AudioExplicitRouting, UplinkMusicSampleApp
Change-Id: Id342c2241ace3e1a359ea74f4a539a395f793b86
13 files changed