am 518a4ad5: am a0af834f: Merge "Change to not allow user to enable/disable LTE if LTE service forced is true." into lmp-mr1-dev
* commit '518a4ad511adbb83c128967cb2decc218900dec3':
Change to not allow user to enable/disable LTE if LTE service forced is true.
diff --git a/res/values/strings.xml b/res/values/strings.xml
index f7cb850..274d74c 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -651,6 +651,24 @@
<item>"10"</item>
</string-array>
+ <string-array name="enabled_networks_cdma_no_lte_choices" translatable="false">
+ <item>@string/network_3G</item>
+ <item>@string/network_1x</item>
+ </string-array>
+ <string-array name="enabled_networks_cdma_no_lte_values" translatable="false">
+ <item>"4"</item>
+ <item>"5"</item>
+ </string-array>
+
+ <string-array name="enabled_networks_cdma_only_lte_choices" translatable="false">
+ <item>@string/network_lte</item>
+ <item>@string/network_global</item>
+ </string-array>
+ <string-array name="enabled_networks_cdma_only_lte_values" translatable="false">
+ <item>"8"</item>
+ <item>"10"</item>
+ </string-array>
+
<!-- CDMA System select strings -->
<!-- Mobile network settings screen, setting option name -->
<string name="cdma_system_select_title">System select</string>
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index 5a64528..afeebd8 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -379,8 +379,6 @@
private void updateBody() {
final Context context = getApplicationContext();
- final TelephonyManager tm =
- (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
PreferenceScreen prefSet = getPreferenceScreen();
boolean isLteOnCdma = mPhone.getLteOnCdmaMode() == PhoneConstants.LTE_ON_CDMA_TRUE;
final int phoneSubId = mPhone.getSubId();
@@ -416,13 +414,46 @@
mGsmUmtsOptions = new GsmUmtsOptions(this, prefSet);
} else {
prefSet.removePreference(mButtonPreferredNetworkMode);
- int phoneType = mPhone.getPhoneType();
+ final int phoneType = mPhone.getPhoneType();
if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
+ int lteForced = android.provider.Settings.Global.getInt(
+ mPhone.getContext().getContentResolver(),
+ android.provider.Settings.Global.LTE_SERVICE_FORCED + mPhone.getSubId(),
+ 0);
+
if (isLteOnCdma) {
- mButtonEnabledNetworks.setEntries(
- R.array.enabled_networks_cdma_choices);
- mButtonEnabledNetworks.setEntryValues(
- R.array.enabled_networks_cdma_values);
+ if (lteForced == 0) {
+ mButtonEnabledNetworks.setEntries(
+ R.array.enabled_networks_cdma_choices);
+ mButtonEnabledNetworks.setEntryValues(
+ R.array.enabled_networks_cdma_values);
+ } else {
+ switch (settingsNetworkMode) {
+ case Phone.NT_MODE_CDMA:
+ case Phone.NT_MODE_CDMA_NO_EVDO:
+ case Phone.NT_MODE_EVDO_NO_CDMA:
+ mButtonEnabledNetworks.setEntries(
+ R.array.enabled_networks_cdma_no_lte_choices);
+ mButtonEnabledNetworks.setEntryValues(
+ R.array.enabled_networks_cdma_no_lte_values);
+ break;
+ case Phone.NT_MODE_GLOBAL:
+ case Phone.NT_MODE_LTE_CDMA_AND_EVDO:
+ case Phone.NT_MODE_LTE_CDMA_EVDO_GSM_WCDMA:
+ case Phone.NT_MODE_LTE_ONLY:
+ mButtonEnabledNetworks.setEntries(
+ R.array.enabled_networks_cdma_only_lte_choices);
+ mButtonEnabledNetworks.setEntryValues(
+ R.array.enabled_networks_cdma_only_lte_values);
+ break;
+ default:
+ mButtonEnabledNetworks.setEntries(
+ R.array.enabled_networks_cdma_choices);
+ mButtonEnabledNetworks.setEntryValues(
+ R.array.enabled_networks_cdma_values);
+ break;
+ }
+ }
}
mCdmaOptions = new CdmaOptions(this, prefSet, mPhone);
} else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {