Merge "audiopolicy: use an exact match for MMAP input"
am: d2bac96d6e

Change-Id: Ic1f090c1eca1940402f08b96d4db05c882c8415f
diff --git a/services/audiopolicy/common/managerdefinitions/src/IOProfile.cpp b/services/audiopolicy/common/managerdefinitions/src/IOProfile.cpp
index fbc2384..390ea36 100644
--- a/services/audiopolicy/common/managerdefinitions/src/IOProfile.cpp
+++ b/services/audiopolicy/common/managerdefinitions/src/IOProfile.cpp
@@ -17,6 +17,7 @@
 #define LOG_TAG "APM::IOProfile"
 //#define LOG_NDEBUG 0
 
+#include <system/audio-base.h>
 #include "IOProfile.h"
 #include "HwModule.h"
 #include "AudioGain.h"
@@ -66,19 +67,23 @@
     audio_format_t myUpdatedFormat = format;
     audio_channel_mask_t myUpdatedChannelMask = channelMask;
     uint32_t myUpdatedSamplingRate = samplingRate;
+    const struct audio_port_config config = {
+        .config_mask = AUDIO_PORT_CONFIG_ALL & ~AUDIO_PORT_CONFIG_GAIN,
+        .sample_rate = samplingRate,
+        .channel_mask = channelMask,
+        .format = format,
+    };
     if (isRecordThread)
     {
-        if (checkCompatibleAudioProfile(
+        if ((flags & AUDIO_INPUT_FLAG_MMAP_NOIRQ) != 0) {
+            if (checkExactAudioProfile(&config) != NO_ERROR) {
+                return false;
+            }
+        } else if (checkCompatibleAudioProfile(
                 myUpdatedSamplingRate, myUpdatedChannelMask, myUpdatedFormat) != NO_ERROR) {
             return false;
         }
     } else {
-        const struct audio_port_config config = {
-            .config_mask = AUDIO_PORT_CONFIG_ALL & ~AUDIO_PORT_CONFIG_GAIN,
-            .sample_rate = samplingRate,
-            .channel_mask = channelMask,
-            .format = format,
-        };
         if (checkExactAudioProfile(&config) != NO_ERROR) {
             return false;
         }