summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhimanyu Garg <agarg@codeaurora.org>2012-09-04 01:42:25 -0700
committerSteve Kondik <steve@cyngn.com>2015-11-07 13:57:35 -0800
commitd62ce4c42fee9316462dd397fb0ebc0ac86d7a70 (patch)
tree76e5b7680ea94bfbee9b1b5b30f107d63931c6de
parent82be3fe1d462c5f784b4bdea9c90f7c8a5fe2c27 (diff)
downloadpackages_apps_Browser-d62ce4c42fee9316462dd397fb0ebc0ac86d7a70.zip
packages_apps_Browser-d62ce4c42fee9316462dd397fb0ebc0ac86d7a70.tar.gz
packages_apps_Browser-d62ce4c42fee9316462dd397fb0ebc0ac86d7a70.tar.bz2
Adding exception handler for voice recognition activity
CRs-Fixed: 395193 Change-Id: Icedba4ef192d56dfcc9918b2f8afe96b2c662fb9
-rw-r--r--src/com/android/browser/Controller.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 3a68f4b..ebc2c90 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -2768,11 +2768,15 @@ public class Controller
@Override
public void startVoiceRecognizer() {
- Intent voice = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
- voice.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
- RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
- voice.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1);
- mActivity.startActivityForResult(voice, VOICE_RESULT);
+ try {
+ Intent voice = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
+ voice.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
+ RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
+ voice.putExtra(RecognizerIntent.EXTRA_MAX_RESULTS, 1);
+ mActivity.startActivityForResult(voice, VOICE_RESULT);
+ } catch(android.content.ActivityNotFoundException ex) {
+ Log.e(LOGTAG, "Could not start voice recognizer activity");
+ }
}
@Override