am 289c2f0d
: Merge "Use MOBILE_PROVISIONING_ACTION for manage mobile plan." into jb-mr2-dev
* commit '289c2f0d3013f423849a9485b3044f0a1fc8dd92': Use MOBILE_PROVISIONING_ACTION for manage mobile plan.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user