Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit daf92cc8 authored by Eric Laurent's avatar Eric Laurent
Browse files

audio policy: fix hotword capture

commit 1c333e25 introduced a regression causing the
wrong input source type to be communicated to
the audio HAL when starting hotword (background) capture.

Change-Id: Iec6b3c58cbc15b9988793077232ff3e7e72a4d6d
parent 0be123df
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -3833,6 +3833,11 @@ status_t AudioPolicyManager::setInputDevice(audio_io_handle_t input,
        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]);