audiopolicy: fix rsubmix / device with dynamic address regressions
Orphan devices (aka devices not declared in configuration file) used to be
managed by apm::mAvailable<Output|Input>Devices and affinity with profile
was done by type only.
As the device affinity with profile is now enforced by checking with descriptor
rather than with type, profile's supported devices list shall be dynamically
updated.
Test: manual audio smoke tests
Change-Id: I5e8092968bbdb03ac7dc1aa1a3f15a0bc1b09251
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.h b/services/audiopolicy/managerdefault/AudioPolicyManager.h
index b214f1f..e99de16 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.h
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.h
@@ -346,7 +346,7 @@
audio_patch_handle_t *patchHandle = NULL);
// select input device corresponding to requested audio source
- sp<DeviceDescriptor> getDeviceForInputSource(audio_source_t inputSource);
+ sp<DeviceDescriptor> getDeviceForAttributes(const audio_attributes_t &attributes);
// compute the actual volume for a given stream according to the requested index and a particular
// device
@@ -517,7 +517,7 @@
if (!hasPrimaryOutput()) {
return DeviceVector();
}
- return mAvailableOutputDevices.filter(mPrimaryOutput->supportedDevices().types());
+ return mAvailableOutputDevices.filter(mPrimaryOutput->supportedDevices());
}
DeviceVector availablePrimaryModuleInputDevices() const
{
@@ -724,8 +724,8 @@
// select input device corresponding to requested audio source and return associated policy
// mix if any. Calls getDeviceForInputSource().
- sp<DeviceDescriptor> getDeviceAndMixForInputSource(audio_source_t inputSource,
- AudioMix **policyMix = NULL);
+ sp<DeviceDescriptor> getDeviceAndMixForAttributes(const audio_attributes_t &attributes,
+ AudioMix **policyMix = NULL);
// Called by setDeviceConnectionState().
status_t setDeviceConnectionStateInt(audio_devices_t deviceType,