Merge "Show alerts in case of some IMS registration errors." into lmp-mr1-wfc-dev
diff --git a/src/com/android/settings/WifiCallingSettings.java b/src/com/android/settings/WifiCallingSettings.java
index f3daf41..dacdc7b 100644
--- a/src/com/android/settings/WifiCallingSettings.java
+++ b/src/com/android/settings/WifiCallingSettings.java
@@ -181,7 +181,7 @@
 
         int wfcMode = ImsManager.getWfcMode(context);
         mButtonWfcMode.setValue(Integer.toString(wfcMode));
-        mButtonWfcMode.setSummary(getWfcModeSummary(context, ImsManager.getWfcMode(context)));
+        mButtonWfcMode.setSummary(getWfcModeSummary(context, wfcMode));
 
         mButtonWfcRoam.setChecked(wfcEnabled
                 && (wfcMode != ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY)
@@ -220,9 +220,10 @@
 
         ImsManager.setWfcSetting(context, isChecked);
 
+        int wfcMode = ImsManager.getWfcMode(context);
+        mButtonWfcMode.setSummary(getWfcModeSummary(context, wfcMode));
         mButtonWfcMode.setEnabled(isChecked);
-        boolean wfcHandoffEnabled = (ImsManager.getWfcMode(context)
-                != ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY);
+        boolean wfcHandoffEnabled = (wfcMode != ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY);
         mButtonWfcRoam.setEnabled(isChecked && wfcHandoffEnabled);
         mButtonWfcRoam.setChecked(isChecked && wfcHandoffEnabled
                 && ImsManager.isWfcRoamingEnabledByUser(context));