Introduce notion of active devices.
The list of active devices is populated by the Engine.
The active devices are selected with the following rules:
1) If all of the preferred devices for media are available then they
will all be used for the output.
2) If not, then the last connected removable device will be used.
3) If there are no removable devices then the default audio policy rule
will be used.
In this CL, we only add a function to query active devices. In a future
CL we will use this list when opening an output.
Test: dumpsys
Bug: 160352965
Change-Id: I12f9ed24e1404264ad7055f3a7c73b444b33ee1a
diff --git a/services/audiopolicy/engine/interface/EngineInterface.h b/services/audiopolicy/engine/interface/EngineInterface.h
index f64608d..a9b536b 100644
--- a/services/audiopolicy/engine/interface/EngineInterface.h
+++ b/services/audiopolicy/engine/interface/EngineInterface.h
@@ -403,6 +403,12 @@
virtual status_t getDevicesForRoleAndCapturePreset(audio_source_t audioSource,
device_role_t role, AudioDeviceTypeAddrVector &devices) const = 0;
+ /**
+ * @brief getActiveMediaDevices returns which devices will most likely to be used for media
+ * @param availableDevices all available devices
+ * @return collection of active devices
+ */
+ virtual DeviceVector getActiveMediaDevices(const DeviceVector& availableDevices) const = 0;
virtual void dump(String8 *dst) const = 0;