diff options
author | Michael Jurka <mikejurka@google.com> | 2012-05-09 11:23:23 -0700 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2012-05-09 11:41:08 -0700 |
commit | 86a720e4927a997e9fd98276d2dab67244138f79 (patch) | |
tree | c333daf570516ce02fea2e9f1bd753ca63af6308 /src/com/android | |
parent | de0fb8fbf11caac382589ab464b50d528942273a (diff) | |
download | android_packages_apps_Trebuchet-86a720e4927a997e9fd98276d2dab67244138f79.tar.gz android_packages_apps_Trebuchet-86a720e4927a997e9fd98276d2dab67244138f79.tar.bz2 android_packages_apps_Trebuchet-86a720e4927a997e9fd98276d2dab67244138f79.zip |
Fix issue where clicking voice search showed "App isn't installed"
Bug: 6466523
Change-Id: I73137e5ce1bb4f8ebf091cae153a59a45083e0de
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 6025c701f..0bb119b31 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -1862,7 +1862,7 @@ public final class Launcher extends Activity if (activityName != null) { intent.setPackage(activityName.getPackageName()); } - startActivitySafely(null, intent, "onClickVoiceButton"); + startActivity(null, intent, "onClickVoiceButton"); } catch (ActivityNotFoundException e) { Intent intent = new Intent(RecognizerIntent.ACTION_WEB_SEARCH); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK @@ -1919,7 +1919,7 @@ public final class Launcher extends Activity } } - boolean startActivitySafely(View v, Intent intent, Object tag) { + boolean startActivity(View v, Intent intent, Object tag) { intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); try { @@ -1936,9 +1936,6 @@ public final class Launcher extends Activity startActivity(intent); } return true; - } catch (ActivityNotFoundException e) { - Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show(); - Log.e(TAG, "Unable to launch. tag=" + tag + " intent=" + intent, e); } catch (SecurityException e) { Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show(); Log.e(TAG, "Launcher does not have the permission to launch " + intent + @@ -1949,6 +1946,17 @@ public final class Launcher extends Activity return false; } + boolean startActivitySafely(View v, Intent intent, Object tag) { + boolean success = false; + try { + success = startActivity(v, intent, tag); + } catch (ActivityNotFoundException e) { + Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT).show(); + Log.e(TAG, "Unable to launch. tag=" + tag + " intent=" + intent, e); + } + return success; + } + void startActivityForResultSafely(Intent intent, int requestCode) { try { startActivityForResult(intent, requestCode); |