Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add toggle Add "Wi-Fi" to network name #263

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.showVoWifiInNetworkName == 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
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<string name="show_vowifi_roaming_preference_in_settings">Show VoWiFi Roaming preference in Settings</string>
<string name="show_ims_status_in_sim_status">Show IMS Status in SIM Info</string>
<string name="add_wifi_calling_to_network_name">Add \"Wi-Fi Calling\" to Network Name</string>
<string name="alternative_wifi_calling_to_network_name">Add \"Wi-Fi\" to Network Name</string>
<string name="show_wifi_only_for_vowifi">Show \"WiFi only\" mode for VoWiFi</string>
<string name="enable_video_calling_vt">Enable Video Calling (VT)</string>
<string name="allow_adding_apns">Allow adding APNs</string>
Expand Down