Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b30023ca authored by Mike LeBeau's avatar Mike LeBeau
Browse files

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
parent f76aca98
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -166229,6 +166229,17 @@
 visibility="public"
>
</field>
<field name="EXTRA_WEB_SEARCH_ONLY"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="&quot;android.speech.extra.WEB_SEARCH_ONLY&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="LANGUAGE_MODEL_FREE_FORM"
 type="java.lang.String"
 transient="false"
@@ -251252,7 +251263,7 @@
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="arg0" type="T">
<parameter name="t" type="T">
</parameter>
</method>
</interface>
+13 −1
Original line number Diff line number Diff line
@@ -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):
@@ -183,6 +188,13 @@ public class RecognizerIntent {
     */
    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
     * as the user speaks (default is false).  The server may ignore a request for partial