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

Commit 482c9bb3 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

New action and extra in RecognizerIntent for "hands free" voice search

New action and extra for android.speech.RecognizerIntent:
  ACTION_VOICE_SEARCH_HANDS_FREE
  EXTRA_SECURE

Change-Id: I1f390ede4f4087bae1781347bb211dc0a093e857
parent d51a68b3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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";
+2 −0
Original line number Diff line number Diff line
@@ -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";
+39 −0
Original line number Diff line number Diff line
@@ -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.
     *
     * <p>Optional extras:
     * <ul>
     *   <li>{@link #EXTRA_SECURE}
     * </ul>
     */
    public static final String ACTION_VOICE_SEARCH_HANDS_FREE =
            "android.speech.action.VOICE_SEARCH_HANDS_FREE";

    /**
     * Optional boolean to indicate that a "hands free" voice search was performed while the device
     * was in a secure mode. An example of secure mode is when the device's screen lock is active,
     * and it requires some form of authentication to be unlocked.
     *
     * When the device is securely locked, the voice search activity should either restrict
     * the set of voice actions that are permitted, or require some form of secure authentication
     * before proceeding.
     */
    public static final String EXTRA_SECURE = "android.speech.extras.EXTRA_SECURE";

    /**
     * The minimum length of an utterance. We will not stop recording before this amount of time.
     *