diff options
author | Mike Lockwood <lockwood@google.com> | 2014-05-12 12:56:03 -0700 |
---|---|---|
committer | Mike Lockwood <lockwood@google.com> | 2014-05-28 13:47:25 -0700 |
commit | c8183af4b3a3515f8f0cff27b2808a7139f18230 (patch) | |
tree | be2294562f95e4ffbb79e55ba0a785244e33bfb9 /include | |
parent | accd09581eae7a7d3c746a4d9a7415c9a131d59e (diff) | |
download | system_core-c8183af4b3a3515f8f0cff27b2808a7139f18230.zip system_core-c8183af4b3a3515f8f0cff27b2808a7139f18230.tar.gz system_core-c8183af4b3a3515f8f0cff27b2808a7139f18230.tar.bz2 |
audio: Add AUDIO_DEVICE_IN_BLUETOOTH_A2DP
Change-Id: I32770abd42702d99f409f0968326041e78d1a826
Diffstat (limited to 'include')
-rw-r--r-- | include/system/audio.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/include/system/audio.h b/include/system/audio.h index 1dabc22..c34a2a5 100644 --- a/include/system/audio.h +++ b/include/system/audio.h @@ -62,7 +62,7 @@ typedef enum { /* Do not change these values without updating their counterparts * in frameworks/base/media/java/android/media/MediaRecorder.java, - * frameworks/av/services/audioflinger/AudioPolicyService.cpp, + * frameworks/av/services/audiopolicy/AudioPolicyService.cpp, * and system/media/audio_effects/include/audio_effects/audio_effects_conf.h! */ typedef enum { @@ -437,6 +437,7 @@ enum { AUDIO_DEVICE_IN_LINE = AUDIO_DEVICE_BIT_IN | 0x8000, /* S/PDIF in */ AUDIO_DEVICE_IN_SPDIF = AUDIO_DEVICE_BIT_IN | 0x10000, + AUDIO_DEVICE_IN_BLUETOOTH_A2DP = AUDIO_DEVICE_BIT_IN | 0x20000, AUDIO_DEVICE_IN_DEFAULT = AUDIO_DEVICE_BIT_IN | AUDIO_DEVICE_BIT_DEFAULT, AUDIO_DEVICE_IN_ALL = (AUDIO_DEVICE_IN_COMMUNICATION | @@ -456,6 +457,7 @@ enum { AUDIO_DEVICE_IN_TV_TUNER | AUDIO_DEVICE_IN_LINE | AUDIO_DEVICE_IN_SPDIF | + AUDIO_DEVICE_IN_BLUETOOTH_A2DP | AUDIO_DEVICE_IN_DEFAULT), AUDIO_DEVICE_IN_ALL_SCO = AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET, AUDIO_DEVICE_IN_ALL_USB = (AUDIO_DEVICE_IN_USB_ACCESSORY | @@ -780,8 +782,17 @@ static inline bool audio_is_output_devices(audio_devices_t device) return (device & AUDIO_DEVICE_BIT_IN) == 0; } +static inline bool audio_is_a2dp_in_device(audio_devices_t device) +{ + if ((device & AUDIO_DEVICE_BIT_IN) != 0) { + device &= ~AUDIO_DEVICE_BIT_IN; + if ((popcount(device) == 1) && (device & AUDIO_DEVICE_IN_BLUETOOTH_A2DP)) + return true; + } + return false; +} -static inline bool audio_is_a2dp_device(audio_devices_t device) +static inline bool audio_is_a2dp_out_device(audio_devices_t device) { if ((popcount(device) == 1) && (device & AUDIO_DEVICE_OUT_ALL_A2DP)) return true; @@ -789,6 +800,12 @@ static inline bool audio_is_a2dp_device(audio_devices_t device) return false; } +// Deprecated - use audio_is_a2dp_out_device() instead +static inline bool audio_is_a2dp_device(audio_devices_t device) +{ + return audio_is_a2dp_out_device(device); +} + static inline bool audio_is_bluetooth_sco_device(audio_devices_t device) { if ((device & AUDIO_DEVICE_BIT_IN) == 0) { |