diff --git a/api/16.txt b/api/16.txt index 1a694a8b06562..c467c3bb8c2a5 100644 --- a/api/16.txt +++ b/api/16.txt @@ -19690,6 +19690,7 @@ package android.speech { method public static final android.content.Intent getVoiceDetailsIntent(android.content.Context); field public static final java.lang.String ACTION_GET_LANGUAGE_DETAILS = "android.speech.action.GET_LANGUAGE_DETAILS"; field public static final java.lang.String ACTION_RECOGNIZE_SPEECH = "android.speech.action.RECOGNIZE_SPEECH"; + field public static final java.lang.String ACTION_VOICE_SEARCH_HANDS_FREE = "android.speech.action.VOICE_SEARCH_HANDS_FREE"; field public static final java.lang.String ACTION_WEB_SEARCH = "android.speech.action.WEB_SEARCH"; field public static final java.lang.String DETAILS_META_DATA = "android.speech.DETAILS"; field public static final java.lang.String EXTRA_CALLING_PACKAGE = "calling_package"; @@ -19705,6 +19706,7 @@ package android.speech { field public static final java.lang.String EXTRA_RESULTS = "android.speech.extra.RESULTS"; field public static final java.lang.String EXTRA_RESULTS_PENDINGINTENT = "android.speech.extra.RESULTS_PENDINGINTENT"; field public static final java.lang.String EXTRA_RESULTS_PENDINGINTENT_BUNDLE = "android.speech.extra.RESULTS_PENDINGINTENT_BUNDLE"; + field public static final java.lang.String EXTRA_SECURE = "android.speech.extras.EXTRA_SECURE"; field public static final java.lang.String EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS = "android.speech.extras.SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS"; field public static final java.lang.String EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS = "android.speech.extras.SPEECH_INPUT_MINIMUM_LENGTH_MILLIS"; field public static final java.lang.String EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS = "android.speech.extras.SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS"; diff --git a/api/current.txt b/api/current.txt index 1a694a8b06562..c467c3bb8c2a5 100644 --- a/api/current.txt +++ b/api/current.txt @@ -19690,6 +19690,7 @@ package android.speech { method public static final android.content.Intent getVoiceDetailsIntent(android.content.Context); field public static final java.lang.String ACTION_GET_LANGUAGE_DETAILS = "android.speech.action.GET_LANGUAGE_DETAILS"; field public static final java.lang.String ACTION_RECOGNIZE_SPEECH = "android.speech.action.RECOGNIZE_SPEECH"; + field public static final java.lang.String ACTION_VOICE_SEARCH_HANDS_FREE = "android.speech.action.VOICE_SEARCH_HANDS_FREE"; field public static final java.lang.String ACTION_WEB_SEARCH = "android.speech.action.WEB_SEARCH"; field public static final java.lang.String DETAILS_META_DATA = "android.speech.DETAILS"; field public static final java.lang.String EXTRA_CALLING_PACKAGE = "calling_package"; @@ -19705,6 +19706,7 @@ package android.speech { field public static final java.lang.String EXTRA_RESULTS = "android.speech.extra.RESULTS"; field public static final java.lang.String EXTRA_RESULTS_PENDINGINTENT = "android.speech.extra.RESULTS_PENDINGINTENT"; field public static final java.lang.String EXTRA_RESULTS_PENDINGINTENT_BUNDLE = "android.speech.extra.RESULTS_PENDINGINTENT_BUNDLE"; + field public static final java.lang.String EXTRA_SECURE = "android.speech.extras.EXTRA_SECURE"; field public static final java.lang.String EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS = "android.speech.extras.SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS"; field public static final java.lang.String EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS = "android.speech.extras.SPEECH_INPUT_MINIMUM_LENGTH_MILLIS"; field public static final java.lang.String EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS = "android.speech.extras.SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS"; diff --git a/core/java/android/speech/RecognizerIntent.java b/core/java/android/speech/RecognizerIntent.java index fd709f214bb7e..457e66c6dbddb 100644 --- a/core/java/android/speech/RecognizerIntent.java +++ b/core/java/android/speech/RecognizerIntent.java @@ -114,6 +114,45 @@ public class RecognizerIntent { */ public static final String ACTION_WEB_SEARCH = "android.speech.action.WEB_SEARCH"; + /** + * Starts an activity that will prompt the user for speech without requiring the user's + * visual attention or touch input. It will send it through a speech recognizer, + * and either synthesize speech for a web search result or trigger + * another type of action based on the user's speech. + * + * This activity may be launched while device is locked in a secure mode. + * Special care must be taken to ensure that the voice actions that are performed while + * hands free cannot compromise the device's security. + * The activity should check the value of the {@link #EXTRA_SECURE} extra to determine + * whether the device has been securely locked. If so, the activity should either restrict + * the set of voice actions that are permitted or require some form of secure + * authentication before proceeding. + * + * To ensure that the activity's user interface is visible while the lock screen is showing, + * the activity should set the + * {@link android.view.WindowManager.LayoutParams#FLAG_SHOW_WHEN_LOCKED} window flag. + * Otherwise the activity's user interface may be hidden by the lock screen. The activity + * should take care not to leak private information when the device is securely locked. + * + *
Optional extras: + *