From 5a0424ac9cc4bf5978694c76fb1c46ed42d7f4f5 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 16 Aug 2017 08:35:43 -0400 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: I708135604960f83c1f92ed41d0584a3b48a7886a --- 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 4ec44534..bf251f88 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -423,6 +423,8 @@ Preferred network mode: CDMA/EvDo/GSM/WCDMA Preferred network mode: LTE + + Preferred network mode: LTE only Preferred network mode: GSM/WCDMA/LTE @@ -681,7 +683,9 @@ Multi-category disabled LTE (recommended) + LTE only 4G (recommended) + 4G only 3G 2G 1x @@ -689,14 +693,17 @@ @string/network_lte + @string/network_lte_only @string/network_3G @string/network_4G + @string/network_4G_only @string/network_3G "9" + "11" "0" @@ -718,28 +725,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" @@ -756,20 +768,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 71feff8b..2a68c99a 100644 --- 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( @@ -1107,7 +1108,6 @@ public class MobileNetworkSettings extends PreferenceActivity controlGsmOptions(true); break; } - 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: + 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.14.1