audiopolicy: avoid unnecessary closure of HOTWORD recording.

When the new selected input device is not supported by current
input handle, normally it needs to be closed and then create
a new one to capture with the new device.
While for HOTWORD recording, as the data will either be captured
from handset mic or headset mic, recording can be continued on
the original input handle.

Bug: 179399190
Test: audio smoke tests
Change-Id: I01ad15fa2bb383979250399fe2b8903965bb6aa9
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index e82691f..340eca4 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -3304,6 +3304,11 @@
 
 void AudioPolicyManager::updateInputRouting() {
     for (const auto& activeDesc : mInputs.getActiveInputs()) {
+        // Skip for hotword recording as the input device switch
+        // is handled within sound trigger HAL
+        if (activeDesc->isSoundTrigger() && activeDesc->source() == AUDIO_SOURCE_HOTWORD) {
+            continue;
+        }
         auto newDevice = getNewInputDevice(activeDesc);
         // Force new input selection if the new device can not be reached via current input
         if (activeDesc->mProfile->getSupportedDevices().contains(newDevice)) {