am 0a04c556: am 19759a08: Merge "audio: fix audio_is_bluetooth_sco_device()"

* commit '0a04c556947e4fb8e12cd73b9aded27318002336':
  audio: fix audio_is_bluetooth_sco_device()
This commit is contained in:
Rom Lemarchand 2014-04-24 22:21:39 +00:00 committed by Android Git Automerger
commit d2674cbad9
1 changed files with 10 additions and 6 deletions

View File

@ -471,12 +471,16 @@ static inline bool audio_is_a2dp_device(audio_devices_t device)
static inline bool audio_is_bluetooth_sco_device(audio_devices_t device)
{
device &= ~AUDIO_DEVICE_BIT_IN;
if ((popcount(device) == 1) && (device & (AUDIO_DEVICE_OUT_ALL_SCO |
AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET)))
return true;
else
return false;
if ((device & AUDIO_DEVICE_BIT_IN) == 0) {
if ((popcount(device) == 1) && ((device & ~AUDIO_DEVICE_OUT_ALL_SCO) == 0))
return true;
} else {
device &= ~AUDIO_DEVICE_BIT_IN;
if ((popcount(device) == 1) && ((device & ~AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET) == 0))
return true;
}
return false;
}
static inline bool audio_is_usb_device(audio_devices_t device)