mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-09-05 00:52:06 +00:00
263 lines
13 KiB
Diff
263 lines
13 KiB
Diff
From 44e79643f7eae9b659473a8ed2d13ffb7e5259ba Mon Sep 17 00:00:00 2001
|
|
From: Tad <tad@spotco.us>
|
|
Date: Fri, 28 Dec 2018 21:22:20 -0500
|
|
Subject: [PATCH] More preferred network modes
|
|
|
|
Change-Id: I6ff09db51fcd64829c24509740ed9a52c3d104cb
|
|
---
|
|
res/values/strings.xml | 47 +++++++++++++++++++
|
|
.../android/phone/MobileNetworkSettings.java | 31 ++++++++++--
|
|
2 files changed, 74 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
|
index a5651571c..7e9ebc2f8 100644
|
|
--- a/res/values/strings.xml
|
|
+++ b/res/values/strings.xml
|
|
@@ -408,6 +408,8 @@
|
|
<string name="preferred_network_mode_cdma_evdo_gsm_wcdma_summary">Preferred network mode: CDMA/EvDo/GSM/WCDMA</string>
|
|
<!-- Mobile network settings, summary for preferred network mode LTE [CHAR LIMIT=100] -->
|
|
<string name="preferred_network_mode_lte_summary">Preferred network mode: LTE </string>
|
|
+ <!-- Mobile network settings, summary for preferred network mode LTE only [CHAR LIMIT=100] -->
|
|
+ <string name="preferred_network_mode_lte_only_summary">Preferred network mode: LTE only</string>
|
|
<!-- Mobile network settings, summary for preferred network mode GSM/WCDMA/LTE [CHAR LIMIT=100] -->
|
|
<string name="preferred_network_mode_lte_gsm_wcdma_summary">Preferred network mode: GSM/WCDMA/LTE</string>
|
|
<!-- Mobile network settings, summary for preferred network mode CDMA+LTE/EVDO[CHAR LIMIT=100] -->
|
|
@@ -416,6 +418,8 @@
|
|
<string name="preferred_network_mode_global_summary">Preferred network mode: Global</string>
|
|
<!-- Mobile network settings, summary for preferred network mode LTE / WCDMA[CHAR LIMIT=100] -->
|
|
<string name="preferred_network_mode_lte_wcdma_summary">Preferred network mode: LTE / WCDMA</string>
|
|
+ <!-- Mobile network settings, summary for preferred network mode LTE / WCDMA only [CHAR LIMIT=100] -->
|
|
+ <string name="preferred_network_mode_lte_wcdma_only_summary">Preferred network mode: LTE / WCDMA only</string>
|
|
<!-- Mobile network settings, summary for preferred network mode LTE / GSM / UMTS [CHAR LIMIT=100] -->
|
|
<string name="preferred_network_mode_lte_gsm_umts_summary">Preferred network mode: LTE / GSM / UMTS</string>
|
|
<!-- Mobile network settings, summary for preferred network mode LTE / CDMA [CHAR LIMIT=100] -->
|
|
@@ -434,6 +438,8 @@
|
|
<string name="preferred_network_mode_tdscdma_gsm_wcdma_summary">Preferred network mode: TDSCDMA/GSM/WCDMA</string>
|
|
<!-- Mobile network settings, summary for preferred network mode LTE / TDSCDMA / WCDMA[CHAR LIMIT=100] -->
|
|
<string name="preferred_network_mode_lte_tdscdma_wcdma_summary">Preferred network mode: LTE/TDSCDMA/WCDMA</string>
|
|
+ <!-- Mobile network settings, summary for preferred network mode LTE / TDSCDMA / WCDMA only [CHAR LIMIT=100] -->
|
|
+ <string name="preferred_network_mode_lte_tdscdma_wcdma_only_summary">Preferred network mode: LTE/TDSCDMA/WCDMA only</string>
|
|
<!-- Mobile network settings, summary for preferred network mode LTE / TDSCDMA / GSM / WCDMA[CHAR LIMIT=100] -->
|
|
<string name="preferred_network_mode_lte_tdscdma_gsm_wcdma_summary">Preferred network mode: LTE/TDSCDMA/GSM/WCDMA</string>
|
|
<!-- Mobile network settings, summary for preferred network mode TDSCDMA / CDMA / EvDo / GSM / WCDMA[CHAR LIMIT=100] -->
|
|
@@ -694,96 +700,137 @@
|
|
<string name="multi_category_enable">Multi-category enabled</string>
|
|
<string name="multi_category_disable">Multi-category disabled</string>
|
|
|
|
+ <string name="network_3G_lte_only">LTE/3G only</string>
|
|
+ <string name="network_lte_only">LTE only</string>
|
|
<string name="network_lte">LTE (recommended)</string>
|
|
+ <string name="network_3G_4G_only">4G/3G only</string>
|
|
+ <string name="network_4G_only">4G only</string>
|
|
<string name="network_4G">4G (recommended)</string>
|
|
+ <string name="network_3G_only">3G only</string>
|
|
<string name="network_3G" translatable="false">3G</string>
|
|
<string name="network_2G" translatable="false">2G</string>
|
|
<string name="network_1x" translatable="false">1x</string>
|
|
<string name="network_global">Global</string>
|
|
|
|
<string-array name="enabled_networks_except_gsm_choices" translatable="false">
|
|
+ <item>@string/network_3G_lte_only</item>
|
|
+ <item>@string/network_lte_only</item>
|
|
<item>@string/network_lte</item>
|
|
+ <item>@string/network_3G_only</item>
|
|
<item>@string/network_3G</item>
|
|
</string-array>
|
|
<string-array name="enabled_networks_except_gsm_4g_choices" translatable="false">
|
|
+ <item>@string/network_3G_4G_only</item>
|
|
+ <item>@string/network_4G_only</item>
|
|
<item>@string/network_4G</item>
|
|
+ <item>@string/network_3G_only</item>
|
|
<item>@string/network_3G</item>
|
|
</string-array>
|
|
<string-array name="enabled_networks_except_gsm_values" translatable="false">
|
|
+ <item>"12"</item>
|
|
+ <item>"11"</item>
|
|
<item>"9"</item>
|
|
+ <item>"2"</item>
|
|
<item>"0"</item>
|
|
</string-array>
|
|
|
|
<string-array name="enabled_networks_except_lte_choices" translatable="false">
|
|
+ <item>@string/network_3G_only</item>
|
|
<item>@string/network_3G</item>
|
|
<item>@string/network_2G</item>
|
|
</string-array>
|
|
<string-array name="enabled_networks_except_lte_values" translatable="false">
|
|
+ <item>"2"</item>
|
|
<item>"0"</item>
|
|
<item>"1"</item>
|
|
</string-array>
|
|
|
|
<string-array name="enabled_networks_except_gsm_lte_choices" translatable="false">
|
|
+ <item>@string/network_3G_only</item>
|
|
<item>@string/network_3G</item>
|
|
</string-array>
|
|
<string-array name="enabled_networks_except_gsm_lte_values" translatable="false">
|
|
+ <item>"2"</item>
|
|
<item>"0"</item>
|
|
</string-array>
|
|
|
|
<string-array name="enabled_networks_choices" translatable="false">
|
|
+ <item>@string/network_3G_lte_only</item>
|
|
+ <item>@string/network_lte_only</item>
|
|
<item>@string/network_lte</item>
|
|
+ <item>@string/network_3G_only</item>
|
|
<item>@string/network_3G</item>
|
|
<item>@string/network_2G</item>
|
|
</string-array>
|
|
<string-array name="enabled_networks_4g_choices" translatable="false">
|
|
+ <item>@string/network_3G_4G_only</item>
|
|
+ <item>@string/network_4G_only</item>
|
|
<item>@string/network_4G</item>
|
|
+ <item>@string/network_3G_only</item>
|
|
<item>@string/network_3G</item>
|
|
<item>@string/network_2G</item>
|
|
</string-array>
|
|
<string-array name="enabled_networks_values" translatable="false">
|
|
+ <item>"12"</item>
|
|
+ <item>"11"</item>
|
|
<item>"9"</item>
|
|
+ <item>"2"</item>
|
|
<item>"0"</item>
|
|
<item>"1"</item>
|
|
</string-array>
|
|
|
|
<string-array name="enabled_networks_cdma_choices" translatable="false">
|
|
+ <item>@string/network_lte_only</item>
|
|
<item>@string/network_lte</item>
|
|
+ <item>@string/network_3G_only</item>
|
|
<item>@string/network_3G</item>
|
|
<item>@string/network_1x</item>
|
|
<item>@string/network_global</item>
|
|
</string-array>
|
|
<string-array name="enabled_networks_cdma_values" translatable="false">
|
|
+ <item>"11"</item>
|
|
<item>"8"</item>
|
|
+ <item>"6"</item>
|
|
<item>"4"</item>
|
|
<item>"5"</item>
|
|
<item>"10"</item>
|
|
</string-array>
|
|
|
|
<string-array name="enabled_networks_cdma_no_lte_choices" translatable="false">
|
|
+ <item>@string/network_3G_only</item>
|
|
<item>@string/network_3G</item>
|
|
<item>@string/network_1x</item>
|
|
</string-array>
|
|
<string-array name="enabled_networks_cdma_no_lte_values" translatable="false">
|
|
+ <item>"6"</item>
|
|
<item>"4"</item>
|
|
<item>"5"</item>
|
|
</string-array>
|
|
|
|
<string-array name="enabled_networks_cdma_only_lte_choices" translatable="false">
|
|
+ <item>@string/network_lte_only</item>
|
|
<item>@string/network_lte</item>
|
|
<item>@string/network_global</item>
|
|
</string-array>
|
|
<string-array name="enabled_networks_cdma_only_lte_values" translatable="false">
|
|
+ <item>"11"</item>
|
|
<item>"8"</item>
|
|
<item>"10"</item>
|
|
</string-array>
|
|
|
|
<string-array name="enabled_networks_tdscdma_choices" translatable="false">
|
|
+ <item>@string/network_3G_lte_only</item>
|
|
+ <item>@string/network_lte_only</item>
|
|
<item>@string/network_lte</item>
|
|
+ <item>@string/network_3G_only</item>
|
|
<item>@string/network_3G</item>
|
|
<item>@string/network_2G</item>
|
|
</string-array>
|
|
<string-array name="enabled_networks_tdscdma_values" translatable="false">
|
|
+ <item>"19"</item>
|
|
+ <item>"11"</item>
|
|
<item>"22"</item>
|
|
+ <item>"14"</item>
|
|
<item>"18"</item>
|
|
<item>"1"</item>
|
|
</string-array>
|
|
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
|
|
index 4bf0f9e9a..bef36528e 100644
|
|
--- a/src/com/android/phone/MobileNetworkSettings.java
|
|
+++ b/src/com/android/phone/MobileNetworkSettings.java
|
|
@@ -1155,8 +1155,11 @@ public class MobileNetworkSettings extends Activity {
|
|
int modemNetworkMode;
|
|
// if new mode is invalid ignore it
|
|
switch (buttonNetworkMode) {
|
|
+ case Phone.NT_MODE_WCDMA_ONLY:
|
|
case Phone.NT_MODE_WCDMA_PREF:
|
|
case Phone.NT_MODE_GSM_ONLY:
|
|
+ case Phone.NT_MODE_LTE_ONLY:
|
|
+ case Phone.NT_MODE_LTE_WCDMA:
|
|
case Phone.NT_MODE_LTE_GSM_WCDMA:
|
|
case Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
|
|
case Phone.NT_MODE_CDMA:
|
|
@@ -1363,7 +1366,7 @@ public class MobileNetworkSettings extends Activity {
|
|
break;
|
|
case Phone.NT_MODE_LTE_ONLY:
|
|
mButtonPreferredNetworkMode.setSummary(
|
|
- R.string.preferred_network_mode_lte_summary);
|
|
+ R.string.preferred_network_mode_lte_only_summary);
|
|
break;
|
|
case Phone.NT_MODE_LTE_TDSCDMA_GSM:
|
|
mButtonPreferredNetworkMode.setSummary(
|
|
@@ -1410,11 +1413,11 @@ public class MobileNetworkSettings extends Activity {
|
|
break;
|
|
case Phone.NT_MODE_LTE_TDSCDMA_WCDMA:
|
|
mButtonPreferredNetworkMode.setSummary(
|
|
- R.string.preferred_network_mode_lte_tdscdma_wcdma_summary);
|
|
+ R.string.preferred_network_mode_lte_tdscdma_wcdma_only_summary);
|
|
break;
|
|
case Phone.NT_MODE_LTE_WCDMA:
|
|
mButtonPreferredNetworkMode.setSummary(
|
|
- R.string.preferred_network_mode_lte_wcdma_summary);
|
|
+ R.string.preferred_network_mode_lte_wcdma_only_summary);
|
|
break;
|
|
default:
|
|
mButtonPreferredNetworkMode.setSummary(
|
|
@@ -1436,6 +1439,12 @@ public class MobileNetworkSettings extends Activity {
|
|
mButtonEnabledNetworks.setSummary(R.string.network_3G);
|
|
break;
|
|
case Phone.NT_MODE_WCDMA_ONLY:
|
|
+ if (!mIsGlobalCdma) {
|
|
+ mButtonEnabledNetworks.setSummary(R.string.network_3G_only);
|
|
+ } else {
|
|
+ mButtonEnabledNetworks.setSummary(R.string.network_global);
|
|
+ }
|
|
+ break;
|
|
case Phone.NT_MODE_GSM_UMTS:
|
|
case Phone.NT_MODE_WCDMA_PREF:
|
|
if (!mIsGlobalCdma) {
|
|
@@ -1459,11 +1468,25 @@ public class MobileNetworkSettings extends Activity {
|
|
controlGsmOptions(true);
|
|
break;
|
|
}
|
|
+ if (!mIsGlobalCdma) {
|
|
+ mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
|
+ ? R.string.network_4G : R.string.network_lte);
|
|
+ } else {
|
|
+ mButtonEnabledNetworks.setSummary(R.string.network_global);
|
|
+ }
|
|
+ break;
|
|
case Phone.NT_MODE_LTE_ONLY:
|
|
+ if (!mIsGlobalCdma) {
|
|
+ mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
|
+ ? R.string.network_4G_only : R.string.network_lte_only);
|
|
+ } else {
|
|
+ mButtonEnabledNetworks.setSummary(R.string.network_global);
|
|
+ }
|
|
+ break;
|
|
case Phone.NT_MODE_LTE_WCDMA:
|
|
if (!mIsGlobalCdma) {
|
|
mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
|
- ? R.string.network_4G : R.string.network_lte);
|
|
+ ? R.string.network_3G_4G_only : R.string.network_3G_lte_only);
|
|
} else {
|
|
mButtonEnabledNetworks.setSummary(R.string.network_global);
|
|
}
|
|
--
|
|
2.20.1
|
|
|