diff options
author | Rom Lemarchand <romlem@android.com> | 2014-04-24 22:25:03 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-04-24 22:25:03 +0000 |
commit | aba03c0b7a7a94f437b786a6fa755c6c297a6a2e (patch) | |
tree | 1b6a28e777b9b0221b785515dd1677fddbeb6af8 /include | |
parent | cef3eff0d903e49ad8b02ca1eab0d7c483eb3739 (diff) | |
parent | d2674cbad9dac54ae23d1bbcdf137d75d582258f (diff) | |
download | system_core-aba03c0b7a7a94f437b786a6fa755c6c297a6a2e.zip system_core-aba03c0b7a7a94f437b786a6fa755c6c297a6a2e.tar.gz system_core-aba03c0b7a7a94f437b786a6fa755c6c297a6a2e.tar.bz2 |
am d2674cba: am 0a04c556: am 19759a08: Merge "audio: fix audio_is_bluetooth_sco_device()"
* commit 'd2674cbad9dac54ae23d1bbcdf137d75d582258f':
audio: fix audio_is_bluetooth_sco_device()
Diffstat (limited to 'include')
-rw-r--r-- | include/system/audio.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/include/system/audio.h b/include/system/audio.h index 56ab4e4..dd194ad 100644 --- a/include/system/audio.h +++ b/include/system/audio.h @@ -514,12 +514,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_out_device(audio_devices_t device) |