diff options
author | Paul Jensen <pauljensen@google.com> | 2014-10-17 22:09:37 -0400 |
---|---|---|
committer | Paul Jensen <pauljensen@google.com> | 2014-10-18 15:33:33 -0400 |
commit | d96c5fc70a7b595358cf020dcbbba559eb50d4f1 (patch) | |
tree | 8716a1f330cbe04b35a278713cf6b1def1da9590 /src/com | |
parent | 2fb9c773761b1375c86963ebb8f3bb3bec18e479 (diff) | |
download | packages_apps_Settings-d96c5fc70a7b595358cf020dcbbba559eb50d4f1.tar.gz packages_apps_Settings-d96c5fc70a7b595358cf020dcbbba559eb50d4f1.tar.bz2 packages_apps_Settings-d96c5fc70a7b595358cf020dcbbba559eb50d4f1.zip |
Launch browser directly when user selects "Mobile Plan".
Previously this used to send a broadcast to ConnectivityService
which would in turn launch the web browser. The ConnectivityService
code has since been removed, so just launch the browser directly.
bug:17472930
Change-Id: I5d419348efbb56b6c3c0fdbb8663efd0cfb2dde9
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/settings/WirelessSettings.java | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/com/android/settings/WirelessSettings.java b/src/com/android/settings/WirelessSettings.java index 9cb3d72f8..09d4a54a5 100644 --- a/src/com/android/settings/WirelessSettings.java +++ b/src/com/android/settings/WirelessSettings.java @@ -21,6 +21,7 @@ import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.app.admin.DevicePolicyManager; +import android.content.ActivityNotFoundException; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; @@ -29,6 +30,7 @@ import android.content.pm.PackageManager; import android.content.res.Resources; import android.net.ConnectivityManager; import android.net.NetworkInfo; +import android.net.Uri; import android.nfc.NfcAdapter; import android.nfc.NfcManager; import android.os.Bundle; @@ -118,8 +120,6 @@ public class WirelessSettings extends SettingsPreferenceFragment } private String mManageMobilePlanMessage; - private static final String CONNECTED_TO_PROVISIONING_NETWORK_ACTION - = "com.android.server.connectivityservice.CONNECTED_TO_PROVISIONING_NETWORK_ACTION"; public void onManageMobilePlanClick() { log("onManageMobilePlanClick:"); mManageMobilePlanMessage = null; @@ -143,11 +143,16 @@ public class WirelessSettings extends SettingsPreferenceFragment // Get provisioning URL String url = mCm.getMobileProvisioningUrl(); if (!TextUtils.isEmpty(url)) { - Intent intent = new Intent(CONNECTED_TO_PROVISIONING_NETWORK_ACTION); - intent.putExtra("EXTRA_URL", url); - Context context = getActivity().getBaseContext(); - context.sendBroadcast(intent); - mManageMobilePlanMessage = null; + Intent intent = Intent.makeMainSelectorActivity(Intent.ACTION_MAIN, + Intent.CATEGORY_APP_BROWSER); + intent.setData(Uri.parse(url)); + intent.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT | + Intent.FLAG_ACTIVITY_NEW_TASK); + try { + startActivity(intent); + } catch (ActivityNotFoundException e) { + Log.w(TAG, "onManageMobilePlanClick: startActivity failed" + e); + } } else { // No provisioning URL String operatorName = mTm.getSimOperatorName(); |