From 67312f74cce843eea22b65ef8d1b85348607804c Mon Sep 17 00:00:00 2001 From: Joy <29514446+fillwithjoy1@users.noreply.github.com> Date: Sun, 18 Feb 2024 21:04:16 +1000 Subject: [PATCH] Update Config.kt --- .../java/dev/bluehouse/enablevolte/pages/Config.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/main/java/dev/bluehouse/enablevolte/pages/Config.kt b/app/src/main/java/dev/bluehouse/enablevolte/pages/Config.kt index 05c05d7..c9f5393 100644 --- a/app/src/main/java/dev/bluehouse/enablevolte/pages/Config.kt +++ b/app/src/main/java/dev/bluehouse/enablevolte/pages/Config.kt @@ -58,6 +58,7 @@ fun Config(navController: NavController, subId: Int) { var showVoWifiMode by rememberSaveable { mutableStateOf(false) } var showVoWifiRoamingMode by rememberSaveable { mutableStateOf(false) } var showVoWifiInNetworkName by rememberSaveable { mutableStateOf(false) } + var alternativeVoWifiInNetworkName by rememberSaveable { mutableStateOf(false) } var showVoWifiIcon by rememberSaveable { mutableStateOf(false) } var alwaysDataRATIcon by rememberSaveable { mutableStateOf(false) } var supportWfcWifiOnly by rememberSaveable { mutableStateOf(false) } @@ -93,6 +94,7 @@ fun Config(navController: NavController, subId: Int) { showVoWifiMode = VERSION.SDK_INT >= VERSION_CODES.R && moder.showVoWifiMode showVoWifiRoamingMode = VERSION.SDK_INT >= VERSION_CODES.R && moder.showVoWifiRoamingMode showVoWifiInNetworkName = (moder.showVoWifiInNetworkName == 1) + alternativeVoWifiInNetworkName = (moder.alternativeVoWifiInNetworkName == 4) showVoWifiIcon = moder.showVoWifiIcon alwaysDataRATIcon = VERSION.SDK_INT >= VERSION_CODES.R && moder.alwaysDataRATIcon supportWfcWifiOnly = moder.supportWfcWifiOnly @@ -287,6 +289,16 @@ fun Config(navController: NavController, subId: Int) { true } } + BooleanPropertyView(label = stringResource(R.string.alternative_wifi_calling_to_network_name), toggled = alternativeVoWifiInNetworkName) { + alternativeVoWifiInNetworkName = if (alternativeVoWifiInNetworkName) { + moder.updateCarrierConfig(CarrierConfigManager.KEY_WFC_SPN_FORMAT_IDX_INT, 0) + false + } else { + moder.updateCarrierConfig(CarrierConfigManager.KEY_WFC_SPN_FORMAT_IDX_INT, 4) + moder.restartIMSRegistration() + true + } + } BooleanPropertyView(label = stringResource(R.string.show_wifi_only_for_vowifi), toggled = supportWfcWifiOnly) { supportWfcWifiOnly = if (supportWfcWifiOnly) { moder.updateCarrierConfig(CarrierConfigManager.KEY_CARRIER_WFC_SUPPORTS_WIFI_ONLY_BOOL, false)