diff options
| author | 2010-02-26 15:21:29 -0800 | |
|---|---|---|
| committer | 2010-02-26 15:21:29 -0800 | |
| commit | 59dc9ecec6e4f53a1a2934b08c7f779d2b0a0d9a (patch) | |
| tree | 4e671e2bb06ee360838c10a70d380f73f6ba79be | |
| parent | d84aca7d3c5e51567e5ed25585d1b1d9629b2d93 (diff) | |
| parent | 340acd870ad05ec7b18ea4d7b3f6fa31b2360dd4 (diff) | |
Merge "Add an extra which allows to query *only* for the voice search language preference. This will be used by e.g. LatinIME to avoid extra computation when this is all that's needed (probably a common use case for this API)."
| -rw-r--r-- | api/current.xml | 11 | ||||
| -rw-r--r-- | core/java/android/speech/RecognizerIntent.java | 9 |
2 files changed, 20 insertions, 0 deletions
diff --git a/api/current.xml b/api/current.xml index ea7bc0840f30..ad1df1abca1b 100644 --- a/api/current.xml +++ b/api/current.xml @@ -138421,6 +138421,17 @@ visibility="public" > </field> +<field name="EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.speech.extra.ONLY_RETURN_LANGUAGE_PREFERENCE"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="EXTRA_PARTIAL_RESULTS" type="java.lang.String" transient="false" diff --git a/core/java/android/speech/RecognizerIntent.java b/core/java/android/speech/RecognizerIntent.java index bf411e1bce01..d55a9431d1d2 100644 --- a/core/java/android/speech/RecognizerIntent.java +++ b/core/java/android/speech/RecognizerIntent.java @@ -298,6 +298,15 @@ public class RecognizerIntent { "android.speech.action.GET_LANGUAGE_DETAILS"; /** + * Specify this boolean extra in a broadcast of {@link #ACTION_GET_LANGUAGE_DETAILS} to + * indicate that only the current language preference is needed in the response. This + * avoids any additional computation if all you need is {@link #EXTRA_LANGUAGE_PREFERENCE} + * in the response. + */ + public static final String EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE = + "android.speech.extra.ONLY_RETURN_LANGUAGE_PREFERENCE"; + + /** * The key to the extra in the {@link Bundle} returned by {@link #ACTION_GET_LANGUAGE_DETAILS} * which is a {@link String} that represents the current language preference this user has * specified - a locale string like "en-US". |