Fix regression on audio effects for VOICE_RECOGNITION source
Add the missing assignments of the input channel mask.
Fix the test on the input channel mask so audio effects can be
enabled on the VOICE_RECOGNITION source, except when recording
from the front+back mic.
Bug 9320596
Change-Id: Ibfbda2cec8444be59eaa34493cff6af97e9776dc
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index ba4c212..d449030 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -542,7 +542,7 @@
}
// disable noise suppression when capturing front and back mic for voice recognition
if ((adev->input_source == AUDIO_SOURCE_VOICE_RECOGNITION) &&
- (adev->in_channel_mask != AUDIO_CHANNEL_IN_FRONT_BACK))
+ (adev->in_channel_mask == AUDIO_CHANNEL_IN_FRONT_BACK))
new_es305_preset = -1;
} else {
if (output_device_id != OUT_DEVICE_NONE) {
@@ -762,6 +762,7 @@
in->frames_in = 0;
adev->input_source = in->input_source;
adev->in_device = in->device;
+ adev->in_channel_mask = in->channel_mask;
eS305_SetActiveIoHandle(in->io_handle);
select_devices(adev);
@@ -1252,6 +1253,7 @@
in->dev->input_source = AUDIO_SOURCE_DEFAULT;
in->dev->in_device = AUDIO_DEVICE_NONE;
+ in->dev->in_channel_mask = 0;
select_devices(adev);
in->standby = true;