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

Commit 1009e82e authored by Bjorn Bringert's avatar Bjorn Bringert Committed by Android (Google) Code Review
Browse files

Merge "Adding speech recognition service public API"

parents 17fe395d 3da3cad9
Loading
Loading
Loading
Loading
+230 −21
Original line number Original line Diff line number Diff line
@@ -135042,7 +135042,7 @@
<parameter name="error" type="int">
<parameter name="error" type="int">
</parameter>
</parameter>
</method>
</method>
<method name="onInit"
<method name="onEvent"
 return="void"
 return="void"
 abstract="true"
 abstract="true"
 native="false"
 native="false"
@@ -135052,6 +135052,10 @@
 deprecated="not deprecated"
 deprecated="not deprecated"
 visibility="public"
 visibility="public"
>
>
<parameter name="eventType" type="int">
</parameter>
<parameter name="params" type="android.os.Bundle">
</parameter>
</method>
</method>
<method name="onPartialResults"
<method name="onPartialResults"
 return="void"
 return="void"
@@ -135137,10 +135141,6 @@
>
>
<parameter name="context" type="android.content.Context">
<parameter name="context" type="android.content.Context">
</parameter>
</parameter>
<parameter name="listener" type="android.speech.RecognitionListener">
</parameter>
<parameter name="recognizerIntent" type="android.content.Intent">
</parameter>
</method>
</method>
<method name="destroy"
<method name="destroy"
 return="void"
 return="void"
@@ -135166,6 +135166,19 @@
<parameter name="context" type="android.content.Context">
<parameter name="context" type="android.content.Context">
</parameter>
</parameter>
</method>
</method>
<method name="setRecognitionListener"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="listener" type="android.speech.RecognitionListener">
</parameter>
</method>
<method name="startListening"
<method name="startListening"
 return="void"
 return="void"
 abstract="false"
 abstract="false"
@@ -135190,7 +135203,7 @@
 visibility="public"
 visibility="public"
>
>
</method>
</method>
<field name="AUDIO_ERROR"
<field name="ERROR_AUDIO"
 type="int"
 type="int"
 transient="false"
 transient="false"
 volatile="false"
 volatile="false"
@@ -135201,7 +135214,7 @@
 visibility="public"
 visibility="public"
>
>
</field>
</field>
<field name="CLIENT_ERROR"
<field name="ERROR_CLIENT"
 type="int"
 type="int"
 transient="false"
 transient="false"
 volatile="false"
 volatile="false"
@@ -135212,7 +135225,7 @@
 visibility="public"
 visibility="public"
>
>
</field>
</field>
<field name="MANAGER_NOT_INITIALIZED_ERROR"
<field name="ERROR_INSUFFICIENT_PERMISSIONS"
 type="int"
 type="int"
 transient="false"
 transient="false"
 volatile="false"
 volatile="false"
@@ -135223,7 +135236,7 @@
 visibility="public"
 visibility="public"
>
>
</field>
</field>
<field name="NETWORK_ERROR"
<field name="ERROR_NETWORK"
 type="int"
 type="int"
 transient="false"
 transient="false"
 volatile="false"
 volatile="false"
@@ -135234,7 +135247,7 @@
 visibility="public"
 visibility="public"
>
>
</field>
</field>
<field name="NETWORK_TIMEOUT_ERROR"
<field name="ERROR_NETWORK_TIMEOUT"
 type="int"
 type="int"
 transient="false"
 transient="false"
 volatile="false"
 volatile="false"
@@ -135245,7 +135258,7 @@
 visibility="public"
 visibility="public"
>
>
</field>
</field>
<field name="NO_MATCH_ERROR"
<field name="ERROR_NO_MATCH"
 type="int"
 type="int"
 transient="false"
 transient="false"
 volatile="false"
 volatile="false"
@@ -135256,44 +135269,44 @@
 visibility="public"
 visibility="public"
>
>
</field>
</field>
<field name="RECOGNITION_RESULTS_STRING_ARRAY"
<field name="ERROR_RECOGNIZER_BUSY"
 type="java.lang.String"
 type="int"
 transient="false"
 transient="false"
 volatile="false"
 volatile="false"
 value="&quot;recognition_results_string_array&quot;"
 value="8"
 static="true"
 static="true"
 final="true"
 final="true"
 deprecated="not deprecated"
 deprecated="not deprecated"
 visibility="public"
 visibility="public"
