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
diff --git a/services/audiopolicy/common/include/RoutingStrategy.h b/services/audiopolicy/common/include/RoutingStrategy.h
index d38967e..f8a1cd6 100644
--- a/services/audiopolicy/common/include/RoutingStrategy.h
+++ b/services/audiopolicy/common/include/RoutingStrategy.h
@@ -23,6 +23,7 @@
 #define SONIFICATION_RESPECTFUL_AFTER_MUSIC_DELAY 5000
 
 enum routing_strategy {
+    STRATEGY_NONE = -1,
     STRATEGY_MEDIA,
     STRATEGY_PHONE,
     STRATEGY_SONIFICATION,