OSDN Git Service

Fix issue 2304669: VoiceIME: starting and canceling voice IME yields persistent ...
authorEric Laurent <elaurent@google.com>
Sat, 5 Dec 2009 13:20:01 +0000 (05:20 -0800)
committerEric Laurent <elaurent@google.com>
Mon, 7 Dec 2009 13:37:47 +0000 (05:37 -0800)
commit9cc489a2196e449dbe090ad9bdbc5cedd0b8334f
tree6f6faede20b355f2a89bd45f2cd05d7d02d3e1db
parentae952b3bcc3eb744cceb5cd0ae65b2c7a83f9de7
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.
core/jni/android_media_AudioRecord.cpp
libs/audioflinger/AudioFlinger.cpp
libs/audioflinger/AudioFlinger.h
media/java/android/media/AudioRecord.java
media/libmedia/AudioRecord.cpp