Fix crash in STK.
This was fixed in factory rom but was a do not merge, see change:
If3f9d1468562a5e7f948156aa8395525665bc9ff
and thus didn't make it to ics-mr1. With this change,
StkAppService.java is now identical to the version in master.
Bug: 5489975
Change-Id: Ieba6e35a8c70342c22341247ee855f26faab4934
diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java
index 54698dc..9b3252d 100644
--- a/src/com/android/stk/StkAppService.java
+++ b/src/com/android/stk/StkAppService.java
@@ -648,13 +648,10 @@
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) {
CatLog.d(this, "settings.url = " + settings.url);
if ((settings.url.startsWith("http://") || (settings.url.startsWith("https://")))) {
@@ -675,14 +672,13 @@
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: