OSDN Git Service

audio policy: fix in call capture device
authorEric Laurent <elaurent@google.com>
Wed, 27 Feb 2013 00:10:05 +0000 (16:10 -0800)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Tue, 5 Mar 2013 16:53:53 +0000 (16:53 +0000)
Allow use of default capture device when
AUDIO_SOURCE_VOICE_UPLINK is specified and the platform
does not support AUDIO_DEVICE_IN_VOICE_CALL.

Change-Id: Ibbc314f60c91e5a0fa75d57878f2d2a96ef2d83b

audio/AudioPolicyManagerBase.cpp

index 4f0bb41..ccaa035 100644 (file)
@@ -2461,7 +2461,14 @@ audio_devices_t AudioPolicyManagerBase::getDeviceForInputSource(int inputSource)
 {
     uint32_t device = AUDIO_DEVICE_NONE;
 
-    switch(inputSource) {
+    switch (inputSource) {
+    case AUDIO_SOURCE_VOICE_UPLINK:
+      if (mAvailableInputDevices & AUDIO_DEVICE_IN_VOICE_CALL) {
+          device = AUDIO_DEVICE_IN_VOICE_CALL;
+          break;
+      }
+      // FALL THROUGH
+
     case AUDIO_SOURCE_DEFAULT:
     case AUDIO_SOURCE_MIC:
     case AUDIO_SOURCE_VOICE_RECOGNITION:
@@ -2482,7 +2489,6 @@ audio_devices_t AudioPolicyManagerBase::getDeviceForInputSource(int inputSource)
             device = AUDIO_DEVICE_IN_BUILTIN_MIC;
         }
         break;
-    case AUDIO_SOURCE_VOICE_UPLINK:
     case AUDIO_SOURCE_VOICE_DOWNLINK:
     case AUDIO_SOURCE_VOICE_CALL:
         if (mAvailableInputDevices & AUDIO_DEVICE_IN_VOICE_CALL) {