From ccc6e57848dc5ddc2e3448497517c1c38f8c3482 Mon Sep 17 00:00:00 2001 From: Cedric Ho Date: Mon, 27 Apr 2015 15:01:46 -0700 Subject: [PATCH] Add android.speech.RecognizerIntent EXTRA_PREFER_OFFLINE to indicate whether to only use an offline speech recognition engine. Change-Id: I15fe9b31f74af1438a018a76a9c7755b43bdc835 --- api/current.txt | 3 ++- api/system-current.txt | 3 ++- core/java/android/speech/RecognizerIntent.java | 8 ++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/api/current.txt b/api/current.txt index df77416c2b734..6c21f88087d76 100644 --- a/api/current.txt +++ b/api/current.txt @@ -29202,6 +29202,7 @@ package android.speech { field public static final java.lang.String EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE = "android.speech.extra.ONLY_RETURN_LANGUAGE_PREFERENCE"; field public static final java.lang.String EXTRA_ORIGIN = "android.speech.extra.ORIGIN"; field public static final java.lang.String EXTRA_PARTIAL_RESULTS = "android.speech.extra.PARTIAL_RESULTS"; + field public static final java.lang.String EXTRA_PREFER_OFFLINE = "android.speech.extra.PREFER_OFFLINE"; field public static final java.lang.String EXTRA_PROMPT = "android.speech.extra.PROMPT"; 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"; @@ -30428,7 +30429,6 @@ package android.telecom { public static abstract class InCallService.VideoCall { ctor public InCallService.VideoCall(); method public abstract void registerCallback(android.telecom.InCallService.VideoCall.Callback); - method public abstract void unregisterCallback(); method public abstract void requestCallDataUsage(); method public abstract void requestCameraCapabilities(); method public abstract void sendSessionModifyRequest(android.telecom.VideoProfile); @@ -30439,6 +30439,7 @@ package android.telecom { method public abstract void setPauseImage(java.lang.String); method public abstract void setPreviewSurface(android.view.Surface); method public abstract void setZoom(float); + method public abstract void unregisterCallback(); } public static abstract class InCallService.VideoCall.Callback { diff --git a/api/system-current.txt b/api/system-current.txt index e10a8b2548dac..4946104b53576 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -31309,6 +31309,7 @@ package android.speech { field public static final java.lang.String EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE = "android.speech.extra.ONLY_RETURN_LANGUAGE_PREFERENCE"; field public static final java.lang.String EXTRA_ORIGIN = "android.speech.extra.ORIGIN"; field public static final java.lang.String EXTRA_PARTIAL_RESULTS = "android.speech.extra.PARTIAL_RESULTS"; + field public static final java.lang.String EXTRA_PREFER_OFFLINE = "android.speech.extra.PREFER_OFFLINE"; field public static final java.lang.String EXTRA_PROMPT = "android.speech.extra.PROMPT"; 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"; @@ -32545,7 +32546,6 @@ package android.telecom { public static abstract class InCallService.VideoCall { ctor public InCallService.VideoCall(); method public abstract void registerCallback(android.telecom.InCallService.VideoCall.Callback); - method public abstract void unregisterCallback(); method public abstract void requestCallDataUsage(); method public abstract void requestCameraCapabilities(); method public abstract void sendSessionModifyRequest(android.telecom.VideoProfile); @@ -32556,6 +32556,7 @@ package android.telecom { method public abstract void setPauseImage(java.lang.String); method public abstract void setPreviewSurface(android.view.Surface); method public abstract void setZoom(float); + method public abstract void unregisterCallback(); } public static abstract class InCallService.VideoCall.Callback { diff --git a/core/java/android/speech/RecognizerIntent.java b/core/java/android/speech/RecognizerIntent.java index e991d84807c18..ce94315c4225a 100644 --- a/core/java/android/speech/RecognizerIntent.java +++ b/core/java/android/speech/RecognizerIntent.java @@ -403,4 +403,12 @@ public class RecognizerIntent { */ public static final String EXTRA_SUPPORTED_LANGUAGES = "android.speech.extra.SUPPORTED_LANGUAGES"; + + /** + * Optional boolean, to be used with {@link #ACTION_RECOGNIZE_SPEECH}, + * {@link #ACTION_VOICE_SEARCH_HANDS_FREE}, {@link #ACTION_WEB_SEARCH} to indicate whether to + * only use an offline speech recognition engine. The default is false, meaning that either + * network or offline recognition engines may be used. + */ + public static final String EXTRA_PREFER_OFFLINE = "android.speech.extra.PREFER_OFFLINE"; }