audio: Fix false positives in audio_is_remote_submix_device()

The audio_is_remote_submix_device() helper function incorrectly
reported AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES and
AUDIO_DEVICE_IN_LINE as a submix devices.

The cases where the confusion occurs are for devices whose bitwise
value only differs in the direction bit.

Change-Id: I3bb9fd1158a26a8f4b3b59246974e703ca5ba0f0
Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com>
This commit is contained in:
Misael Lopez Cruz 2015-04-29 12:02:08 -05:00
parent 89114c5000
commit bee4965cb2
1 changed files with 4 additions and 2 deletions

View File

@ -1102,8 +1102,10 @@ static inline bool audio_is_usb_device(audio_devices_t device)
static inline bool audio_is_remote_submix_device(audio_devices_t device)
{
if ((device & AUDIO_DEVICE_OUT_REMOTE_SUBMIX) == AUDIO_DEVICE_OUT_REMOTE_SUBMIX
|| (device & AUDIO_DEVICE_IN_REMOTE_SUBMIX) == AUDIO_DEVICE_IN_REMOTE_SUBMIX)
if ((audio_is_output_devices(device) &&
(device & AUDIO_DEVICE_OUT_REMOTE_SUBMIX) == AUDIO_DEVICE_OUT_REMOTE_SUBMIX)
|| (!audio_is_output_devices(device) &&
(device & AUDIO_DEVICE_IN_REMOTE_SUBMIX) == AUDIO_DEVICE_IN_REMOTE_SUBMIX))
return true;
else
return false;