Enable VoLTE/VT with overlay overrides.

This reverts commit 5acf587392f4d5f2aec9d0dac1f1261566573396.

Bug: 17134661
Change-Id: I48c9ba6c9ecbb16c8acb54453f8cd145305d037c
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index 4f038f0..89749ad 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -16,7 +16,6 @@
 
 package com.android.phone;
 
-import com.android.ims.ImsConfig;
 import com.android.ims.ImsManager;
 import com.android.ims.ImsException;
 import com.android.internal.telephony.Phone;
@@ -24,8 +23,6 @@
 import com.android.internal.telephony.TelephonyIntents;
 import com.android.internal.telephony.TelephonyProperties;
 
-import java.util.Map;
-
 import android.app.ActionBar;
 import android.app.AlertDialog;
 import android.content.Context;
@@ -41,10 +38,8 @@
 import android.os.SystemProperties;
 import android.os.UserHandle;
 import android.os.UserManager;
-import android.preference.CheckBoxPreference;
 import android.preference.ListPreference;
 import android.preference.Preference;
-import android.preference.Preference.OnPreferenceChangeListener;
 import android.preference.PreferenceActivity;
 import android.preference.PreferenceScreen;
 import android.preference.SwitchPreference;
@@ -199,14 +194,6 @@
         }
     }
 
-    public boolean isIMSOn() {
-        SharedPreferences imsPref =
-            getSharedPreferences(ImsManager.IMS_SHARED_PREFERENCES, Context.MODE_WORLD_READABLE);
-
-        //return imsPref.getBoolean(ImsManager.KEY_IMS_ON, ImsManager.IMS_DEFAULT_SETTING);
-        return false;
-    }
-
     private void setIMS(boolean turnOn) {
         SharedPreferences imsPref =
             getSharedPreferences(ImsManager.IMS_SHARED_PREFERENCES, Context.MODE_WORLD_READABLE);
@@ -234,7 +221,7 @@
         mButton4glte = (SwitchPreference)findPreference(BUTTON_4G_LTE_KEY);
 
         mButton4glte.setOnPreferenceChangeListener(this);
-        mButton4glte.setChecked(isIMSOn());
+        mButton4glte.setChecked(ImsManager.isEnhanced4gLteModeSettingEnabledByUser(this));
 
         try {
             Context con = createPackageContext("com.android.systemui", 0);
@@ -351,6 +338,13 @@
                 prefSet.removePreference(pref);
             }
         }
+        Preference pref = prefSet.findPreference(BUTTON_4G_LTE_KEY);
+        if (pref != null) {
+            if (!ImsManager.isEnhanced4gLteModeSettingEnabledByPlatform(this)) {
+                ((SwitchPreference)pref).setChecked(false);
+                pref.setEnabled(false);
+            }
+        }
 
         ActionBar actionBar = getActionBar();
         if (actionBar != null) {