audio policy: fix hotword capture
commit 1c333e2 introduced a regression causing the
wrong input source type to be communicated to
the audio HAL when starting hotword (background) capture.
Change-Id: Iec6b3c58cbc15b9988793077232ff3e7e72a4d6d
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp
index d9acb56..8783ec9 100644
--- a/services/audiopolicy/AudioPolicyManager.cpp
+++ b/services/audiopolicy/AudioPolicyManager.cpp
@@ -3833,6 +3833,11 @@
if (!deviceList.isEmpty()) {
struct audio_patch patch;
inputDesc->toAudioPortConfig(&patch.sinks[0]);
+ // AUDIO_SOURCE_HOTWORD is for internal use only:
+ // handled as AUDIO_SOURCE_VOICE_RECOGNITION by the audio HAL
+ if (patch.sinks[0].ext.mix.usecase.source == AUDIO_SOURCE_HOTWORD) {
+ patch.sinks[0].ext.mix.usecase.source = AUDIO_SOURCE_VOICE_RECOGNITION;
+ }
patch.num_sinks = 1;
//only one input device for now
deviceList.itemAt(0)->toAudioPortConfig(&patch.sources[0]);