Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 289c2f0d authored by Wink Saville's avatar Wink Saville Committed by Android (Google) Code Review
Browse files

Merge "Use MOBILE_PROVISIONING_ACTION for manage mobile plan." into jb-mr2-dev

parents c7902845 bb77bf22
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ 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.os.Bundle;
import android.os.SystemProperties;
@@ -97,21 +96,22 @@ public class WirelessSettings extends SettingsPreferenceFragment {
    }

    private String mManageMobilePlanMessage;

    private static final String MOBILE_PROVISIONING_ACTION
            = "com.android.server.connectivityservice.MOBILE_PROVISIONING_ACTION";
    public void onManageMobilePlanClick() {
        log("onManageMobilePlanClick:");
        mManageMobilePlanMessage = null;
        Resources resources = getActivity().getResources();

        NetworkInfo ni = mCm.getActiveNetworkInfo();
        NetworkInfo ni = mCm.getProvisioningOrActiveNetworkInfo();
        if (mTm.hasIccCard() && (ni != null)) {
            // Get provisioning URL
            String url = mCm.getMobileProvisioningUrl();
            if (!TextUtils.isEmpty(url)) {
                // Send user to provisioning webpage
                Intent intent = new Intent(Intent.ACTION_VIEW);
                intent.setData(Uri.parse(url));
                startActivity(intent);
                Intent intent = new Intent(MOBILE_PROVISIONING_ACTION);
                intent.putExtra("EXTRA_URL", url);
                Context context = getActivity().getBaseContext();
                context.sendBroadcast(intent);
                mManageMobilePlanMessage = null;
            } else {
                // No provisioning URL