Fix crash in STK app when launching browser

The problem was that StkAppService.launchBrowser() was calling

        intent.setClassName("com.android.browser",
                "com.android.browser.BrowserActivity");

when launching the browser.  But in ICS, the browser that's actually
installed is from the package com.google.android.browser, not
com.android.browser.  So right now, the STK crashes if it ever tries to
view a web page.

The fix is for the STK app to just not hardcode the browser package/class
name at all, since if you fire off a VIEW intent with an http: URI in the
data, you'll get whatever the default browser is.  Also, if the STK gets a
request with no URI at all, we bring up http://google.com/ as a default
"home page".

Bug: 5489975
Change-Id: If3f9d1468562a5e7f948156aa8395525665bc9ff
diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java
index a21b240..0ffb9c8 100644
--- a/src/com/android/stk/StkAppService.java
+++ b/src/com/android/stk/StkAppService.java
@@ -648,25 +648,30 @@
         if (settings == null) {
             return;
         }
-        // Set browser launch mode
-        Intent intent = new Intent();
-        intent.setClassName("com.android.browser",
-                "com.android.browser.BrowserActivity");
 
-        // to launch home page, make sure that data Uri is null.
-        Uri data = null;
+        Intent intent = new Intent(Intent.ACTION_VIEW);
+
+        Uri data;
         if (settings.url != null) {
             data = Uri.parse(settings.url);
+        } else {
+            // If no URL specified, just bring up the "home page".
+            //
+            // (Note we need to specify *something* in the intent's data field
+            // here, since if you fire off a VIEW intent with no data at all
+            // you'll get an activity chooser rather than the browser.  There's
+            // no specific URI that means "use the default home page", so
+            // instead let's just explicitly bring up http://google.com.)
+            data = Uri.parse("http://google.com/");
         }
         intent.setData(data);
+
         intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
         switch (settings.mode) {
         case USE_EXISTING_BROWSER:
-            intent.setAction(Intent.ACTION_VIEW);
             intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
             break;
         case LAUNCH_NEW_BROWSER:
-            intent.setAction(Intent.ACTION_VIEW);
             intent.addFlags(Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
             break;
         case LAUNCH_IF_NOT_ALREADY_LAUNCHED: