mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-09-06 17:42:25 +00:00
160 lines
7.2 KiB
Diff
160 lines
7.2 KiB
Diff
From f6132218fcfcf8932e963b7f7e785710cdd13f13 Mon Sep 17 00:00:00 2001
|
|
From: Daniel Micay <danielmicay@gmail.com>
|
|
Date: Mon, 12 Feb 2018 07:27:04 -0500
|
|
Subject: [PATCH] LTE only option
|
|
|
|
This is a modified version of thestinger's implementation in CopperheadOS from a time when the repo was/is still licensed under Apache2
|
|
https://github.com/CopperheadOS/platform_packages_services_Telephony/commit/567b8daca2d5d570e4eeecd548aa03c606ee9c18
|
|
|
|
Change-Id: I63cd7d31bc5942b4dd48ce0c3bef0397a06091a6
|
|
---
|
|
res/values/strings.xml | 16 ++++++++++++++++
|
|
src/com/android/phone/MobileNetworkSettings.java | 10 ++++++++--
|
|
2 files changed, 24 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
|
index a5651571c..7bf60a8df 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] -->
|
|
@@ -695,7 +697,9 @@
|
|
<string name="multi_category_disable">Multi-category disabled</string>
|
|
|
|
<string name="network_lte">LTE (recommended)</string>
|
|
+ <string name="network_lte_only">LTE only</string>
|
|
<string name="network_4G">4G (recommended)</string>
|
|
+ <string name="network_4G_only">4G 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>
|
|
@@ -703,14 +707,17 @@
|
|
|
|
<string-array name="enabled_networks_except_gsm_choices" translatable="false">
|
|
<item>@string/network_lte</item>
|
|
+ <item>@string/network_lte_only</item>
|
|
<item>@string/network_3G</item>
|
|
</string-array>
|
|
<string-array name="enabled_networks_except_gsm_4g_choices" translatable="false">
|
|
<item>@string/network_4G</item>
|
|
+ <item>@string/network_4G_only</item>
|
|
<item>@string/network_3G</item>
|
|
</string-array>
|
|
<string-array name="enabled_networks_except_gsm_values" translatable="false">
|
|
<item>"9"</item>
|
|
+ <item>"11"</item>
|
|
<item>"0"</item>
|
|
</string-array>
|
|
|
|
@@ -732,28 +739,33 @@
|
|
|
|
<string-array name="enabled_networks_choices" translatable="false">
|
|
<item>@string/network_lte</item>
|
|
+ <item>@string/network_lte_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_4G</item>
|
|
+ <item>@string/network_4G_only</item>
|
|
<item>@string/network_3G</item>
|
|
<item>@string/network_2G</item>
|
|
</string-array>
|
|
<string-array name="enabled_networks_values" translatable="false">
|
|
<item>"9"</item>
|
|
+ <item>"11"</item>
|
|
<item>"0"</item>
|
|
<item>"1"</item>
|
|
</string-array>
|
|
|
|
<string-array name="enabled_networks_cdma_choices" translatable="false">
|
|
<item>@string/network_lte</item>
|
|
+ <item>@string/network_lte_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>"8"</item>
|
|
+ <item>"11"</item>
|
|
<item>"4"</item>
|
|
<item>"5"</item>
|
|
<item>"10"</item>
|
|
@@ -770,20 +782,24 @@
|
|
|
|
<string-array name="enabled_networks_cdma_only_lte_choices" translatable="false">
|
|
<item>@string/network_lte</item>
|
|
+ <item>@string/network_lte_only</item>
|
|
<item>@string/network_global</item>
|
|
</string-array>
|
|
<string-array name="enabled_networks_cdma_only_lte_values" translatable="false">
|
|
<item>"8"</item>
|
|
+ <item>"11"</item>
|
|
<item>"10"</item>
|
|
</string-array>
|
|
|
|
<string-array name="enabled_networks_tdscdma_choices" translatable="false">
|
|
<item>@string/network_lte</item>
|
|
+ <item>@string/network_lte_only</item>
|
|
<item>@string/network_3G</item>
|
|
<item>@string/network_2G</item>
|
|
</string-array>
|
|
<string-array name="enabled_networks_tdscdma_values" translatable="false">
|
|
<item>"22"</item>
|
|
+ <item>"11"</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 0ea4702b4..47e8bcf12 100644
|
|
--- a/src/com/android/phone/MobileNetworkSettings.java
|
|
+++ b/src/com/android/phone/MobileNetworkSettings.java
|
|
@@ -1157,6 +1157,7 @@ public class MobileNetworkSettings extends Activity {
|
|
switch (buttonNetworkMode) {
|
|
case Phone.NT_MODE_WCDMA_PREF:
|
|
case Phone.NT_MODE_GSM_ONLY:
|
|
+ case Phone.NT_MODE_LTE_ONLY:
|
|
case Phone.NT_MODE_LTE_GSM_WCDMA:
|
|
case Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
|
|
case Phone.NT_MODE_CDMA:
|
|
@@ -1363,7 +1364,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(
|
|
@@ -1463,7 +1464,6 @@ public class MobileNetworkSettings extends Activity {
|
|
controlGsmOptions(true);
|
|
break;
|
|
}
|
|
- case Phone.NT_MODE_LTE_ONLY:
|
|
case Phone.NT_MODE_LTE_WCDMA:
|
|
if (!mIsGlobalCdma) {
|
|
mButtonEnabledNetworks.setValue(
|
|
@@ -1476,6 +1476,12 @@ public class MobileNetworkSettings extends Activity {
|
|
mButtonEnabledNetworks.setSummary(R.string.network_global);
|
|
}
|
|
break;
|
|
+ case Phone.NT_MODE_LTE_ONLY:
|
|
+ mButtonEnabledNetworks.setValue(
|
|
+ Integer.toString(Phone.NT_MODE_LTE_ONLY));
|
|
+ mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
|
+ ? R.string.network_4G_only : R.string.network_lte_only);
|
|
+ break;
|
|
case Phone.NT_MODE_LTE_CDMA_AND_EVDO:
|
|
if (isWorldMode()) {
|
|
mButtonEnabledNetworks.setSummary(
|
|
--
|
|
2.16.1
|
|
|