Select or not Wi-Fi Calling preference as CarrierConfig

Some operators support Wi-Fi Calling only, not VoLTE.
They don't need "Cellular preferred" option.
In this case, set uneditalbe attribute for preferred preference.

Bug: 26299288
Change-Id: I58b44bbd85bb5ef436d32a5e34d7372532695b91
diff --git a/src/com/android/settings/WifiCallingSettings.java b/src/com/android/settings/WifiCallingSettings.java
index 787ccb4..f8446f8 100644
--- a/src/com/android/settings/WifiCallingSettings.java
+++ b/src/com/android/settings/WifiCallingSettings.java
@@ -23,9 +23,11 @@
 import android.content.Intent;
 import android.content.IntentFilter;
 import android.os.Bundle;
+import android.os.PersistableBundle;
 import android.preference.ListPreference;
 import android.preference.Preference;
 import android.preference.PreferenceScreen;
+import android.telephony.CarrierConfigManager;
 import android.telephony.PhoneStateListener;
 import android.telephony.TelephonyManager;
 import android.util.Log;
@@ -58,6 +60,7 @@
     private TextView mEmptyView;
 
     private boolean mValidListener = false;
+    private boolean mEditableWfcMode = true;
 
     private final PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
         /*
@@ -161,6 +164,15 @@
 
         mIntentFilter = new IntentFilter();
         mIntentFilter.addAction(ImsManager.ACTION_IMS_REGISTRATION_ERROR);
+
+        CarrierConfigManager configManager = (CarrierConfigManager)
+                getSystemService(Context.CARRIER_CONFIG_SERVICE);
+        if (configManager != null) {
+            PersistableBundle b = configManager.getConfig();
+            if (b != null) {
+                mEditableWfcMode = b.getBoolean(CarrierConfigManager.KEY_EDITABLE_WFC_MODE_BOOL);
+            }
+        }
     }
 
     @Override
@@ -240,6 +252,7 @@
         } else {
             preferenceScreen.removePreference(mButtonWfcMode);
         }
+        preferenceScreen.setEnabled(mEditableWfcMode);
     }
 
     @Override