summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYamit Mehta <ymehta@codeaurora.org>2012-10-04 19:38:41 +0530
committerGerrit Code Review <gerrit@review.cyanogenmod.com>2012-11-05 23:46:26 -0800
commit6bfd17bdda585db6995fe059fc4e31adb3051116 (patch)
tree822151ca0386f79a991c3fcb7fc3a70c1386aba1
parent083ccce048f7af472fa83d78438bb94e5e7ff204 (diff)
downloadandroid_hardware_qcom_audio-6bfd17bdda585db6995fe059fc4e31adb3051116.tar.gz
android_hardware_qcom_audio-6bfd17bdda585db6995fe059fc4e31adb3051116.tar.bz2
android_hardware_qcom_audio-6bfd17bdda585db6995fe059fc4e31adb3051116.zip
audio/msm8660: Fix to avoid routing in voice call
-If a device selected for media playback is other than the current active device selected to route voice call, routing is switched to that device. -Avoid routing in such cases if device to route is different from current device for voice call. Change-Id: I6d4e7a667b1949a5bc45e19c2f7b3a4555b6bbfe CRs-Fixed: 397595
-rwxr-xr-xmsm8660/AudioPolicyManager.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/msm8660/AudioPolicyManager.cpp b/msm8660/AudioPolicyManager.cpp
index f505e726..6e70897a 100755
--- a/msm8660/AudioPolicyManager.cpp
+++ b/msm8660/AudioPolicyManager.cpp
@@ -262,6 +262,14 @@ audio_devices_t AudioPolicyManager::getDeviceForStrategy(routing_strategy strate
device |= AudioSystem::DEVICE_OUT_ANC_HEADPHONE;
}
#endif
+ // Do not play media stream if in call and the requested device would change the hardware
+ // output routing
+ if (mPhoneState == AudioSystem::MODE_IN_CALL &&
+ !AudioSystem::isA2dpDevice((AudioSystem::audio_devices)device) &&
+ device != getDeviceForStrategy(STRATEGY_PHONE)) {
+ device = getDeviceForStrategy(STRATEGY_PHONE);
+ ALOGV("getDeviceForStrategy() incompatible media and phone devices");
+ }
if (device == 0) {
ALOGE("getDeviceForStrategy() no device found for STRATEGY_MEDIA");
}