Skip to content

Commit c79a9ea

Browse files
jmtriviAndroid (Google) Code Review
authored andcommitted
Merge "New action and extra in RecognizerIntent for "hands free" voice search" into jb-dev
2 parents ede4d56 + 482c9bb commit c79a9ea

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

api/16.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19690,6 +19690,7 @@ package android.speech {
1969019690
method public static final android.content.Intent getVoiceDetailsIntent(android.content.Context);
1969119691
field public static final java.lang.String ACTION_GET_LANGUAGE_DETAILS = "android.speech.action.GET_LANGUAGE_DETAILS";
1969219692
field public static final java.lang.String ACTION_RECOGNIZE_SPEECH = "android.speech.action.RECOGNIZE_SPEECH";
19693+
field public static final java.lang.String ACTION_VOICE_SEARCH_HANDS_FREE = "android.speech.action.VOICE_SEARCH_HANDS_FREE";
1969319694
field public static final java.lang.String ACTION_WEB_SEARCH = "android.speech.action.WEB_SEARCH";
1969419695
field public static final java.lang.String DETAILS_META_DATA = "android.speech.DETAILS";
1969519696
field public static final java.lang.String EXTRA_CALLING_PACKAGE = "calling_package";
@@ -19705,6 +19706,7 @@ package android.speech {
1970519706
field public static final java.lang.String EXTRA_RESULTS = "android.speech.extra.RESULTS";
1970619707
field public static final java.lang.String EXTRA_RESULTS_PENDINGINTENT = "android.speech.extra.RESULTS_PENDINGINTENT";
1970719708
field public static final java.lang.String EXTRA_RESULTS_PENDINGINTENT_BUNDLE = "android.speech.extra.RESULTS_PENDINGINTENT_BUNDLE";
19709+
field public static final java.lang.String EXTRA_SECURE = "android.speech.extras.EXTRA_SECURE";
1970819710
field public static final java.lang.String EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS = "android.speech.extras.SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS";
1970919711
field public static final java.lang.String EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS = "android.speech.extras.SPEECH_INPUT_MINIMUM_LENGTH_MILLIS";
1971019712
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";

api/current.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19690,6 +19690,7 @@ package android.speech {
1969019690
method public static final android.content.Intent getVoiceDetailsIntent(android.content.Context);
1969119691
field public static final java.lang.String ACTION_GET_LANGUAGE_DETAILS = "android.speech.action.GET_LANGUAGE_DETAILS";
1969219692
field public static final java.lang.String ACTION_RECOGNIZE_SPEECH = "android.speech.action.RECOGNIZE_SPEECH";
19693+
field public static final java.lang.String ACTION_VOICE_SEARCH_HANDS_FREE = "android.speech.action.VOICE_SEARCH_HANDS_FREE";
1969319694
field public static final java.lang.String ACTION_WEB_SEARCH = "android.speech.action.WEB_SEARCH";
1969419695
field public static final java.lang.String DETAILS_META_DATA = "android.speech.DETAILS";
1969519696
field public static final java.lang.String EXTRA_CALLING_PACKAGE = "calling_package";
@@ -19705,6 +19706,7 @@ package android.speech {
1970519706
field public static final java.lang.String EXTRA_RESULTS = "android.speech.extra.RESULTS";
1970619707
field public static final java.lang.String EXTRA_RESULTS_PENDINGINTENT = "android.speech.extra.RESULTS_PENDINGINTENT";
1970719708
field public static final java.lang.String EXTRA_RESULTS_PENDINGINTENT_BUNDLE = "android.speech.extra.RESULTS_PENDINGINTENT_BUNDLE";
19709+
field public static final java.lang.String EXTRA_SECURE = "android.speech.extras.EXTRA_SECURE";
1970819710
field public static final java.lang.String EXTRA_SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS = "android.speech.extras.SPEECH_INPUT_COMPLETE_SILENCE_LENGTH_MILLIS";
1970919711
field public static final java.lang.String EXTRA_SPEECH_INPUT_MINIMUM_LENGTH_MILLIS = "android.speech.extras.SPEECH_INPUT_MINIMUM_LENGTH_MILLIS";
1971019712
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";

core/java/android/speech/RecognizerIntent.java

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,45 @@ private RecognizerIntent() {
114114
*/
115115
public static final String ACTION_WEB_SEARCH = "android.speech.action.WEB_SEARCH";
116116

117+
/**
118+
* Starts an activity that will prompt the user for speech without requiring the user's
119+
* visual attention or touch input. It will send it through a speech recognizer,
120+
* and either synthesize speech for a web search result or trigger
121+
* another type of action based on the user's speech.
122+
*
123+
* This activity may be launched while device is locked in a secure mode.
124+
* Special care must be taken to ensure that the voice actions that are performed while
125+
* hands free cannot compromise the device's security.
126+
* The activity should check the value of the {@link #EXTRA_SECURE} extra to determine
127+
* whether the device has been securely locked. If so, the activity should either restrict
128+
* the set of voice actions that are permitted or require some form of secure
129+
* authentication before proceeding.
130+
*
131+
* To ensure that the activity's user interface is visible while the lock screen is showing,
132+
* the activity should set the
133+
* {@link android.view.WindowManager.LayoutParams#FLAG_SHOW_WHEN_LOCKED} window flag.
134+
* Otherwise the activity's user interface may be hidden by the lock screen. The activity
135+
* should take care not to leak private information when the device is securely locked.
136+
*
137+
* <p>Optional extras:
138+
* <ul>
139+
* <li>{@link #EXTRA_SECURE}
140+
* </ul>
141+
*/
142+
public static final String ACTION_VOICE_SEARCH_HANDS_FREE =
143+
"android.speech.action.VOICE_SEARCH_HANDS_FREE";
144+
145+
/**
146+
* Optional boolean to indicate that a "hands free" voice search was performed while the device
147+
* was in a secure mode. An example of secure mode is when the device's screen lock is active,
148+
* and it requires some form of authentication to be unlocked.
149+
*
150+
* When the device is securely locked, the voice search activity should either restrict
151+
* the set of voice actions that are permitted, or require some form of secure authentication
152+
* before proceeding.
153+
*/
154+
public static final String EXTRA_SECURE = "android.speech.extras.EXTRA_SECURE";
155+
117156
/**
118157
* The minimum length of an utterance. We will not stop recording before this amount of time.
119158
*

0 commit comments

Comments
 (0)