Fix issue where clicking voice search showed "App isn't installed"

Bug: 6466523
Change-Id: I73137e5ce1bb4f8ebf091cae153a59a45083e0de
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 6025c70..0bb119b 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -1862,7 +1862,7 @@
             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 @@
         }
     }
 
-    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 @@
                 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 @@
         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);