diff options
author | Eric Laurent <elaurent@google.com> | 2015-03-26 19:00:00 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2015-03-30 10:58:50 -0700 |
commit | f5d144f7ca773750ea7be371f14f9fc975a15862 (patch) | |
tree | e43a14e4c74293289770e712fc8a81a47da9206b /services/audiopolicy/managerdefault/IOProfile.cpp | |
parent | 84b784dd4f340331d36b1be3de05a6c814d9795c (diff) | |
download | frameworks_av-f5d144f7ca773750ea7be371f14f9fc975a15862.zip frameworks_av-f5d144f7ca773750ea7be371f14f9fc975a15862.tar.gz frameworks_av-f5d144f7ca773750ea7be371f14f9fc975a15862.tar.bz2 |
audio policy: fix IOProfile::isCompatibleProfile()
Handle composite devices in IOProfile::isCompatibleProfile()
by just checking the type in this case, not the address which is relevant
only if a single device type is passed as input.
Also remove warning.
Bug: 19762960.
Change-Id: Iaecb7fcfbf7ad39b1e33cb460922f7c069a34a00
Diffstat (limited to 'services/audiopolicy/managerdefault/IOProfile.cpp')
-rw-r--r-- | services/audiopolicy/managerdefault/IOProfile.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/services/audiopolicy/managerdefault/IOProfile.cpp b/services/audiopolicy/managerdefault/IOProfile.cpp index 538ac1a..8000914 100644 --- a/services/audiopolicy/managerdefault/IOProfile.cpp +++ b/services/audiopolicy/managerdefault/IOProfile.cpp @@ -46,8 +46,16 @@ bool IOProfile::isCompatibleProfile(audio_devices_t device, const bool isRecordThread = mType == AUDIO_PORT_TYPE_MIX && mRole == AUDIO_PORT_ROLE_SINK; ALOG_ASSERT(isPlaybackThread != isRecordThread); - if (device != AUDIO_DEVICE_NONE && mSupportedDevices.getDevice(device, address) == 0) { - return false; + + if (device != AUDIO_DEVICE_NONE) { + // just check types if multiple devices are selected + if (popcount(device & ~AUDIO_DEVICE_BIT_IN) > 1) { + if ((mSupportedDevices.types() & device) != device) { + return false; + } + } else if (mSupportedDevices.getDevice(device, address) == 0) { + return false; + } } if (samplingRate == 0) { |