diff options
-rwxr-xr-x | res/values/config.xml | 3 | ||||
-rw-r--r-- | src/com/android/settings/WifiCallingSettings.java | 13 |
2 files changed, 15 insertions, 1 deletions
diff --git a/res/values/config.xml b/res/values/config.xml index 295d5d1..7425798 100755 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -38,4 +38,7 @@ <!-- The duration (in milliseconds) of activity transitions --> <integer name="setup_wizard_transition_duration">300</integer> + <!-- Config to show/hide Wifi calling mode Preference UI option --> + <bool name="config_wfc_mode_supported" translatable="false">true</bool> + </resources> diff --git a/src/com/android/settings/WifiCallingSettings.java b/src/com/android/settings/WifiCallingSettings.java index 787ccb4..d928de2 100644 --- a/src/com/android/settings/WifiCallingSettings.java +++ b/src/com/android/settings/WifiCallingSettings.java @@ -178,6 +178,12 @@ public class WifiCallingSettings extends SettingsPreferenceFragment mValidListener = true; } + if (!isWfcModeSupported()) { + android.provider.Settings.Global.putInt(context.getContentResolver(), + android.provider.Settings.Global.WFC_IMS_MODE, + ImsConfig.WfcModeFeatureValueConstants.WIFI_ONLY); + } + // NOTE: Buttons will be enabled/disabled in mPhoneStateListener boolean wfcEnabled = ImsManager.isWfcEnabledByUser(context) && ImsManager.isNonTtyOrTtyOnVolteEnabled(context); @@ -235,7 +241,7 @@ public class WifiCallingSettings extends SettingsPreferenceFragment mButtonWfcMode.setEnabled(wfcEnabled); final PreferenceScreen preferenceScreen = getPreferenceScreen(); - if (wfcEnabled) { + if (wfcEnabled && isWfcModeSupported()) { preferenceScreen.addPreference(mButtonWfcMode); } else { preferenceScreen.removePreference(mButtonWfcMode); @@ -277,4 +283,9 @@ public class WifiCallingSettings extends SettingsPreferenceFragment } return resId; } + + private boolean isWfcModeSupported() { + return getActivity().getResources().getBoolean( + R.bool.config_wfc_mode_supported); + } } |