Merge "policy_hal: Remove closeAllInputs() from custom policy manager"
diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp
index 39482be..298aed4 100644
--- a/policy_hal/AudioPolicyManager.cpp
+++ b/policy_hal/AudioPolicyManager.cpp
@@ -1454,9 +1454,9 @@
         // in case direct voip is bypassed
         bool use_primary_out = true;
 
-        if ((channelMask == 1) &&
-                (samplingRate == 8000 || samplingRate == 16000 ||
-                samplingRate == 32000 || samplingRate == 48000)) {
+        if ((config->channel_mask == 1) &&
+                (config->sample_rate == 8000 || config->sample_rate == 16000 ||
+                config->sample_rate == 32000 || config->sample_rate == 48000)) {
             // Allow Voip direct output only if:
             // audio mode is MODE_IN_COMMUNCATION; AND
             // voip output is not opened already; AND
@@ -1479,11 +1479,11 @@
             }
 
             if ((voipOutCount == 0) &&
-                ((voipSampleRate == 0) || (voipSampleRate == samplingRate))) {
+                ((voipSampleRate == 0) || (voipSampleRate == config->sample_rate))) {
                 char propValue[PROPERTY_VALUE_MAX] = {0};
                 property_get("vendor.voice.path.for.pcm.voip", propValue, "0");
                 bool voipPcmSysPropEnabled = !strncmp("true", propValue, sizeof("true"));
-                if (voipPcmSysPropEnabled && (format == AUDIO_FORMAT_PCM_16_BIT)) {
+                if (voipPcmSysPropEnabled && (config->format == AUDIO_FORMAT_PCM_16_BIT)) {
                     *flags = (audio_output_flags_t)(AUDIO_OUTPUT_FLAG_VOIP_RX |
                                                  AUDIO_OUTPUT_FLAG_DIRECT);
                     ALOGD("Set VoIP and Direct output flags for PCM format");