Merge f2274a4c3cde5b707d88701f78b13b6c47b9c000 on remote branch

Change-Id: I48d49c6e10b681552b75ac673bdb838d8617e370
diff --git a/configs/parrot/parrot.mk b/configs/parrot/parrot.mk
index 6e989a5..7c7604e 100644
--- a/configs/parrot/parrot.mk
+++ b/configs/parrot/parrot.mk
@@ -84,7 +84,8 @@
 AUDIO_FEATURE_ENABLED_USB_BURST_MODE := true
 AUDIO_FEATURE_ENABLED_SVA_MULTI_STAGE := true
 AUDIO_FEATURE_ENABLED_BATTERY_LISTENER := true
-AUDIO_FEATURE_ENABLED_DYNAMIC_SR := false 
+AUDIO_FEATURE_ENABLED_DYNAMIC_SR := false
+AUDIO_FEATURE_ENABLED_TRUE_STEREO := false
 BUILD_AUDIO_TECHPACK_SOURCE := true
 AUDIO_FEATURE_ENABLED_MCS := true
 ##AUDIO_FEATURE_FLAGS
diff --git a/hal/Android.mk b/hal/Android.mk
index 5514ae6..c92c574 100644
--- a/hal/Android.mk
+++ b/hal/Android.mk
@@ -37,6 +37,10 @@
 LOCAL_CFLAGS += -DDYNAMIC_SR_ENABLED
 endif
 
+ifeq ($(strip $(AUDIO_FEATURE_ENABLED_TRUE_STEREO)),true)
+LOCAL_CFLAGS += -DTRUE_STEREO_ENABLED
+endif
+
 LOCAL_CFLAGS += -Wno-macro-redefined
 LOCAL_CFLAGS += -DSOUND_TRIGGER_PLATFORM_NAME=$(TARGET_BOARD_PLATFORM)
 LOCAL_CFLAGS += -D_GNU_SOURCE
diff --git a/hal/AudioStream.cpp b/hal/AudioStream.cpp
index ab8d53d..106186e 100644
--- a/hal/AudioStream.cpp
+++ b/hal/AudioStream.cpp
@@ -4979,6 +4979,18 @@
             AHAL_DBG("setting SR for usecase %d as %d", usecase_, config_.sample_rate);
         }
 #endif
+
+#ifdef TRUE_STEREO_ENABLED
+        if (source_ == AUDIO_SOURCE_DEFAULT || source_ == AUDIO_SOURCE_MIC || source_ == AUDIO_SOURCE_CAMCORDER) {
+            uint8_t channels =
+                audio_channel_count_from_in_mask(config_.channel_mask);
+            if (channels == 2) {
+                strlcpy(mPalInDevice[i].custom_config.custom_key, "dual-mic-eans",
+                        sizeof(mPalInDevice[i].custom_config.custom_key));
+                AHAL_INFO("Setting custom key as %s", mPalInDevice[i].custom_config.custom_key);
+            }
+        }
+#endif
     }
 
     if (flags & AUDIO_INPUT_FLAG_MMAP_NOIRQ) {