From 1c9c2cc4b170b79a83433749808e286eb0fcc449 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Thu, 28 Aug 2014 19:37:25 -0700 Subject: audio policy: fix input source passed to openInput() The input source passed to openInput() must be modified from HOTWORD to VOICE_RECOGNITION if the capture does not correspond to a sound trigger session. Bug: 16731718. Change-Id: I48aa4180e75dd5335cd096b48da1c15f2236e6ed --- services/audiopolicy/AudioPolicyManager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'services') diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp index 06dd22c..3c1400d 100644 --- a/services/audiopolicy/AudioPolicyManager.cpp +++ b/services/audiopolicy/AudioPolicyManager.cpp @@ -1297,21 +1297,23 @@ audio_io_handle_t AudioPolicyManager::getInput(audio_source_t inputSource, audio_io_handle_t input = AUDIO_IO_HANDLE_NONE; bool isSoundTrigger = false; + audio_source_t halInputSource = inputSource; if (inputSource == AUDIO_SOURCE_HOTWORD) { ssize_t index = mSoundTriggerSessions.indexOfKey(session); if (index >= 0) { input = mSoundTriggerSessions.valueFor(session); isSoundTrigger = true; ALOGV("SoundTrigger capture on session %d input %d", session, input); + } else { + halInputSource = AUDIO_SOURCE_VOICE_RECOGNITION; } } - status_t status = mpClientInterface->openInput(profile->mModule->mHandle, &input, &config, &device, String8(""), - inputSource, + halInputSource, flags); // only accept input with the exact requested set of parameters -- cgit v1.1