From 148b266afe2ac92b5616c24e8d5160e6f9242f69 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Sat, 5 Dec 2009 05:20:01 -0800 Subject: Fix issue 2304669: VoiceIME: starting and canceling voice IME yields persistent "error 8" state on future attempts and breaks voice search. Fixed AudioFlinger::openInput() broken in change ddb78e7753be03937ad57ce7c3c842c52bdad65e so that an invalid IO handle (0) is returned in case of failure. Applied the same correction to openOutput(). Modified RecordThread start procedure so that a failure occuring during the first read from audio input stream is detected and causes the record start to fail. Modified RecordThread stop procedure to make sure that audio input stream fd is closed before we exit the stop function. Fixed AudioRecord JAVA and JNI implementation to take status of native AudioRecord::start() into account and not change mRecordingState to RECORDSTATE_RECORDING if start fails. --- media/libmedia/AudioRecord.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'media/libmedia') diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp index c3828f0..f4165ff 100644 --- a/media/libmedia/AudioRecord.cpp +++ b/media/libmedia/AudioRecord.cpp @@ -125,7 +125,7 @@ status_t AudioRecord::set( audio_io_handle_t input = AudioSystem::getInput(inputSource, sampleRate, format, channels, (AudioSystem::audio_in_acoustics)flags); if (input == 0) { - LOGE("Could not get audio output for stream type %d", inputSource); + LOGE("Could not get audio input for record source %d", inputSource); return BAD_VALUE; } @@ -539,7 +539,6 @@ ssize_t AudioRecord::read(void* buffer, size_t userSize) return BAD_VALUE; } - LOGV("read size: %d", userSize); do { -- cgit v1.1