Merge "Cleaned up data enable code"
diff --git a/src/java/com/android/internal/telephony/CarrierActionAgent.java b/src/java/com/android/internal/telephony/CarrierActionAgent.java
index 4582404..40fe386 100644
--- a/src/java/com/android/internal/telephony/CarrierActionAgent.java
+++ b/src/java/com/android/internal/telephony/CarrierActionAgent.java
@@ -118,6 +118,10 @@
                 log("SET_METERED_APNS_ENABLED: " + mCarrierActionOnMeteredApnEnabled);
                 mMeteredApnEnabledLog.log("SET_METERED_APNS_ENABLED: "
                         + mCarrierActionOnMeteredApnEnabled);
+                int otaspState = (mCarrierActionOnMeteredApnEnabled)
+                        ? mPhone.getServiceStateTracker().getOtasp()
+                        : TelephonyManager.OTASP_SIM_UNPROVISIONED;
+                mPhone.notifyOtaspChanged(otaspState);
                 mMeteredApnEnableRegistrants.notifyRegistrants(
                         new AsyncResult(null, mCarrierActionOnMeteredApnEnabled, null));
                 break;
diff --git a/src/java/com/android/internal/telephony/dataconnection/DcTracker.java b/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
index 5cc7158..ca85e33 100755
--- a/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
+++ b/src/java/com/android/internal/telephony/dataconnection/DcTracker.java
@@ -783,14 +783,6 @@
     private void onSetUserDataEnabled(boolean enabled) {
         if (mDataEnabledSettings.isUserDataEnabled() != enabled) {
             mDataEnabledSettings.setUserDataEnabled(enabled);
-            if (!getDataRoamingEnabled() && mPhone.getServiceState().getDataRoaming()) {
-                if (enabled) {
-                    notifyOffApnsOfAvailability(Phone.REASON_ROAMING_ON);
-                } else {
-                    notifyOffApnsOfAvailability(Phone.REASON_DATA_DISABLED);
-                }
-            }
-
             mPhone.notifyUserMobileDataStateChanged(enabled);
 
             // TODO: We should register for DataEnabledSetting's data enabled/disabled event and
@@ -2188,16 +2180,10 @@
             mDataEnabledSettings.setCarrierDataEnabled(enabled);
 
             if (!enabled) {
-                // Send otasp_sim_unprovisioned so that SuW is able to proceed and notify users
-                mPhone.notifyOtaspChanged(TelephonyManager.OTASP_SIM_UNPROVISIONED);
                 // Tear down all metered apns
                 cleanUpAllConnectionsInternal(true,
                         Phone.REASON_CARRIER_ACTION_DISABLE_METERED_APN);
             } else {
-                // Re-evaluate Otasp state
-                int otaspState = mPhone.getServiceStateTracker().getOtasp();
-                mPhone.notifyOtaspChanged(otaspState);
-
                 reevaluateDataConnections();
                 setupDataOnConnectableApns(Phone.REASON_DATA_ENABLED);
             }