diff --git a/src/com/android/settings/network/telephony/WifiCallingPreferenceController.java b/src/com/android/settings/network/telephony/WifiCallingPreferenceController.java
index 4d4d3ef..5998483 100644
--- a/src/com/android/settings/network/telephony/WifiCallingPreferenceController.java
+++ b/src/com/android/settings/network/telephony/WifiCallingPreferenceController.java
@@ -61,16 +61,12 @@
     PhoneAccountHandle mSimCallManager;
     private PhoneCallStateListener mPhoneStateListener;
     private Preference mPreference;
-    private boolean mEditableWfcRoamingMode;
-    private boolean mUseWfcHomeModeForRoaming;
 
     public WifiCallingPreferenceController(Context context, String key) {
         super(context, key);
         mCarrierConfigManager = context.getSystemService(CarrierConfigManager.class);
         mTelephonyManager = context.getSystemService(TelephonyManager.class);
         mPhoneStateListener = new PhoneCallStateListener(Looper.getMainLooper());
-        mEditableWfcRoamingMode = true;
-        mUseWfcHomeModeForRoaming = false;
     }
 
     @Override
@@ -129,9 +125,18 @@
             preference.setTitle(title);
             int resId = com.android.internal.R.string.wifi_calling_off_summary;
             if (mImsManager.isWfcEnabledByUser()) {
-                boolean wfcRoamingEnabled = mEditableWfcRoamingMode && !mUseWfcHomeModeForRoaming;
+                boolean useWfcHomeModeForRoaming = false;
+                if (mCarrierConfigManager != null) {
+                    final PersistableBundle carrierConfig =
+                            mCarrierConfigManager.getConfigForSubId(mSubId);
+                    if (carrierConfig != null) {
+                        useWfcHomeModeForRoaming = carrierConfig.getBoolean(
+                                CarrierConfigManager
+                                        .KEY_USE_WFC_HOME_NETWORK_MODE_IN_ROAMING_NETWORK_BOOL);
+                    }
+                }
                 final boolean isRoaming = mTelephonyManager.isNetworkRoaming();
-                int wfcMode = mImsManager.getWfcMode(isRoaming && wfcRoamingEnabled);
+                int wfcMode = mImsManager.getWfcMode(isRoaming && !useWfcHomeModeForRoaming);
                 switch (wfcMode) {
                     case ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY:
                         resId = com.android.internal.R.string.wfc_mode_wifi_only_summary;
@@ -159,16 +164,6 @@
         mImsManager = ImsManager.getInstance(mContext, SubscriptionManager.getPhoneId(mSubId));
         mSimCallManager = mContext.getSystemService(TelecomManager.class)
                 .getSimCallManagerForSubscription(mSubId);
-        if (mCarrierConfigManager != null) {
-            final PersistableBundle carrierConfig = mCarrierConfigManager.getConfigForSubId(mSubId);
-            if (carrierConfig != null) {
-                mEditableWfcRoamingMode = carrierConfig.getBoolean(
-                        CarrierConfigManager.KEY_EDITABLE_WFC_ROAMING_MODE_BOOL);
-                mUseWfcHomeModeForRoaming = carrierConfig.getBoolean(
-                        CarrierConfigManager
-                                .KEY_USE_WFC_HOME_NETWORK_MODE_IN_ROAMING_NETWORK_BOOL);
-            }
-        }
     }
 
     private class PhoneCallStateListener extends PhoneStateListener {
diff --git a/tests/robotests/src/com/android/settings/network/telephony/WifiCallingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/telephony/WifiCallingPreferenceControllerTest.java
index 42422f9..f795d61 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/WifiCallingPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/WifiCallingPreferenceControllerTest.java
@@ -127,10 +127,10 @@
     }
 
     @Test
-    public void updateState_wfcNonRoaming() {
+    public void updateState_nonRoaming_wfcCellularPreferred() {
         assertNull(mController.mSimCallManager);
-        mCarrierConfig.putBoolean(CarrierConfigManager.KEY_EDITABLE_WFC_ROAMING_MODE_BOOL, false);
-        // update the config value by calling init again.
+        mCarrierConfig.putBoolean(
+                CarrierConfigManager.KEY_USE_WFC_HOME_NETWORK_MODE_IN_ROAMING_NETWORK_BOOL, true);
         mController.init(SUB_ID);
         mController.mImsManager = mImsManager;
 
@@ -147,9 +147,10 @@
     }
 
     @Test
-    public void updateState_wfcRoaming() {
+    public void updateState_roaming_wfcWifiPreferred() {
         assertNull(mController.mSimCallManager);
-
+        // useWfcHomeModeForRoaming is false by default. In order to check wfc in roaming mode. We
+        // need the device roaming, and not using home mode in roaming network.
         when(mImsManager.getWfcMode(true)).thenReturn(
                 ImsConfig.WfcModeFeatureValueConstants.WIFI_PREFERRED);
         when(mImsManager.getWfcMode(false)).thenReturn(
