Removed old data stack

Fix: 201830726
Test: Manual
Change-Id: I798b17a59c0288b0ceccd8115631c2c87e8e0aeb
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 66cef64..f1f0a68 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -184,7 +184,6 @@
 import com.android.internal.telephony.TelephonyIntents;
 import com.android.internal.telephony.TelephonyPermissions;
 import com.android.internal.telephony.data.DataUtils;
-import com.android.internal.telephony.dataconnection.ApnSettingUtils;
 import com.android.internal.telephony.emergency.EmergencyNumberTracker;
 import com.android.internal.telephony.euicc.EuiccConnector;
 import com.android.internal.telephony.ims.ImsResolver;
@@ -2861,13 +2860,8 @@
             int subId = mSubscriptionController.getDefaultDataSubId();
             final Phone phone = getPhone(subId);
             if (phone != null) {
-                if (phone.isUsingNewDataStack()) {
-                    phone.getDataSettingsManager().setDataEnabled(
-                            TelephonyManager.DATA_ENABLED_REASON_USER, true, callingPackage);
-                } else {
-                    phone.getDataEnabledSettings().setDataEnabled(
-                            TelephonyManager.DATA_ENABLED_REASON_USER, true);
-                }
+                phone.getDataSettingsManager().setDataEnabled(
+                        TelephonyManager.DATA_ENABLED_REASON_USER, true, callingPackage);
                 return true;
             } else {
                 return false;
@@ -2887,13 +2881,8 @@
             int subId = mSubscriptionController.getDefaultDataSubId();
             final Phone phone = getPhone(subId);
             if (phone != null) {
-                if (phone.isUsingNewDataStack()) {
-                    phone.getDataSettingsManager().setDataEnabled(
-                            TelephonyManager.DATA_ENABLED_REASON_USER, false, callingPackage);
-                } else {
-                    phone.getDataEnabledSettings().setDataEnabled(
-                            TelephonyManager.DATA_ENABLED_REASON_USER, false);
-                }
+                phone.getDataSettingsManager().setDataEnabled(
+                        TelephonyManager.DATA_ENABLED_REASON_USER, false, callingPackage);
                 return true;
             } else {
                 return false;
@@ -3009,10 +2998,7 @@
         try {
             final Phone phone = getPhone(subId);
             if (phone != null) {
-                if (phone.isUsingNewDataStack()) {
-                    return phone.getDataNetworkController().getInternetDataNetworkState();
-                }
-                return PhoneConstantConversions.convertDataState(phone.getDataConnectionState());
+                return phone.getDataNetworkController().getInternetDataNetworkState();
             } else {
                 return PhoneConstantConversions.convertDataState(
                         PhoneConstants.DataState.DISCONNECTED);
@@ -6648,11 +6634,7 @@
             Phone phone = PhoneFactory.getPhone(phoneId);
             if (phone != null) {
                 boolean retVal;
-                if (phone.isUsingNewDataStack()) {
-                    retVal = phone.getDataSettingsManager().isDataEnabled();
-                } else {
-                    retVal = phone.getDataEnabledSettings().isDataEnabled();
-                }
+                retVal = phone.getDataSettingsManager().isDataEnabled();
                 if (DBG) log("isDataEnabled: " + retVal + ", subId=" + subId);
                 return retVal;
             } else {
@@ -6704,15 +6686,7 @@
             Phone phone = PhoneFactory.getPhone(phoneId);
             if (phone != null) {
                 boolean retVal;
-                if (phone.isUsingNewDataStack()) {
-                    retVal = phone.getDataSettingsManager().isDataEnabledForReason(reason);
-                } else {
-                    if (reason == TelephonyManager.DATA_ENABLED_REASON_USER) {
-                        retVal = phone.isUserDataEnabled();
-                    } else {
-                        retVal = phone.getDataEnabledSettings().isDataEnabledForReason(reason);
-                    }
-                }
+                retVal = phone.getDataSettingsManager().isDataEnabledForReason(reason);
                 if (DBG) log("isDataEnabledForReason: retVal=" + retVal);
                 return retVal;
             } else {
@@ -8451,12 +8425,8 @@
                 if (reason == TelephonyManager.DATA_ENABLED_REASON_CARRIER) {
                     phone.carrierActionSetMeteredApnsEnabled(enabled);
                 } else {
-                    if (phone.isUsingNewDataStack()) {
-                        phone.getDataSettingsManager().setDataEnabled(
-                                reason, enabled, callingPackage);
-                    } else {
-                        phone.getDataEnabledSettings().setDataEnabled(reason, enabled);
-                    }
+                    phone.getDataSettingsManager().setDataEnabled(
+                            reason, enabled, callingPackage);
                 }
             }
         } finally {
@@ -9666,15 +9636,10 @@
 
             boolean isMetered;
             boolean isDataEnabled;
-            if (phone.isUsingNewDataStack()) {
-                isMetered = phone.getDataNetworkController().getDataConfigManager()
-                        .isMeteredCapability(DataUtils.apnTypeToNetworkCapability(apnType),
-                                phone.getServiceState().getDataRoaming());
-                isDataEnabled = phone.getDataSettingsManager().isDataEnabled(apnType);
-            } else {
-                isMetered = ApnSettingUtils.isMeteredApnType(apnType, phone);
-                isDataEnabled = phone.getDataEnabledSettings().isDataEnabled(apnType);
-            }
+            isMetered = phone.getDataNetworkController().getDataConfigManager()
+                    .isMeteredCapability(DataUtils.apnTypeToNetworkCapability(apnType),
+                            phone.getServiceState().getDataRoaming());
+            isDataEnabled = phone.getDataSettingsManager().isDataEnabled(apnType);
             return !isMetered || isDataEnabled;
         } finally {
             Binder.restoreCallingIdentity(identity);
@@ -9690,13 +9655,9 @@
         try {
             Phone phone = getPhone(subId);
             if (phone == null) return true; // By default return true.
-            if (phone.isUsingNewDataStack()) {
-                return phone.getDataNetworkController().getDataConfigManager().isMeteredCapability(
-                        DataUtils.apnTypeToNetworkCapability(apnType),
-                        phone.getServiceState().getDataRoaming());
-            }
-
-            return ApnSettingUtils.isMeteredApnType(apnType, phone);
+            return phone.getDataNetworkController().getDataConfigManager().isMeteredCapability(
+                    DataUtils.apnTypeToNetworkCapability(apnType),
+                    phone.getServiceState().getDataRoaming());
         } finally {
             Binder.restoreCallingIdentity(identity);
         }
@@ -9828,17 +9789,9 @@
 
             switch (policy) {
                 case TelephonyManager.MOBILE_DATA_POLICY_DATA_ON_NON_DEFAULT_DURING_VOICE_CALL:
-                    if (phone.isUsingNewDataStack()) {
-                        return phone.getDataSettingsManager().isDataAllowedInVoiceCall();
-                    } else {
-                        return phone.getDataEnabledSettings().isDataAllowedInVoiceCall();
-                    }
+                    return phone.getDataSettingsManager().isDataAllowedInVoiceCall();
                 case TelephonyManager.MOBILE_DATA_POLICY_MMS_ALWAYS_ALLOWED:
-                    if (phone.isUsingNewDataStack()) {
-                        return phone.getDataSettingsManager().isMmsAlwaysAllowed();
-                    } else {
-                        return phone.getDataEnabledSettings().isMmsAlwaysAllowed();
-                    }
+                    return phone.getDataSettingsManager().isMmsAlwaysAllowed();
                 default:
                     throw new IllegalArgumentException(policy + " is not a valid policy");
             }
@@ -9859,18 +9812,10 @@
 
             switch (policy) {
                 case TelephonyManager.MOBILE_DATA_POLICY_DATA_ON_NON_DEFAULT_DURING_VOICE_CALL:
-                    if (phone.isUsingNewDataStack()) {
-                        phone.getDataSettingsManager().setAllowDataDuringVoiceCall(enabled);
-                    } else {
-                        phone.getDataEnabledSettings().setAllowDataDuringVoiceCall(enabled);
-                    }
+                    phone.getDataSettingsManager().setAllowDataDuringVoiceCall(enabled);
                     break;
                 case TelephonyManager.MOBILE_DATA_POLICY_MMS_ALWAYS_ALLOWED:
-                    if (phone.isUsingNewDataStack()) {
-                        phone.getDataSettingsManager().setAlwaysAllowMmsData(enabled);
-                    } else {
-                        phone.getDataEnabledSettings().setAlwaysAllowMmsData(enabled);
-                    }
+                    phone.getDataSettingsManager().setAlwaysAllowMmsData(enabled);
                     break;
                 default:
                     throw new IllegalArgumentException(policy + " is not a valid policy");
@@ -11247,12 +11192,6 @@
         }
     }
 
-    @Override
-    public boolean isUsingNewDataStack() {
-        TelephonyPermissions.enforceShellOnly(Binder.getCallingUid(), "isUsingNewDataStack");
-        return getDefaultPhone().isUsingNewDataStack();
-    }
-
     /**
      * Sets the modem service class Name that Telephony will bind to.
      *