exynos: audiohal: Allow to disable speech param selection

* Any values other than 8 will lower the volume on exynos9820.

Change-Id: I04cfd6793e92001d5d93b6fcefaf915dd5aab6ed
diff --git a/libaudio/audiohal/Android.mk b/libaudio/audiohal/Android.mk
index 8b04718..c965f37 100644
--- a/libaudio/audiohal/Android.mk
+++ b/libaudio/audiohal/Android.mk
@@ -49,6 +49,10 @@
 LOCAL_SHARED_LIBRARIES := liblog libcutils libprocessgroup libaudioproxy
 LOCAL_SHARED_LIBRARIES += libaudio-ril
 
+ifeq ($(BOARD_USE_SPEECH_PARAM),true)
+LOCAL_CFLAGS += -DSUPPORT_SPEECH_PARAM
+endif
+
 ifeq ($(BOARD_USE_SOUNDTRIGGER_HAL),true)
 LOCAL_CFLAGS += -DSUPPORT_STHAL_INTERFACE
 endif
diff --git a/libaudio/audiohal/audio_hw.c b/libaudio/audiohal/audio_hw.c
index a4e6e60..8fa8e34 100644
--- a/libaudio/audiohal/audio_hw.c
+++ b/libaudio/audiohal/audio_hw.c
@@ -662,11 +662,11 @@
     return ret;
 }
 
-static int get_apcall_speech_param(struct stream_out *out)
+static int get_apcall_speech_param(struct stream_out *out __attribute__((unused)))
 {
+#ifdef SUPPORT_SPEECH_PARAM
     struct audio_device *adev = out->adev;
     device_type device = get_device_id(adev, out->common.requested_devices);
-    int ret = 8;
     //Voip WB
     if(device == DEVICE_EARPIECE)return 8;
     if(device == DEVICE_SPEAKER)return 9;
@@ -686,7 +686,8 @@
             return 7;
         }
     }
-    return ret;
+#endif
+    return 8;
 }
 
 static device_type adev_get_device(void *stream, audio_usage_type usage_type)