Skip to content

Commit

Permalink
Update Config.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
fillwithjoy1 authored Feb 18, 2024
1 parent 160a735 commit 67312f7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/src/main/java/dev/bluehouse/enablevolte/pages/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 67312f7

Please sign in to comment.