summaryrefslogtreecommitdiff
path: root/core/java/android/speech/RecognizerIntent.java
diff options
context:
space:
mode:
authorMike LeBeau <mlebeau@android.com>2010-12-16 04:45:26 -0500
committerMike LeBeau <mlebeau@android.com>2010-12-16 14:41:46 -0500
commitb30023cabade7aebaf15b70bdbb3d17c32dfc431 (patch)
treec3c04f641fa865d15e79852935f3fc352b650aa5 /core/java/android/speech/RecognizerIntent.java
parentf76aca984c4754e4de2cd731d5b6bbdb169b7544 (diff)
Add new EXTRA_WEB_SEARCH_ONLY to RecognizerIntent API. This can be used to
avoid triggering any non-web-search actions from the speech recognizer (such as Voice Actions in the Google implementation). The browser will set this to true to avoid triggering non-web-search actions when speech recognition is requested from the browser. Change-Id: I9b410ef8696e12f22dbad325b367f0f187a2dce8 http://b/3289997 http://b/3176717
Diffstat (limited to 'core/java/android/speech/RecognizerIntent.java')
-rw-r--r--core/java/android/speech/RecognizerIntent.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/core/java/android/speech/RecognizerIntent.java b/core/java/android/speech/RecognizerIntent.java
index d55a9431d1d2..02c324c791fb 100644
--- a/core/java/android/speech/RecognizerIntent.java
+++ b/core/java/android/speech/RecognizerIntent.java
@@ -82,7 +82,11 @@ public class RecognizerIntent {
/**
* Starts an activity that will prompt the user for speech, sends it through a
- * speech recognizer, and invokes and displays a web search result.
+ * speech recognizer, and invokes and either displays a web search result or triggers
+ * another type of action based on the user's speech.
+ *
+ * <p>If you want to avoid triggering any type of action besides web search, you can use
+ * the {@link #EXTRA_WEB_SEARCH_ONLY} extra.
*
* <p>Required extras:
* <ul>
@@ -95,6 +99,7 @@ public class RecognizerIntent {
* <li>{@link #EXTRA_LANGUAGE}
* <li>{@link #EXTRA_MAX_RESULTS}
* <li>{@link #EXTRA_PARTIAL_RESULTS}
+ * <li>{@link #EXTRA_WEB_SEARCH_ONLY}
* </ul>
*
* <p> Result extras (returned in the result, not to be specified in the request):
@@ -182,6 +187,13 @@ public class RecognizerIntent {
* will choose how many results to return. Must be an integer.
*/
public static final String EXTRA_MAX_RESULTS = "android.speech.extra.MAX_RESULTS";
+
+ /**
+ * Optional boolean, to be used with {@link #ACTION_WEB_SEARCH}, to indicate whether to
+ * only fire web searches in response to a user's speech. The default is false, meaning
+ * that other types of actions can be taken based on the user's speech.
+ */
+ public static final String EXTRA_WEB_SEARCH_ONLY = "android.speech.extra.WEB_SEARCH_ONLY";
/**
* Optional boolean to indicate whether partial results should be returned by the recognizer