diff options
author | Rom Lemarchand <romlem@android.com> | 2014-04-24 22:14:12 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-04-24 22:14:13 +0000 |
commit | 19759a08053e18bc8efc4aa73f9a0cb8a88608fb (patch) | |
tree | 09ff471eeb6c10bbbbaa6360fbf76388078f45ff | |
parent | 6798914b6fc93d6a9964129b734ec7d7be88d99b (diff) | |
parent | b526630ab843f9a405be23618d5808d8e65755f3 (diff) | |
download | system_core-19759a08053e18bc8efc4aa73f9a0cb8a88608fb.zip system_core-19759a08053e18bc8efc4aa73f9a0cb8a88608fb.tar.gz system_core-19759a08053e18bc8efc4aa73f9a0cb8a88608fb.tar.bz2 |
Merge "audio: fix audio_is_bluetooth_sco_device()"
-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 aa7ac02..f36befb 100644 --- a/include/system/audio.h +++ b/include/system/audio.h @@ -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) |