summaryrefslogtreecommitdiff
path: root/core/java/android/speech/RecognitionManager.java
diff options
context:
space:
mode:
authorValentin Kravtsov <valentink@google.com>2010-03-18 07:41:38 +0000
committerValentin Kravtsov <valentink@google.com>2010-03-18 09:32:11 +0000
commit1168622bce0a8ab51362daadf4a22ea43dd46c10 (patch)
tree5d6f73b7687e7c7f7acdbf0e06fb327be794eff1 /core/java/android/speech/RecognitionManager.java
parente4eb5bf243cb51b75b0717ebcd8c317a5b8fae8a (diff)
RecognitionManager does not throw exceptions when needed
bug fix for: http://b/issue?id=2522063 RecognitionManager does not throw an exception in startListening() was called without the preceding setListener() Change-Id: I8e303d0c53c7593fbf1dc7033b2c0f82eebfb081
Diffstat (limited to 'core/java/android/speech/RecognitionManager.java')
-rw-r--r--core/java/android/speech/RecognitionManager.java39
1 files changed, 20 insertions, 19 deletions
diff --git a/core/java/android/speech/RecognitionManager.java b/core/java/android/speech/RecognitionManager.java
index 16b1f89b4202..9ed9941ad568 100644
--- a/core/java/android/speech/RecognitionManager.java
+++ b/core/java/android/speech/RecognitionManager.java
@@ -180,10 +180,11 @@ public class RecognitionManager {
}
/**
- * Factory method to create a new {@code RecognitionManager}, please note that
- * {@link #setRecognitionListener(RecognitionListener)} must be called before dispatching any
- * command to the created {@code RecognitionManager}.
- *
+ * Factory method to create a new {@code RecognitionManager}. Please note that
+ * {@link #setRecognitionListener(RecognitionListener)} should be called before dispatching any
+ * command to the created {@code RecognitionManager}, otherwise no notifications will be
+ * received.
+ *
* @param context in which to create {@code RecognitionManager}
* @return a new {@code RecognitionManager}
*/
@@ -192,14 +193,15 @@ public class RecognitionManager {
}
/**
- * Factory method to create a new {@code RecognitionManager}, please note that
- * {@link #setRecognitionListener(RecognitionListener)} must be called before dispatching any
- * command to the created {@code RecognitionManager}.
- *
+ * Factory method to create a new {@code RecognitionManager}. Please note that
+ * {@link #setRecognitionListener(RecognitionListener)} should be called before dispatching any
+ * command to the created {@code RecognitionManager}, otherwise no notifications will be
+ * received.
+ *
* Use this version of the method to specify a specific service to direct this
* {@link RecognitionManager} to. Normally you would not use this; use
- * {@link #createRecognitionManager(Context)} instead to use the system default
- * recognition service.
+ * {@link #createRecognitionManager(Context)} instead to use the system default recognition
+ * service.
*
* @param context in which to create {@code RecognitionManager}
* @param serviceComponent the {@link ComponentName} of a specific service to direct this
@@ -230,9 +232,9 @@ public class RecognitionManager {
/**
* Starts listening for speech. Please note that
- * {@link #setRecognitionListener(RecognitionListener)} must be called beforehand, otherwise a
- * {@link RuntimeException} will be thrown.
- *
+ * {@link #setRecognitionListener(RecognitionListener)} should be called beforehand, otherwise
+ * no notifications will be received.
+ *
* @param recognizerIntent contains parameters for the recognition to be performed. The intent
* may also contain optional extras, see {@link RecognizerIntent}. If these values are
* not set explicitly, default values will be used by the recognizer.
@@ -280,8 +282,8 @@ public class RecognitionManager {
* determines speech has completed. However, you can manipulate endpointer parameters directly
* using the intent extras defined in {@link RecognizerIntent}, in which case you may sometimes
* want to manually call this method to stop listening sooner. Please note that
- * {@link #setRecognitionListener(RecognitionListener)} must be called beforehand, otherwise a
- * {@link RuntimeException} will be thrown.
+ * {@link #setRecognitionListener(RecognitionListener)} should be called beforehand, otherwise
+ * no notifications will be received.
*/
public void stopListening() {
checkIsCalledFromMainThread();
@@ -290,8 +292,8 @@ public class RecognitionManager {
/**
* Cancels the speech recognition. Please note that
- * {@link #setRecognitionListener(RecognitionListener)} must be called beforehand, otherwise a
- * {@link RuntimeException} will be thrown.
+ * {@link #setRecognitionListener(RecognitionListener)} should be called beforehand, otherwise
+ * no notifications will be received.
*/
public void cancel() {
checkIsCalledFromMainThread();
@@ -371,8 +373,7 @@ public class RecognitionManager {
}
/**
- * Destroys the {@code RecognitionManager} object. Note that after calling this method all
- * method calls on this object will fail, triggering {@link RecognitionListener#onError}.
+ * Destroys the {@code RecognitionManager} object.
*/
public void destroy() {
if (mConnection != null) {