diff --git a/api/current.xml b/api/current.xml index a8f710946e742..31ab3cec4047c 100644 --- a/api/current.xml +++ b/api/current.xml @@ -135940,6 +135940,17 @@ visibility="public" > + + - + diff --git a/core/java/android/speech/RecognitionListener.java b/core/java/android/speech/RecognitionListener.java index 5434887006a17..2f5bcc3ddb53e 100644 --- a/core/java/android/speech/RecognitionListener.java +++ b/core/java/android/speech/RecognitionListener.java @@ -79,7 +79,8 @@ public interface RecognitionListener { * time between {@link #onBeginningOfSpeech()} and {@link #onResults(Bundle)} when partial * results are ready. This method may be called zero, one or multiple times for each call to * {@link RecognitionManager#startListening(Intent)}, depending on the speech recognition - * service implementation. + * service implementation. To request partial results, use + * {@link RecognizerIntent#EXTRA_PARTIAL_RESULTS} * * @param partialResults the returned results. To retrieve the results in * ArrayList<String> format use {@link Bundle#getStringArrayList(String)} with diff --git a/core/java/android/speech/RecognizerIntent.java b/core/java/android/speech/RecognizerIntent.java index 334b04909adaa..241a8b0d7d248 100644 --- a/core/java/android/speech/RecognizerIntent.java +++ b/core/java/android/speech/RecognizerIntent.java @@ -77,6 +77,7 @@ public class RecognizerIntent { *
  • {@link #EXTRA_PROMPT} *
  • {@link #EXTRA_LANGUAGE} *
  • {@link #EXTRA_MAX_RESULTS} + *
  • {@link #EXTRA_PARTIAL_RESULTS} * * *

    Result extras (returned in the result, not to be specified in the request): @@ -165,6 +166,13 @@ public class RecognizerIntent { */ public static final String EXTRA_MAX_RESULTS = "android.speech.extra.MAX_RESULTS"; + /** + * 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 + * results in some or all cases. + */ + public static final String EXTRA_PARTIAL_RESULTS = "android.speech.extra.PARTIAL_RESULTS"; + /** * When the intent is {@link #ACTION_RECOGNIZE_SPEECH}, the speech input activity will * return results to you via the activity results mechanism. Alternatively, if you use this