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

Commit 3da3cad9 authored by Valentin Kravtsov's avatar Valentin Kravtsov
Browse files

Adding speech recognition service public API

Change-Id: Ia2c13d4c7993d646956090aa5c56d1a441af9e5a
parent f6e003bc
Loading
Loading
Loading
Loading
+230 −21
Original line number Diff line number Diff line
@@ -135042,7 +135042,7 @@
<parameter name="error" type="int">
</parameter>
</method>
<method name="onInit"
<method name="onEvent"
 return="void"
 abstract="true"
 native="false"
@@ -135052,6 +135052,10 @@
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="eventType" type="int">
</parameter>
<parameter name="params" type="android.os.Bundle">
</parameter>
</method>
<method name="onPartialResults"
 return="void"
@@ -135137,10 +135141,6 @@
>
<parameter name="context" type="android.content.Context">
</parameter>
<parameter name="listener" type="android.speech.RecognitionListener">
</parameter>
<parameter name="recognizerIntent" type="android.content.Intent">
</parameter>
</method>
<method name="destroy"
 return="void"
@@ -135166,6 +135166,19 @@
<parameter name="context" type="android.content.Context">
</parameter>
</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"
 return="void"
 abstract="false"
@@ -135190,7 +135203,7 @@
 visibility="public"
>
</method>
<field name="AUDIO_ERROR"
<field name="ERROR_AUDIO"
 type="int"
 transient="false"
 volatile="false"
@@ -135201,7 +135214,7 @@
 visibility="public"
>
</field>
<field name="CLIENT_ERROR"
<field name="ERROR_CLIENT"
 type="int"
 transient="false"
 volatile="false"
@@ -135212,7 +135225,7 @@
 visibility="public"
>
</field>
<field name="MANAGER_NOT_INITIALIZED_ERROR"
<field name="ERROR_INSUFFICIENT_PERMISSIONS"
 type="int"
 transient="false"
 volatile="false"
@@ -135223,7 +135236,7 @@
 visibility="public"
>
</field>
<field name="NETWORK_ERROR"
<field name="ERROR_NETWORK"
 type="int"
 transient="false"
 volatile="false"
@@ -135234,7 +135247,7 @@
 visibility="public"
>
</field>
<field name="NETWORK_TIMEOUT_ERROR"
<field name="ERROR_NETWORK_TIMEOUT"
 type="int"
 transient="false"
 volatile="false"
@@ -135245,7 +135258,7 @@
 visibility="public"
>
</field>
<field name="NO_MATCH_ERROR"
<field name="ERROR_NO_MATCH"
 type="int"
 transient="false"
 volatile="false"
@@ -135256,44 +135269,44 @@
 visibility="public"
>
</field>
<field name="RECOGNITION_RESULTS_STRING_ARRAY"
 type="java.lang.String"
<field name="ERROR_RECOGNIZER_BUSY"
 type="int"
 transient="false"
 volatile="false"
 value="&quot;recognition_results_string_array&quot;"
 value="8"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="SERVER_BUSY_ERROR"
<field name="ERROR_SERVER"
 type="int"
 transient="false"
 volatile="false"
 value="8"
 value="4"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="SERVER_ERROR"
<field name="ERROR_SPEECH_TIMEOUT"
 type="int"
 transient="false"
 volatile="false"
 value="4"
 value="6"
 static="true"
 final="true"
 deprecated="not deprecated"
 visibility="public"
>
</field>
<field name="SPEECH_TIMEOUT_ERROR"
 type="int"
<field name="RESULTS_RECOGNITION"
 type="java.lang.String"
 transient="false"
 volatile="false"
 value="6"
 value="&quot;results_recognition&quot;"
 static="true"
 final="true"
 deprecated="not deprecated"
@@ -135301,6 +135314,202 @@
>
</field>
</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"
 extends="java.lang.Object"
 abstract="false"
+10 −2
Original line number 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.
 *  {@hide}
 */
interface IRecognitionListener {
oneway interface IRecognitionListener {
    /**
     * 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.
     */
    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 Diff line number Diff line
@@ -29,7 +29,7 @@ import android.speech.IRecognitionListener;
* accessing recognition service. 
* {@hide}
*/
interface IRecognitionService {
oneway interface IRecognitionService {
    /**
     * Starts listening for speech. Please note that the recognition service supports
     * 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,
     *        this intent can contain extra parameters to manipulate the behavior of the recognition
     *        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);

@@ -46,11 +46,15 @@ interface IRecognitionService {
     * 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
     * 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.
     *
     * @param listener to receive callbacks, note that this must be non-null
     */
    void cancel();
    void cancel(in IRecognitionListener listener);
}
+9 −8
Original line number Diff line number Diff line
@@ -24,12 +24,6 @@ import android.os.Bundle;
 * Application main thread.
 */
public interface RecognitionListener {

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

    /**
     * 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
     *        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);

@@ -89,8 +83,15 @@ public interface RecognitionListener {
     * 
     * @param partialResults the returned results. To retrieve the results in
     *        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);

    /**
     * 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