summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy
diff options
context:
space:
mode:
authorPavan Chikkala <pavanc@codeaurora.org>2015-01-21 14:36:15 +0530
committerSteve Kondik <shade@chemlab.org>2015-11-07 13:31:53 -0800
commit3cc70e7d66b4f1015f1639faab8acc21afd48841 (patch)
tree1777d170b4481529995b25efff66f101ad63f698 /services/audiopolicy
parent710a109d4a7d8b90d15f3f33ba02ccb7b3ed9674 (diff)
downloadframeworks_av-3cc70e7d66b4f1015f1639faab8acc21afd48841.zip
frameworks_av-3cc70e7d66b4f1015f1639faab8acc21afd48841.tar.gz
frameworks_av-3cc70e7d66b4f1015f1639faab8acc21afd48841.tar.bz2
audio: Fixed Audio Source in Voice Call
setPhoneState calls getDeviceForInputSource to check if voice_tx device is available as part of Primary Audio Module. getDeviceForInputSource always returns DEVICE_IN_COMMUNICATION for SOURCE_VOICE_COMMUNICATION on A Family and this is not added to Available devices This is leading to creation of txPatch when it is not needed Fix is to use AUDIO_SOURCE_VOICE_CALL instead of AUDIO_SOURCE_VOICE_COMMUNICATION Change-Id: I9aa7dd2139b8374ec7f06676d06ef5addea4b2a9
Diffstat (limited to 'services/audiopolicy')
-rwxr-xr-xservices/audiopolicy/enginedefault/src/Engine.cpp4
-rw-r--r--services/audiopolicy/managerdefault/AudioPolicyManager.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/services/audiopolicy/enginedefault/src/Engine.cpp b/services/audiopolicy/enginedefault/src/Engine.cpp
index 4a42a47..71f6b51 100755
--- a/services/audiopolicy/enginedefault/src/Engine.cpp
+++ b/services/audiopolicy/enginedefault/src/Engine.cpp
@@ -355,7 +355,11 @@ audio_devices_t Engine::getDeviceForStrategy(routing_strategy strategy) const
// - cannot route from voice call RX OR
// - audio HAL version is < 3.0 and TX device is on the primary HW module
if (getPhoneState() == AUDIO_MODE_IN_CALL) {
+#ifdef LEGACY_ALSA_AUDIO
+ audio_devices_t txDevice = getDeviceForInputSource(AUDIO_SOURCE_VOICE_CALL);
+#else
audio_devices_t txDevice = getDeviceForInputSource(AUDIO_SOURCE_VOICE_COMMUNICATION);
+#endif
sp<AudioOutputDescriptor> primaryOutput = outputs.getPrimaryOutput();
audio_devices_t availPrimaryInputDevices =
availableInputDevices.getDevicesFromHwModule(primaryOutput->getModuleHandle());
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 7419297..3739b60 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -321,7 +321,11 @@ void AudioPolicyManager::updateCallRouting(audio_devices_t rxDevice, int delayMs
if(!hasPrimaryOutput()) {
return;
}
+#ifdef LEGACY_ALSA_AUDIO
+ audio_devices_t txDevice = getDeviceAndMixForInputSource(AUDIO_SOURCE_VOICE_CALL);
+#else
audio_devices_t txDevice = getDeviceAndMixForInputSource(AUDIO_SOURCE_VOICE_COMMUNICATION);
+#endif
ALOGV("updateCallRouting device rxDevice %08x txDevice %08x", rxDevice, txDevice);
// release existing RX patch if any