summaryrefslogtreecommitdiffstats
path: root/core/java/android/speech/RecognizerIntent.java
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2012-05-17 14:18:39 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2012-05-17 15:43:40 -0700
commit482c9bb390f1dae8e55806431a960f9df4d2f0b8 (patch)
treed7931def437cbf09b8d95403a4d0efa6a1b1f62a /core/java/android/speech/RecognizerIntent.java
parentd51a68b3d2d347be989b53af1777454f97ad9b46 (diff)
downloadframeworks_base-482c9bb390f1dae8e55806431a960f9df4d2f0b8.zip
frameworks_base-482c9bb390f1dae8e55806431a960f9df4d2f0b8.tar.gz
frameworks_base-482c9bb390f1dae8e55806431a960f9df4d2f0b8.tar.bz2
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
Diffstat (limited to 'core/java/android/speech/RecognizerIntent.java')
-rw-r--r--core/java/android/speech/RecognizerIntent.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/core/java/android/speech/RecognizerIntent.java b/core/java/android/speech/RecognizerIntent.java
index fd709f2..457e66c 100644
--- a/core/java/android/speech/RecognizerIntent.java
+++ b/core/java/android/speech/RecognizerIntent.java
@@ -115,6 +115,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.
*
* Note that it is extremely rare you'd want to specify this value in an intent. If you don't