History log of /frameworks/base/core/java/android/speech/RecognitionService.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
483701eb9f36a322ca7fa6cad76fa849a756810a 18-Feb-2011 Valentin Kravtsov <valentink@google.com> Fixing a race condition in RecognitionService

Bug #3458256

If an error occurs and simultaneously user cancels the recognition, here is what happens:
1. dispatchCancel() is called since the user requested cancel. It passes the first "if" successfully.

private void dispatchCancel(IRecognitionListener listener) {
if (mCurrentCallback == null) {
if (DBG) Log.d(TAG, "cancel called with no preceding startListening - ignoring");
} else if (mCurrentCallback.mListener.asBinder() != listener.asBinder()) {
Log.w(TAG, "cancel called by client who did not call startListening - ignoring");
} else { // the correct state
RecognitionService.this.onCancel(mCurrentCallback);
mCurrentCallback = null;
if (DBG) Log.d(TAG, "canceling - setting mCurrentCallback to null");
}
}

2. Error occurs in the app, which sets the mCurrentCallback to null:
public void error(int error) throws RemoteException {
mCurrentCallback = null;
mListener.onError(error);
}

3. the second "if" is reached in dispatchCancel()
4. boom

Change-Id: I54cdcc98b495d820a2caead1709d8dee968c461e
/frameworks/base/core/java/android/speech/RecognitionService.java
2b0c7ab6891294473136bb6f7f2e751d133ae8cf 04-May-2010 Valentin Kravtsov <valentink@google.com> Fixing: RecognitionService logcat spam "cancel called..."

Bug fix for: http://b/issue?id=2647644

RecognitionService logcat spam "cancel called with no preceding startListening - ignoring"

Change-Id: I1da8b4d40406929ed0225d40cfac629507e71c7e
/frameworks/base/core/java/android/speech/RecognitionService.java
1c3cca0abed55516d2c67f2f11fc888a6a66f341 21-Apr-2010 Valentin Kravtsov <valentink@google.com> bugfix for: OOM error while doing voice search repeatedly

fix for: http://b/issue?id=2599931

Change-Id: Ic27d9eb8b29afa99787e469d9248c20f7d2988de
/frameworks/base/core/java/android/speech/RecognitionService.java
2a5d9f9b577376768372837723f0f42098aba13b 30-Mar-2010 Jean-Michel Trivi <jmtrivi@google.com> Fix bug 2553592 API REVIEW: android.speech
Change 1 of 4
Notes from API Council review:
Rename RecognitionManager to SpeechRecognizer

Change-Id: I892c0d714d928d5e31575c72b6a36281fc4c7a8a
/frameworks/base/core/java/android/speech/RecognitionService.java
2f853ea47a194680657ddc2cc54336a14f38b8ba 12-Feb-2010 Mike LeBeau <mlebeau@android.com> Improve a comment in RecognitionService.
/frameworks/base/core/java/android/speech/RecognitionService.java
378ae126d9d61feed77ad596fa0823394eac6240 11-Feb-2010 Mike LeBeau <mlebeau@android.com> Add SERVICE_INTERFACE and SERVICE_META_DATA constants to RecognitionService,
to be used by anyone implementing a voice recognition service. Also define
a new <recognition-service> styleable to be used in such service's metadata
xml.

Still to do: Change VoiceSearch's GoogleRecognitionService to respond to this
intent, and actually use this intent instead of ACTION_RECOGNIZE_SPEECH here
in RecognitionService.
/frameworks/base/core/java/android/speech/RecognitionService.java
3da3cad97269d694a6153771fb4a0c3775ca6ab5 28-Jan-2010 Valentin Kravtsov <valentink@google.com> Adding speech recognition service public API

Change-Id: Ia2c13d4c7993d646956090aa5c56d1a441af9e5a
/frameworks/base/core/java/android/speech/RecognitionService.java