2017-08-16 11:27:10 -04:00
|
|
|
From 5a0424ac9cc4bf5978694c76fb1c46ed42d7f4f5 Mon Sep 17 00:00:00 2001
|
2017-07-18 20:34:46 -04:00
|
|
|
From: Daniel Micay <danielmicay@gmail.com>
|
2017-08-16 11:27:10 -04:00
|
|
|
Date: Wed, 16 Aug 2017 08:35:43 -0400
|
2017-07-18 20:34:46 -04:00
|
|
|
Subject: [PATCH] LTE only option
|
|
|
|
|
2017-07-18 21:44:53 -04:00
|
|
|
This is a modified version of thestinger's implementation in CopperheadOS from a time when the repo was/is still licensed under Apache2
|
2017-07-18 20:34:46 -04:00
|
|
|
https://github.com/CopperheadOS/platform_packages_services_Telephony/commit/567b8daca2d5d570e4eeecd548aa03c606ee9c18
|
|
|
|
|
2017-08-16 11:27:10 -04:00
|
|
|
Change-Id: I708135604960f83c1f92ed41d0584a3b48a7886a
|
2017-07-18 20:34:46 -04:00
|
|
|
---
|
|
|
|
res/values/strings.xml | 16 ++++++++++++++++
|
2017-08-16 11:27:10 -04:00
|
|
|
src/com/android/phone/MobileNetworkSettings.java | 10 ++++++++--
|
|
|
|
2 files changed, 24 insertions(+), 2 deletions(-)
|
2017-07-18 20:34:46 -04:00
|
|
|
|
|
|
|
diff --git a/res/values/strings.xml b/res/values/strings.xml
|
2017-07-19 04:10:19 -04:00
|
|
|
index 4ec44534..bf251f88 100644
|
2017-07-18 20:34:46 -04:00
|
|
|
--- a/res/values/strings.xml
|
|
|
|
+++ b/res/values/strings.xml
|
|
|
|
@@ -423,6 +423,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] -->
|
|
|
|
@@ -681,7 +683,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>
|
|
|
|
@@ -689,14 +693,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>
|
2017-07-19 04:10:19 -04:00
|
|
|
+ <item>@string/network_4G_only</item>
|
2017-07-18 20:34:46 -04:00
|
|
|
<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>
|
|
|
|
|
|
|
|
@@ -718,28 +725,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>
|
|
|
|
@@ -756,20 +768,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
|
2017-08-16 11:27:10 -04:00
|
|
|
index 71feff8b..2a68c99a 100644
|
2017-07-18 20:34:46 -04:00
|
|
|
--- a/src/com/android/phone/MobileNetworkSettings.java
|
|
|
|
+++ b/src/com/android/phone/MobileNetworkSettings.java
|
|
|
|
@@ -819,6 +819,7 @@ public class MobileNetworkSettings extends PreferenceActivity
|
|
|
|
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:
|
|
|
|
@@ -1007,7 +1008,7 @@ public class MobileNetworkSettings extends PreferenceActivity
|
|
|
|
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(
|
2017-08-16 11:27:10 -04:00
|
|
|
@@ -1107,7 +1108,6 @@ public class MobileNetworkSettings extends PreferenceActivity
|
|
|
|
controlGsmOptions(true);
|
2017-07-18 20:34:46 -04:00
|
|
|
break;
|
|
|
|
}
|
2017-08-16 11:27:10 -04:00
|
|
|
- case Phone.NT_MODE_LTE_ONLY:
|
|
|
|
case Phone.NT_MODE_LTE_WCDMA:
|
|
|
|
if (!mIsGlobalCdma) {
|
|
|
|
mButtonEnabledNetworks.setValue(
|
|
|
|
@@ -1120,6 +1120,12 @@ public class MobileNetworkSettings extends PreferenceActivity
|
|
|
|
mButtonEnabledNetworks.setSummary(R.string.network_global);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
+ case Phone.NT_MODE_LTE_ONLY:
|
2017-07-18 20:34:46 -04:00
|
|
|
+ mButtonEnabledNetworks.setValue(
|
2017-07-18 21:44:53 -04:00
|
|
|
+ Integer.toString(Phone.NT_MODE_LTE_ONLY));
|
|
|
|
+ mButtonEnabledNetworks.setSummary((mShow4GForLTE == true)
|
|
|
|
+ ? R.string.network_4G_only : R.string.network_lte_only);
|
2017-07-18 20:34:46 -04:00
|
|
|
+ break;
|
2017-08-16 11:27:10 -04:00
|
|
|
case Phone.NT_MODE_LTE_CDMA_AND_EVDO:
|
|
|
|
if (isWorldMode()) {
|
|
|
|
mButtonEnabledNetworks.setSummary(
|
2017-07-18 20:34:46 -04:00
|
|
|
--
|
2017-08-16 11:27:10 -04:00
|
|
|
2.14.1
|
2017-07-18 20:34:46 -04:00
|
|
|
|