Index: content/public/android/java/src/org/chromium/content/browser/SpeechRecognition.java |
diff --git a/content/public/android/java/src/org/chromium/content/browser/SpeechRecognition.java b/content/public/android/java/src/org/chromium/content/browser/SpeechRecognition.java |
index 7df3c659590f73dbf6e259a5a837eaf675b30f55..77d60e57219eb032fb66a77c06b662f24b33a12a 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/SpeechRecognition.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/SpeechRecognition.java |
@@ -19,6 +19,7 @@ import android.speech.SpeechRecognizer; |
import org.chromium.base.CalledByNative; |
import org.chromium.base.JNINamespace; |
+import org.chromium.content_public.common.SpeechRecognitionErrorCode; |
import java.util.ArrayList; |
import java.util.List; |
@@ -89,30 +90,30 @@ public class SpeechRecognition { |
@Override |
public void onError(int error) { |
- int code = SpeechRecognitionError.NONE; |
+ int code = SpeechRecognitionErrorCode.NONE; |
// Translate Android SpeechRecognizer errors to Web Speech API errors. |
switch(error) { |
case SpeechRecognizer.ERROR_AUDIO: |
- code = SpeechRecognitionError.AUDIO; |
+ code = SpeechRecognitionErrorCode.AUDIO; |
break; |
case SpeechRecognizer.ERROR_CLIENT: |
- code = SpeechRecognitionError.ABORTED; |
+ code = SpeechRecognitionErrorCode.ABORTED; |
break; |
case SpeechRecognizer.ERROR_RECOGNIZER_BUSY: |
case SpeechRecognizer.ERROR_INSUFFICIENT_PERMISSIONS: |
- code = SpeechRecognitionError.NOT_ALLOWED; |
+ code = SpeechRecognitionErrorCode.NOT_ALLOWED; |
break; |
case SpeechRecognizer.ERROR_NETWORK_TIMEOUT: |
case SpeechRecognizer.ERROR_NETWORK: |
case SpeechRecognizer.ERROR_SERVER: |
- code = SpeechRecognitionError.NETWORK; |
+ code = SpeechRecognitionErrorCode.NETWORK; |
break; |
case SpeechRecognizer.ERROR_NO_MATCH: |
- code = SpeechRecognitionError.NO_MATCH; |
+ code = SpeechRecognitionErrorCode.NO_MATCH; |
break; |
case SpeechRecognizer.ERROR_SPEECH_TIMEOUT: |
- code = SpeechRecognitionError.NO_SPEECH; |
+ code = SpeechRecognitionErrorCode.NO_SPEECH; |
break; |
default: |
assert false; |
@@ -142,7 +143,7 @@ public class SpeechRecognition { |
// We assume that onResults is called only once, at the end of a session, thus we |
// terminate. If one day the recognition provider changes dictation mode behavior to |
// call onResults several times, we should terminate only if (!mContinuous). |
- terminate(SpeechRecognitionError.NONE); |
+ terminate(SpeechRecognitionErrorCode.NONE); |
} |
@Override |
@@ -237,7 +238,7 @@ public class SpeechRecognition { |
mState = STATE_IDLE; |
} |
- if (error != SpeechRecognitionError.NONE) |
+ if (error != SpeechRecognitionErrorCode.NONE) |
nativeOnRecognitionError(mNativeSpeechRecognizerImplAndroid, error); |
mRecognizer.destroy(); |
@@ -270,7 +271,7 @@ public class SpeechRecognition { |
return; |
mRecognizer.cancel(); |
- terminate(SpeechRecognitionError.ABORTED); |
+ terminate(SpeechRecognitionErrorCode.ABORTED); |
} |
@CalledByNative |