diff --git a/ailib/src/main/java/ai/api/services/GoogleRecognitionServiceImpl.java b/ailib/src/main/java/ai/api/services/GoogleRecognitionServiceImpl.java index 766c61f..bf945bb 100644 --- a/ailib/src/main/java/ai/api/services/GoogleRecognitionServiceImpl.java +++ b/ailib/src/main/java/ai/api/services/GoogleRecognitionServiceImpl.java @@ -66,7 +66,6 @@ public class GoogleRecognitionServiceImpl extends AIService { private final Handler handler; private volatile boolean wasReadyForSpeech; - private String googleRecognizerVersion; private final Map errorMessages = new HashMap(); @@ -93,13 +92,11 @@ public GoogleRecognitionServiceImpl(final Context context, final AIConfiguration } handler = new Handler(context.getMainLooper()); - - googleRecognizerVersion = RecognizerChecker.getGoogleRecognizerVersion(context); } protected void initializeRecognizer() { - if (speechRecognizer != null && affectedWithGoogleSearchProblem()) { + if (speechRecognizer != null) { return; } @@ -282,19 +279,6 @@ private void runInUiThread(final Runnable runnable) { handler.post(runnable); } - /** - * Workaround for http://stackoverflow.com/questions/31071650/speechrecognizer-throws-onerror-on-the-first-listening - * @return - */ - private boolean affectedWithGoogleSearchProblem() { - if (googleRecognizerVersion != null) { - if (googleRecognizerVersion.contains("4.7.13.19")) { - return true; - } - } - return false; - } - private class InternalRecognitionListener implements RecognitionListener { @Override @@ -331,11 +315,7 @@ public void onEndOfSpeech() { @Override public void onError(final int error) { - - // workaround for http://stackoverflow.com/questions/31071650/speechrecognizer-throws-onerror-on-the-first-listening - if (error == SpeechRecognizer.ERROR_NO_MATCH - && affectedWithGoogleSearchProblem() - && !wasReadyForSpeech) { + if (error == SpeechRecognizer.ERROR_NO_MATCH && !wasReadyForSpeech) { return; }