From f6132218fcfcf8932e963b7f7e785710cdd13f13 Mon Sep 17 00:00:00 2001 From: Daniel Micay 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 @@ Preferred network mode: CDMA/EvDo/GSM/WCDMA Preferred network mode: LTE + + Preferred network mode: LTE only Preferred network mode: GSM/WCDMA/LTE @@ -695,7 +697,9 @@ Multi-category disabled LTE (recommended) + LTE only 4G (recommended) + 4G only 3G 2G 1x @@ -703,14 +707,17 @@ @string/network_lte + @string/network_lte_only @string/network_3G @string/network_4G + @string/network_4G_only @string/network_3G "9" + "11" "0" @@ -732,28 +739,33 @@ @string/network_lte + @string/network_lte_only @string/network_3G @string/network_2G @string/network_4G + @string/network_4G_only @string/network_3G @string/network_2G "9" + "11" "0" "1" @string/network_lte + @string/network_lte_only @string/network_3G @string/network_1x @string/network_global "8" + "11" "4" "5" "10" @@ -770,20 +782,24 @@ @string/network_lte + @string/network_lte_only @string/network_global "8" + "11" "10" @string/network_lte + @string/network_lte_only @string/network_3G @string/network_2G "22" + "11" "18" "1" 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