summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/hardware_legacy/AudioPolicyManagerBase.h2
-rw-r--r--include/hardware_legacy/AudioSystemLegacy.h10
2 files changed, 10 insertions, 2 deletions
diff --git a/include/hardware_legacy/AudioPolicyManagerBase.h b/include/hardware_legacy/AudioPolicyManagerBase.h
index a6ae397..07e52f7 100644
--- a/include/hardware_legacy/AudioPolicyManagerBase.h
+++ b/include/hardware_legacy/AudioPolicyManagerBase.h
@@ -507,6 +507,8 @@ protected:
DefaultKeyedVector<audio_io_handle_t, AudioInputDescriptor *> mInputs; // list of input descriptors
audio_devices_t mAvailableOutputDevices; // bit field of all available output devices
audio_devices_t mAvailableInputDevices; // bit field of all available input devices
+ // without AUDIO_DEVICE_BIT_IN to allow direct bit
+ // field comparisons
int mPhoneState; // current phone state
AudioSystem::forced_config mForceUse[AudioSystem::NUM_FORCE_USE]; // current forced use configuration
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);