summaryrefslogtreecommitdiffstats
path: root/include/hardware_legacy/AudioSystemLegacy.h
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-08-28 14:32:21 -0700
committerEric Laurent <elaurent@google.com>2012-09-07 10:34:46 -0700
commited8f62d4faa53bbd53a358c5f494b653a09285e4 (patch)
treefab09d08af6dc4a54b2e8732491bc12d4796582f /include/hardware_legacy/AudioSystemLegacy.h
parent48387b28c87327c6c4d512eabe091c29236d2e70 (diff)
downloadhardware_libhardware_legacy-ed8f62d4faa53bbd53a358c5f494b653a09285e4.zip
hardware_libhardware_legacy-ed8f62d4faa53bbd53a358c5f494b653a09285e4.tar.gz
hardware_libhardware_legacy-ed8f62d4faa53bbd53a358c5f494b653a09285e4.tar.bz2
audio: new audio devices enums
Changes for new audio devices enums: - legacy audio HAL wrapper provides conversion between new and old device enums. It exposes a rev 2.0 audio device API to the audio framework and allow legacy implementation to use old device enums. - AudioPolicyManager: use standard enum value for no device (0). Change-Id: I855d72291d672cdd8a6641bedb228634a54b7d9d
Diffstat (limited to 'include/hardware_legacy/AudioSystemLegacy.h')
-rw-r--r--include/hardware_legacy/AudioSystemLegacy.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/hardware_legacy/AudioSystemLegacy.h b/include/hardware_legacy/AudioSystemLegacy.h
index 8eec57b..7cf7672 100644
--- a/include/hardware_legacy/AudioSystemLegacy.h
+++ b/include/hardware_legacy/AudioSystemLegacy.h
@@ -321,10 +321,16 @@ public:
#if 1
static bool isOutputDevice(audio_devices device) {
- return audio_is_output_device((audio_devices_t)device);
+ if ((popcount(device) == 1) && ((device & ~DEVICE_OUT_ALL) == 0))
+ return true;
+ else
+ return false;
}
static bool isInputDevice(audio_devices device) {
- return audio_is_input_device((audio_devices_t)device);
+ if ((popcount(device) == 1) && ((device & ~DEVICE_IN_ALL) == 0))
+ return true;
+ else
+ return false;
}
static bool isA2dpDevice(audio_devices device) {
return audio_is_a2dp_device((audio_devices_t)device);