public void onManageMobilePlanClick() {
    log("onManageMobilePlanClick:");
    mManageMobilePlanMessage = null;
    Resources resources = getActivity().getResources();

    NetworkInfo ni = mCm.getProvisioningOrActiveNetworkInfo();
    if (mTm.hasIccCard() && (ni != null)) {
      // 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;
      } else {
        // No provisioning URL
        String operatorName = mTm.getSimOperatorName();
        if (TextUtils.isEmpty(operatorName)) {
          // Use NetworkOperatorName as second choice in case there is no
          // SPN (Service Provider Name on the SIM). Such as with T-mobile.
          operatorName = mTm.getNetworkOperatorName();
          if (TextUtils.isEmpty(operatorName)) {
            mManageMobilePlanMessage = resources.getString(R.string.mobile_unknown_sim_operator);
          } else {
            mManageMobilePlanMessage =
                resources.getString(R.string.mobile_no_provisioning_url, operatorName);
          }
        } else {
          mManageMobilePlanMessage =
              resources.getString(R.string.mobile_no_provisioning_url, operatorName);
        }
      }
    } else if (mTm.hasIccCard() == false) {
      // No sim card
      mManageMobilePlanMessage = resources.getString(R.string.mobile_insert_sim_card);
    } else {
      // NetworkInfo is null, there is no connection
      mManageMobilePlanMessage = resources.getString(R.string.mobile_connect_to_internet);
    }
    if (!TextUtils.isEmpty(mManageMobilePlanMessage)) {
      log("onManageMobilePlanClick: message=" + mManageMobilePlanMessage);
      showDialog(MANAGE_MOBILE_PLAN_DIALOG_ID);
    }
  }