LAUNCH_BROWSER cmd should not be handled by Setup Wizard application
WebDialogActivity implemented in com.google.android.setupwizard.util is
Launched instead of a browser if Intent.ACTION_VIEW is broadcasted
with http/https schemes when the phone setup has not been
completed. WebDialogActivity cannot always handle user operations
on a carrier's SIM activation page which was displayed
because of the request from SIM, so it's better NOT to broadcast the
intent if the phone setup has not completed yet.
Bug: 29085544
Change-Id: I0ce7a4f87f477f13bd28ffb96bac23e75b67859d
diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java
index 0b19f9e..ccf5a20 100644
--- a/src/com/android/stk/StkAppService.java
+++ b/src/com/android/stk/StkAppService.java
@@ -916,6 +916,13 @@
launchEventMessage(slotId);
break;
case LAUNCH_BROWSER:
+ // The device setup process should not be interrupted by launching browser.
+ if (Settings.Global.getInt(mContext.getContentResolver(),
+ Settings.Global.DEVICE_PROVISIONED, 0) == 0) {
+ CatLog.d(this, "The command is not performed if the setup has not been completed.");
+ sendScreenBusyResponse(slotId);
+ break;
+ }
TextMessage alphaId = mStkContext[slotId].mCurrentCmd.geTextMessage();
if ((mStkContext[slotId].mCurrentCmd.getBrowserSettings().mode
== LaunchBrowserMode.LAUNCH_IF_NOT_ALREADY_LAUNCHED) &&