>
>
</field>
</field>
<field name="SERVER_BUSY_ERROR"
<field name="ERROR_SERVER"
 type="int"
 type="int"
 transient="false"
 transient="false"
 volatile="false"
 volatile="false"
 value="8"
 value="4"
 static="true"
 static="true"
 final="true"
 final="true"
 deprecated="not deprecated"
 deprecated="not deprecated"
 visibility="public"
 visibility="public"
>
>
</field>
</field>
<field name="SERVER_ERROR"
<field name="ERROR_SPEECH_TIMEOUT"
 type="int"
 type="int"
 transient="false"
 transient="false"
 volatile="false"
 volatile="false"
 value="4"
 value="6"
 static="true"
 static="true"
 final="true"
 final="true"
 deprecated="not deprecated"
 deprecated="not deprecated"
 visibility="public"
 visibility="public"
>
>
</field>
</field>
<field name="SPEECH_TIMEOUT_ERROR"
<field name="RESULTS_RECOGNITION"
 type="int"
 type="java.lang.String"
 transient="false"
 transient="false"
 volatile="false"
 volatile="false"
 value="6"
 value="&quot;results_recognition&quot;"
 static="true"
 static="true"
 final="true"
 final="true"
 deprecated="not deprecated"
 deprecated="not deprecated"
@@ -135301,6 +135314,202 @@
>
>
</field>
</field>
</class>
</class>
<class name="RecognitionService"
 extends="android.app.Service"
 abstract="true"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<constructor name="RecognitionService"
 type="android.speech.RecognitionService"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
</constructor>
<method name="onBind"
 return="android.os.IBinder"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="intent" type="android.content.Intent">
</parameter>
</method>
<method name="onCancel"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="protected"
>
<parameter name="listener" type="android.speech.RecognitionService.Callback">
</parameter>
</method>
<method name="onStartListening"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="protected"
>
<parameter name="recognizerIntent" type="android.content.Intent">
</parameter>
<parameter name="listener" type="android.speech.RecognitionService.Callback">
</parameter>
</method>
<method name="onStopListening"
 return="void"
 abstract="true"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="protected"
>
<parameter name="listener" type="android.speech.RecognitionService.Callback">
</parameter>
</method>
</class>
<class name="RecognitionService.Callback"
 extends="java.lang.Object"
 abstract="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<method name="beginningOfSpeech"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<exception name="RemoteException" type="android.os.RemoteException">
</exception>
</method>
<method name="bufferReceived"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="buffer" type="byte[]">
</parameter>
<exception name="RemoteException" type="android.os.RemoteException">
</exception>
</method>
<method name="endOfSpeech"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<exception name="RemoteException" type="android.os.RemoteException">
</exception>
</method>
<method name="error"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="error" type="int">
</parameter>
<exception name="RemoteException" type="android.os.RemoteException">
</exception>
</method>
<method name="partialResults"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="partialResults" type="android.os.Bundle">
</parameter>
<exception name="RemoteException" type="android.os.RemoteException">
</exception>
</method>
<method name="readyForSpeech"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="params" type="android.os.Bundle">
</parameter>
<exception name="RemoteException" type="android.os.RemoteException">
</exception>
</method>
<method name="results"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="results" type="android.os.Bundle">
</parameter>
<exception name="RemoteException" type="android.os.RemoteException">
</exception>
</method>
<method name="rmsChanged"
 return="void"
 abstract="false"
 native="false"
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="rmsdB" type="float">
</parameter>
<exception name="RemoteException" type="android.os.RemoteException">
</exception>
</method>
</class>
<class name="RecognizerIntent"
<class name="RecognizerIntent"
 extends="java.lang.Object"
 extends="java.lang.Object"
 abstract="false"
 abstract="false"
+10 −2
Original line number Original line Diff line number Diff line
@@ -24,7 +24,7 @@ import android.os.Bundle;
 *  intermediate events that can be used to show visual feedback to the user.
 *  intermediate events that can be used to show visual feedback to the user.
 *  {@hide}
 *  {@hide}
 */
 */
