aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/voice/VoiceInput.java
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2010-03-30 10:05:53 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2010-03-30 10:29:41 -0700
commit06933183c8b4935f22e793d9f715907653074d2c (patch)
tree57b5301c27c01cd9820e27e65844cc56fc31a4b4 /java/src/com/android/inputmethod/voice/VoiceInput.java
parent7f4f7b877a1db0b3e6dfc8b7add31f9fa802ee32 (diff)
downloadlatinime-06933183c8b4935f22e793d9f715907653074d2c.tar.gz
latinime-06933183c8b4935f22e793d9f715907653074d2c.tar.xz
latinime-06933183c8b4935f22e793d9f715907653074d2c.zip
Fix bug 2553592 API REVIEW: android.speech
Change 3 of 4 Notes from API Council review: Rename RecognitionManager to SpeechRecognizer Change-Id: Ieea0ade975b7c01f1fccb83a78a5b8f75e0c62de
Diffstat (limited to 'java/src/com/android/inputmethod/voice/VoiceInput.java')
-rw-r--r--java/src/com/android/inputmethod/voice/VoiceInput.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/java/src/com/android/inputmethod/voice/VoiceInput.java b/java/src/com/android/inputmethod/voice/VoiceInput.java
index 72cb2f902..ac06ab50d 100644
--- a/java/src/com/android/inputmethod/voice/VoiceInput.java
+++ b/java/src/com/android/inputmethod/voice/VoiceInput.java
@@ -26,7 +26,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.speech.RecognitionListener;
-import android.speech.RecognitionManager;
+import android.speech.SpeechRecognizer;
import android.speech.RecognizerIntent;
import android.util.Log;
import android.view.View;
@@ -134,7 +134,7 @@ public class VoiceInput implements OnClickListener {
public void onCancelVoice();
}
- private RecognitionManager mRecognitionManager;
+ private SpeechRecognizer mSpeechRecognizer;
private RecognitionListener mRecognitionListener;
private RecognitionView mRecognitionView;
private UiListener mUiListener;
@@ -147,8 +147,8 @@ public class VoiceInput implements OnClickListener {
public VoiceInput(Context context, UiListener uiHandler) {
mLogger = VoiceInputLogger.getLogger(context);
mRecognitionListener = new ImeRecognitionListener();
- mRecognitionManager = RecognitionManager.createRecognitionManager(context);
- mRecognitionManager.setRecognitionListener(mRecognitionListener);
+ mSpeechRecognizer = SpeechRecognizer.createSpeechRecognizer(context);
+ mSpeechRecognizer.setRecognitionListener(mRecognitionListener);
mUiListener = uiHandler;
mContext = context;
newView();
@@ -334,7 +334,7 @@ public class VoiceInput implements OnClickListener {
EXTRA_SPEECH_INPUT_POSSIBLY_COMPLETE_SILENCE_LENGTH_MILLIS,
null /* rely on endpointer default */);
- mRecognitionManager.startListening(intent);
+ mSpeechRecognizer.startListening(intent);
}
/**
@@ -357,7 +357,7 @@ public class VoiceInput implements OnClickListener {
}
public void destroy() {
- mRecognitionManager.destroy();
+ mSpeechRecognizer.destroy();
}
/**
@@ -484,7 +484,7 @@ public class VoiceInput implements OnClickListener {
// Remove all pending tasks (e.g., timers to cancel voice input)
mHandler.removeMessages(MSG_CLOSE_ERROR_DIALOG);
- mRecognitionManager.cancel();
+ mSpeechRecognizer.cancel();
mUiListener.onCancelVoice();
mRecognitionView.finish();
}
@@ -492,20 +492,20 @@ public class VoiceInput implements OnClickListener {
private int getErrorStringId(int errorType, boolean endpointed) {
switch (errorType) {
// We use CLIENT_ERROR to signify that voice search is not available on the device.
- case RecognitionManager.ERROR_CLIENT:
+ case SpeechRecognizer.ERROR_CLIENT:
return R.string.voice_not_installed;
- case RecognitionManager.ERROR_NETWORK:
+ case SpeechRecognizer.ERROR_NETWORK:
return R.string.voice_network_error;
- case RecognitionManager.ERROR_NETWORK_TIMEOUT:
+ case SpeechRecognizer.ERROR_NETWORK_TIMEOUT:
return endpointed ?
R.string.voice_network_error : R.string.voice_too_much_speech;
- case RecognitionManager.ERROR_AUDIO:
+ case SpeechRecognizer.ERROR_AUDIO:
return R.string.voice_audio_error;
- case RecognitionManager.ERROR_SERVER:
+ case SpeechRecognizer.ERROR_SERVER:
return R.string.voice_server_error;
- case RecognitionManager.ERROR_SPEECH_TIMEOUT:
+ case SpeechRecognizer.ERROR_SPEECH_TIMEOUT:
return R.string.voice_speech_timeout;
- case RecognitionManager.ERROR_NO_MATCH:
+ case SpeechRecognizer.ERROR_NO_MATCH:
return R.string.voice_no_match;
default: return R.string.voice_error;
}
@@ -562,7 +562,7 @@ public class VoiceInput implements OnClickListener {
public void onResults(Bundle resultsBundle) {
List<String> results = resultsBundle
- .getStringArrayList(RecognitionManager.RESULTS_RECOGNITION);
+ .getStringArrayList(SpeechRecognizer.RESULTS_RECOGNITION);
mState = DEFAULT;
final Map<String, List<CharSequence>> alternatives =