interface IRecognitionListener {
oneway interface IRecognitionListener {
    /**
    /**
     * Called when the endpointer is ready for the user to start speaking.
     * Called when the endpointer is ready for the user to start speaking.
     *
     *
@@ -76,4 +76,12 @@ interface IRecognitionListener {
     * @param results a Bundle containing the current most likely result.
     * @param results a Bundle containing the current most likely result.
     */
     */
    void onPartialResults(in Bundle results);
    void onPartialResults(in Bundle results);

    /**
     * Reserved for adding future events.
     *
     * @param eventType the type of the occurred event
     * @param params a Bundle containing the passed parameters
     */
    void onEvent(in int eventType, in Bundle params);
}
}
+8 −4
Original line number Original line Diff line number Diff line
@@ -29,7 +29,7 @@ import android.speech.IRecognitionListener;
* accessing recognition service. 
* accessing recognition service. 
* {@hide}
* {@hide}
*/
*/
interface IRecognitionService {
oneway interface IRecognitionService {
    /**
    /**
     * Starts listening for speech. Please note that the recognition service supports
     * Starts listening for speech. Please note that the recognition service supports
     * one listener only, therefore, if this function is called from two different threads,
     * one listener only, therefore, if this function is called from two different threads,
@@ -38,7 +38,7 @@ interface IRecognitionService {
     * @param recognizerIntent the intent from which the invocation occurred. Additionally,
     * @param recognizerIntent the intent from which the invocation occurred. Additionally,
     *        this intent can contain extra parameters to manipulate the behavior of the recognition
     *        this intent can contain extra parameters to manipulate the behavior of the recognition
     *        client. For more information see {@link RecognizerIntent}.
     *        client. For more information see {@link RecognizerIntent}.
     * @param listener to receive callbacks
     * @param listener to receive callbacks, note that this must be non-null
     */
     */
    void startListening(in Intent recognizerIntent, in IRecognitionListener listener);
    void startListening(in Intent recognizerIntent, in IRecognitionListener listener);


@@ -46,11 +46,15 @@ interface IRecognitionService {
     * Stops listening for speech. Speech captured so far will be recognized as
     * Stops listening for speech. Speech captured so far will be recognized as
     * if the user had stopped speaking at this point. The function has no effect unless it
     * if the user had stopped speaking at this point. The function has no effect unless it
     * is called during the speech capturing.
     * is called during the speech capturing.
     *
     * @param listener to receive callbacks, note that this must be non-null
     */
     */
    void stopListening();
    void stopListening(in IRecognitionListener listener);


    /**
    /**
     * Cancels the speech recognition.
     * Cancels the speech recognition.
     *
     * @param listener to receive callbacks, note that this must be non-null
     */
     */
    void cancel();
    void cancel(in IRecognitionListener listener);
}
}
+9 −8
Original line number Original line Diff line number Diff line
@@ -24,12 +24,6 @@ import android.os.Bundle;
 * Application main thread.
 * Application main thread.
 */
 */
public interface RecognitionListener {
public interface RecognitionListener {

    /**
     * Called when RecognitionManager is successfully initialized
     */
    void onInit();

    /**
    /**
     * Called when the endpointer is ready for the user to start speaking.
     * Called when the endpointer is ready for the user to start speaking.
     * 
     * 
@@ -76,7 +70,7 @@ public interface RecognitionListener {
     * 
     * 
     * @param results the recognition results. To retrieve the results in {@code
     * @param results the recognition results. To retrieve the results in {@code
     *        ArrayList&lt;String&gt;} format use {@link Bundle#getStringArrayList(String)} with
     *        ArrayList&lt;String&gt;} format use {@link Bundle#getStringArrayList(String)} with
     *        {@link RecognitionManager#RECOGNITION_RESULTS_STRING_ARRAY} as a parameter
     *        {@link RecognitionManager#RESULTS_RECOGNITION} as a parameter
     */
     */
    void onResults(Bundle results);
    void onResults(Bundle results);


@@ -89,8 +83,15 @@ public interface RecognitionListener {
     * 
     * 
     * @param partialResults the returned results. To retrieve the results in
     * @param partialResults the returned results. To retrieve the results in
     *        ArrayList&lt;String&gt; format use {@link Bundle#getStringArrayList(String)} with
     *        ArrayList&lt;String&gt; format use {@link Bundle#getStringArrayList(String)} with
     *        {@link RecognitionManager#RECOGNITION_RESULTS_STRING_ARRAY} as a parameter
     *        {@link RecognitionManager#RESULTS_RECOGNITION} as a parameter
     */
     */
    void onPartialResults(Bundle partialResults);
    void onPartialResults(Bundle partialResults);


    /**
     * Reserved for adding future events.
     * 
     * @param eventType the type of the occurred event
     * @param params a Bundle containing the passed parameters
     */
    void onEvent(int eventType, Bundle params);
}
}
+247 −142

File changed.

Preview size limit exceeded, changes collapsed.

Loading